Bug 589665 - virt-install cannot add whole disk to guest easily via storage APIs
virt-install cannot add whole disk to guest easily via storage APIs
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst (Show other bugs)
6.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
: FutureFeature
Depends On:
Blocks: 655920
  Show dependency treegraph
 
Reported: 2010-05-06 12:01 EDT by Vivek Goyal
Modified: 2011-06-09 23:37 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 09:45:11 EDT
Type: ---
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-2011:0636 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-05-18 13:55:48 EDT

  None (edit)
Description Vivek Goyal 2010-05-06 12:01:30 EDT
Description of problem:

I tried exporting a whole disk (/dev/sdb) to guest but virt-manager does not
allow that until and unless one partitions the disk (create volumes).

I think one should be able to export the whole disk and not create the partitions on the disk. (might help with alignment issues sometimes).

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 2 RHEL Product and Program Management 2010-05-06 13:25:19 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 4 Cole Robinson 2010-12-13 17:28:18 EST
Fixed upstream:

http://hg.fedorahosted.org/hg/python-virtinst/rev/560f4d9015c0
Comment 5 Cole Robinson 2011-01-14 17:12:18 EST
Fix built in python-virtinst-0.500.5-1.el6
Comment 7 min zhan 2011-01-18 07:11:40 EST
Hi Cole,

I cannot reproduce this bug with virt-manager-0.8.4-8.el6.noarch,libvirt-0.8.7-2.el6.x86_64,python-virtinst-0.500.3-7.el6.noarch.

In virt-manager, I install a guest with storage setting as /dev/sdb (no partition) by cdrom. I don't see any error message when i set /dev/sdb as storage. And Everything is ok except using all space for installation. Then create a partition, an error display that not enough space on that disks. Actually I only allocate 20G of 500G for it. 

And I update the python-virtinst to python-virtinst-0.500.5-1.el6. Same behavior happens.

Actually I do not understand what 'export /dev/sdb to guest' means.please help to confirm this method is ok or not. Thanks

mzhan
Comment 8 Cole Robinson 2011-01-21 15:33:23 EST
Sorry for the confusion. To reproduce this issue, you want to set /dev/sdb as a 'disk' storage pool. To do this, from the main virt-manager window

Edit->Host Details->Storage->'+'
Choose a 'disk' type pool
Set the source to /dev/sdb

Then try to create a new guest, and at the storage step, manually enter the path
/dev/sdb. virt-manager should throw an error. You actually might not get an error if you are running virt-manager as root, but I'm not sure.

With the newer packages, this scenario should work fine. Let me know if you have any more questions.
Comment 10 Cole Robinson 2011-02-03 12:37:23 EST
hmm, are you running virt-manager/virt-install as root? if so, try running as your regular user or virt-manager connected remotely with virt-manager --connect qemu+ssh://root@localhost/system
Comment 11 min zhan 2011-02-17 04:46:15 EST
yes, i run virt-manager as root before.

Now I try with 
- connected remotely with virt-manager --connect qemu+ssh://root@localhost/system
- run as regular user

But Still no error message pop-up in virt-manager. Guest can be installed with storage /dev/sdb. Please have a look. Thanks

Environment:
# uname -a
Linux dhcp-92-51.nay.redhat.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
qemu-kvm-0.12.1.2-2.113.el6.x86_64
libvirt-0.8.1-27.el6.x86_64
virt-manager-0.8.4-8.el6.noarch
python-virtinst-0.500.3-7.el6.noarch

Steps:
1. Use virt-manager create disk pool. 
# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------
default              active     yes       
disk                 active     yes     

# virsh pool-dumpxml disk
<pool type='disk'>
  <name>disk</name>
  <uuid>f0a56a5a-3be1-08f3-37c6-07e35e47c8d1</uuid>
  <capacity>500107862016</capacity>
  <allocation>0</allocation>
  <available>500107861504</available>
  <source>
    <device path='/dev/sdb'>
    <freeExtent start='512' end='500107862016'/>
    </device>
    <format type='bsd'/>
  </source>
  <target>
    <path>/dev</path>
    <permissions>
      <mode>0700</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>

2. Create a new guest using http, make sure the storage is /dev/sdb.
# virsh dumpxml <guest>
...
 <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source dev='/dev/sdb'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <interface type='network'>
...
Comment 12 Cole Robinson 2011-03-08 17:52:39 EST
Here's how I reproduced with virt-install:

# rpm -Uvh --force --nodeps http://download.devel.redhat.com/brewroot/packages/python-virtinst/0.500.3/7.el6/noarch/python-virtinst-0.500.3-7.el6.noarch.rpm

(this is the only storage pool)
# sudo virsh pool-define-as --type disk --source-dev /dev/sda --name diskpool --target /dev

# sudo virsh pool-start diskpool

# sudo virt-install --name disktest --ram 64 --pxe --noautoconsole --disk path=/dev/sda
ERROR    Error with storage parameters: Size must be specified for non existent volume path '/dev/sda'

# sudo yum update python-virtinst

# sudo virt-install --name disktest --ram 64 --pxe --noautoconsole --disk path=/dev/sda

Unfortunately that last step now hits a different error involving storage size, which I'm working on a fix for now :(
Comment 13 min zhan 2011-03-08 21:49:17 EST
(In reply to comment #12)

Hi Cole,

I think comment #12 is the same as the comment #9 scenario 1. I also can reproduce this bug with virt-install in older python-virtinst package, but can not with virt-manager:(

Also seems a new issue display with new python-virtinst, please check comment #9 scenario 2.

Please give some suggestion about bug reproduce with virt-manager. Thanks
Comment 14 Cole Robinson 2011-03-09 09:37:24 EST
I was able to reproduce with virt-manager. Additionally install

http://download.devel.redhat.com/brewroot/packages/virt-manager/0.8.4/8.el6/noarch/virt-manager-0.8.4-8.el6.noarch.rpm

Make sure the disk pool is started. Try to install a new guest, choose 'import existing disk', manually enter /dev/sda, see the error

Size must be specified for non existent volume path '/dev/sda'

Hope that helps.
Comment 15 Cole Robinson 2011-03-09 10:56:38 EST
Since this needs an additional fix, and since all the changed code is in virtinst, reassigning.
Comment 16 Cole Robinson 2011-03-10 11:38:31 EST
Fixed in python-virtinst-0.500.5-2.el6
Comment 18 Vivian Bian 2011-03-10 21:15:26 EST
Verified PASS with python-virtinst-0.500.5-2.el6.noarch

# virt-install -n xxs -r 1024 -f /dev/sdb -l
http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-5-Server/U5/i386/os/
--debug

Could install the guest with /dev/sdb storage which has not partition successfully
Comment 20 errata-xmlrpc 2011-05-19 09:45:11 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0636.html

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