Migrate Google compute engine instance to a different region

后端 未结 4 587
太阳男子
太阳男子 2021-02-07 06:32

I am trying to migrate a couple of compute engine instances from Europe to Asia. I need to do this because most of the users for those servers are in Asia and they get faster a

相关标签:
4条回答
  • 2021-02-07 06:50

    The command you are using is for moving across zones of same region and not across regions.

    You can create an image of your instance and use the image to create a new instance in different region.

    0 讨论(0)
  • 2021-02-07 06:51

    Follow steps below in Google Cloud Platform

    1. Create snapshot of your VM instance
    2. Create disk with this snapshot
    3. Create image with disk created
    4. Create a new instance using the image created in steps above and change your zone
    0 讨论(0)
  • 2021-02-07 06:54

    GCP Guide says Snapshot the root disk, create an image, and use the image for the new VM root disk.

    0 讨论(0)
  • 2021-02-07 07:07

    If the auto move is not happening, you can try the manual move of vm instance. First list all the disk to choose the right disk to take snapshot.

    gcloud compute disks list
    

    Identify the name of disk from the list and create a snapshot of that one

    gcloud compute disks snapshot <disk_name> --snapshot-names <snapshot_disk_name> --zone <current_zone>
    

    Now you can delete your instance in you are trying to move.

    gcloud compute instances delete <instance_name> --zone <instance_zone>
    

    Next step is to create a disk from the snapshot you have created in the new zone where you want to create the instance.

    gcloud compute disks create <disk_name> --source-snapshot <snapshot_disk_name> --zone <new_zone_name>
    

    Now, you have to create an instance with the disk you have just created mounted on it. Please choose the right machine type for your need, here am going to create an instance with f1-micro.

    gcloud compute instances create <instance_name> --machine-type f1-micro --zone <new_zone> 
    --disk name=<disk_name>,boot=yes,mode=rw
    

    That's it.

    Now if you want you can delete the snapshot

    gcloud compute snapshots delete <snapshot_name> 
    
    0 讨论(0)
提交回复
热议问题