Bug 830135 - libguestfs should support mount-local APIs in RHEL 6 (for OpenStack)
libguestfs should support mount-local APIs in RHEL 6 (for OpenStack)
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.4
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)
Environment:
Last Closed: 2013-02-21 03:38:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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
locally.

https://rwmj.wordpress.com/2012/03/29/libguestfs-mount-local/
https://rwmj.wordpress.com/2012/05/14/tip-using-mount-local-api-from-c/
https://github.com/libguestfs/libguestfs/blob/master/examples/mount_local.c

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

https://www.redhat.com/archives/libguestfs/2012-June/msg00021.html
https://www.redhat.com/archives/libguestfs/2012-June/msg00020.html

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
libguestfs-1.16.32-3.el6

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 /
PUT_FILES_AND_DIRECTORIES_HERE
lost+found
mount_local.c
this_is_mount_local_test
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.

http://rhn.redhat.com/errata/RHBA-2013-0324.html

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