Migrate Google compute engine instance to a different region

后端 未结 4 586
太阳男子
太阳男子 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 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  --snapshot-names  --zone 
    

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

    gcloud compute instances delete  --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  --source-snapshot  --zone 
    

    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  --machine-type f1-micro --zone  
    --disk name=,boot=yes,mode=rw
    

    That's it.

    Now if you want you can delete the snapshot

    gcloud compute snapshots delete  
    

提交回复
热议问题