---
title: "Update VNG"
method: PUT
path: "/ocean/aws/ecs/launchSpec/{launchSpecId}"
tags: ["Ocean ECS"]
---

# Update VNG

`PUT /ocean/aws/ecs/launchSpec/{launchSpecId}`

Update a specified virtual node group in an Ocean cluster.

## Parameters

- `#/paths/~1azure~1costs/get/parameters/0` — unresolved $ref
- `#/paths/~1ocean~1aws~1ecs~1launchSpec~1%7BlaunchSpecId%7D/get/parameters/1` — unresolved $ref
- `#/paths/~1aws~1ec2~1group~1%7BgroupId%7D/put/parameters/2` — unresolved $ref

## Request body

- object
  - `launchSpec` object, required — AWS Cluster Virtual Node Group (VNG).
    - `id` string
    - `name` string — User given name of the virtual node group.
    - `imageId` string — Set image identifier. Can be null.
    - `images` object[] — An array of image objects. <br> * You can configure VNG with either the imageId or images objects, but not both simultaneously. * For each architecture type (amd64, arm64) only one AMI is allowed. * Valid values: null, or an array with at least one element
      - `id` string, required — Identifier of the image in AWS. Valid values: any string which is not empty or null.
    - `userData` string, byte — Base64-encoded MIME user data to make available to the instances.
    - `securityGroupIds` string[] — Set security groups. Each element in array should be a security group identifier.
    - `instanceTypes` string[] — An array of supported instance types for the VNG.
    - `preferredSpotTypes` string[] — When Ocean scales up instances, it takes your preferred types into consideration while maintaining a variety of machine types running for optimized distribution. [Learn More](https://docs.flexera.com/spot/ocean/features/vngs/attributes-and-actions-per-vng?id=preferred-spot-instance-types-per-vng)
    - `subnetIds` string[] — Set the subnets in the VNG. Each element in the array should be a subnet identifier.
    - `iamInstanceProfile` union[] — The instance profile iamRole object.
      - union
        - string — The iamRole ARN. If set, do not set launchSpec.iamInstanceProfile.name
        - string — The iamRole name. If set, do not set launchSpec.iamInstanceProfile.arn
    - `attributes` object[] — Add attributes to the cluster.
      - `key` string, required — Give the attribute a key.
      - `value` string, required — Set the value of the attribute.
    - `autoScale` object
      - `headrooms` object[] — Set custom headroom per VNG. Provide a list of launchSpec.autoscale.headroom objects.
        - `cpuPerUnit` integer — Configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU.
        - `memoryPerUnit` integer — Configure the amount of memory (MiB) to allocate the headroom.
        - `numOfUnits` integer, required — The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.
    - `tags` object[] — List of kay-value pairs of tags.
      - `tagKey` string — Set the tag key.
      - `tagValue` string — Set the tag value.
    - `blockDeviceMappings` object[] — Block devices that are exposed to the instance. You can specify virtual devices and EBS volumes. This parameter and rootVolumeSize cannot be in the configuration at the same time. This parameter can be null, but if not null, it must contain at least one block device.
      - `deviceName` string — Set device name.
      - `ebs` object — Set EBS properties.
        - `throughput` integer — The amount of data transferred to or from a storage device per second. You can use this parameter only if volumetype=‘gp3’.
        - `deleteOnTermination` boolean — Flag to delete the EBS on instance termination.
        - `encrypted` boolean
        - `iops` integer — Must be greater than or equal to 0.
        - `kmsKeyId` string
        - `snapshotId` string
        - `volumeType` string — Set volume type.
        - `volumeSize` integer — Set volume size (in GB). When using this property, you cannot use dynamicVolumeSize. You must use one or the other. Volume size should be greater than or equal to the size configured in the AMI.
        - `dynamicVolumeSize` object — Set dynamic volume size properties. When using this object, you cannot use volumeSize. You must use one or the other.
          - `baseSize` integer, required — Initial size per volume.
          - `resource` string, required
          - `sizePerResourceUnit` integer, required — Additional size per resource unit (in GB). For example: if baseSize=50, and sizePerResourceUnit=20, and an instance with 2 CPU is launched, its disk size will be: 90 GB.
    - `restrictScaleDown` boolean — When set to True, the VNG container instances will be treated as if all tasks running have the [restrict-scale-down label](https://docs.flexera.com/spot/ocean/features/labels-and-taints). Therefore, Ocean will not scale down container instances unless they are empty.
    - `instanceMetadataOptions` object — Ocean instance metadata options object for [IMDSv2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html).
      - `httpTokens` 'optional' | 'required', required — Determines if a signed token is required or not.
      - `httpPutResponseHopLimit` integer — An integer from 1 through 64. The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further the instance metadata requests can travel.
    - `scheduling` object — An object used to define scheduled tasks such as a manual headroom update.
      - `tasks` object[]
        - `isEnabled` boolean, required — Describes whether the task is enabled. When True, the task runs. When False, it does not run. Required for launchSpec.scheduling.tasks. In case automatic headroom is configured, please make sure to set autoScaler.enableAutomaticAndManualHeadroom on Ocean level to true in order to make sure that the manual headroom would be affective.
        - `cronExpression` string, required — A valid cron expression. For example : " * * * * * ". The cron job runs in UTC time and is in Unix cron format. (See the Cron Expression Validator Script.)
        - `taskType` 'manualHeadroomUpdate', required — The activity that you are scheduling. Valid values: "manualHeadroomUpdate". Required for launchSpec.scheduling.tasks.
        - `config` object — The config of this scheduled task. Depends on the value of `taskType`.
          - `headrooms` object[], required — Set custom headroom per VNG. Provide a list of launchSpec.autoscale.headroom objects.
            - `cpuPerUnit` integer — Configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU.
            - `memoryPerUnit` integer — Configure the amount of memory (MiB) to allocate the headroom.
            - `numOfUnits` integer — The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.
    - `strategy` object — Similar to a strategy for an Ocean cluster, but applying only to a virtual node group.
      - `spotPercentage` integer — The desired percentage of the Spot instances out of all running container instances. Defaults to 100 when not set.\ Only available when the field is **not** set in the cluster directly (Ocean.Strategy.spotPercentage)
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/spot/apis/spot-by-flexera-api.md) · [All operations](https://skmtc.net/spot/apis/spot-by-flexera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spot/spot-by-flexera-api/revisions/72813baf8d47/schema)
