libguestfs could not connect to libvirt

Bug #1366773 reported by Peeyush Gupta on 2014-09-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Undecided
Unassigned

Bug Description

Hi all,

I am trying to setup tripleo using RDO instack. I am using Fedora 20. I was able to set it up few weeks ago, but then I removed the undercloud and tried to deploy it again, and I am getting the following error:

+ virt-builder fedora-20 --size 30G --format qcow2 -o instack.qcow2 --install net-tools,yum-utils,git --mkdir /home/stack/.ssh --upload /home/stack/.ssh/id_rsa_virt_power:/home/stack/.ssh/id_rsa_virt_power --upload /home/stack/.ssh/id_rsa_virt_power.pub:/home/stack/.ssh/id_rsa_virt_power.pub --upload /tmp/deploy-virt-overcloudrc:/home/stack/deploy-overcloudrc --upload /usr/share/doc/instack-undercloud/instack-virt.answers.sample:/home/stack/instack.answers --run-command 'useradd -m -G wheel -p "" stack ; echo "stack:stack" | chpasswd;
     echo "stack ALL=(root) NOPASSWD:ALL" >> /etc/sudoers.d/stack ; chmod 0440 /etc/sudoers.d/stack;
     chmod 0700 /home/stack/.ssh;
     chmod 0600 /home/stack/.ssh/id_rsa_virt_power /home/stack/.ssh/id_rsa_virt_power.pub;
     cp /etc/skel/.* /home/stack/;
     chown -R stack:stack /home/stack' --firstboot-command 'restorecon /etc/resolv.conf' --selinux-relabel
virt-builder: warning: cache /home/stack/.cache/virt-builder:
Unix.Unix_error(20, "mkdir", "/home/stack/.cache/virt-builder")
virt-builder: warning: disabling the cache
|S-chain|-<>-127.0.0.1:6000-<><>-209.132.180.99:80-<><>-OK
ProxyChains-3.1 (http://proxychains.sf.net)
|S-chain|-<>-127.0.0.1:6000-<><>-209.132.180.99:80-<><>-OK
[ 6.0] Downloading: http://libguestfs.org/download/builder/fedora-20.xz
|S-chain|-<>-127.0.0.1:6000-<><>-209.132.180.99:80-<><>-OK
ProxyChains-3.1 (http://proxychains.sf.net)
|S-chain|-<>-127.0.0.1:6000-<><>-209.132.180.99:80-<><>-OK
####################################################################### 99.9%
[ 116.0] Planning how to build this image
[ 116.0] Uncompressing
[ 118.0] Resizing (using virt-resize) to expand the disk to 30.0G
libvirt: XML-RPC error : Failed to connect socket to '/run/user/0/libvirt/libvirt-sock': Permission denied
virt-resize: libguestfs error: could not connect to libvirt (URI = qemu:///session): Failed to connect socket to '/run/user/0/libvirt/libvirt-sock': Permission denied [code=38 domain=7]
[stack@llmvm02 ~]$ echo $LIBVIRT_DEFAULT_URI
qemu:///system

The default URI for libvirt is qemu:///system, but libguestfs is still trying to connect to qemu:///session.

I then did a fresh install of Fedora 20 and ran the procedure again, still I am getting the same error.

Peeyush Gupta (peeygupt) on 2014-09-09
Changed in tripleo:
status: New → Invalid
Richard Jones (rjones-redhat) wrote :

Just a note that /home/stack on the *host* is not writable, which may be a problem.

However I'd say in this case the specific problem is with libvirt:

 libvirt: XML-RPC error : Failed to connect socket to '/run/user/0/libvirt/libvirt-sock': Permission denied

You can tell libguestfs not to use libvirt, by setting the following environment variable:

 export LIBGUESTFS_BACKEND=direct

In this case virt-builder will just run qemu directly, and libvirt is not involved.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers