0

I created a machine image on GCE from a running ubuntu VM which has an "additional" disk available to be mounted. That disk is mounted for backups, then dismounted, and was not mounted at the time the machine image was made.

Some time later (cron job), the additional disk was mounted, a backup written, and then dismounted. Manually mounting the disk shows the new backup file.

I later created a new VM from the machine image. When I start that VM and mount the backup disk, it does not show the last backup file written. If I look at the disks for this project in the console, I see two new disks -- the one for the boot disk clone from the machine image, and another for the "additional" disk.

This seems to imply that creating a machine image also creates an image of any "additional" disks available to the VM, even if they are not mounted. Is there a way to create a machine image without also cloning unmounted disks, without dis-associating the disks from the original VM?

2 Answers2

0

Unmounting a disk sometimes is not a cold backup.

Remove extra disks from the source instance. You said you didn't want to, but those are not necessary to make a copy.

Snapshot the source disk, mount the snapshot as a new disk on a different instance that does backups, and copy the disk image somewhere else like archival blob storage. GCP docs outline an implementation of this under exporting an image manually. Which will need to be enhanced to make a robust backup script that meets your recovery point objective.

Some third party backup software has already scripted backing up a wide variety of data into GCP Cloud Storage. Consider these for backing up data both inside and out of GCP, or other more complex use cases.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
0

I test machine image in my own project and there is no way to create an image from a GCE instance which has attached additional disk without this additional disk even those weren’t mount at OS level, I mean, machine image read the disk from the instance and not from the OS, therefore you have attached additional disk those disk will be backed up

Also you can check the [documentation]1 about the machine image feature to get a better idea about the capacities of this feature.

Now as I can see the better option to do what you want is detach your disk first (manually) and after that run the backup with machine image to detach disk you can use this command, and to reattach it this one.

By last, as I know machine image still in beta, then may you can go to this page and ask for a functionality that allow you to choose what disk should be included in the image,