Bug 734727 - Use libguestfs to inject files into Nova instances
Summary: Use libguestfs to inject files into Nova instances
Alias: None
Product: Fedora
Classification: Fedora
Component: openstack-nova
Version: 16
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Pádraig Brady
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-08-31 10:06 UTC by Mark McLoughlin
Modified: 2016-01-04 14:46 UTC (History)
4 users (show)

Fixed In Version: openstack-nova-2011.3-14.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-01-02 21:52:50 UTC

Attachments (Terms of Use)

Description Mark McLoughlin 2011-08-31 10:06:53 UTC
Nova has code to inject files into images before launching instances. The image is mapped either using nbd for qcow or loopback for raw, mounted and files copied in.

Of course, this doesn't work with LVM based images like you might build using a simple Oz template.

Enter stage left, libguestfs - this is a perfect use case for it.

It'd be really cool for upstream to use libguestfs where available to handle many more image and OS types.

Comment 1 Richard W.M. Jones 2011-08-31 11:44:30 UTC
We should have a clearer libguestfs-on-Ubuntu-10.4 story
before we launch into this further.  At the moment I don't
even know if it compiles on that platform, and I suspect
the kernel will be too old (lacking support for virtio-serial).

Investigating ...

Comment 2 Mark McLoughlin 2011-08-31 12:12:20 UTC
(In reply to comment #1)
> We should have a clearer libguestfs-on-Ubuntu-10.4 story before we launch into this further. 

Even without this, I'm sure upstream would take libguestfs if it was option - e.g. try it and fallback to loopback mounting, or even introduce the concept of a FileInjectionDriver and make a libguestfs based driver that can be enabled in nova.conf

Comment 3 Richard W.M. Jones 2011-08-31 16:52:26 UTC
Ubuntu 10.04:

- qemu-kvm is really old (0.12.3)

- kernel is also old (2.6.32)

- febootstrap is collecting its pension (2.1!)

- No hivex at all.  hivex is not available until Ubuntu 11.04.

- 'apt depends --recurse' is buggy so apt needs upgrading or the
  fix needs to be backported.

The apt update is where the real problems lie.  A straight
backport of the oneiric package is not feasible because it
would pull other core dependencies.  I need to isolate the
fix and backport just that.

So I think it'd be a lot of work to get libguestfs working
in Ubuntu 10.04, and therefore it must be an optional
dependency as you describe in comment 2.  I also think this
will limit acceptance upstream, and testing, because it looks
like upstream have settled on Ubuntu 10.04.

Comment 4 Mark McLoughlin 2011-08-31 17:39:05 UTC
(In reply to comment #3)
> it looks like upstream have settled on Ubuntu 10.04.

Upstream want to *support* Ubuntu 10.04 - and that's what the FileInjectionDriver based on the current code would be for. Doesn't exclude adding a libguestfs based implementation

Comment 5 Richard W.M. Jones 2011-09-01 12:23:45 UTC
Actually I got a bit further and managed to get libguestfs


The good news is that the workarounds required to install
this aren't too bad.  All that is really missing is an
updated qemu-kvm, and we can easily supply that missing dependency
or persuade Ubuntu that they really should think about backporting
the newer qemu since it's generally [less] broken than the ancient
version they are shipping.

Comment 6 Mark McLoughlin 2011-09-14 09:56:23 UTC
It turns out that Grid Dynamics have a patch to do this:


Comment 7 Richard W.M. Jones 2011-09-15 08:07:07 UTC
The patch needs a little bit of work, but it's generally on the
right track.

Comment 8 Richard W.M. Jones 2011-11-09 13:55:11 UTC
[Just some "notes to self" about this]

Currently the code in nova/virt/disk.py implements a lot
of things like resizing disks, injecting files etc which
would be better done using libguestfs.


We should make an abstract interface for the class (same
as driver.ComputeDriver which abstracts libvirt, XenAPI etc)
and then have implementations for the current impl and for

Comment 9 Mark McLoughlin 2011-12-05 10:41:04 UTC
Pádraig's made great progress on this: https://review.openstack.org/1994

Comment 10 Fedora Update System 2011-12-30 13:16:25 UTC
openstack-nova-2011.3-14.fc16 has been submitted as an update for Fedora 16.

Comment 11 Fedora Update System 2011-12-30 22:53:04 UTC
Package openstack-nova-2011.3-14.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openstack-nova-2011.3-14.fc16'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2012-01-02 21:52:50 UTC
openstack-nova-2011.3-14.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.