yc compute instance create
Written by
Updated at December 2, 2024
Create a virtual machine instance
Command Usage
Syntax:
yc compute instance create <INSTANCE-NAME> [Flags...] [Global Flags...]
Flags
Flag | Description |
---|---|
--name |
string A name of the instance. |
--description |
string Specifies 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 |
string The 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 |
string Creates 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 |
string If 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 |
byteSize Specifies how much memory instance should have. |
--cores |
int Specifies how many CPU cores instance should have. |
--core-fraction |
int If provided, specifies baseline performance for a core in percent. |
--gpus |
int Specifies how many GPUs instance should have. |
--platform |
string Specifies platform for the instance. |
--hostname |
string Creates instance with specified hostname. |
--preemptible |
Creates preemptible instance. |
--maintenance-policy |
string Behaviour on maintenance events. Values: 'restart', 'migrate' |
--maintenance-grace-period |
duration Time between notification via metadata service and maintenance. |
--placement-group-id |
string Placement group to create the instance in. |
--placement-group-name |
string Placement group to create the instance in. |
--placement-group-partition |
int Specifies placement group partition for the instance. |
--host-group-id |
string Host group to create the instance in. |
--host-group-name |
string Host group to create the instance in. |
--host-id |
string Host to create the instance in. |
--gpu-cluster-id |
string GPU cluster to create the instance in. |
--gpu-cluster-name |
string GPU cluster to create the instance in. |
--service-account-id |
string Service account, which token can be obtained inside VM from metadata service. |
--service-account-name |
string Service account, which token can be obtained inside VM from metadata service. |
--image-folder-id |
string The 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 |
string Set 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 |
int Enable 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 |
string Set the ID of the cloud to use. |
--folder-id |
string Set the ID of the folder to use. |
--folder-name |
string Set the name of the folder to use (will be resolved to id). |
--endpoint |
string Set the Cloud API endpoint (host:port). |
--token |
string Set the OAuth token to use. |
--impersonate-service-account-id |
string Set the ID of the service account to impersonate. |
--no-browser |
Disable opening browser for authentication. |
--format |
string Set the output format: text (default), yaml, json, json-rest. |
--jq |
string Query to select values from the response using jq syntax |
-h ,--help |
Display help for the command. |