yc compute instance create
Статья создана
Обновлена 24 июля 2025 г.
Create a virtual machine instance
Command Usage
Syntax:
yc compute instance create <INSTANCE-NAME> [Flags...] [Global Flags...]
Flags
| Flag | Description | 
|---|---|
--name | 
stringA name of the instance.  | 
--description | 
stringSpecifies a textual description of the instance.  | 
--labels | 
key=value[,key=value...]A list of label KEY=VALUE pairs to add. For example, to add two labels named 'foo' and 'bar', both with the value 'baz', use '--labels foo=baz,bar=baz'.  | 
--zone | 
stringThe zone of the instance to create.  | 
--metadata | 
key=value[,key=value...]Metadata to be made available to the guest operating system running on the instance. See for details https://yandex.cloud/ru/docs/compute/concepts/vm-metadata  | 
--metadata-options | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Options set the access mode to instance's metadata. Possible property names: 
  | 
--metadata-from-file | 
key=value[,key=value...]Same as --metadata except that the value for the entry will be read from a local file.  | 
--ssh-key | 
stringCreates user 'yc-user' and adds SSH key from specified file to authorized keys using cloud-config. If your need more flexibility, use cloud-config passed in 'user-data' metadata key.  | 
--public-ip | 
If true, one-to-one NAT public IP will be created for the default network interface. Cannot be passed together with --network-interface | 
--public-address | 
stringIf set, one-to-one NAT public IP will be created for the default network interface with the specified value. Cannot be passed together with --network-interface  | 
--create-disk | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Creates and attaches persistent disks to the instance. Possible property names: 
  | 
--attach-disk | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Attaches persistent disks to the instances. The specified disks must already exist. Possible property names: 
  | 
--create-boot-disk | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Creates a new disk and uses it as a boot disk of the instance. Possible property names: 
  | 
--use-boot-disk | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Uses an already existing disk as a boot disk of the instance. Possible property names: 
  | 
--attach-filesystem | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Attaches filesystems to the instances. The specified filesystems must already exist. Possible property names: 
  | 
--attach-local-disk | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Attaches local disks to the instances. Possible property names: 
  | 
--network-settings | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Network settings for the instance. Possible property names: 
  | 
--network-interface | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Adds a network interface to the instance. Possible property names: 
  | 
--serial-port-settings | 
PROPERTY=VALUE[,PROPERTY=VALUE...]Serial port settings for the instance. Possible property names: 
  | 
--memory | 
byteSizeSpecifies how much memory instance should have in GB. You can also use M and T suffixes to specify smaller or greater size respectively.  | 
--cores | 
intSpecifies how many CPU cores instance should have.  | 
--core-fraction | 
intIf provided, specifies baseline performance for a core in percent.  | 
--gpus | 
intSpecifies how many GPUs instance should have.  | 
--platform | 
stringSpecifies platform for the instance.  | 
--hostname | 
stringCreates instance with specified hostname.  | 
--preemptible | 
Creates preemptible instance. | 
--maintenance-policy | 
stringBehaviour on maintenance events. Values: 'restart', 'migrate'  | 
--maintenance-grace-period | 
durationTime between notification via metadata service and maintenance.  | 
--placement-group-id | 
stringPlacement group to create the instance in.  | 
--placement-group-name | 
stringPlacement group to create the instance in.  | 
--placement-group-partition | 
intSpecifies placement group partition for the instance.  | 
--host-group-id | 
stringHost group to create the instance in.  | 
--host-group-name | 
stringHost group to create the instance in.  | 
--host-id | 
stringHost to create the instance in.  | 
--gpu-cluster-id | 
stringGPU cluster to create the instance in.  | 
--gpu-cluster-name | 
stringGPU cluster to create the instance in.  | 
--service-account-id | 
stringService account, which token can be obtained inside VM from metadata service.  | 
--service-account-name | 
stringService account, which token can be obtained inside VM from metadata service.  | 
--reserved-instance-pool-id | 
stringReserved instance pool to create the instance in.  | 
--reserved-instance-pool-name | 
stringReserved instance pool to create the instance in.  | 
--image-folder-id | 
stringThe folder ID against which all image and image family references will be resolved.  | 
--async | 
Display information about the operation in progress, without waiting for the operation to complete. | 
Global Flags
| Flag | Description | 
|---|---|
--profile | 
stringSet the custom configuration file.  | 
--debug | 
Debug logging. | 
--debug-grpc | 
Debug gRPC logging. Very verbose, used for debugging connection problems. | 
--no-user-output | 
Disable printing user intended output to stderr. | 
--retry | 
intEnable gRPC retries. By default, retries are enabled with maximum 5 attempts. Pass 0 to disable retries. Pass any negative value for infinite retries. Even infinite retries are capped with 2 minutes timeout.  | 
--cloud-id | 
stringSet the ID of the cloud to use.  | 
--folder-id | 
stringSet the ID of the folder to use.  | 
--folder-name | 
stringSet the name of the folder to use (will be resolved to id).  | 
--endpoint | 
stringSet the Cloud API endpoint (host:port).  | 
--token | 
stringSet the OAuth token to use.  | 
--impersonate-service-account-id | 
stringSet the ID of the service account to impersonate.  | 
--no-browser | 
Disable opening browser for authentication. | 
--format | 
stringSet the output format: text (default), yaml, json, json-rest.  | 
--jq | 
stringQuery to select values from the response using jq syntax  | 
-h,--help | 
Display help for the command. | 
Examples
- Создание виртуальной машины в группе выделенных хостов
 - Создание виртуальной машины на выделенном хосте
 - Создайте виртуальную машину в другой зоне доступности с дисками из снимков
 - Добавить виртуальную машину в кластер GPU
 - Создайте ВМ из подготовленного образа
 - Создать виртуальную машину из публичного образа
 - Добавить виртуальную машину в группу размещения
 - Создать виртуальную машину в группе размещения
 - Создать новую ВМ с привязкой к пулу
 - Включение консоли при создании ВМ из публичного образа
 - К создаваемой ВМ
 - Утрачены учетные данные пользователя ВМ
 - Создайте виртуальную машину в другой зоне доступности с дисками из снимков
 - К создаваемой ВМ
 - Создайте ВМ с настроенной политикой обслуживания
 - Создать виртуальную машину из набора дисков
 - Создать виртуальную машину с дисками из снимков
 - Создайте ВМ из подготовленного образа
 - Создать виртуальную машину из публичного образа Linux
 - Создать прерываемую ВМ
 - Создание виртуальной машины с GPU
 - Создание виртуальной машины с пользовательским скриптом конфигурации
 - Создать виртуальную машину с метаданными из переменных окружения
 - Создать ВМ с доступом к секрету Yandex Lockbox
 - Настроить параметры сервиса метаданных ВМ