Detach a disk from Google Compute Instance
To remove a disk from Google Compute instance, run
gcloud compute instances detach-disk INSTANCE_NAME --disk=DISK
Example
Here “indiameds” is name of the disk i want to detach from google compute instance with name “debug-instance”.
Google Cloud only allow detaching secondary disks. Boot disks can’t be detached, only way to detach a boot disk and attach on a new instance is to delete the instance. Make sure you don’t delete the disk along with the instance.
See gcloud