Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Compute Cloud
  • Getting started
    • Overview
    • Creating a Linux VM
    • Creating a Windows VM
    • Creating instance groups
  • Step-by-step instructions
    • All instructions
    • Creating VMs
      • Creating a Linux VM
      • Creating a Windows VM
      • Creating a VM from a set of disks
      • Creating a VM with disks from snapshots
      • Creating a VM from a custom image
      • Creating a VM with a GPU
      • Making a VM preemptible
    • DSVM
      • Overview
      • Creating a VM from a public DSVM image
    • Placement groups
      • Creating a placement group
      • Deleting a placement group
      • Creating a VM in a placement group
      • Adding a VM to a placement group
      • Removing a VM from a placement group
    • Images with pre-installed software
      • Creating a VM from a public image
      • Configuring software
      • Running a VM based on a public image
      • Getting a list of public images
    • Getting information about a VM
      • Getting information about a VM
      • Getting serial port's output
    • Managing VMs
      • Stopping and starting a VM
      • Resetting a VM user password
      • Attaching a disk to a VM
      • Detaching a disk from a VM
      • Moving a VM to a different availability zone
      • Moving a VM to another folder
      • Attaching a public IP address to a VM
      • Detaching a public IP address from a VM
      • Making a VM's public IP address static
      • Updating a VM
      • Changing VM computing resources
      • Deleting a VM
    • Working on VMs
      • Connecting to a VM via SSH
      • Connecting to a VM via RDP
      • Connecting to a VM via PowerShell
      • Working with Yandex Cloud from inside a VM
      • Installing NVIDIA drivers
      • Restoring access to a VM
    • Managing the password reset agent
      • Verifying agent operation
      • Installing the agent
      • Deleting the agent
    • Creating new disks
      • Creating an empty disk
      • Creating an empty disk with a large block
      • Creating a non-replicated disk
    • Disk management
      • Creating a disk snapshot
      • Updating a disk
      • Moving a disk to another folder
      • Deleting a disk
      • Deleting a disk snapshot
    • Disk placement groups
      • Creating a disk placement group
      • Removing a disk from a placement group
    • Creating new images
      • Preparing a disk image
      • Uploading your image
      • Creating an image from a disk
      • Creating an image from a snapshot
      • Creating an image from other custom image
    • Managing images
      • Getting a list of images
      • Deleting a disk image
    • File storage
      • Creating file storage
      • Attaching file storage to a VM
      • Detaching file storage from a VM
      • Updating file storage
      • Deleting file storage
    • Managing the serial console
      • Getting started
      • Connecting to a serial console via SSH
      • Connecting to a serial console via CLI
      • Starting your terminal in the Windows serial console (SAC)
      • Disabling access to the serial console
    • Creating instance groups
      • Creating a fixed-size instance group
      • Creating a fixed-size instance group with a network load balancer
      • Creating a fixed-size instance group with an L7 load balancer
      • Creating an automatically scaled instance group
      • Creating an instance group from a Container Optimized Image
      • Creating an instance group based on the YAML specification
    • Getting information about instance groups
      • Getting a list of instance groups
      • Getting information about an instance group
      • Getting a list of instances in a group
    • Managing instance groups
      • Editing an instance group
      • Edit an instance group based on the YAML specification
      • Configuring application health check on the VM
      • Updating a group
        • Incremental update
        • Uninterrupted updates
      • Pausing an instance group
      • Resuming an instance group
      • Stopping an instance group
      • Starting an instance group
      • Deleting an instance group
    • Dedicated hosts
      • Creating a VM in a group of dedicated hosts
      • Creating a VM on a dedicated host
  • Yandex Container Solution
  • Practical guidelines
    • Configuring NTP time synchronization
    • Running instance groups with auto scaling
    • Automatically scaling an instance group for handling messages from a queue
    • Updating an instance group under load
    • Deploying Remote Desktop Gateway
    • Transferring logs from a VM instance to Yandex Cloud Logging
  • Concepts
    • Relationship between resources
    • Virtual machines
      • Overview
      • Platforms
      • vCPU performance levels
      • Preemptible VMs
      • Network on a VM
      • Software-accelerated network
      • Live migration
      • Placement groups
      • Statuses
      • Metadata
      • Resetting a Windows VM password
    • Graphics accelerators
    • Disks and file storage
      • Overview
      • Disks
      • Disk snapshots
      • Non-replicated disk placement groups
      • File storage
      • Read and write operations
    • Images
    • Instance groups
      • Overview
      • Access
      • YAML specification
      • Instance template
      • Variables in an instance template
      • Policies
        • Overview
        • Allocation policy
        • Deployment policy
        • Scaling policy
      • Scaling types
      • Auto-healing
      • Updating
        • Overview
        • Allocating instances across zones
        • Deployment algorithm
        • Rules for updating virtual machines
        • Changing secondary disks in an instance template
      • Stopping and pausing an instance group
      • Statuses
    • Dedicated host
    • Backups
    • Quotas and limits
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1 to May 1, 2019
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • DiskPlacementGroupService
      • DiskService
      • DiskTypeService
      • FilesystemService
      • HostGroupService
      • HostTypeService
      • ImageService
      • InstanceService
      • PlacementGroupService
      • SnapshotScheduleService
      • SnapshotService
      • ZoneService
      • InstanceGroupService
      • OperationService
    • REST
      • Overview
      • DiskPlacementGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listDisks
        • listOperations
        • update
      • Disk
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • DiskType
        • Overview
        • get
        • list
      • Filesystem
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • HostGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listHosts
        • listInstances
        • listOperations
        • update
      • HostType
        • Overview
        • get
        • list
      • Image
        • Overview
        • create
        • delete
        • get
        • getLatestByFamily
        • list
        • listOperations
        • update
      • Instance
        • Overview
        • addOneToOneNat
        • attachDisk
        • attachFilesystem
        • create
        • delete
        • detachDisk
        • detachFilesystem
        • get
        • getSerialPortOutput
        • list
        • listOperations
        • move
        • removeOneToOneNat
        • restart
        • start
        • stop
        • update
        • updateMetadata
        • updateNetworkInterface
      • PlacementGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listInstances
        • listOperations
        • update
      • SnapshotSchedule
        • Overview
        • create
        • delete
        • disable
        • enable
        • get
        • list
        • listDisks
        • listOperations
        • listSnapshots
        • update
        • updateDisks
      • Snapshot
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • Zone
        • Overview
        • get
        • list
      • Operation
        • Overview
        • get
      • InstanceGroup
        • Overview
        • list
        • get
        • listLogRecords
        • updateFromYaml
        • updateAccessBindings
        • pauseProcesses
        • stop
        • start
        • delete
        • listInstances
        • createFromYaml
        • update
        • setAccessBindings
        • listOperations
        • create
        • listAccessBindings
        • resumeProcesses
  • Questions and answers
    • General questions
    • Virtual machines
    • Connection
    • Disks, snapshots, and images
    • Disaster recovery
    • Monitoring
    • Licensing
    • All questions on the same page
  1. API reference
  2. REST
  3. Instance
  4. create

Method create

Written by
Yandex Cloud
,
improved by
amatol
  • HTTP request
  • Body parameters
  • Response

Creates an instance in the specified folder.
Method starts an asynchronous operation that can be cancelled while it is in progress.

HTTP request

POST https://compute.api.cloud.yandex.net/compute/v1/instances

Body parameters

{
  "folderId": "string",
  "name": "string",
  "description": "string",
  "labels": "object",
  "zoneId": "string",
  "platformId": "string",
  "resourcesSpec": {
    "memory": "string",
    "cores": "string",
    "coreFraction": "string",
    "gpus": "string"
  },
  "metadata": "object",
  "metadataOptions": {
    "gceHttpEndpoint": "string",
    "awsV1HttpEndpoint": "string",
    "gceHttpToken": "string",
    "awsV1HttpToken": "string"
  },
  "bootDiskSpec": {
    "mode": "string",
    "deviceName": "string",
    "autoDelete": true,

    // `bootDiskSpec` includes only one of the fields `diskSpec`, `diskId`
    "diskSpec": {
      "name": "string",
      "description": "string",
      "typeId": "string",
      "size": "string",
      "blockSize": "string",
      "diskPlacementPolicy": {
        "placementGroupId": "string"
      },

      // `bootDiskSpec.diskSpec` includes only one of the fields `imageId`, `snapshotId`
      "imageId": "string",
      "snapshotId": "string",
      // end of the list of possible fields`bootDiskSpec.diskSpec`

    },
    "diskId": "string",
    // end of the list of possible fields`bootDiskSpec`

  },
  "secondaryDiskSpecs": [
    {
      "mode": "string",
      "deviceName": "string",
      "autoDelete": true,

      // `secondaryDiskSpecs[]` includes only one of the fields `diskSpec`, `diskId`
      "diskSpec": {
        "name": "string",
        "description": "string",
        "typeId": "string",
        "size": "string",
        "blockSize": "string",
        "diskPlacementPolicy": {
          "placementGroupId": "string"
        },

        // `secondaryDiskSpecs[].diskSpec` includes only one of the fields `imageId`, `snapshotId`
        "imageId": "string",
        "snapshotId": "string",
        // end of the list of possible fields`secondaryDiskSpecs[].diskSpec`

      },
      "diskId": "string",
      // end of the list of possible fields`secondaryDiskSpecs[]`

    }
  ],
  "localDiskSpecs": [
    {
      "size": "string"
    }
  ],
  "filesystemSpecs": [
    {
      "mode": "string",
      "deviceName": "string",
      "filesystemId": "string"
    }
  ],
  "networkInterfaceSpecs": [
    {
      "subnetId": "string",
      "primaryV4AddressSpec": {
        "address": "string",
        "oneToOneNatSpec": {
          "ipVersion": "string",
          "address": "string",
          "dnsRecordSpecs": [
            {
              "fqdn": "string",
              "dnsZoneId": "string",
              "ttl": "string",
              "ptr": true
            }
          ]
        },
        "dnsRecordSpecs": [
          {
            "fqdn": "string",
            "dnsZoneId": "string",
            "ttl": "string",
            "ptr": true
          }
        ]
      },
      "primaryV6AddressSpec": {
        "address": "string",
        "oneToOneNatSpec": {
          "ipVersion": "string",
          "address": "string",
          "dnsRecordSpecs": [
            {
              "fqdn": "string",
              "dnsZoneId": "string",
              "ttl": "string",
              "ptr": true
            }
          ]
        },
        "dnsRecordSpecs": [
          {
            "fqdn": "string",
            "dnsZoneId": "string",
            "ttl": "string",
            "ptr": true
          }
        ]
      },
      "securityGroupIds": [
        "string"
      ]
    }
  ],
  "hostname": "string",
  "schedulingPolicy": {
    "preemptible": true
  },
  "serviceAccountId": "string",
  "networkSettings": {
    "type": "string"
  },
  "placementPolicy": {
    "placementGroupId": "string",
    "hostAffinityRules": [
      {
        "key": "string",
        "op": "string",
        "values": [
          "string"
        ]
      }
    ]
  }
}
Field Description
folderId string

Required. ID of the folder to create an instance in. To get the folder ID, use a list request.

The maximum string length in characters is 50.

name string

Name of the instance.

Value must match the regular expression |[a-z]([-a-z0-9]{0,61}[a-z0-9])?.

description string

Description of the instance.

The maximum string length in characters is 256.

labels object

Resource labels as key:value pairs.

No more than 64 per resource. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_./\@0-9a-z]*. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_./\@0-9a-z]*.

zoneId string

Required. ID of the availability zone where the instance resides. To get a list of available zones, use the list request

The maximum string length in characters is 50.

platformId string

Required. ID of the hardware platform configuration for the instance. This field affects the available values in resourcesSpec field.

Platforms allows you to create various types of instances: with a large amount of memory, with a large number of cores, with a burstable performance. For more information, see Platforms.

resourcesSpec object

Required. Computing resources of the instance, such as the amount of memory and number of cores. To get a list of available values, see Levels of core performance.

resourcesSpec.
memory
string (int64)

Required. The amount of memory available to the instance, specified in bytes.

The maximum value is 274877906944.

resourcesSpec.
cores
string (int64)

Required. The number of cores available to the instance.

Value must be one of 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76 or 80.

resourcesSpec.
coreFraction
string (int64)

Baseline level of CPU performance with the ability to burst performance above that baseline level. This field sets baseline performance for each core.

For example, if you need only 5% of the CPU performance, you can set core_fraction=5. For more information, see Levels of core performance.

Value must be one of 0, 5, 20, 50 or 100.

resourcesSpec.
gpus
string (int64)

The number of GPUs available to the instance.

Value must be one of 0, 1, 2 or 4.

metadata object

The metadata key:value pairs that will be assigned to this instance. This includes custom metadata and predefined keys. The total size of all keys and values must be less than 512 KB.

Values are free-form strings, and only have meaning as interpreted by the programs which configure the instance. The values must be 256 KB or less.

For example, you may use the metadata in order to provide your public SSH key to the instance. For more information, see Metadata.

metadataOptions object

Options allow user to configure access to instance's metadata

metadataOptions.
gceHttpEndpoint
string

Enabled access to GCE flavored metadata

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled
metadataOptions.
awsV1HttpEndpoint
string

Enabled access to AWS flavored metadata (IMDSv1)

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled
metadataOptions.
gceHttpToken
string

Enabled access to IAM credentials with GCE flavored metadata

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled
metadataOptions.
awsV1HttpToken
string

Enabled access to IAM credentials with AWS flavored metadata (IMDSv1)

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled
bootDiskSpec object

Required. Boot disk to attach to the instance.

bootDiskSpec.
mode
string
The mode in which to attach this disk.
  • READ_ONLY: Read-only access.
  • READ_WRITE: Read/Write access. Default value.
bootDiskSpec.
deviceName
string

Specifies a unique serial number of your choice that is reflected into the /dev/disk/by-id/ tree of a Linux operating system running within the instance.

This value can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, a random value will be generated.

Value must match the regular expression [a-z][a-z0-9-_]{,19}.

bootDiskSpec.
autoDelete
boolean (boolean)

Specifies whether the disk will be auto-deleted when the instance is deleted.

bootDiskSpec.
diskSpec
object
Disk specification.
bootDiskSpec includes only one of the fields diskSpec, diskId
bootDiskSpec.
diskSpec.
name
string

Name of the disk.

Value must match the regular expression |[a-z]([-a-z0-9]{0,61}[a-z0-9])?.

bootDiskSpec.
diskSpec.
description
string

Description of the disk.

The maximum string length in characters is 256.

bootDiskSpec.
diskSpec.
typeId
string

ID of the disk type. To get a list of available disk types, use the list request.

The maximum string length in characters is 50.

bootDiskSpec.
diskSpec.
size
string (int64)

Required. Size of the disk, specified in bytes.

Acceptable values are 4194304 to 4398046511104, inclusive.

bootDiskSpec.
diskSpec.
blockSize
string (int64)

Block size of the disk, specified in bytes. The default is 4096.

bootDiskSpec.
diskSpec.
diskPlacementPolicy
object
Placement policy configuration.
bootDiskSpec.
diskSpec.
diskPlacementPolicy.
placementGroupId
string

Placement group ID.

bootDiskSpec.
diskSpec.
imageId
string
bootDiskSpec.diskSpec includes only one of the fields imageId, snapshotId

ID of the image to create the disk from.

The maximum string length in characters is 50.

bootDiskSpec.
diskSpec.
snapshotId
string
bootDiskSpec.diskSpec includes only one of the fields imageId, snapshotId

ID of the snapshot to restore the disk from.

The maximum string length in characters is 50.

bootDiskSpec.
diskId
string
bootDiskSpec includes only one of the fields diskSpec, diskId

ID of the disk that should be attached.

The maximum string length in characters is 50.

secondaryDiskSpecs[] object

Array of secondary disks to attach to the instance.

The maximum number of elements is 3.

secondaryDiskSpecs[].
mode
string
The mode in which to attach this disk.
  • READ_ONLY: Read-only access.
  • READ_WRITE: Read/Write access. Default value.
secondaryDiskSpecs[].
deviceName
string

Specifies a unique serial number of your choice that is reflected into the /dev/disk/by-id/ tree of a Linux operating system running within the instance.

This value can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, a random value will be generated.

Value must match the regular expression [a-z][a-z0-9-_]{,19}.

secondaryDiskSpecs[].
autoDelete
boolean (boolean)

Specifies whether the disk will be auto-deleted when the instance is deleted.

secondaryDiskSpecs[].
diskSpec
object
Disk specification.
secondaryDiskSpecs[] includes only one of the fields diskSpec, diskId
secondaryDiskSpecs[].
diskSpec.
name
string

Name of the disk.

Value must match the regular expression |[a-z]([-a-z0-9]{0,61}[a-z0-9])?.

secondaryDiskSpecs[].
diskSpec.
description
string

Description of the disk.

The maximum string length in characters is 256.

secondaryDiskSpecs[].
diskSpec.
typeId
string

ID of the disk type. To get a list of available disk types, use the list request.

The maximum string length in characters is 50.

secondaryDiskSpecs[].
diskSpec.
size
string (int64)

Required. Size of the disk, specified in bytes.

Acceptable values are 4194304 to 4398046511104, inclusive.

secondaryDiskSpecs[].
diskSpec.
blockSize
string (int64)

Block size of the disk, specified in bytes. The default is 4096.

secondaryDiskSpecs[].
diskSpec.
diskPlacementPolicy
object
Placement policy configuration.
secondaryDiskSpecs[].
diskSpec.
diskPlacementPolicy.
placementGroupId
string

Placement group ID.

secondaryDiskSpecs[].
diskSpec.
imageId
string
secondaryDiskSpecs[].diskSpec includes only one of the fields imageId, snapshotId

ID of the image to create the disk from.

The maximum string length in characters is 50.

secondaryDiskSpecs[].
diskSpec.
snapshotId
string
secondaryDiskSpecs[].diskSpec includes only one of the fields imageId, snapshotId

ID of the snapshot to restore the disk from.

The maximum string length in characters is 50.

secondaryDiskSpecs[].
diskId
string
secondaryDiskSpecs[] includes only one of the fields diskSpec, diskId

ID of the disk that should be attached.

The maximum string length in characters is 50.

localDiskSpecs[] object

Array of local disks to attach to the instance.

localDiskSpecs[].
size
string (int64)

Required. Size of the disk, specified in bytes.

filesystemSpecs[] object

Array of filesystems to attach to the instance.

The filesystems must reside in the same availability zone as the instance.

To use the instance with an attached filesystem, the latter must be mounted. For details, see documentation.

filesystemSpecs[].
mode
string

Mode of access to the filesystem that should be attached.

  • READ_ONLY: Read-only access.
  • READ_WRITE: Read/Write access. Default value.
filesystemSpecs[].
deviceName
string

Name of the device representing the filesystem on the instance.

The name should be used for referencing the filesystem from within the instance when it's being mounted, resized etc.

If not specified, a random value will be generated.

Value must match the regular expression [a-z][a-z0-9-_]{,19}.

filesystemSpecs[].
filesystemId
string

ID of the filesystem that should be attached.

The maximum string length in characters is 50.

networkInterfaceSpecs[] object

Required. Network configuration for the instance. Specifies how the network interface is configured to interact with other services on the internal network and on the internet. Currently only one network interface is supported per instance.

Must contain exactly 1 element.

networkInterfaceSpecs[].
subnetId
string

Required. ID of the subnet.

The maximum string length in characters is 50.

networkInterfaceSpecs[].
primaryV4AddressSpec
object

Primary IPv4 address that will be assigned to the instance for this network interface.

networkInterfaceSpecs[].
primaryV4AddressSpec.
address
string

An IPv4 internal network address that is assigned to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system.

networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec
object

An external IP address configuration. If not specified, then this instance will have no external internet access.

networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec.
ipVersion
string

External IP address version.

  • IPV4: IPv4 address, for example 192.0.2.235.
  • IPV6: IPv6 address. Not available yet.
networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec.
address
string
networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[]
object

External DNS configuration

networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[].
fqdn
string

Required. FQDN (required)

networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[].
dnsZoneId
string

DNS zone id (optional, if not set, private zone used)

networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[].
ttl
string (int64)

DNS record ttl, values in 0-86400 (optional)

Acceptable values are 0 to 86400, inclusive.

networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[].
ptr
boolean (boolean)

When set to true, also create PTR DNS record (optional)

networkInterfaceSpecs[].
primaryV4AddressSpec.
dnsRecordSpecs[]
object

Internal DNS configuration

networkInterfaceSpecs[].
primaryV4AddressSpec.
dnsRecordSpecs[].
fqdn
string

Required. FQDN (required)

networkInterfaceSpecs[].
primaryV4AddressSpec.
dnsRecordSpecs[].
dnsZoneId
string

DNS zone id (optional, if not set, private zone used)

networkInterfaceSpecs[].
primaryV4AddressSpec.
dnsRecordSpecs[].
ttl
string (int64)

DNS record ttl, values in 0-86400 (optional)

Acceptable values are 0 to 86400, inclusive.

networkInterfaceSpecs[].
primaryV4AddressSpec.
dnsRecordSpecs[].
ptr
boolean (boolean)

When set to true, also create PTR DNS record (optional)

networkInterfaceSpecs[].
primaryV6AddressSpec
object

Primary IPv6 address that will be assigned to the instance for this network interface. IPv6 not available yet.

networkInterfaceSpecs[].
primaryV6AddressSpec.
address
string

An IPv4 internal network address that is assigned to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system.

networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec
object

An external IP address configuration. If not specified, then this instance will have no external internet access.

networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec.
ipVersion
string

External IP address version.

  • IPV4: IPv4 address, for example 192.0.2.235.
  • IPV6: IPv6 address. Not available yet.
networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec.
address
string
networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[]
object

External DNS configuration

networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[].
fqdn
string

Required. FQDN (required)

networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[].
dnsZoneId
string

DNS zone id (optional, if not set, private zone used)

networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[].
ttl
string (int64)

DNS record ttl, values in 0-86400 (optional)

Acceptable values are 0 to 86400, inclusive.

networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec.
dnsRecordSpecs[].
ptr
boolean (boolean)

When set to true, also create PTR DNS record (optional)

networkInterfaceSpecs[].
primaryV6AddressSpec.
dnsRecordSpecs[]
object

Internal DNS configuration

networkInterfaceSpecs[].
primaryV6AddressSpec.
dnsRecordSpecs[].
fqdn
string

Required. FQDN (required)

networkInterfaceSpecs[].
primaryV6AddressSpec.
dnsRecordSpecs[].
dnsZoneId
string

DNS zone id (optional, if not set, private zone used)

networkInterfaceSpecs[].
primaryV6AddressSpec.
dnsRecordSpecs[].
ttl
string (int64)

DNS record ttl, values in 0-86400 (optional)

Acceptable values are 0 to 86400, inclusive.

networkInterfaceSpecs[].
primaryV6AddressSpec.
dnsRecordSpecs[].
ptr
boolean (boolean)

When set to true, also create PTR DNS record (optional)

networkInterfaceSpecs[].
securityGroupIds[]
string

ID's of security groups attached to the interface

hostname string

Host name for the instance. This field is used to generate the Instance.fqdn value. The host name must be unique within the network and region. If not specified, the host name will be equal to Instance.id of the instance and FQDN will be <id>.auto.internal. Otherwise FQDN will be <hostname>.<region_id>.internal.

Value must match the regular expression |[a-z]([-a-z0-9]{0,61}[a-z0-9])?.

schedulingPolicy object

Scheduling policy configuration.

schedulingPolicy.
preemptible
boolean (boolean)

True for short-lived compute instances. For more information, see Preemptible VMs.

serviceAccountId string

ID of the service account to use for authentication inside the instance. To get the service account ID, use a list request.

networkSettings object

Network settings.

networkSettings.
type
string

Network Type

  • STANDARD: Standard network.
  • SOFTWARE_ACCELERATED: Software accelerated network.
  • HARDWARE_ACCELERATED: Hardware accelerated network (not available yet, reserved for future use).
placementPolicy object

Placement policy configuration.

placementPolicy.
placementGroupId
string

Placement group ID.

placementPolicy.
hostAffinityRules[]
object

List of affinity rules. Scheduler will attempt to allocate instances according to order of rules.

placementPolicy.
hostAffinityRules[].
key
string

Affinity label or one of reserved values - 'yc.hostId', 'yc.hostGroupId'

placementPolicy.
hostAffinityRules[].
op
string

Include or exclude action

placementPolicy.
hostAffinityRules[].
values[]
string

Affinity value or host ID or host group ID

Response

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": true,
  "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 text format.

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 text format.

done boolean (boolean)

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

metadata object

Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.

error object
The error result of the operation in case of failure or cancellation.
includes only one of the fields error, response
error.
code
integer (int32)

Error code. An enum value of google.rpc.Code.

error.
message
string

An error message.

error.
details[]
object

A list of messages that carry the error details.

response object
includes only one of the fields error, response

The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • HTTP request
  • Body parameters
  • Response