How to migrate openstack instance from one cluster to another?

asked 2020-07-13 03:12:14 -0500

rawmain gravatar image

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?

edit retag flag offensive close merge delete

Comments

It sounds to me that your instances are volume-based, what is your cinder backend? Cinder snapshots have a size of 0, you need to make them flat (in terms of ceph if that's your backend), you can also upload volumes to images and then download them. Please provide more information about your backend

eblock gravatar imageeblock ( 2020-07-13 03:29:50 -0500 )edit

Yes, using Cinder now. How to make them flat? Every time we create a stack also set a volume and size in the heat template. So it should attach to instance. Is it possible also download volume snapshot to local as instance?

rawmain gravatar imagerawmain ( 2020-07-13 20:12:30 -0500 )edit

No, not that I'm aware of. You can create a volume from that snapshot, that should be flat (I believe). And that volume can be uploaded to glance so you can download it to local storage.

eblock gravatar imageeblock ( 2020-07-14 02:38:24 -0500 )edit

Sorry, I still not sure which snapshot you mean. Is it this guide? And how to upload to glance? Maybe this one

rawmain gravatar imagerawmain ( 2020-07-14 03:36:54 -0500 )edit

I mean the same snapshot you mean ;-) You have several options to get to your goal. Either directly upload your volume to glance and then copy it wherever you want. Or you create a snapshot from that volume, create a new volume from said snapshot and upload that new volume to glance.

eblock gravatar imageeblock ( 2020-07-14 05:22:37 -0500 )edit