Bug 830135 - libguestfs should support mount-local APIs in RHEL 6 (for OpenStack)
libguestfs should support mount-local APIs in RHEL 6 (for OpenStack)
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
Depends On: 836501
Blocks: 830694
  Show dependency treegraph
Reported: 2012-06-08 06:32 EDT by Richard W.M. Jones
Modified: 2013-02-21 03:38 EST (History)
7 users (show)

See Also:
Fixed In Version: libguestfs-1.16.31-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 830694 (view as bug list)
Last Closed: 2013-02-21 03:38:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0324 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2013-02-20 15:54:42 EST

  None (edit)
Description Richard W.M. Jones 2012-06-08 06:32:29 EDT
Description of problem:

In libguestfs 1.18 we added useful new APIs which expose FUSE,
so that programs don't need to use the external guestmount program
in order to make guest filesystem directories appear mounted


Currently OpenStack uses guestmount directly, but this is
problematic, see eg:


These kinds of problems could be solved easily if OpenStack
could use a more recent version of libguestfs which supported
the mount-local API.  However because RHEL 6.3 libguestfs is
version 1.16, it doesn't have this API, effectively preventing
us from contributing such a patch upstream.

Therefore it would make sense for us either to rebase
libguestfs to 1.18, or to backport the 3 mount-local APIs
to libguestfs 1.16, for RHEL 6.4.

Note that Fedora >= 17 has libguestfs 1.18.
Comment 2 Pádraig Brady 2012-06-11 04:45:34 EDT
Note this should only be an issue when nova is _creating_ the authorized_keys file. A workaround would be to create an empty file with appropriate selinux labels in the guest image.

Also guestmount supports passing mount options when using a specific partition,
so if the guest image(s) have a simple layout, a specific partition to inject to can be configured, and in this mode nova could be modified to pass the appropriate options. It's not been tested whether SElinux labels can be updated in this way.
Comment 3 Richard W.M. Jones 2012-06-15 12:43:12 EDT
Bug 832511 would be helped by this.
Comment 5 Mohua Li 2012-11-09 06:36:18 EST

have run some basic test for mount-local api with the following test script(https://github.com/libguestfs/libguestfs/blob/master/examples/mount_local.c), more detail test will be done later, 

[root@station2 tmp]# ./mount_local  disk.img

This is the 'mount-local' demonstration program.  Follow the
instructions on screen.

Creating and formatting the disk image, please wait a moment ...

The _current directory_ is a FUSE filesystem backed by the disk
image which is managed by libguestfs.  Any files or directories
you copy into here (up to 512 MB) will be saved into the disk
image.  You can also delete files, create certain special files
and so on.

When you have finished adding files, hit ^D or exit to exit the
shell and return to the mount-local program.

mount-local-shell> touch mount_local.c
mount-local-shell> touch this_is_mount_local_test
mount-local-shell> exit

[root@station2 tmp]# guestfish -a disk.img -m /dev/sda1 
><fs> ls /
Comment 7 errata-xmlrpc 2013-02-21 03:38:16 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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