Ask Your Question

What's the recommended way to snapshot images for cloud-init?

asked 2013-05-22 08:16:57 -0500

lorin gravatar image

updated 2013-05-24 17:32:17 -0500

smaffulli gravatar image

Is there anything I need to do inside a running instance before I snapshot it so that cloud-init will have the correct behavior when I provision a new instance from the snapshotted image?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-05-31 16:14:30 -0500

lorin gravatar image

I emailed Scott Moser, the author of cloud-init, about this. He replied:

[cloud-init] is intended to do the right thing. it uses the instance-Id as a marker for 'first-boot' things. so the new instance should run them again.

I'd recommend shutting the instance down rather than taking a snapshot of a live filesystem. but other than that, it is supposed to work.

edit flag offensive delete link more

answered 2014-07-09 11:08:17 -0500

Mathias Ewald gravatar image

updated 2014-07-09 13:16:47 -0500

Unfortunately, it isn't. I tested with Ubuntun 12.04 and 14.04 cloud images. Here is what I do:

  1. deploy from original image with SSH keypair
  2. SSH into the instance works
  3. snapshot the instance
  4. deploy from the snapshot (on boot the screen is black so no information to get from there)
  5. SSH not working anymore.

From the serial console I can see this:

cloud-init start-local running: Wed, 09 Jul 2014 16:08:11 +0000. up 3.16 seconds
no instance data found in start-local
cloud-init-nonet waiting 120 seconds for a network device.
ci-info: lo    : 1       .
ci-info: eth0  : 1   fa:16:3e:22:89:7f
ci-info: route-0:         eth0   UG
ci-info: route-1:     eth0   U
ci-info: route-2:   eth0   U
cloud-init start running: Wed, 09 Jul 2014 16:08:25 +0000. up 16.80 seconds
2014-07-09 16:08:28,906 -[WARNING]: '' failed [2/120s]: url error [[Errno 113] No route to host]
2014-07-09 16:08:31,906 -[WARNING]: '' failed [5/120s]: url error [[Errno 113] No route to host]
2014-07-09 16:07:03,707 -[WARNING]: '' failed [-82/120s]: url error [[Errno 113] No route to host]
2014-07-09 16:07:06,707 -[WARNING]: '' failed [-79/120s]: url error [[Errno 113] No route to host]
2014-07-09 16:07:09,707 -[WARNING]: '' failed [-76/120s]: url error [[Errno 113] No route to host]

It looks like the metadata service was not working. But I know it is as any newly spawned instance (ubuntu or cirros) can connect to it and retrieve their metadata.

Any ideas?

EDIT: I am sorry I have to admit that between steps 2 and 3 I installed xubuntu-desktop. I just did the plain procedure as above and it worked. Any suggestions why is failes with xubuntu-desktop installed?

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-05-22 08:16:57 -0500

Seen: 1,339 times

Last updated: Jul 09 '14