Ask Your Question
0

How to force nova to boot an updated glance image?

asked 2013-11-28 08:53:08 -0500

cyberang3l gravatar image

I have an image, on which I make some modifications and eventually I run the following command to update it:

glance image-update --size <the new size as taken from stat output> <UUID>

This will update the size and the updated_at properties of the image, but the next time I try to boot a VM based on the updated image, it will still boot from the base image cached in the common storage (the previous one which is not updated).

How can I force nova to re-download the latest image from the glance server?

edit retag flag offensive close delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-12-10 11:04:08 -0500

gmi gravatar image

How did you make modifications to the Glance image? Any changes would cause the md5sum to change, which will render the old image invalid. You should copy the Glance image from the "/var/lib/glance/images" somewhere else, change it and re-add it to Glance with a new name (and new UUID), then start instances using this new image.

edit flag offensive delete publish link more

Comments

I add the images in a web server and then I add them in glance using the --location http://xxx.img. So when I want to change the image, I simply change it in the web server. If I remove the cached base image, nova will re-download the image from the "location" and it works. No need to create a new

cyberang3l ( 2013-12-10 11:11:01 -0500 )edit

image. The problem comes when some virtual machines already use the base image so I cannot remove it in this case.

cyberang3l ( 2013-12-10 11:12:04 -0500 )edit

For all intents and purposes, you end up with two different images and Nova behavior is correct. You can use other means of updating the contents of the image instead of changing the image itself (e,g, use cloud-init: http://ubuntu-smoser.blogspot.fr/2010/03/introducing-cloud-inits-cloud-config.html) I don't think there is a solution for your issue in the existing Nova, other than running a script that ssh into each compute node and checks to see if there are no instances using the old image and then removing it. Another way would be, instead of updating the image, just create a new one pointing to that --location http://xxx.img and start instances based on it.

gmi ( 2013-12-10 11:38:10 -0500 )edit

"Another way would be, instead of updating the image, just create a new one pointing to that --location http://xxx.img and start instances based on it." <- This is what I am actually doint at the moment, so I was just looking if there is any way to avoid creating a new image. Since there is not, thanks for the reply and suggestions!!

cyberang3l ( 2013-12-10 12:34:19 -0500 )edit

Your Answer

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

Add Answer

[hide preview]

Question Tools

Follow
1 follower

Stats

Asked: 2013-11-28 08:53:08 -0500

Seen: 86 times

Last updated: Dec 10 '13