r/openstack • u/rawmainb • Jul 13 '20
How to migrate openstack instance from one cluster to another?
We have 2 OpenStack clusters.
Now want to migrate instance from one cluster to another.
The steps are:
- Create a snapshot in cluster1
- Download the snapshot to local
- Connect to cluster2 and create an image with the snapshot
- Create new stack with new image by heat template
I got 2 issues:
- When I create a snapshot in cluster1 and download the file, I found the file's size was 0.
openstack image save --file mySnapshot.raw [image_id]
- When I create new stack set normal volume information, it got this error:
Resource CREATE failed: ResourceInError: resources.server_volume: Went to status error due to "Unknown"
I found it wan't attached to anywhere.
Is there any necessary to do for volume when create a snapshot in cluster1? So how to migrate with volume to cluster2 correctly?
9
Upvotes
2
u/iammpizi Jul 27 '20
I am going to offer another piece of advice here which might be of interest.
It might apply to you,or not but at least I hope it can be informative.
Migration of a VM basically means that a Virtual disk will be moved from one place to another and then a VM will be spawned on top of that disk. Many openstack Clusters use a CEPH backend for the VMs instead of LVMs. If your 2 clusters point to the same CEPH cluster it is entirely possible to create volume copies within CEPH and have Openstack manage them. Therefore your VM will "appear" on your new cluster without having to do all that process you described. Dont forget that creating all those snapshots can be an expensive process. It is OK for a singe 10 GB image but what if you have a 30TB cluster?? Are you going to transfer all that through a 10Gbps wire??