Search code examples
google-compute-engine

Clone GCE instance and fix mounting previous disks


I am trying to create a new instance (instance-2) by clicking "create similar" in an existing instance (instance-1).

I have then created the boot disk (instance-2-disk) from existing snapshot (instance-1-disk-snapshot) on the previous instance and a data ssd secondary disk (instance-2-disk-data) also from a snapshot of (instance-1-disk-data-snapshot).

However the machine doesn't want to bootup, because it is still trying to attache the instance-1-disk-data. This is an output of the machine's serial console:

[ TIME ] Timed out waiting for device instance-1-disk-data.
[DEPEND] Dependency failed for File…ogle-instance-1-disk-data.
[DEPEND] Dependency failed for /data.
[DEPEND] Dependency failed for Local File Systems.

How can I tell the system to expect the instance-2-disk-data even though the instance has correctly set the instance-2-disk-data?


Solution

  • In Addition to John Hanley. Here are the detailed steps

    1. Go to your instance-2 VM
    2. Shut Down
    3. Edit
    4. Detached Boot disk
    5. Custom Image
    6. Select Project > Select Image
    7. Save and Start Server

    In case you want to do it again by scratch

    1. Go to you instance-1 VM
    2. Select Disk > Create Snapshot
    3. Go to Compute Engine > Snapshot
    4. Select Snapshot
    5. Create Instance
    6. Configure VM then Create