To create an instance with the out-of-the-box Ubuntu image, run:
gdcloud compute instances create example-instance \
--project example-project \
--machine-type n2-standard-2-gdc \
--boot-disk-size 10GB \
--image-name ubuntu-20.04-server-cloudimg-amd64-1.0 \
--image-project vm-system
To create an instance with an existing disk, run:
gdcloud compute instances create example-instance \
--project example-project \
--machine-type n2-standard-2-gdc \
--disk=name=example-disk,boot=true
FLAG FACOLTATIVI
--boot-disk-size string The size of the boot disk.
Can only be specified if a new boot disk is being created by providing the "image"
(as opposed to mounting an existing disk).
The value must be a whole number followed by a size unit of GB for gigabyte, or TB for terabyte.
For example, "10GB" will produce a 10 gigabyte disk.
The disk size must be a multiple of 1 GB.
If not specified, the minimum disk size of the boot image will be used.
If the minimum disk size is not set in the image, an error will be thrown.
--custom-cpu uint32 A whole number value specifying the number of cores to configure for the virtual machine instance.
Must be specified if "machine-type" is empty.
--custom-memory string A whole number value indicating how much memory to configure for the virtual machine instance.
A size unit should be provided (eg. 8GB).
Must be specified if "machine-type" is empty.
--description string The description of the virtual machine instance.
--disk stringArray Attaches persistent disks to the virtual machine instance. The disks specified must already exist.
For each disk that is to be attached, the following attributes must be specified as key=value pairs:
name: The name of the disk to attach to the virtual machine instance
boot: If set to true, this disk will be used as the boot disk (default false)
auto-delete: If set to true, this disk will be automatically deleted when
the virtual machine instance is deleted (default false)
read-only: Whether the disk should be attached to the VM in read-only mode (default false)
For example, "--disk name=disk1,boot=true --disk name=disk2".
--enable-external-access Indicate whether the virtual machine instance should have networking ingress and egress NAT enabled.
--image string The boot image name for the instance.
A new boot disk will be created from the given image.
To view a list of available image to use, run "gdcloud compute images list".
--image-project string The project of the boot image for the instance.
If specifying one of our public shared images, "image-project" must be provided.
The public shared image project is "vm-system".
If not specified, but "image" is provided, the current default project will be used.
Only public shared images and images in the same project as the instance are supported.
--labels stringToString List of comma-separated KEY=VALUE labels to add to the virtual machine instance.
For example, "--labels key1=val1,key2=val2". (default [])
--machine-type string The name of the predefined machine type to be used to create the virtual machine instance.
Must be specified if one of "custom-cpu" and "custom-memory" is empty.
To view a list of available machine types, run "gdcloud compute machine-types list"
--no-boot-disk-auto-delete Disable automatically deleting the boot disk when the instance is deleted
(automatic deletion is enabled by default).
GDCLOUD WIDE FLAGS
Questi flag sono disponibili per tutti i comandi: --configuration, --format, --help, --project, --quiet.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003egdcloud compute instances create\u003c/code\u003e command is used to create virtual machine instances within a project.\u003c/p\u003e\n"],["\u003cp\u003eYou can create an instance using a specified boot image, machine type, and boot disk size, with examples provided for using an Ubuntu image or an existing disk.\u003c/p\u003e\n"],["\u003cp\u003eOptional flags allow for customization, such as specifying custom CPU and memory, attaching existing disks, and controlling network access and disk deletion settings.\u003c/p\u003e\n"],["\u003cp\u003eThe command requires an instance name and allows specifying the project, with options to define the boot disk size, custom CPU and memory, description, and labels for the instance.\u003c/p\u003e\n"],["\u003cp\u003eThe tool also includes gdcloud-wide flags, such as configuration and project flags, that can be applied to the \u003ccode\u003ecreate\u003c/code\u003e command as well as other gdcloud commands.\u003c/p\u003e\n"]]],[],null,["# gdcloud compute instances create\n\nNAME\n----\n\ngdcloud compute instances create - Create virtual machine instances.\n\nSYNOPSIS\n--------\n\n gdcloud compute instances create INSTANCE_NAME [flags]\n\n### EXAMPLES\n\n To create an instance with the out-of-the-box Ubuntu image, run:\n\n gdcloud compute instances create example-instance \\\n --project example-project \\\n --machine-type n2-standard-2-gdc \\\n --boot-disk-size 10GB \\\n --image-name ubuntu-20.04-server-cloudimg-amd64-1.0 \\\n --image-project vm-system\n\n To create an instance with an existing disk, run:\n\n gdcloud compute instances create example-instance \\\n --project example-project \\\n --machine-type n2-standard-2-gdc \\\n --disk=name=example-disk,boot=true\n\n### OPTIONAL FLAGS\n\n --boot-disk-size string The size of the boot disk.\n Can only be specified if a new boot disk is being created by providing the \"image\"\n (as opposed to mounting an existing disk).\n The value must be a whole number followed by a size unit of GB for gigabyte, or TB for terabyte.\n For example, \"10GB\" will produce a 10 gigabyte disk.\n The disk size must be a multiple of 1 GB.\n If not specified, the minimum disk size of the boot image will be used.\n If the minimum disk size is not set in the image, an error will be thrown.\n --custom-cpu uint32 A whole number value specifying the number of cores to configure for the virtual machine instance.\n Must be specified if \"machine-type\" is empty.\n --custom-memory string A whole number value indicating how much memory to configure for the virtual machine instance.\n A size unit should be provided (eg. 8GB).\n Must be specified if \"machine-type\" is empty.\n --description string The description of the virtual machine instance.\n --disk stringArray Attaches persistent disks to the virtual machine instance. The disks specified must already exist.\n For each disk that is to be attached, the following attributes must be specified as key=value pairs:\n name: The name of the disk to attach to the virtual machine instance\n boot: If set to true, this disk will be used as the boot disk (default false)\n auto-delete: If set to true, this disk will be automatically deleted when\n the virtual machine instance is deleted (default false)\n read-only: Whether the disk should be attached to the VM in read-only mode (default false)\n For example, \"--disk name=disk1,boot=true --disk name=disk2\".\n --enable-external-access Indicate whether the virtual machine instance should have networking ingress and egress NAT enabled.\n --image string The boot image name for the instance.\n A new boot disk will be created from the given image.\n To view a list of available image to use, run \"gdcloud compute images list\".\n --image-project string The project of the boot image for the instance.\n If specifying one of our public shared images, \"image-project\" must be provided.\n The public shared image project is \"vm-system\".\n If not specified, but \"image\" is provided, the current default project will be used.\n Only public shared images and images in the same project as the instance are supported.\n --labels stringToString List of comma-separated KEY=VALUE labels to add to the virtual machine instance.\n For example, \"--labels key1=val1,key2=val2\". (default [])\n --machine-type string The name of the predefined machine type to be used to create the virtual machine instance.\n Must be specified if one of \"custom-cpu\" and \"custom-memory\" is empty.\n To view a list of available machine types, run \"gdcloud compute machine-types list\"\n --no-boot-disk-auto-delete Disable automatically deleting the boot disk when the instance is deleted\n (automatic deletion is enabled by default).\n\n### GDCLOUD WIDE FLAGS\n\nThese flags are available to all commands: `--configuration`, `--format`, `--help`, `--project`, `--quiet`.\n\nFor more information, see the [gdcloud CLI reference overview](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-reference/gdcloud) page."]]