1
votes

I am creating an image from a running GCE instance as per these instructions: developers.google.com/compute/docs/disks#repartitionrootpd , but I'm a little worried its taking too long and hung.

I'm attempting to create an image before expanding my boot disk from 10GB to 100GB.

I needed to clone the compute-image-package as my instance didn't have access to this first off, so I did this whilst logged into the instance:

git clone https://github.com/GoogleCloudPlatform/compute-image-packages

I then followed the instructions for the package installation:

sudo python setup.py install

..and creating the image itself:

sudo gcimagebundle \ 
-d /dev/sda -o /tmp/ --log_file=/tmp/abc.log 

Its now been 2 hours and according to the CPU use graph in the API console the instance has been at 100% for that long, during which all other services such as the webpage the instance serves not being available (expected).

No doubt if I wait long enough I'll answer my own question, but when googling for an answer couldn't find any estimates, so thought it would be useful to get an idea here, especially in cases for larger disk sizes such as 500GB.

edit: so turned out it was human error (:)) trying to create a disk image of 8GB and save it to the remaining 2GB. For some reason I thought it would save the image outside of the disk. So before starting, it seems advisable if you are using more than 50% of the boot disk to create another disk, attach and mount and save your image to that, upload it to GS as an image, then use that to create a larger boot disk.

Yours sincerely, Mark

1
Ha, well of course as soon as I posted this the process ends. It took 2.5 hrs to clone an 8GB disk for anyone's future reference. The problem now is my whole disk is used up and I can't find the image. - Mark
So probably took so long as I tried to squeeze 8GB into 2GB... - Mark

1 Answers

1
votes

I ran in to the same issue when trying to expand to larger disk but out of room already for the image.

You can attach a secondary persistent disk and have gcimagebundle write the image to it instead.

Snapshots are way faster/easier but do not work in the case of trying to get on a larger disk, I think.