fbpx
POSThttps://api.spotinst.io/compute/azure/group?accountId={ACCOUNT_ID}

 

          Create a new Elastigroup cluster

URL Parameters

Parameter Type Description
ACCOUNT_ID String

Your Spotinst accountid associated with your token

Example: act-123abc
Request

Headers
{  
   "Content-Type": "application/json",
   "Authorization": "Bearer ${token}" 
}
Body
Copied!
Downloaded!
{
  "group": {
    "name": "spotinst-group",
    "region": "eastus",
    "resourceGroupName": "spotinst-azure",
    "capacity": {
      "target": 8,
      "minimum": 6,
      "maximum": 9
    },
    "scaling": {
      "up": [
        {
          	"policyName": "up when 75% CPU",
        	"metricName": "Percentage CPU",
        	"statistic": "average",
        	"threshold": 0.75,
        	"period": 60,
        	"evaluationPeriods": 3,
        	"cooldown": 300,
        	"action": {
          		"type": "adjustment", 
          		"adjustment": "2"
        	},
        "operator": "gte" 
        }
      ],
     "down": [
       {
         	"policyName": "down when 20% CPU",
        	"metricName": "Percentage CPU",
        	"statistic": "average",
        	"threshold": 0.2,
        	"period": 60,
        	"evaluationPeriods": 4,
        	"cooldown": 300,
        	"action": {
          		"type": "updateCapacity", 
          		"target": 10,
              	"minimum": 8,
              	"maximum": 10
        	},
        "operator": "lte" 
       }
     ]
    },
    "strategy": {
      "lowPriorityPercentage": 100,
      "odCount": 1,
      "drainingTimeout": 300
    },
    "compute": {
      "vmSizes": {
        "odSizes": [
          "standard_a1_v1"
        ],
        "lowPrioritySizes": [
          "standard_a1_v1",
          "standard_a2_v2"
        ]
      },
      "product": "Linux",
      "health": {
        "autoHealing":true,
        "healthCheckType":"INSTANCE_STATE",
        "gracePeriod":120
       },
      "launchSpecification": {
        "image": {
          "marketplace": { 
            "publisher": "OpenLogic",
            "offer": "CentOS",
            "sku": "7.3"
          },
          "custom": {
            "resourceGroupName": "spotinst-azure",
            "imageName": "custom-image-name"
          }
        },
       "loadBalancersConfig":{
                                "loadBalancers":[
									{
                                      "type":"MULTAI_TARGET_SET",
                                      "balancerId":"lb-1ee2e3q",
                                      "targetSetId":"ts-3eq",
                                      "autoWeight": true
									}
								]                            
                            },
        "userData": "",
        "network": {
          "virtualNetworkName": "vname",
          "subnetName": "my-subnet-name",
          "resourceGroupName": "subnetResourceGroup",
          "assignPublicIp": true
        },
        "login": {
  		"userName": "Admin",   
        	 "sshPublicKey": "IyEvYmluL2Jhc2gNCnRvdWNoIHRlc3QuZmlsZQ==",
             "password": "**************"
        }
      }
    }
  }
}

Body Parameters


  • name * String
    Elastigroup name
  • region * String
    The Azure region your Elastigroup will be created in.
  • resourceGroupName * String
    Name of the Resource Group for Elastigroup.
  • capacity * Object
    Capacity of Elastigroup.
  • capacity.target * Integer
    Desired number of instances for Elastigroup to maintain.
  • capacity.minimum * Integer
    Minimum number of instances.
  • capacity.maximum * Integer
    Maximum number of instances.
  • scaling Object
    Scaling Policies for Elastigroup.
  • scaling.up.policyName String
    Name of scaling policy.
  • scaling.up.metricName String
    Metric to monitor.

    Valid Values: "Percentage CPU", "Network In", "Network Out", "Disk Read Bytes", "Disk Write Bytes", "Disk Write Operations/Sec", "Disk Read Operations/Sec"

  • scaling.up.statistic String
    Statistic by which to evaluate the selected metric.

    Valid Values: AVERAGE(“average”), SAMPLE_COUNT(“sampleCount”), SUM(“sum”), MINIMUM(“minimum”), MAXIMUM(“maximum”), PERCENTILE(“percentile”), COUNT(“count”)

  • scaling.up.threshold Float
    The value at which the scaling action is triggered.
  • scaling.up.period Integer
    Amount of time (seconds) for which the threshold must be met in order to trigger the scaling action.
    Example: 60
  • scaling.up.evaluationPeriods Integer
    Number of consecutive periods in which the threshold must be met in order to trigger the scaling action.
    Example: 5
  • scaling.up.cooldown Integer
    Time (seconds) to wait after a scaling action before resuming monitoring.
  • scaling.up.action Object
    Scaling action to take when the policy is triggered.
  • scaling.up.action.type String
    Type of scaling action to take when the scaling policy is triggered.

    Valid Values: "adjustment", "setMinTarget", "updateCapacity", "percentageAdjustment".

    Example: "setMinTarget"
  • scaling.up.action.adjustment Integer
    Value to which the action type will be adjusted.
    Required if using "numeric" or "percentageAdjustment" action types.
  • scaling.up.action.minTargetCapacity Integer
    Value to adjust the capacity to. Required if using “setMinTarget” as action type
  • scaling.up.action.target Integer
    Value to update the group target capacity to. Required if using “updateCapacity” as action type and neither “minimum” nor “maximum” are not defined.
  • scaling.up.action.minimum Integer
    Value to update the group mimimum capacity to. Required if using “updateCapacity” as action type and neither “target” nor “maximum” are not defined.
  • scaling.up.action.maximum Integer
    Value to update the group mimimum capacity to. Required if using “updateCapacity” as action type and neither “target” nor “minimum” are not defined.
  • scaling.up.operator String
    The operator used to evaluate the threshold against the current metric value.

    Valid Values: "gt" (Greater Than),"gte" (Greater Than or Equal), "lt" (Less Than), "lte" (Less Than or Equal)

    Example: "gte"
  • scaling.down.policyName String
    Name of scaling policy.
  • scaling.down.metricName String
    Metric to monitor.

    Valid Values: "Percentage CPU", "Network In", "Network Out", "Disk Read Bytes", "Disk Write Bytes", "Disk Write Operations/Sec", "Disk Read Operations/Sec"

  • scaling.down.statistic String
    Statistic by which to evaluate the selected metric.

    Valid Values: AVERAGE(“average”), SAMPLE_COUNT(“sampleCount”), SUM(“sum”), MINIMUM(“minimum”), MAXIMUM(“maximum”), PERCENTILE(“percentile”), COUNT(“count”)

  • scaling.down.threshold Float
    The value at which the scaling action is triggered.
  • scaling.down.period Integer
    Amount of time (seconds) for which the threshold must be met in order to trigger the scaling action.
  • scaling.down.evaluationPeriods Integer
    Number of consecutive periods in which the threshold must be met in order to trigger the scaling action.
  • scaling.down.cooldown Integer
    Time (seconds) to wait after a scaling action before resuming monitoring.
  • scaling.down.action Object
    Scaling action to take when the policy is triggered.
  • scaling.down.action.type String
    Type of scaling action to take when the scaling policy is triggered.

    Valid Values: "adjustment", "setMaxTarget", "updateCapacity", "percentageAdjustment".

  • scaling.down.action.adjustment Integer
    Value to which the action type will be adjusted.
    Required if using "numeric" or "percentageAdjustment" action types.
  • scaling.down.action.maxTargetCapacity Integer
    Value to adjust the capacity to. Required if using “setMinTarget” as action type.
  • scaling.down.action.target Integer
    Desired number of instances. Required if using “updateCapacity” as action type and neither “minimum” nor “maximum” are not defined.
  • scaling.down.action.minimum Integer
    Lower limit of instances that you can scale down to. Optional, required if using “updateCapacity” as action type and neither “target” nor “maximum” are not defined.
  • scaling.down.action.maximum Integer
    Upper limit of instances that you can scale down to. Optional, required if using “updateCapacity” as action type and neither “target” nor “minimum” are not defined.
  • scaling.down.operator String
    The operator used to evaluate the threshold against the current metric value.

    Valid Values: "gt" (Greater Than),"gte" (Greater Than or Equal), "lt" (Less Than), "lte" (Less Than or Equal)

    Example: lte
  • strategy * Object
  • strategy.lowPriorityPercentage Integer
    Percentage of Low Priority instances to maintain.

    Required if odCount isn't specified.

    Default: 100
  • strategy.odCount Integer
    Number of On-Demand instances to maintain.

    Required if lowPriorityPercentage isn't specified.

  • strategy.drainingTimeout Integer
    Time (seconds) to allow the instance be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation.
    Default: 120 seconds
  • compute * Object
  • compute.vmSizes * Array<Object>
    Sizes of On-Demand and Low-Priority VMs.
  • compute.vmSizes.odSizes * Array<String>
    Available On-Demand sizes.
  • compute.vmSizes.lowPrioritySizes * Array<String>
    Available Low-Priority sizes.
  • compute.product * String
    Type of operating system. Valid Values: Linux, Windows
  • compute.health Object
    Autohealing of unhealthy VMs.
  • compute.health.autoHealing Boolean
    Enable Autohealing of unhealthy VMs.
  • compute.health.healthCheckType String
    Healthcheck to use to validate VM health. Valid Values: "INSTANCE_STATE"
    Example: "INSTANCE_STATE"
  • compute.health.gracePeriod Integer
    Period of time to wait for VM to reach healthiness before monitoring for unhealthiness.
    Example: 300
  • compute.launchSpecification * Object
  • compute.launchSpecification.image * Object
    Image of VM. An image is a template for creating new VMs. Choose from Azure image catalogue (marketplace) or use a custom image.
  • compute.launchSpecification.image.marketplace Array<Object>
    Select an image from Azure's Marketplace image catalogue

    Required if custom image isn't specified.

  • compute.launchSpecification.image.marketplace.publisher String
    Image publisher.

    Required if marketplace image is specified.

  • compute.launchSpecification.image.marketplace.offer String
    Name of image to use.

    Required if marketplace image is specified.

  • compute.launchSpecification.image.marketplace.sku String
    Image's Stock Keeping Unit, which is the specific version of the image.

    Required if marketplace image is specified.

  • compute.launchSpecification.image.custom Array<Object>
    Custom image to launch Elastigroup with.

    Required if marketplace image isn't specified.

  • compute.launchSpecification.image.custom.resourceGroupName String
    Name of Resource Group for custom image.

    Required if custom image is specified.

  • compute.launchSpecification.image.custom.imageName String
    Name of the custom image.

    Required if custom image is specified.

  • compute.launchSpecification.userData Base64
    Base64-encoded MIME user data to make available to the instances.
  • compute.launchSpecification.network * Array<Object>
    Define the Virtual Network and Subnet for your Elastigroup.
  • compute.launchSpecification.network.resourceGroupName * String
    Vnet Resource Group Name
  • compute.launchSpecification.network.virtualNetworkName * String
    Name of Vnet.
  • compute.launchSpecification.network.subnetName * String
    ID of subnet.
  • compute.launchSpecification.network.assignPublicIp Boolean
    Assign a public IP to each VM in the Elastigroup.
    Default: False
  • compute.launchSpecification.login * Array<Object>
    Set admin access for accessing your VMs.
  • compute.launchSpecification.login.userName * String
    user name for admin access to VMs.
  • compute.launchSpecification.login.sshPublicKey String
    SSH for admin access to Linux VMs.

    Required for Linux.

  • compute.launchSpecification.login.password String
    Password for admin access to Windows VMs.

    Required for Windows.

Response - Response: 200

Body
Copied!
Downloaded!
{    
  "request": {
        "id": "d9cdd020-cea0-428c-bd72-534339d43336",
        "url": "/azure/compute/group?spotinstAccountId=act-91234h4a",
        "method": "POST",
        "timestamp": "2018-06-20T09:42:23.934+0000"
  },
  "response": {
      "status": {
        "code": 200,
        "message": "OK"
      },
      "kind": "spotinst:azure:compute:group",
      "items": [
        {
          "Id": "sig-123123",
          "name": "spotinst-group",
          "region": "westus",
          "resourceGroupName": "name",
          "capacity": {
            "target": 2,
            "minimum": 2,
            "maximum": 10
          },
          "scaling": {
            "up": [
              {
                "policyName": "up when 30% CPU",
                "metricName": "Percentage CPU",
                "statistic": "average",
                "unit": "bytse",
                "threshold": 0.3,
                "period": 60,
                "evaluationPeriods": 5,
                "cooldown": 1,
                "action": {
                  "type": "setMinTarget",
                  "minTargetCapacity": "2"
                },
                "operator": "gte"
              }
            ]
          },
          "strategy": {
            "lowPriorityPercentage": 100,
            "odCount": 1,
            "drainingTimeout": 300
          },
          "compute": {
            "vmSizes": {
              "odSizes": [
                "standard_a1",
                "standard_a2"
              ],
              "lowPrioritySizes": [
                "standard_a1",
                "standard_a2"
              ]
          	},
          "product": "Linux",
          "launchSpecification": {
              "image": {
                "marketplace": { 
                	"publisher": "Canonical",
                	"offer": "Ubuntu Server",
                	"sku": "16.04"
                },
                "custom": {
                    "resourceGroupName": "resourceGroupName",
                    "imageName": "image"
                  }
              },
              "userData": "Base64",
              "network": {
                    "virtualNetworkName": "vname",
                    "subnetName": "id",
                    "resourceGroupName": "subnetResourceGroup",
                    "assignPublicIp": true
               },
               "login": {
                      "userName": "Admin",   
                      "sshPublicKey": "IyEvYml1234OC87CnRvdWNoIHRlc3QuZmlsZQ==",
                      "password": "******"
               }
          }
		}
      }
      ],
  	"count": 1
	}
}