Compute Cloud Instance Groups API, REST: InstanceGroup.Create
- HTTP request
- Body parameters
- InstanceTemplate
- ResourcesSpec
- AttachedDiskSpec
- DiskSpec
- NetworkInterfaceSpec
- PrimaryAddressSpec
- OneToOneNatSpec
- DnsRecordSpec
- SchedulingPolicy
- NetworkSettings
- PlacementPolicy
- HostAffinityRule
- AttachedFilesystemSpec
- MetadataOptions
- ScalePolicy
- FixedScale
- AutoScale
- CpuUtilizationRule
- CustomRule
- DeployPolicy
- AllocationPolicy
- Zone
- LoadBalancerSpec
- TargetGroupSpec
- HealthChecksSpec
- HealthCheckSpec
- TcpOptions
- HttpOptions
- Variable
- ApplicationLoadBalancerSpec
- ApplicationTargetGroupSpec
- AutoHealingPolicy
- Response
- Status
Creates an instance group in the specified folder.
This method starts an operation that can be cancelled by another operation.
HTTP request
POST https://compute.api.cloud.yandex.net/compute/v1/instanceGroups
Body parameters
{
"folderId": "string",
"name": "string",
"description": "string",
"labels": "object",
"instanceTemplate": {
"description": "string",
"labels": "object",
"platformId": "string",
"resourcesSpec": {
"memory": "string",
"cores": "string",
"coreFraction": "string",
"gpus": "string"
},
"metadata": "object",
"bootDiskSpec": {
"mode": "string",
"deviceName": "string",
"diskSpec": {
"description": "string",
"typeId": "string",
"size": "string",
// Includes only one of the fields `imageId`, `snapshotId`
"imageId": "string",
"snapshotId": "string",
// end of the list of possible fields
"preserveAfterInstanceDelete": "boolean"
},
"diskId": "string",
"name": "string"
},
"secondaryDiskSpecs": [
{
"mode": "string",
"deviceName": "string",
"diskSpec": {
"description": "string",
"typeId": "string",
"size": "string",
// Includes only one of the fields `imageId`, `snapshotId`
"imageId": "string",
"snapshotId": "string",
// end of the list of possible fields
"preserveAfterInstanceDelete": "boolean"
},
"diskId": "string",
"name": "string"
}
],
"networkInterfaceSpecs": [
{
"networkId": "string",
"subnetIds": [
"string"
],
"primaryV4AddressSpec": {
"oneToOneNatSpec": {
"ipVersion": "string",
"address": "string",
"dnsRecordSpecs": [
{
"fqdn": "string",
"dnsZoneId": "string",
"ttl": "string",
"ptr": "boolean"
}
]
},
"address": "string",
"dnsRecordSpecs": [
{
"fqdn": "string",
"dnsZoneId": "string",
"ttl": "string",
"ptr": "boolean"
}
]
},
"primaryV6AddressSpec": {
"oneToOneNatSpec": {
"ipVersion": "string",
"address": "string",
"dnsRecordSpecs": [
{
"fqdn": "string",
"dnsZoneId": "string",
"ttl": "string",
"ptr": "boolean"
}
]
},
"address": "string",
"dnsRecordSpecs": [
{
"fqdn": "string",
"dnsZoneId": "string",
"ttl": "string",
"ptr": "boolean"
}
]
},
"securityGroupIds": [
"string"
]
}
],
"schedulingPolicy": {
"preemptible": "boolean"
},
"serviceAccountId": "string",
"name": "string",
"hostname": "string",
"networkSettings": {
"type": "string"
},
"placementPolicy": {
"placementGroupId": "string",
"hostAffinityRules": [
{
"key": "string",
"op": "string",
"values": [
"string"
]
}
]
},
"filesystemSpecs": [
{
"mode": "string",
"deviceName": "string",
"filesystemId": "string"
}
],
"reservedInstancePoolId": "string",
"metadataOptions": {
"gceHttpEndpoint": "string",
"awsV1HttpEndpoint": "string",
"gceHttpToken": "string",
"awsV1HttpToken": "string",
"awsV2HttpEndpoint": "string",
"awsV2HttpToken": "string"
}
},
"scalePolicy": {
// Includes only one of the fields `fixedScale`, `autoScale`
"fixedScale": {
"size": "string"
},
"autoScale": {
"minZoneSize": "string",
"maxSize": "string",
"measurementDuration": "string",
"warmupDuration": "string",
"stabilizationDuration": "string",
"initialSize": "string",
"cpuUtilizationRule": {
"utilizationTarget": "string"
},
"customRules": [
{
"ruleType": "string",
"metricType": "string",
"metricName": "string",
"labels": "object",
"target": "string",
"folderId": "string",
"service": "string"
}
],
"autoScaleType": "string"
},
// end of the list of possible fields
"testAutoScale": {
"minZoneSize": "string",
"maxSize": "string",
"measurementDuration": "string",
"warmupDuration": "string",
"stabilizationDuration": "string",
"initialSize": "string",
"cpuUtilizationRule": {
"utilizationTarget": "string"
},
"customRules": [
{
"ruleType": "string",
"metricType": "string",
"metricName": "string",
"labels": "object",
"target": "string",
"folderId": "string",
"service": "string"
}
],
"autoScaleType": "string"
}
},
"deployPolicy": {
"maxUnavailable": "string",
"maxDeleting": "string",
"maxCreating": "string",
"maxExpansion": "string",
"startupDuration": "string",
"strategy": "string",
"minimalAction": "string"
},
"allocationPolicy": {
"zones": [
{
"zoneId": "string",
"instanceTagsPool": [
"string"
]
}
]
},
"loadBalancerSpec": {
"targetGroupSpec": {
"name": "string",
"description": "string",
"labels": "object"
},
"maxOpeningTrafficDuration": "string",
"ignoreHealthChecks": "boolean"
},
"healthChecksSpec": {
"healthCheckSpecs": [
{
"interval": "string",
"timeout": "string",
"unhealthyThreshold": "string",
"healthyThreshold": "string",
// Includes only one of the fields `tcpOptions`, `httpOptions`
"tcpOptions": {
"port": "string"
},
"httpOptions": {
"port": "string",
"path": "string"
}
// end of the list of possible fields
}
],
"maxCheckingHealthDuration": "string"
},
"serviceAccountId": "string",
"variables": [
{
"key": "string",
"value": "string"
}
],
"deletionProtection": "boolean",
"applicationLoadBalancerSpec": {
"targetGroupSpec": {
"name": "string",
"description": "string",
"labels": "object"
},
"maxOpeningTrafficDuration": "string",
"ignoreHealthChecks": "boolean"
},
"autoHealingPolicy": {
"autoHealingAction": "string"
}
}
|
Field |
Description |
|
folderId |
string Required field. ID of the folder to create an instance group in. |
|
name |
string Name of the instance group. Value must match the regular expression |
|
description |
string Description of the instance group. |
|
labels |
object (map<string, string>) Resource labels as Each value must match the regular expression |
|
instanceTemplate |
Required field. Instance template that the instance group belongs to. |
|
scalePolicy |
Required field. Scaling policy of the instance group. |
|
deployPolicy |
Required field. Deployment policy of the instance group. |
|
allocationPolicy |
Required field. Allocation policy of the instance group by zones and regions. |
|
loadBalancerSpec |
Settings for balancing load between instances via Network Load Balancer |
|
healthChecksSpec |
Health checking specification. For more information, see Health check. |
|
serviceAccountId |
string Required field. ID of the service account. The service account will be used for all API calls |
|
variables[] |
|
|
deletionProtection |
boolean Flag prohibiting deletion of the instance group. |
|
applicationLoadBalancerSpec |
Settings for balancing load between instances via Application Load Balancer |
|
autoHealingPolicy |
AutoHealingPolicy policy of the instance group. |
InstanceTemplate
|
Field |
Description |
|
description |
string Description of the instance template. |
|
labels |
object (map<string, string>) Resource labels as |
|
platformId |
string Required field. ID of the hardware platform configuration for the instance. |
|
resourcesSpec |
Required field. Computing resources of the instance such as the amount of memory and number of cores. |
|
metadata |
object (map<string, string>) The metadata |
|
bootDiskSpec |
Boot disk specification that will be attached to the instance. |
|
secondaryDiskSpecs[] |
Array of secondary disks that will be attached to the instance. |
|
networkInterfaceSpecs[] |
Array of network interfaces that will be attached to the instance. |
|
schedulingPolicy |
Scheduling policy for the instance. |
|
serviceAccountId |
string Service account ID for the instance. |
|
name |
string Name of the instance. |
|
hostname |
string Host name for the instance. |
|
networkSettings |
Network settings for the instance. |
|
placementPolicy |
Placement Group |
|
filesystemSpecs[] |
Array of filesystems to attach to the instance. |
|
reservedInstancePoolId |
string ID of the reserved instance pool that the instance should belong to. |
|
metadataOptions |
Metadata options for the instance |
ResourcesSpec
|
Field |
Description |
|
memory |
string (int64) The amount of memory available to the instance, specified in bytes. |
|
cores |
string (int64) The number of cores available to the instance. |
|
coreFraction |
string (int64) Baseline level of CPU performance with the ability to burst performance above that baseline level. |
|
gpus |
string (int64) The number of GPUs available to the instance. |
AttachedDiskSpec
|
Field |
Description |
|
mode |
enum (Mode) Required field. Access mode to the Disk resource.
|
|
deviceName |
string Serial number that is reflected in the /dev/disk/by-id/ tree Value must match the regular expression |
|
diskSpec |
oneof disk_spec or disk_id |
|
diskId |
string Set to use an existing disk. To set use variables. Value must match the regular expression |
|
name |
string When set can be later used to change DiskSpec of actual disk. |
DiskSpec
|
Field |
Description |
|
description |
string Description of the disk. |
|
typeId |
string Required field. ID of the disk type. |
|
size |
string (int64) Size of the disk, specified in bytes. |
|
imageId |
string ID of the image that will be used for disk creation. Includes only one of the fields |
|
snapshotId |
string ID of the snapshot that will be used for disk creation. Includes only one of the fields |
|
preserveAfterInstanceDelete |
boolean When set to true, disk will not be deleted even after managed instance is deleted. |
NetworkInterfaceSpec
|
Field |
Description |
|
networkId |
string ID of the network. |
|
subnetIds[] |
string IDs of the subnets. |
|
primaryV4AddressSpec |
Primary IPv4 address that is assigned to the instance for this network interface. |
|
primaryV6AddressSpec |
Primary IPv6 address that is assigned to the instance for this network interface. IPv6 not available yet. |
|
securityGroupIds[] |
string IDs of security groups. |
PrimaryAddressSpec
|
Field |
Description |
|
oneToOneNatSpec |
An external IP address configuration. |
|
address |
string Optional. Manual set static internal IP. To set use variables. Value must match the regular expression |
|
dnsRecordSpecs[] |
Internal DNS configuration |
OneToOneNatSpec
|
Field |
Description |
|
ipVersion |
enum (IpVersion) IP version for the public IP address.
|
|
address |
string Manual set static public IP. To set use variables. (optional) Value must match the regular expression |
|
dnsRecordSpecs[] |
External DNS configuration |
DnsRecordSpec
|
Field |
Description |
|
fqdn |
string FQDN (required) |
|
dnsZoneId |
string DNS zone id (optional, if not set, private zone used) |
|
ttl |
string (int64) DNS record ttl, values in 0-86400 (optional) |
|
ptr |
boolean When set to true, also create PTR DNS record (optional) |
SchedulingPolicy
|
Field |
Description |
|
preemptible |
boolean Preemptible instances are stopped at least once every 24 hours, and can be stopped at any time |
NetworkSettings
|
Field |
Description |
|
type |
enum (Type) Required field. Type of instance network.
|
PlacementPolicy
|
Field |
Description |
|
placementGroupId |
string Identifier of placement group |
|
hostAffinityRules[] |
List of affinity rules. Scheduler will attempt to allocate instances according to order of rules. |
HostAffinityRule
Affinity definition
|
Field |
Description |
|
key |
string Required field. Affinity label or one of reserved values - 'yc.hostId', 'yc.hostGroupId' |
|
op |
enum (Operator) Include or exclude action
|
|
values[] |
string Affinity value or host ID or host group ID |
AttachedFilesystemSpec
|
Field |
Description |
|
mode |
enum (Mode) Mode of access to the filesystem that should be attached.
|
|
deviceName |
string Name of the device representing the filesystem on the instance. Value must match the regular expression |
|
filesystemId |
string ID of the filesystem that should be attached. Value must match the regular expression |
MetadataOptions
|
Field |
Description |
|
gceHttpEndpoint |
enum (MetadataOption) Enabled access to GCE flavored metadata
|
|
awsV1HttpEndpoint |
enum (MetadataOption) Enabled access to AWS flavored metadata (IMDSv1)
|
|
gceHttpToken |
enum (MetadataOption) Enabled access to IAM credentials with GCE flavored metadata
|
|
awsV1HttpToken |
enum (MetadataOption) Enabled access to IAM credentials with AWS flavored metadata (IMDSv1)
|
|
awsV2HttpEndpoint |
enum (MetadataOption) Enabled access to AWS flavored metadata with session token (IMDSv2)
|
|
awsV2HttpToken |
enum (MetadataOption) Enabled access to STS credentials with AWS flavored metadata with session token (IMDSv2)
|
ScalePolicy
|
Field |
Description |
|
fixedScale |
Manual scaling policy of the instance group. Includes only one of the fields |
|
autoScale |
Automatic scaling policy of the instance group. Includes only one of the fields |
|
testAutoScale |
Test spec for automatic scaling policy of the instance group. |
FixedScale
|
Field |
Description |
|
size |
string (int64) Number of instances in the instance group. |
AutoScale
|
Field |
Description |
|
minZoneSize |
string (int64) Lower limit for instance count in each zone. |
|
maxSize |
string (int64) Upper limit for total instance count (across all zones). |
|
measurementDuration |
string (duration) Time in seconds allotted for averaging metrics. |
|
warmupDuration |
string (duration) The warmup time of the instance in seconds. During this time, |
|
stabilizationDuration |
string (duration) Minimum amount of time in seconds allotted for monitoring before |
|
initialSize |
string (int64) Target group size. |
|
cpuUtilizationRule |
Defines an autoscaling rule based on the average CPU utilization of the instance group. |
|
customRules[] |
Defines an autoscaling rule based on a custom metric from Monitoring. |
|
autoScaleType |
enum (AutoScaleType) Autoscaling type.
|
CpuUtilizationRule
|
Field |
Description |
|
utilizationTarget |
string Target CPU utilization level. Instance Groups maintains this level for each availability zone. |
CustomRule
|
Field |
Description |
|
ruleType |
enum (RuleType) Required field. Custom metric rule type. This field affects which label from
|
|
metricType |
enum (MetricType) Required field. Type of custom metric. This field affects how Instance Groups calculates the average metric value.
|
|
metricName |
string Required field. Name of custom metric in Monitoring that should be used for scaling. Value must match the regular expression |
|
labels |
object (map<string, string>) Labels of custom metric in Monitoring that should be used for scaling. Each value must match the regular expression |
|
target |
string Target value for the custom metric. Instance Groups maintains this level for each availability zone. |
|
folderId |
string Folder id of custom metric in Monitoring that should be used for scaling. |
|
service |
string Service of custom metric in Monitoring that should be used for scaling. |
DeployPolicy
|
Field |
Description |
|
maxUnavailable |
string (int64) The maximum number of running instances that can be taken offline (i.e., stopped or deleted) at the same time |
|
maxDeleting |
string (int64) The maximum number of instances that can be deleted at the same time. |
|
maxCreating |
string (int64) The maximum number of instances that can be created at the same time. |
|
maxExpansion |
string (int64) The maximum number of instances that can be temporarily allocated above the group's target size |
|
startupDuration |
string (duration) Instance startup duration. |
|
strategy |
enum (Strategy) Affects the lifecycle of the instance during deployment.
|
|
minimalAction |
enum (MinimalAction) If instance update requires a less disruptive action than
|
AllocationPolicy
|
Field |
Description |
|
zones[] |
List of availability zones. |
Zone
|
Field |
Description |
|
zoneId |
string Required field. ID of the availability zone where the instance resides. |
|
instanceTagsPool[] |
string Each instance in a zone will be associated with exactly one of a tag from a pool below. |
LoadBalancerSpec
|
Field |
Description |
|
targetGroupSpec |
Required field. Specification of the target group that the instance group will be added to. For more information, see Target groups and resources. |
|
maxOpeningTrafficDuration |
string (duration) Timeout for waiting for the VM to be checked by the load balancer. If the timeout is exceeded, |
|
ignoreHealthChecks |
boolean Do not wait load balancer health checks. |
TargetGroupSpec
|
Field |
Description |
|
name |
string Name of the target group. Value must match the regular expression |
|
description |
string Description of the target group. |
|
labels |
object (map<string, string>) Resource labels as Each value must match the regular expression |
HealthChecksSpec
|
Field |
Description |
|
healthCheckSpecs[] |
Health checking specification. For more information, see Health check. |
|
maxCheckingHealthDuration |
string (duration) Timeout for waiting for the VM to become healthy. If the timeout is exceeded, |
HealthCheckSpec
|
Field |
Description |
|
interval |
string (duration) The interval between health checks. The default is 2 seconds. |
|
timeout |
string (duration) Timeout for the managed instance to return a response for the health check. The default is 1 second. |
|
unhealthyThreshold |
string (int64) The number of failed health checks for the managed instance to be considered unhealthy. The default (0) is 2. |
|
healthyThreshold |
string (int64) The number of successful health checks required in order for the managed instance to be considered healthy. The default (0) is 2. |
|
tcpOptions |
Configuration options for a TCP health check. Includes only one of the fields |
|
httpOptions |
Configuration options for an HTTP health check. Includes only one of the fields |
TcpOptions
|
Field |
Description |
|
port |
string (int64) Port to use for TCP health checks. |
HttpOptions
|
Field |
Description |
|
port |
string (int64) Port to use for HTTP health checks. |
|
path |
string URL path to set for health checking requests. |
Variable
|
Field |
Description |
|
key |
string Name of the variable. Value must match the regular expression |
|
value |
string Value of the variable. |
ApplicationLoadBalancerSpec
|
Field |
Description |
|
targetGroupSpec |
Required field. Basic properties of the Application Load Balancer target group attributed to the instance group. |
|
maxOpeningTrafficDuration |
string (duration) Timeout for waiting for the VM to be checked by the load balancer. If the timeout is exceeded, |
|
ignoreHealthChecks |
boolean Do not wait load balancer health checks. |
ApplicationTargetGroupSpec
|
Field |
Description |
|
name |
string Name of the target group. Value must match the regular expression |
|
description |
string Description of the target group. |
|
labels |
object (map<string, string>) Resource labels as Each value must match the regular expression |
AutoHealingPolicy
|
Field |
Description |
|
autoHealingAction |
enum (AutoHealingAction) Instance Groups performs
|
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": "object",
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": "object"
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
|
Field |
Description |
|
id |
string ID of the operation. |
|
description |
string Description of the operation. 0-256 characters long. |
|
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
|
createdBy |
string ID of the user or service account who initiated the operation. |
|
modifiedAt |
string (date-time) The time when the Operation resource was last modified. String in RFC3339 To work with values in this field, use the APIs described in the |
|
done |
boolean If the value is |
|
metadata |
object Service-specific metadata associated with the operation. |
|
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
|
response |
object The normal response of the operation in case of success. Includes only one of the fields The operation result. |
Status
The error result of the operation in case of failure or cancellation.
|
Field |
Description |
|
code |
integer (int32) Error code. An enum value of google.rpc.Code |
|
message |
string An error message. |
|
details[] |
object A list of messages that carry the error details. |