[Libguestfs] [libguestfs] conversion issue on NFS shares
Richard W.M. Jones
rjones at redhat.com
Thu May 7 13:12:28 UTC 2015
On Thu, Oct 16, 2014 at 04:34:03PM +0200, Artur Krzywdzinski wrote:
> Hi
>
> T'm trying to convert XEN virtual machine image into raw. Source file is on
> NFS export and destination is also on nfs export. (both exports are mounted
> on migration servers RW access). I'm getting permission denied.
> I have RW access to both exports - I can create, delete objects on both
> exports from migration server. But when I copy img file onto migration
> server local filesystem, conversion works, from local fs to nfs export.
> However when I tried to run guestfish against file located on NFS - I'm
> getting the same erro - Permission denied .
>
> [root at kvm01 export]# virt-v2v -i disk migr01.img -o local -os /tmp
> [ 0.0] Opening the source -i disk migr01.img
> [ 0.0] Creating an overlay to protect the source from being modified
> [ 0.0] Opening the overlay
> virt-v2v: error: libguestfs error: could not create appliance through
> libvirt.
>
> Try running qemu directly without libvirt using this environment variable:
> export LIBGUESTFS_BACKEND=direct
>
> Original error from libvirt: internal error: process exited while
> connecting to monitor: 2014-10-16T14:25:13.729270Z qemu-kvm: -drive
> file=/var/tmp/v2vovl60e1a0.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=unsafe,discard=unmap:
> could not open disk image /var/tmp/v2vovl60e1a0.qcow2: Could not open
> backing file: Could not open '/mnt/xen01/export/migr01.img': Permission
> denied
> [code=1 domain=10]
>
> If reporting bugs, run virt-v2v with debugging enabled and include the
> complete output:
>
> virt-v2v -v -x [...]
> [root at kvm01 export]#
Finally I worked out what's going on here.
If your $HOME directly is on NFS, then you have to enable a couple of
SELinux booleans so that libvirt can write to it:
setsebool -P use_nfs_home_dirs on
setsebool -P virt_use_nfs on
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
More information about the Libguestfs
mailing list