1
votes

How can I create a boot disk type of SSD persistent disk using gcloud?

From the console I can create a VM instance with SSD persistent disk from the image. I am not able to do it using gcloud.

gcloud compute instances create instance1 --image img_name1 --image-project project_id --machine-type=type_value1 --zone=${CONFIG_zone}

By defaults it is creating a Standard Persistent Disk.

1
Never mind. Figure it out. --boot-disk-type=BOOT_DISK_TYPE - pythonhmmm

1 Answers

3
votes

You are right, the default disk type for boot disks in new compute engine instances is "Standard persistent disk"

Try to use the optional parameter "--boot-disk-type" for the "gcloud compute instances create" command as described in the gcloud documentation.

With the following command I created a debian test instance with ssd boot disk:

gcloud compute instances create test-vm  --machine-type=f1-micro \
 --zone=europe-west4-b --boot-disk-type=pd-ssd

You can get the available disk types for each zone via the following gcloud command:

gcloud compute disk-types list

The disk typ "pd-ssd" however seems to be available in all zones.