cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wido den Hollander <w...@widodh.nl>
Subject Re: Using libguestfs for modifying (System) VM's
Date Mon, 23 Apr 2012 08:40:17 GMT
Hi,

On 04/21/2012 10:13 PM, Chiradeep Vittal wrote:
> Dunno..last time I checked, Ubuntu 10.04 did not have an "out-of-the-box"
> guestfish.
>
> Has this changed?

No, it hasn't.

The new Ubuntu LTS 12.04 is coming out in a couple of days though and 
that will ship with guestfish [0].

I don't have the time right now to work on this, but in a later stadium 
I think it would be a nice project. With the clean Java bindings for 
libguestfs we could get rid of a lot of nasty BASH scripts and make this 
code much more reliable.

This would also pave the road for running System VM's from RBD, which I 
don't see happening with the current BASH scripts.

Wido

[0]: http://packages.ubuntu.com/precise/guestfish
>
> On 4/21/12 12:52 PM, "David Nalley"<david@gnsa.us>  wrote:
>
>> On Sat, Apr 21, 2012 at 7:50 AM, Wido den Hollander<wido@widodh.nl>
>> wrote:
>>> Hi,
>>>
>>> I'm not a big fan of all the bash scripts which are being called on KVM
>>> system for deploying the System VM's.
>>>
>>> They try to mount the guest, inject data (like SSH keys) and then
>>> continue
>>> the boot process of the guest.
>>>
>>> It's something I don't like and I think libguestfs [0] can help here.
>>>
>>> With guestfish [1] you can access the VM and modify its filesystem:
>>>
>>> guestfish<<_EOF_
>>>   add disk.img
>>>   run
>>>   mount /dev/vda1 /
>>>   write-append /root/.ssh/authorized_keys "ssh-rsa XXXXXX...."
>>>   _EOF_
>>>
>>> Imho this would be a much cleaner way to modify the System VM's without
>>> having to set up loop devices, mount them, etc, etc.
>>>
>>> The nice thing with libguestfs is that you can access the VM's while
>>> they
>>> are running (use with caution!), so that gives you much more
>>> flexibility!
>>>
>>> There is a native C API, but there also seem to be Java bindings [2], so
>>> that could make it much cleaner to integrate into CloudStack.
>>>
>>> libguestfs also seems to be present in Fedora [3] and in RHEL 6, so that
>>> shouldn't be a problem.
>>>
>>> Searching the web showed me some reports of libguestfs and CloudStack,
>>> but
>>> browsing the code I found no reference to this.
>>>
>>> Something worth looking at I think?
>>>
>>> Wido
>>>
>>> [0]: http://libguestfs.org/
>>> [1]: http://libguestfs.org/guestfish.1.html
>>> [2]: http://libguestfs.org/guestfs-java.3.html
>>> [3]: https://fedoraproject.org/wiki/Features/libguestfs
>>
>> Yes please - guestfish would likely make this far more efficient all
>> the way around.
>>
>> --David (whose opinion doesn't matter much because I don't maintain
>> the systemvms :) )
>

Mime
View raw message