Compute Cloud API, gRPC: InstanceService.Create
- gRPC request
- CreateInstanceRequest
- ResourcesSpec
- AttachedDiskSpec
- DiskSpec
- DiskPlacementPolicy
- AttachedFilesystemSpec
- AttachedLocalDiskSpec
- PhysicalLocalDiskSpec
- NetworkInterfaceSpec
- PrimaryAddressSpec
- OneToOneNatSpec
- DnsRecordSpec
- SchedulingPolicy
- NetworkSettings
- PlacementPolicy
- HostAffinityRule
- GpuSettings
- MetadataOptions
- SerialPortSettings
- Application
- ContainerSolutionSpec
- Secret
- BackupSpec
- operation.Operation
Creates an instance in the specified folder.
Method starts an asynchronous operation that can be cancelled while it is in progress.
gRPC request
rpc Create (CreateInstanceRequest) returns (operation.Operation)
CreateInstanceRequest
{
"folder_id": "string",
"name": "string",
"description": "string",
"labels": "map<string, string>",
"zone_id": "string",
"platform_id": "string",
"resources_spec": {
"memory": "int64",
"cores": "int64",
"core_fraction": "int64",
"gpus": "int64"
},
"metadata": "map<string, string>",
"boot_disk_spec": {
"mode": "Mode",
"device_name": "string",
"auto_delete": "bool",
// Includes only one of the fields `disk_spec`, `disk_id`
"disk_spec": {
"name": "string",
"description": "string",
"type_id": "string",
"size": "int64",
"block_size": "int64",
"disk_placement_policy": {
"placement_group_id": "string",
"placement_group_partition": "int64"
},
// Includes only one of the fields `image_id`, `snapshot_id`
"image_id": "string",
"snapshot_id": "string",
// end of the list of possible fields
"kms_key_id": "string"
},
"disk_id": "string"
// end of the list of possible fields
},
"secondary_disk_specs": [
{
"mode": "Mode",
"device_name": "string",
"auto_delete": "bool",
// Includes only one of the fields `disk_spec`, `disk_id`
"disk_spec": {
"name": "string",
"description": "string",
"type_id": "string",
"size": "int64",
"block_size": "int64",
"disk_placement_policy": {
"placement_group_id": "string",
"placement_group_partition": "int64"
},
// Includes only one of the fields `image_id`, `snapshot_id`
"image_id": "string",
"snapshot_id": "string",
// end of the list of possible fields
"kms_key_id": "string"
},
"disk_id": "string"
// end of the list of possible fields
}
],
"filesystem_specs": [
{
"mode": "Mode",
"device_name": "string",
"filesystem_id": "string"
}
],
"local_disk_specs": [
{
"size": "int64",
// Includes only one of the fields `physical_local_disk`
"physical_local_disk": {
"kms_key_id": "string"
}
// end of the list of possible fields
}
],
"network_interface_specs": [
{
"index": "string",
"subnet_id": "string",
"primary_v4_address_spec": {
"address": "string",
"one_to_one_nat_spec": {
"ip_version": "IpVersion",
"address": "string",
"dns_record_specs": [
{
"fqdn": "string",
"dns_zone_id": "string",
"ttl": "int64",
"ptr": "bool"
}
]
},
"dns_record_specs": [
{
"fqdn": "string",
"dns_zone_id": "string",
"ttl": "int64",
"ptr": "bool"
}
]
},
"primary_v6_address_spec": {
"address": "string",
"one_to_one_nat_spec": {
"ip_version": "IpVersion",
"address": "string",
"dns_record_specs": [
{
"fqdn": "string",
"dns_zone_id": "string",
"ttl": "int64",
"ptr": "bool"
}
]
},
"dns_record_specs": [
{
"fqdn": "string",
"dns_zone_id": "string",
"ttl": "int64",
"ptr": "bool"
}
]
},
"security_group_ids": [
"string"
]
}
],
"hostname": "string",
"scheduling_policy": {
"preemptible": "bool"
},
"service_account_id": "string",
"network_settings": {
"type": "Type"
},
"placement_policy": {
"placement_group_id": "string",
"placement_group_partition": "int64",
"host_affinity_rules": [
{
"key": "string",
"op": "Operator",
"values": [
"string"
]
}
]
},
"gpu_settings": {
"gpu_cluster_id": "string"
},
"maintenance_policy": "MaintenancePolicy",
"maintenance_grace_period": "google.protobuf.Duration",
"metadata_options": {
"gce_http_endpoint": "MetadataOption",
"aws_v1_http_endpoint": "MetadataOption",
"gce_http_token": "MetadataOption",
"aws_v1_http_token": "MetadataOption",
"aws_v2_http_endpoint": "MetadataOption",
"aws_v2_http_token": "MetadataOption"
},
"serial_port_settings": {
"ssh_authorization": "SSHAuthorization"
},
"application": {
// Includes only one of the fields `container_solution`
"container_solution": {
"product_id": "string",
"secrets": "map<string, Secret>",
"environment": "map<string, string>"
},
// end of the list of possible fields
"cloudbackup": {
"enabled": "bool",
"initial_policy_ids": [
"string"
],
"recovery_from_backup": "bool",
"backup_id": "string",
"instance_registration_id": "string"
}
},
"reserved_instance_pool_id": "string"
}
|
Field |
Description |
|
folder_id |
string ID of the folder to create an instance in. |
|
name |
string Name of the instance. |
|
description |
string Description of the instance. |
|
labels |
object (map<string, string>) Resource labels as |
|
zone_id |
string ID of the availability zone where the instance resides. |
|
platform_id |
string ID of the hardware platform configuration for the instance. |
|
resources_spec |
Computing resources of the instance, such as the amount of memory and number of cores. |
|
metadata |
object (map<string, string>) The metadata |
|
boot_disk_spec |
Boot disk to attach to the instance. |
|
secondary_disk_specs[] |
Array of secondary disks to attach to the instance. |
|
filesystem_specs[] |
Array of filesystems to attach to the instance. |
|
local_disk_specs[] |
Array of local disks to attach to the instance. |
|
network_interface_specs[] |
Network configuration for the instance. Specifies how the network interface is configured |
|
hostname |
string Host name for the instance. |
|
scheduling_policy |
Scheduling policy configuration. |
|
service_account_id |
string ID of the service account to use for authentication inside the instance. |
|
network_settings |
Network settings. |
|
placement_policy |
Placement policy configuration. |
|
gpu_settings |
GPU settings. |
|
maintenance_policy |
enum MaintenancePolicy Behaviour on maintenance events
|
|
maintenance_grace_period |
Time between notification via metadata service and maintenance |
|
metadata_options |
Options allow user to configure access to instance's metadata |
|
serial_port_settings |
Serial port settings |
|
application |
Instance application settings. |
|
reserved_instance_pool_id |
string ID of the reserved instance pool that the instance should belong to. |
ResourcesSpec
|
Field |
Description |
|
memory |
int64 The amount of memory available to the instance, specified in bytes. |
|
cores |
int64 The number of cores available to the instance. |
|
core_fraction |
int64 Baseline level of CPU performance with the ability to burst performance above that baseline level. |
|
gpus |
int64 The number of GPUs available to the instance. |
AttachedDiskSpec
|
Field |
Description |
|
mode |
enum Mode The mode in which to attach this disk.
|
|
device_name |
string Specifies a unique serial number of your choice that is reflected into the /dev/disk/by-id/ tree |
|
auto_delete |
bool Specifies whether the disk will be auto-deleted when the instance is deleted. |
|
disk_spec |
Disk specification. Includes only one of the fields Only one field must by specified. |
|
disk_id |
string ID of the disk that should be attached. Includes only one of the fields Only one field must by specified. |
DiskSpec
|
Field |
Description |
|
name |
string Name of the disk. |
|
description |
string Description of the disk. |
|
type_id |
string ID of the disk type. |
|
size |
int64 Size of the disk, specified in bytes. |
|
block_size |
int64 Block size of the disk, specified in bytes. The default is 4096. |
|
disk_placement_policy |
Placement policy configuration. |
|
image_id |
string ID of the image to create the disk from. Includes only one of the fields |
|
snapshot_id |
string ID of the snapshot to restore the disk from. Includes only one of the fields |
|
kms_key_id |
string ID of KMS key for disk encryption |
DiskPlacementPolicy
|
Field |
Description |
|
placement_group_id |
string Placement group ID. |
|
placement_group_partition |
int64 |
AttachedFilesystemSpec
|
Field |
Description |
|
mode |
enum Mode Mode of access to the filesystem that should be attached.
|
|
device_name |
string Name of the device representing the filesystem on the instance. |
|
filesystem_id |
string ID of the filesystem that should be attached. |
AttachedLocalDiskSpec
|
Field |
Description |
|
size |
int64 Size of the disk, specified in bytes. |
|
physical_local_disk |
Local disk configuration Includes only one of the fields |
PhysicalLocalDiskSpec
|
Field |
Description |
|
kms_key_id |
string ID of KMS key for disk encryption |
NetworkInterfaceSpec
|
Field |
Description |
|
index |
string The index of the network interface, will be generated by the server, 0,1,2... etc if not specified. |
|
subnet_id |
string ID of the subnet. |
|
primary_v4_address_spec |
Primary IPv4 address that will be assigned to the instance for this network interface. |
|
primary_v6_address_spec |
Primary IPv6 address that will be assigned to the instance for this network interface. IPv6 not available yet. |
|
security_group_ids[] |
string ID's of security groups attached to the interface |
PrimaryAddressSpec
|
Field |
Description |
|
address |
string An IPv4 internal network address that is assigned to the instance for this network interface. |
|
one_to_one_nat_spec |
An external IP address configuration. |
|
dns_record_specs[] |
Internal DNS configuration |
OneToOneNatSpec
|
Field |
Description |
|
ip_version |
enum IpVersion External IP address version.
|
|
address |
string set static IP by value |
|
dns_record_specs[] |
External DNS configuration |
DnsRecordSpec
|
Field |
Description |
|
fqdn |
string FQDN (required) |
|
dns_zone_id |
string DNS zone id (optional, if not set, private zone used) |
|
ttl |
int64 DNS record ttl, values in 0-86400 (optional) |
|
ptr |
bool When set to true, also create PTR DNS record (optional) |
SchedulingPolicy
|
Field |
Description |
|
preemptible |
bool True for short-lived compute instances. For more information, see Preemptible VMs. |
NetworkSettings
|
Field |
Description |
|
type |
enum Type Network Type
|
PlacementPolicy
|
Field |
Description |
|
placement_group_id |
string Placement group ID. |
|
placement_group_partition |
int64 Placement group partition |
|
host_affinity_rules[] |
List of affinity rules. Scheduler will attempt to allocate instances according to order of rules. |
HostAffinityRule
Affinity definition
|
Field |
Description |
|
key |
string 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 |
GpuSettings
|
Field |
Description |
|
gpu_cluster_id |
string Attach instance to specified GPU cluster. |
MetadataOptions
|
Field |
Description |
|
gce_http_endpoint |
enum MetadataOption Enabled access to GCE flavored metadata
|
|
aws_v1_http_endpoint |
enum MetadataOption Enabled access to AWS flavored metadata (IMDSv1)
|
|
gce_http_token |
enum MetadataOption Enabled access to IAM credentials with GCE flavored metadata
|
|
aws_v1_http_token |
enum MetadataOption Enabled access to IAM credentials with AWS flavored metadata (IMDSv1)
|
|
aws_v2_http_endpoint |
enum MetadataOption Enabled access to AWS flavored metadata with session token (IMDSv2)
|
|
aws_v2_http_token |
enum MetadataOption Enabled access to STS credentials with AWS flavored metadata with session token (IMDSv2)
|
SerialPortSettings
|
Field |
Description |
|
ssh_authorization |
enum SSHAuthorization Authentication and authorization in serial console when using SSH protocol
|
Application
|
Field |
Description |
|
container_solution |
Container specification. Includes only one of the fields |
|
cloudbackup |
Backup settings. |
ContainerSolutionSpec
|
Field |
Description |
|
product_id |
string ID of the product. |
|
secrets |
object (map<string, Secret>) A list of the secrets. |
|
environment |
object (map<string, string>) A list of the environmets. |
Secret
|
Field |
Description |
|
id |
string ID of the secret. |
|
key |
string Name of the key. |
|
version_id |
string Version of the secret. |
BackupSpec
|
Field |
Description |
|
enabled |
bool If true, backup is enabled. |
|
initial_policy_ids[] |
string A list of policy IDs to apply after resource registration. |
|
recovery_from_backup |
bool If true, recovery from backup starts on instance. |
|
backup_id |
string ID of the backup to recover from. |
|
instance_registration_id |
string ID of the instance registration for cloud backup agent installation. |
operation.Operation
{
"id": "string",
"description": "string",
"created_at": "google.protobuf.Timestamp",
"created_by": "string",
"modified_at": "google.protobuf.Timestamp",
"done": "bool",
"metadata": "google.protobuf.Any",
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": "google.protobuf.Any"
// 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. |
|
created_at |
Creation timestamp. |
|
created_by |
string ID of the user or service account who initiated the operation. |
|
modified_at |
The time when the Operation resource was last modified. |
|
done |
bool If the value is |
|
metadata |
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 |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |