Adding and removing the disk using Cloud Shell.

  • date 12th March, 2021 |
  • by Prwatech |
  • 0 Comments

Prerequisites

Hardware : GCP

Google Account

We can add and remove the disks using GCP cloud shell also.

Open GCP Console.

Click on Activate cloud shell.

$        gcloud compute disks create [diskname] --size [disk-size] --type [disk-type] --zone [zone-name]

To create disk.

Click on Authorize.

$        gcloud compute instances attach-disk [instance-name] --disk [disk-name]

To Attach the disk.

$        gcloud compute disks resize [disk-name] --size [disk-size]

To resize the disk. Type y for resize.

NB: We can increase the size. But we can’t downgrade it.

$        gcloud compute instances detach-disk [instance-name] --disk=[disk-name]

To detach/remove the disk.

Quick Support

image image