---
title: "Update Virtual Node Group"
method: PUT
path: "/ocean/aws/k8s/launchSpec/{launchSpecId}"
tags: ["Ocean AWS"]
---

# Update Virtual Node Group

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

Update Virtual Node Group.

## Query parameters

- `autoApplyTags` boolean

## Parameters

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

## Request body

- object
  - `launchSpec` object, required — AWS Cluster Virtual Node Group (VNG).
    - `name` string — Set Virtual Node Group name.
    - `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 — Set user data script in base 64 encoded MIME.
    - `iamInstanceProfile` object — The instance profile iamRole object.
      - `arn` string — The iamRole ARN. If set, do not set launchSpec.iamInstanceProfile.name
      - `name` string — The iamRole name. If set, do not set launchSpec.iamInstanceProfile.arn
    - `securityGroupIds` string[] — Set security groups. Each element in the array is a security group identifier.
    - `instanceTypes` string[] — A list of instance types allowed to be provisioned for pods pending for the Virtual Node Group.\ The list overrides the list defined for the Ocean cluster. Can be null.
    - `instanceTypesFilters` InstanceTypesFilters — unresolved $ref
    - `preferredOnDemandTypes` string[] — When Ocean scales up instances, it takes your preferred types into consideration while maintaining a variety of machine types running for optimized distribution.
    - `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)
    - `rootVolumeSize` integer — Set root volume size (in GB). This field and blockDeviceMappings cannot be used in the same specification.
    - `reservedENIs` integer — Specifies the count of ENIs to reserve per instance type for scaling purposes.
    - `labels` object[] — An array of labels to add to the VNG nodes. Only custom user labels are allowed, and not Kubernetes built-in labels or Spot internal labels.
      - `key` string — Set label key.\ The following are not allowed: * "kubernetes.io/hostname" * "failure-domain.beta.kubernetes.io/zone" * "topology.kubernetes.io/zone" * "failure-domain.beta.kubernetes.io/region" * "topology.kubernetes.io/region" * "beta.kubernetes.io/instance-type" * "node.kubernetes.io/instance-type" * "beta.kubernetes.io/os" * "kubernetes.io/os" * "beta.kubernetes.io/arch" * "kubernetes.io/arch" * "spotinst.io/node-lifecycle"'
      - `value` string — Set label value.
    - `taints` object[] — Add taints to Virtual Node Group.
      - `key` string — Set taint key.
      - `value` string — Set taint value.
      - `effect` string — Set taint effect.
    - `subnetIds` string[] — Set subnets in Virtual Node Group. Each element in the array is a subnet identifier.
    - `elasticIpPool` object — Assign an Elastic IP to the instances launched by the Virtual Node Group. Can be null.
      - `tagSelector` object — Key-value object, which defines an Elastic IP from the customer pool. Can be null.
        - `tagKey` string, required — Elastic IP tag key. The Virtual Node Group will consider all elastic IPs tagged with this tag as a part of the elastic IP pool to use.
        - `tagValue` string — Elastic IP tag value. Can be null.
    - `autoScale` object — Object specifying the automatic scaling of an Ocean VNG.
      - `headrooms` object[] — Specify the custom headroom per VNG. Provide a list of 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.
        - `gpuPerUnit` integer — Amont of GPU to allocate for headroom unit.
      - `autoHeadroomPercentage` integer — Control the headroom % of the specific Virtual Node Group. Effective when cluster.autoScaler.isAutoConfig=true is set on the Ocean cluster.
      - `down` object — Autoscaling scale down operations.
        - `maxScaleDownPercentage` number, double — The maximum percentage allowed to scale down in a single scaling action on the nodes running in a specific VNG. Allowed only if maxScaleDownPercentage is set to null at the cluster level.
        - `aggressiveScaleDown` object — Enable and configure the Accelerated Scale Down feature to allow the Ocean autoscaler to immediately scale down eligible nodes without any waiting period.
          - `isEnabled` boolean — When set to 'true', Accelerated Scale Down is enabled.
    - `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 spec 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.
        - `dynamicIops` object — Set dynamic IOPS properties. When using this object, you cannot use the `iops` property. You must use one or the other. When `dynamicIops` is configured, the `volumeType` field must also be set.
          - `baseSize` integer, required — Initial size for IOPS.
          - `resource` 'CPU' | 'memory', required — Selects which resource is used to calculate the dynamic IOPS (CPU or memory).
          - `sizePerResourceUnit` integer, required — Additional size per resource unit (in IOPS). For example: if baseSize=50, and sizePerResourceUnit=20, and an instance with 2 CPU is launched, its IOPS size will be 90.
        - `kmsKeyId` string
        - `snapshotId` string
        - `volumeType` 'standard' | 'io1' | 'io2' | 'gp2' | 'gp3' | 'st1' | 'sc1' — Specifies the EBS volume type. This field is required when either `dynamicIops` or `dynamicVolumeSize` is configured.
        - `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. When `dynamicVolumeSize` is configured, the `volumeType` field must also be set.
          - `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.
    - `ephemeralStorage` object
      - `deviceName` string — Specify an alternative device name from which ephemeral storage calculations should be derived. This parameter is used when the ephemeral storage should not utilize the root device. Provide the device name configured in the VNG's BDM or AMI's BDM that differs from the default root device.
    - `resourceLimits` object
      - `maxInstanceCount` integer — Option to set a maximum number of instances per Virtual Node Group.\ Can be null. If set, value must be greater than or equal to 0.
      - `minInstanceCount` integer — Option to set a minimum number of instances per Virtual Node Group.\ Can be null. If set, value must be greater than or equal to 0.
    - `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 instances for this VNG.\ Only available when the field is **not** set in the cluster directly (cluster.strategy.spotPercentage).
      - `utilizeReservedInstances` boolean — When set as ‘true’, if reserved instances exist, Ocean will utilize them before launching spot instances. If the value is set as 'null', it will automatically be inherited from the cluster level.
      - `utilizeCommitments` boolean — When set as ‘true’, if savings plans commitments have available capacity, Ocean will utilize them alongside RIs (if exist) to maximize cost efficiency. If the value is set as 'null', it will automatically be inherited from the cluster level.
      - `drainingTimeout` integer — The configurable amount of time that Ocean will wait for the draining process to complete before terminating an instance. If you have not defined a draining timeout, the default of 300 seconds will be used.
      - `orientation` object
        - `availabilityVsCost` 'costOriented' | 'balanced' | 'cheapest' — Set this value to control the approach that Ocean takes while launching nodes.
    - `associatePublicIpAddress` boolean — Configure public IP address allocation.
    - `restrictScaleDown` boolean — When set to “True”, VNG nodes will be treated as if all pods running have the [restrict-scale-down label](https://docs.flexera.com/spot/ocean/features/labels-and-taints). Therefore, Ocean will not scale nodes down unless empty.
    - `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.
            - `gpuPerUnit` integer — Amont of GPU to allocate for headroom unit.
      - `shutdownHours` object — An object used to specify times that the nodes in the virtual node group will be taken down.
        - `timeWindows` string[], required — The times that the shutdown hours will apply.
        - `isEnabled` boolean — Flag to enable or disable the shutdown hours mechanism. When False, the mechanism is deactivated, and the virtual node group remains in its current state.
      - `optimizationWindows` object — An object used to specify time windows during which certain optimization constraints can be eased.
        - `isEnabled` boolean, required — Used to enable or disable the optimization windows mechanism. Must be a boolean (null is invalid). When true, at least one window must be defined. When false, windows can be empty or omitted.
        - `windows` object[] — The times when the optimization windows will apply. Required if isEnabled is true.
          - `cronExpression` string, required — A valid cron expression defining when the optimization window starts. For example: "0 0 * * *" (daily at midnight). The cron job runs in UTC time and follows Unix cron format.
          - `duration` string, required — The duration of the optimization window. Must be in the format <number><unit> where unit is 'm' (minutes), 'h' (hours), or 'd' (days). Examples: 10m, 5h, 2d.
          - `effects` string[], required — The list of effects that will be applied during this optimization window.
    - `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 within 1,64 range (including). The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel.
    - `startupTaints` object[] — Temporary taints applied to a node during its initialization phase. For a startup taint to work, it must also be set as a regular taint in the userData for the VNG.
      - `key` string — Set startup taint key.
      - `value` string — Set startup taint value.
      - `effect` string — Set startup taint effect.
    - `instanceStorePolicy` object — Determines the utilization of instance store volumes. If not defined, instance store volumes will not be used.
      - `type` 'RAID0' — The method for using the instance store volumes (**must also be defined in the userData**).
    - `gpu` object — GPU configuration
      - `sharing` object[] — List of configurations for GPU sharing. You can get up to 1 configuration.
        - `gpuSharingType` 'timeSlicing' — Type of GPU sharing.
        - `config` object
          - `replicas` integer — Number of shared replicas for the GPU sharing configuration.
    - `loadBalancers` Items[] — Configure load balancer settings for the VNG. — unresolved $ref

## 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)
