Search code examples
google-cloud-platformgcloudgoogle-compute-engine

Moving Google Instances to different Zone


Having issues with a simple instance move in GCE.

Using the following commands in gcloud.

 gcloud compute instances move MY-VM \ --zone europe-west1 --destination-zone europe-west2

gcloud compute instances move MY-VM --zone europe-west1-b --destination-zone europe-west2-b

gcloud compute instances move MY-VM \ --destination-zone europe-west2-b

gcloud compute instances move MY-VM \ europe-west1-b --destination-zone europe-west2-b

Gcloud throws the follwing error for above;

ERROR: (gcloud.compute.instances.move) unrecognized arguments:
   --zone
  europe-west1-b

Google --help documents:

NAME
    gcloud compute instances move - move an instance and its attached
        persistent disks between zones



SYNOPSIS
    gcloud compute instances move INSTANCE_NAME
        --destination-zone=DESTINATION_ZONE [--async] [--zone=ZONE]
        [GCLOUD_WIDE_FLAG ...]


DESCRIPTION
    gcloud compute instances move facilitates moving a Google Compute Engine
    virtual machine from one zone to another. Moving a virtual machine may
    incur downtime if the guest OS must be shutdown in order to quiesce disk
    volumes prior to snapshotting.

    For example, running:
        $ gcloud compute instances move example-instance-1 \ --zone us-central1-b --destination-zone us-central1-f



    will move the instance called example-instance-1 with its all attached
    persistent disks, currently running in us-central1-b, to us-central1-f. 

is it me or am I losing my mind.


Solution

  • UPDATE:

    The issue was that I was trying to change actual country so that was the issue. Trying to move from Belgium to London and the only way was to create a new instance using the snapshot of the one I wanted to move.

    you can only move instances ie;

    europe-west1-b to europe-west1-c or west1-a etc 
    

    Hope this helps.