---
title: "Create Stateful Node"
method: POST
path: "/azure/compute/statefulNode"
tags: ["Elastigroup Azure Stateful"]
---

# Create Stateful Node

`POST /azure/compute/statefulNode`

Create a new stateful node.

## Parameters

- `#/paths/~1azure~1costs/get/parameters/0` — unresolved $ref

## Request body

- object
  - `statefulNode` object
    - `id` string — Stateful Node unique identifier.
    - `name` string, required — Stateful Node Name.
    - `region` string, required — The Azure region in which the Stateful Node will be launched.
    - `resourceGroupName` string, required — The Azure resource group in which the VM and all of the subsequent subresources will be launched.
    - `description` string — The description for the Stateful Node.
    - `strategy` object, required — The strategy to launch the underlying VM and Spot’s behavior for the Stateful Node.
      - `preferredLifecycle` 'od' | 'spot' — The preferred life cycle to launch the 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[] — Signals that VMs are expected to send to the platform.
        - `type` 'vmReady' | 'vmReadyToShutdown', required — The defined type of signal.
        - `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 LB before terminating it.
      - `revertToSpot` object — Hold settings for strategy correction - replacing On-Demand for Spot VMs
        - `performAt` 'timeWindow' | 'never' | 'always', required — Defines the time in which to perform revert to spot. 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 processes 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. 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.
        - `isEnabled` boolean — Enables interruption tolerance for the stateful node.
        - `cooldown` integer — The cooldown period in minutes after an interruption occurs before another interruption can be tolerated. Must be set if isEnabled is true.
        - `evaluationPeriod` integer — The period in minutes to evaluate the interruption tolerance. Must be set if isEnabled is true.
        - `threshold` integer — The maximum number of interruptions allowed within the evaluation period. Must be set if isEnabled is true.
    - `compute` object, required — Defines the computational parameters to use when launch the VM for the Stateful Node.
      - `os` 'Linux' | 'Windows', required — Defines the type of the operating system.
      - `vmSizes` object, required — Defines the VM sizes to use when launching VMs.
        - `odSizes` string[], required — Defines the on-demand sizes to use when launching VMs.
        - `spotSizes` string[] — Defines the spot VM sizes to use when launching VMs. <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. * <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, VMs 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 — Defines the Virtual Node Group of the VM.
        - `image` object, required — Defines the image with which the VM will be launched. * <a style=color:red>Must be only one initialized from the following (marketplace, custom, gallery).</a> * <a style=color:red>For import or update operations, image object cannot be defined when the compute.persistence.shouldPersistOsDisk = true.</a> * <a style=color:red>For import or update operations, image that contains data disk definitions cannot be defined when the compute.persistence.shouldPersistDataDisks = true.</a>
          - `marketplace` object — Select an image from Azure's Marketplace image catalogue. * <a style=color:red>Required if the custom image or gallery image are not specified.</a>
            - `publisher` string, required — Image publisher.
            - `offer` string, required — Image offer.
            - `sku` string, required — Image 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 definitions. * <a style=color:red>Required if marketplace image or gallery image are not specified.</a>
            - `resourceGroupName` string, required — The resource group name for custom image.
            - `name` string, required — The name of the custom image.
          - `gallery` object — Gallery image definitions. * <a style=color:red>Required if custom image or marketplace image are not specified.</a>
            - `resourceGroupName` string, required — The resource group name for gallery 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.
          - `publisher` string, required — Purchase plan publisher.
          - `product` string, required — Purchase plan product / offer.
          - `name` string, required — 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 — Defines the custom data (YAML encoded at Base64) that will be executed upon VM launch. * <a style=color:red>The customData object cannot be defined when the compute.launchSpecification.image is defined as specialized.</a> * <a style=color:red>For import or update operations, customData object cannot be defined when the compute.persistence.shouldPersistOsDisk = true.</a>
        - `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 — Defines the shutdown script (encoded at Base64) to execute once the VM is detached. * <a style=color:red>For import or update operations, shutdownScript object cannot be defined when the compute.persistence.shouldPersistOsDisk = true.</a>
        - `network` object, required — Defines the network profile with which the VM will be launched. * <a style=color:red>For import or update operations, network object cannot be defined when the compute.persistence.shouldPersistNetwork = true.</a>
          - `resourceGroupName` string, required — Defines the resource group name of the virtual network with which the VM will be launched.
          - `virtualNetworkName` string, required — Defines the name of the virtual network with which the VM will be launched.
          - `networkInterfaces` object[], required — Defines the network interfaces with which the VM will be launched.
            - `isPrimary` boolean, required — Defines whether the network interface is primary or not. * <a style=color:red>Must be true for only one of the items.</a>
            - `subnetName` string, required — Defines the subnet to which the network interface will be connected.
            - `assignPublicIp` boolean — Defines if a Public IP should be assigned in this network interface.
            - `publicIpSku` 'Standard' | 'Basic' — Defines the type of public IP to assign the VM. * <a style=color:red>Required if assignPublicIp=true.</a>
            - `networkSecurityGroup` object — Defines the network security group to which the network interface will be assigned.
              - …
            - `enableIpForwarding` boolean — Enables IP forwarding on the network interface.
            - `privateIpAddresses` string[] — Specify the private IP pool in which the VMs will be launched. * A list of unique IP addresses. * If none of the IP addresses available then a dynamic IP is used.
            - `additionalIpConfigurations` object[] — Defines a list of extra IPs to be dynamically allocated.
              - …
            - `publicIps` object[] — Specify the public IP pool in which the VMs will be launched. * A list of unique IP addresses. * If none of the IP addresses available then a dynamic IP is used.
              - …
            - `applicationSecurityGroups` object[] — Defines the Application Security Groups that will be associated to the primary IP configration of the network interface.
              - …
        - `login` object — Specify the authentication details to be used for launching VMs. * <a style=color:red>For Linux: password/sshPublicKey is required.</a> * <a style=color:red>For Windows: password is required.</a> * <a style=color:red>The login object cannot be defined when the compute.launchSpecification.image is defined as specialized.</a> * <a style=color:red>For import or update operations, login object cannot be defined when the compute.persistence.shouldPersistOsDisk = true.</a>
          - `userName` string, required — Defines the admin user name for launching VMs.
          - `sshPublicKey` string — Defines the SSH public key for admin access to Linux VMs. * Optional only for Linux.
          - `password` string — Defines the password for admin access to Windows VMs. * <a style=color:red>Required for Windows.</a>
        - `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[] — Defines the tags (unique key-value pairs) to tag your resources.
          - `tagKey` string — Tag key for all resources. * Maximum length of 512 characters.
          - `tagValue` string — Tag value for all resources. * Maximum length of 512 characters.
        - `managedServiceIdentities` object[] — Defines a user-assigned managed identity to the launched VMs.
          - `name` string, required — Defines the name of the managed service identities.
          - `resourceGroupName` string, required — Defines the resource group of the managed service identities.
          - `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[] — A 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[] — The definitions of data disks that will be created and 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 storage type on VM launch in Azure.
          - `storageUri` string — The storage URI that is used if a 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, required — Defines the persistence of the Stateful Node.
      - `shouldPersistOsDisk` boolean, required — Enables the OS disk persistency.
      - `osDiskPersistenceMode` 'reattach' | 'onLaunch' — Defines The way persistency is handled in case of os disk persistence.
      - `shouldPersistDataDisks` boolean, required — Enables the data disk persistency.
      - `dataDisksPersistenceMode` 'reattach' | 'onLaunch' — Defines the way persistency is handled in case of data disks persistence.
      - `shouldPersistNetwork` boolean, required — Enables the network persistency.
    - `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 VMs in the stateful node.
      - `insights` object — Configure integrations for the stateful node VM.
        - `isEnabled` boolean, required — Enable insights for the stateful node.
        - `dataCollectionRuleId` string, required — 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)
