r/openstack • • 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

17 comments sorted by

View all comments

Show parent comments

1

u/rawmainb Jul 16 '20

Thank you very much.

I did it and this time I can download a large file!

But when I use it as an image to create a new stack with heat template in openstack cluster2, it took a long time and timeout finally. Failed. It's volume is 8GB.

By the way, are the snapshot-name and image name above are the same thing? If so, I found an image created by nova, and use cinder upload-to-image also generated another new one with the same image name but different UUID. I used the second one to download it has large size, not 0.

1

u/mysterysmith Jul 16 '20

snapshot-name is an arbitrary name that you give your initial VM snapshot. image-name is also an arbitrary name that you give the new image you're creating from the volume you created with the cinder create command (Hope that helps).

1

u/rawmainb Jul 17 '20

So why create it first?

nova image-create --poll <instance> <snapshot-name>

This one will also create an image for download, right?

cinder upload-to-image <volume id from the above cidner create> <image name>

Or its purpose is to attach the volume snapshot to instance snapshot?

1

u/mysterysmith Jul 17 '20

Actually nova image-create is doing all the dirty work for you (This is why you have to run it first). It creates a snapshot of the source VM from which you run all the other commands. The cinder upload-to-image just copies the snapshot to glance basically.

1

u/rawmainb Jul 18 '20

It's a very clear explanation. Thank you very much for your help!