Ask Your Question

Upload Snapshots to New Openstack Instance

asked 2013-04-24 07:06:36 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I have an existing OpenStack environment with around 20 running instances. I am creating a new environment (same OpenStack version, different servers, etc.) I am curious how to move all of my running instances to this new environment. I've tried taking a snapshot and uploading it to Glance, but I couldn't get that to work. Is there an easy way to do this? I know the images are in /var/lib/glance/images. Should I be moving the contents of /var/lib/nova instead?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-05-10 05:51:52 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

The files in /var/lib/nova are the backing disk images of your running instances. You can't migrate the running instances (unless the environment was configured for live migration)

You can instead:

  1. create snapshots of the running instances with "nova image-create"
  2. publish your /var/lib/glance/images via http OR use glance image-download to copy the snapshots somewhere and publish that directory via http
  3. import those snaps in the new environment by using "glance image-create --copy-from"

[EDITED after @lloydde comments]

edit flag offensive delete link more



Is there a way to do this without publishing the images directory via HTTP ? In a multi-tenant environment, this would allow access to resources not owned by the user.

tim-bell gravatar imagetim-bell ( 2013-05-10 06:54:26 -0500 )edit

@tim-bell sure you could, for example, copy the images manually and then re-create from the local files but the question seems to discuss a one-time migration need. For instance, this also requires to manually relaunch the instances in the new environment, it really isn't a rock solid solution.

gfidente gravatar imagegfidente ( 2013-05-10 07:01:33 -0500 )edit

@gfidente , @tim-bell I generally prefer approaches that don't go in to the internals. I would use 'glance image-download' instead of step 2.

lloydde gravatar imagelloydde ( 2013-06-09 11:07:30 -0500 )edit

Thanks so much! I finally got it to work using your above method. Snapshot, download with glance image-download and scp to new server, then upload with glance image-create. Thanks again!

dcparker gravatar imagedcparker ( 2013-06-17 20:28:39 -0500 )edit

answered 2013-06-09 12:39:11 -0500

tim-bell gravatar image

Completely agree with @lloydde. We found the glance download image command last week for this problem and it works very nicely. Not sure which release it arrived in but we need to be able to avoid exposing the underlying solutions but using the APIs.

edit flag offensive delete link more


At least for Diablo, prior to glance image-download being part of the Python command-line tool (CLP), to download images authenticated you would do something like: curl -H "X-Auth-Token:<YOUR_AUTH_TOKEN>" <GLANCE_HOST>:9292/v1/images/<IMAGE_ID> -o <OUTPUT_FILE>

Hat tip @jaypipes.

lloydde gravatar imagelloydde ( 2013-06-09 15:19:09 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-04-24 07:06:36 -0500

Seen: 5,196 times

Last updated: Jun 10 '13