Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you rename a GCE persistent disk?

This should be easy but ...

I have been working on a Google Compute Engine persistent disk image that I'm calling utilserver, and basically now need to build it again from scratch, but I might need the original one to try a few things in case problems come up. So I'd like to rename utilserver to utilserver-backup and then create a new utilserver that will hopefully end up being more correct. However, under the web console for my project there's only a "Delete" button, no "Rename" button. Neither does gcutil seem to have a rename command. Ok, I tried creating a snapshot of utilserver and then from that a new persistent disk called utilserver-backup, but when I did that the new disk looked like a completely new image--none of my prior installation work was on there. Any ideas here?

like image 428
Purplejacket Avatar asked Oct 16 '25 17:10

Purplejacket


1 Answers

You can create a snapshot of your disk and then can create multiple disk from that snapshot. By creating the snapshot you will have the backup of your original disk. You can then delete the original disk and create a new one with the same name. You can refer to the following link for more details about snapshot: https://cloud.google.com/compute/docs/disks/create-snapshots

I personally have tried creating a new disk from snapshot using the following command and it created a new disk with all my data

gcutil adddisk <disk-name> --project=<project-id> --source_snapshot=<snapshot-name>
like image 68
Faizan Avatar answered Oct 19 '25 09:10

Faizan