---
title: "Update Stateful Node"
method: PUT
path: "/azure/compute/statefulNode/{nodeId}"
tags: ["Elastigroup Azure Stateful"]
---

# Update Stateful Node

`PUT /azure/compute/statefulNode/{nodeId}`

Update an existing stateful node.

## Parameters

- `#/paths/~1azure~1costs/get/parameters/0` — unresolved $ref
- `#/paths/~1azure~1compute~1statefulNode~1%7BnodeId%7D/get/parameters/1` — unresolved $ref

## Request body

- object
  - `statefulNode` object
    - `id` string — Azure Stateful Node ID
    - `name` string — Azure Stateful Node Name
    - `region` string — The Azure region your Stateful Node will be created in.
    - `resourceGroupName` string — Name of the Resource Group for Stateful Node.
    - `description` string — Describe your Azure Stateful Node
    - `strategy` object — Strategy for Stateful Node.
      - `preferredLifecycle` 'od' | 'spot' — The desired type of VM.
      - `shouldUtilizeCommitments` boolean — Determines whether to utilize any existing Azure Savings Plans or Reserved Instances associated with the subscription for On-Demand VMs.
      - `signals` object[] — The signals defined for the stateful node.
        - `type` 'vmReady' | 'vmReadyToShutdown', required — The type of the signal defined for the stateful node.
        - `timeout` integer, required — The timeout in seconds to hold the vm until a signal is sent.\ If no signal is sent the vm will be replaced (vmReady) or we will terminate the vm (vmReadyToShutdown) after the timeout.
      - `fallbackToOd` boolean, required — In case of no spots available, Stateful Node will launch an On-demand instance instead
      - `drainingTimeout` integer — Time (in seconds) to allow the VM be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation.
      - `revertToSpot` object — Hold settings for strategy correction - replacing On-Demand for Spot VMs
        - `performAt` 'timeWindow' | 'never' | 'always', required — Settings for maintenance strategy. default: "always"
      - `optimizationWindows` string[] — Defines the windows of which to revert to spot. * <a style=color:red>Requires the following format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))".</a> * <a style=color:red>Must be not empty if revertToSpot.performAt = timeWindow.</a>
      - `odWindows` string[] — * Define the time windows in which the underlying VM will be set as an on-demand lifecycle type. * During the entire time window, the rest of the strategy process will be paused. * Switching between on-demand and Spot VM types at the enter/exit of the time window will trigger the recycling of the stateful node. * <a style=color:red>Requires the following format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))".</a>
      - `capacityReservation` object — On-demand Capacity Reservation group enables you to reserve Compute capacity in an Azure region or an Availability Zone for any duration of time. [CRG can only be created on the Azure end.](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create)
        - `shouldUtilize` boolean, required — Determines whether capacity reservations should be utilized.
        - `utilizationStrategy` 'utilizeOverSpot' | 'utilizeOverOD', required — The priority requested for using CRG. This value will determine if CRG is used ahead of spot VMs or On-demand VMs. * utilizeOverOD- If picked, we will use CRG only in case On-demand should be launched. * utilizeOverSpot- CRG will be preferred over Spot. Only after CRG is fully used, spot VMs can be used.
        - `capacityReservationGroups` object[] — List of the desired CRGs to use under the associated Azure subscription. When null we will utilize any available reservation that matches the Virtual Node Group.
          - `name` string, required — The name of the CRG.
          - `resourceGroupName` string, required — Azure resource group name
          - `shouldPrioritize` boolean — The desired CRG to utilize ahead of other CRGs in the subscription.
      - `availabilityVsCost` integer — Set the desired preference for the Spot market VM selection. (100- Availability, 0- cost)
      - `interruptionToleration` object — Interruption tolerance settings for the stateful node.
        - `isEnabled` boolean — Interruption tolerance settings for the stateful node. When enabled, the stateful node tracks interruption frequency and temporarily switches the node to On-Demand if too many interruptions occur within a defined evaluation window.
        - `cooldown` integer — The cooldown period in minutes after an interruption occurs before another interruption can be tolerated.
        - `evaluationPeriod` integer — The period in minutes to evaluate the interruption tolerance.
        - `threshold` integer — The maximum number of interruptions allowed within the evaluation period.
    - `compute` object — Compute settings for Stateful Node
      - `os` 'Linux' | 'Windows', required — Type of operating system.
      - `vmSizes` object, required — Amount of time to be unhealthy before a replacement is triggered
        - `odSizes` string[], required — Available On-Demand sizes.
        - `spotSizes` string[] — Available Spot-VM sizes. <a style=color:red>Required if spotSizeAttributes isn't specified.</a>
        - `spotSizeAttributes` object — The values and ranges for spot size attributes when launching VMs. <a style=color:red>Required if spotSizes isn't specified.</a>
          - `minCpu` integer — Minimum amount of vCPU units.
          - `maxCpu` integer — Maximum amount of vCPU units.
          - `minStorage` integer — Minimum amount of storage in GiB.
          - `MaxStorage` integer — Maximum amount of storage in GiB.
          - `minMemory` integer — Minimum amount of memory in GiB.
          - `maxMemory` integer — Maximum amount of memory in GiB.
        - `excludedVmSizes` string[] — Exclude these spot VM sizes when using attribute-based VM sizes.
        - `preferredSpotSizes` string[] — Prioritize Spot VM sizes when launching Spot VMs for the group. <a style=color:red>If set, must be a sublist of compute.vmSizes.spotSizes. </a>
      - `zones` string[] — List of Azure Availability Zones in the defined region; If not defined, Virtual machines will be launched regionally.
      - `preferredZone` '1' | '2' | '3' — The AZ to prioritize when launching VMs. * If no markets are available in the Preferred AZ, VMs will be launched in the non-preferred AZs. * <a style=color:red>Must be one of the zones in compute.zones.</a>
      - `launchSpecification` object, required
        - `image` object, required — Image of VM. An image is a template for creating new VMs.
          - `marketplace` object — Select an image from Azure's Marketplace image catalogue\ Required if custom image or gallery image are not specified.
            - `publisher` string, required — Image publisher.
            - `offer` string, required — Name of image to use.
            - `sku` string, required — Image's Stock Keeping Unit, which is the specific version of the image.
            - `version` string, required — Image's version. if version not provided we use "latest"
          - `custom` object — Custom image to launch Stateful Node with.
            - `resourceGroupName` string, required — Name of Resource Group for custom image.
            - `name` string, required — Name of the custom image.
          - `gallery` object — Gallery image to launch Stateful Node with. Required if custom image or marketplace image are not specified.
            - `resourceGroupName` string, required — Name of Resource Group for custom image
            - `galleryName` string, required — Name of the gallery.
            - `imageName` string, required — Name of the gallery image.
            - `versionName` string, required — Image's version. Can be in the format x.x.x or 'latest'.
            - `spotAccountId` string — The Spot account ID that connected to the Azure subscription to which the gallery belongs. Relevant only in case of cross-subscription shared galleries. [Read more](https://docs.flexera.com/spot/elastigroup/features-azure/shared-image-galleries) about cross-subscription shared galleries in Elastigroup.
        - `purchasePlan` object — Defines the Azure Marketplace purchase plan for the VM image. * On update, each provided field must contain a non-empty value.
          - `publisher` string — Purchase plan publisher.
          - `product` string — Purchase plan product / offer.
          - `name` string — Purchase plan name / SKU. * This value is case-sensitive and must exactly match the Azure plan metadata.
        - `vmName` string — * Set a VM name that will be persisted throughout the entire node lifecycle. * The name value should comply with the following limitations: * A maximal length of 64 characters. * The name can’t contain spaces, control characters, or these characters: ~ ! @ # $ % ^ & * ( ) = + _ [ ] { } | ; : . ' " , < > / ? * A Windows VM name can't include a period or end with a hyphen. * A Linux VM name can't end with a period or hyphen.
        - `vmNamePrefix` string — * Set a VM name prefix to be used for all launched VMs and the VM resources. * The prefix value should comply with the following limitations: * A maximal length of 25 characters. * The prefix can’t contain spaces, control characters, or these characters: ~ ! @ # $ % ^ & * ( ) = + _ [ ] { } | ; : . ' " , < > / ? * The VM prefix can't end with a hyphen.
        - `customData` string, byte — This value will hold the YML in base64 and will be added to the virtual machine.
        - `userData` string — Define a set of scripts or other metadata that's inserted to an Azure virtual machine at provision time. (Base64 encoded)
        - `shutdownScript` string, byte — Shutdown script for the stateful node. Value should be passed as a string encoded at Base64 only
        - `network` object, required — Define the Virtual Network and Subnet for your Stateful Node.
          - `resourceGroupName` string, required — Vnet Resource Group Name
          - `virtualNetworkName` string, required — Virtual Network
          - `networkInterfaces` object[], required — Network Interfaces
            - `isPrimary` boolean, required — Defines whether the network interface is primary or not.
            - `subnetName` string, required — Subnet name
            - `assignPublicIp` boolean — Assign public IP
            - `publicIpSku` string — Required if assignPublicIp=true values=[STANDARD/BASIC]
            - `networkSecurityGroup` object — Network Security Group
              - …
            - `enableIpForwarding` boolean — Enable IP Forwarding
            - `privateIpAddresses` string[] — A list with unique items that every item is a valid IP
            - `additionalIpConfigurations` object[] — Additional configuration of network interface
              - …
            - `publicIps` object[] — Defined a pool of Public Ips (from Azure), that will be associated to the network interface. We will associate one public ip per instance until the pool is exhausted, in which case, we will create a new one.
              - …
            - `applicationSecurityGroups` object[] — List of Application Security Groups that will be associated to the primary ip configration of the network interface.
              - …
        - `login` object — Set admin access for accessing your VMs. Password/SSH is required for Linux.
          - `userName` string, required — user name for admin access to VMs.\ Login can be set: * for windows: compute.launchSpecification.login.password * for linux: compute.launchSpecification.login.sshPublicKey Just user name, without pwd or SSH key
          - `sshPublicKey` string — SSH for admin access to Linux VMs.\ Optional for Linux.
          - `password` string — Password for admin access to Windows VMs.\ Required for Windows.
        - `loadBalancersConfig` object — Configure a Load Balancer.
          - `loadBalancers` object[] — Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer.
            - `type` 'loadBalancer' | 'applicationGateway', required — The type of load balancer.
            - `resourceGroupName` string, required — The Resource Group name of the Load Balancer.
            - `name` string, required — Name of the Application Gateway/Load Balancer
            - `loadBalancerSku` string — * if type is LoadBalancer then possible values are: * “Standard" * Basic” * if ApplicationGateway then possible values are: * “Standard_Large” * “Standard_Medium” * “Standard_Small” * “Standard_v2 * “WAF_Large” * “WAF_Medium" * “WAF_v2"
            - `backendPoolNames` string[], required — Name of the Backend Pool to register the Stateful Node VMs to.\ Each Backend Pool is a separate load balancer.\ Required if Type is APPLICATION_GATEWAY.
        - `tags` object[] — Unique Key-Value pairs for all Stateful Node Resources.
          - `tagKey` string — Tag Key for Stateful Node Resources.
          - `tagValue` string — Tag Value for Stateful Node Resources.
        - `managedServiceIdentities` object[] — Add a user-assigned managed identity to the Stateful Node's VM.
          - `name` string, required — name of the managed identity
          - `resourceGroupName` string, required — The Resource Group that the user-assigned managed identity resides in.
          - `subscriptionId` string — Defines the subscription ID of the managed service identities. Required if the managed service identity is in a different subscription. To use a user-assigned managed identity in a different subscription, you must | ensure that the spotAccount's Service Principal has access to the defined subscription and that it | has the two following permissions: 1. Microsoft.ManagedIdentity/userAssignedIdentities/assign/action 2. Microsoft.ManagedIdentity/userAssignedIdentities/read
        - `extensions` object[] — List of objects for azure extensions
          - `name` string, required — Required on compute.launchSpecification.extensions object
          - `type` string, required — Required on compute.launchSpecification.extensions object
          - `publisher` string, required — Required on compute.launchSpecification.extensions object
          - `apiVersion` string, required — The API version of the extension. Required if extension specified.
          - `minorVersionAutoUpgrade` boolean, required — Required on compute.launchSpecification.extensions object
          - `publicSettings` object — Object for public settings
          - `protectedSettings` object — Object for protected settings
          - `enableAutomaticUpgrade` boolean — Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available.
          - `protectedSettingsFromKeyVault` object — The extensions protected settings that are passed by reference, and consumed from key vault.
            - `sourceVault` string, required — The relative URL of the Key Vault containing the secret.
            - `secretUrl` string, required — The URL referencing a secret in a Key Vault.
        - `dataDisks` object[] — list of data disks to be attached to the stateful node's vm.
          - `sizeGB` integer, required — The size of the data disk in GB, Required if dataDisks is specified.
          - `lun` integer, required — The lun of the data disk.
          - `type` 'Standard_LRS' | 'Premium_LRS' | 'StandardSSD_LRS' | 'UltraSSD_LRS' | 'StandardSSD_ZRS' | 'Premium_ZRS' | 'PremiumV2_LRS', required — The type of the data disk
          - `caching` 'None' | 'ReadOnly' | 'ReadWrite' — Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. * If not specified, the Azure default behavior will be applied.
        - `osDisk` object — Specify OS disk specification other than default.
          - `type` 'Standard_LRS' | 'Premium_LRS' | 'StandardSSD_LRS' | 'StandardSSD_ZRS' | 'Premium_ZRS', required — The type of the OS disk.
          - `sizeGB` integer — The size of the data disk in GB.
          - `caching` 'None' | 'ReadOnly' | 'ReadWrite' — Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. * If not specified, the Azure default behavior will be applied.
        - `secrets` object[] — Set of certificates that should be installed on the VM
          - `sourceVault` object, required — The key vault reference, contains the required certificates
            - `resourceGroupName` string, required — The resource group name of the key vault
            - `name` string, required — The name of the key vault
          - `vaultCertificates` object[], required — The required certificate references
            - `certificateUrl` string, required — The URL of the certificate under the key vault
            - `certificateStore` string, required — The certificate store directory the VM. The directory is created in the LocalMachine account. * This field is required only when using windows OS type * This field must be ‘null’ when the OS type is Linux
        - `bootDiagnostics` object — Will enable boot diagnostics in Azure when a new VM is launched
          - `isEnabled` boolean, required — Allows you to enable and disable the configuration of boot diagnostics at launch
          - `type` 'managed' | 'unmanaged', required — Defines the type of storage on VM launch in Azure.
          - `storageUri` string — The storage URI that is used if type is unmanaged. The storage URI must follow the blob storage URI format ("https://<blobstoragename>.blob.core.windows.net/"). StorageUri is required if the type is unmanaged. StorageUri must be ‘null’ in case the boot diagnostics type is managed
        - `licenseType` string — Specify an existing Azure license type to use when launching new VMs. * Valid values for Windows OS: "Windows_Server", "Windows_Client" * Valid values for Linux OS: "RHEL_BYOS", "SLES_BYOS"
        - `security` object — Specifies the Security related profile settings for the virtual machine.
          - `securityType` 'Standard' | 'TrustedLaunch' | 'ConfidentialVM' — Security type refers to the different security features of a virtual machine. Security features like Trusted launch virtual machines help to improve the security of Azure generation 2 virtual machines.
          - `secureBootEnabled` boolean — Specifies whether secure boot should be enabled on the virtual machine.
          - `vTpmEnabled` boolean — Specifies whether vTPM should be enabled on the virtual machine.
          - `encryptionAtHost` boolean — Enables the Host Encryption for the virtual machine. The Encryption at host will be disabled unless this property is set to true for the resource.
          - `confidentialOsDiskEncryption` boolean — Confidential disk encryption binds the disk encryption keys to the VM's TPM, ensuring VM-only access. The security type must be "ConfidentialVM" to enable defining this preference as “true”.
        - `proximityPlacementGroups` object[] — The proximity placement group where the VM is launched.
          - `name` string, required — The name of the proximity placement group.
          - `resourceGroupName` string, required — The resource group name of the proximity placement group.
    - `persistence` object — Persistence settings for stateful node
      - `shouldPersistOsDisk` boolean — Should persist os disk.
      - `osDiskPersistenceMode` 'reattach' | 'onLaunch' — The way persistency is handled in case of os disk persistence.
      - `shouldPersistDataDisks` boolean — Should persist data disks.
      - `dataDisksPersistenceMode` 'reattach' | 'onLaunch' — The way persistency is handled in case of data disks persistence.
      - `shouldPersistNetwork` boolean — Should persist network.
    - `scheduling` object — Scheduling settings for stateful node
      - `tasks` object[] — List of scheduled tasks to excute for the stateful node's.
        - `isEnabled` boolean, required — Is scheduled task enabled for stateful node.
        - `type` 'pause' | 'resume' | 'recycle', required — The type of the scheduled task
        - `cronExpression` string, required — A expression which describes when to execute the scheduled task (UTC)
    - `health` object — Set health check and auto-healing of unhealthy VMs.
      - `healthCheckTypes` string[] — Health check types to use in order to validate VM health.
      - `gracePeriod` integer — The amount of time (in seconds) after a new VM has launched before terminating the old VM.
      - `autoHealing` boolean — Enable auto-healing of unhealthy VMs.
      - `unhealthyDuration` integer — Amount of time (in seconds) for the VM to remain unhealthy before a replacement is triggered.
    - `integrations` object — Configure integrations for the stateful node VM.
      - `insights` object — Configure insights for the stateful node VM.
        - `isEnabled` boolean — Enable insights for the stateful node.
        - `dataCollectionRuleId` string — The ID of the data collection rule to be associated with the Stateful Node.
    - `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)
