Bug 701920

Summary: Convert to libvirt failed by using unprivileged user due to pool can not be recognized
Product: Red Hat Enterprise Linux 6 Reporter: Qin Guan <qguan>
Component: virt-v2vAssignee: Matthew Booth <mbooth>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: cshao, leiwang, rwu, whuang, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 711715 (view as bug list) Environment:
Last Closed: 2011-06-10 08:56:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 711715    

Description Qin Guan 2011-05-04 09:47:08 UTC
Description of problem:
Convert to libvirt failed by using unprivileged user, the user defined pool could not be recognized by virt-v2v.

Version-Release number of selected component (if applicable):
virt-v2v-0.6.2-4.el6.x86_64
libguestfs-1.7.17-17.el6.x86_64
libvirt-0.8.7-18.el6.x86_64
virt-manager-0.8.6-4.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. create a normal user (user1) on RHEL6.1 with libvirt installed

2. login as user1 and define a new pool (dir_pool_user1):
[user1@dhcp-8-218 ~]$ cat /tmp/dir_pool_user.xml 
<pool type="dir">
<name>dir_pool_user1</name>
<target>
<path>/tmp/dir_pool_user1</path>
</target>
</pool>
[user1@dhcp-8-218 Desktop]$ virsh pool-list
Name                 State      Autostart
-----------------------------------------
default              active     yes      
dir_pool_user1       active     no        

3. Convert a remote VM to local libvirt pool by user1:
[user1@dhcp-8-218 Desktop]$ virt-v2v -ic xen+ssh://root.72.123 -op dir_pool_user1 xen-hvm-rhel5.7-x86_64
virt-v2v: Output pool dir_pool_user1 is not a valid storage pool

Actual results:
As step 3.

Expected results:
Below two result should be both OK:
Solution 1: The local pool defined by the unprivileged user can be recognized, and converting successfully
Solution 2: Document that virt-v2v converting can only be used by root user, no matter the target is libvirt or RHEV

Additional info:
Below sentence can be found in virt-v2v man page:

N.B. When exporting to RHEV, virt-v2v must run as root.

Comment 2 Matthew Booth 2011-06-10 08:56:50 UTC
This is cause by the same underlying problem as bug 671094, namely that when running as non-root, the default libvirt target is still qemu:///system rather than qemu:///session.

*** This bug has been marked as a duplicate of bug 671094 ***