[libvirt] cloud-init integration

Hi, if that has been discussed before, please point me to it. I have not been able to find anything about it. It would be great to easily generate and cd-attach cloud-init isos when starting a vm. The config files could be taken from the file system (e.g. %sysconfdir/cloud-init/host-name) and put into an iso. when the host stops the generated iso should be removed. What do you think? If that's a worthwhile cause, I would be glad to start to implement it, if pointers are given. My C i a little rusty unfortunately. Thank you for your consideration, Tobias Florek

2015-06-19 13:44 GMT+03:00 Tobias Florek <libvirt@ibotty.net>:
if that has been discussed before, please point me to it. I have not been able to find anything about it.
It would be great to easily generate and cd-attach cloud-init isos when starting a vm. The config files could be taken from the file system (e.g. %sysconfdir/cloud-init/host-name) and put into an iso. when the host stops the generated iso should be removed.
What do you think? If that's a worthwhile cause, I would be glad to start to implement it, if pointers are given. My C i a little rusty unfortunately.
Thank you for your consideration, Tobias Florek
I simple write daemon for this purpose. It listens for events from netlink about creating tap devices, loookup domain from libvirt and get domain metadata. After that get from metadata ipv4, ipv6 addresses and provide dhcp and ipv6 slaac service for vm, also it listens for http requests to 169.254.169.254 and provide cloud-config data for cloud-init. Generate iso not very hard if you really need it. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On Fri, Jun 19, 2015 at 12:44:51PM +0200, Tobias Florek wrote:
Hi,
if that has been discussed before, please point me to it. I have not been able to find anything about it.
It would be great to easily generate and cd-attach cloud-init isos when starting a vm. The config files could be taken from the file system (e.g. %sysconfdir/cloud-init/host-name) and put into an iso. when the host stops the generated iso should be removed.
What do you think? If that's a worthwhile cause, I would be glad to start to implement it, if pointers are given. My C i a little rusty unfortunately.
I'm not convinced that libvirt needs to be in the business of dynamically generating application specific disk images. It feels like that is a task that is more easily accomplished outside of libvirt, by a variety of pre-existing tools. There are a tonne of tools for building images in general. Richard Jones illustrated how to build disk images specifically for cloud init using libguestfs as an example https://rwmj.wordpress.com/2013/12/10/creating-a-cloud-init-config-disk-for-... So it seems sufficient to leave it to external apps. I'm not saying you shouldn't create some general purpose tool to build it from templates though - just that it doesn't need to be in libvirt. I could see value in perhaps adding some code for doing this, and a CLI tool into the virt-manager project for example. eg so virt-manager and virt-install could simplify the task of initializing cloud init when they deploy Vms. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (3)
-
Daniel P. Berrange
-
Tobias Florek
-
Vasiliy Tolstov