Description of problem:
The auto-generated volume's name is incorrect if pool type is disk
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. create a disk pool
2. Run below command and set '--disk pool=diskpool,size=0.5'.
virt-install --name test --memory 1024 --disk pool=diskpool,size=0.5 -l http://download.eng.pek2.redhat.com/pub/rhel/rel-eng/RHEL-7.5-20180221.0/compose/Server/x86_64/os/ --debug --check all=off
[Mon, 23 Apr 2018 17:49:09 virt-install 8100] DEBUG (storage:816) Creating storage volume 'test' with xml:
[Mon, 23 Apr 2018 17:49:09 virt-install 8100] DEBUG (storage:847) Using vol create flags=0
[Mon, 23 Apr 2018 17:49:09 virt-install 8100] DEBUG (storage:857) Error creating storage volume
Traceback (most recent call last):
File "/usr/share/virt-manager/virtinst/storage.py", line 848, in install
vol = self.pool.createXML(xml, createflags)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3185, in createXML
if ret is None:raise libvirtError('virStorageVolCreateXML() failed', pool=self)
libvirtError: invalid argument: invalid partition name 'test', expected 'sdb1'
The guest should be installed successfully.
Created attachment 1425627 [details]
virt-manager debug log
Thanks for the report. Unfortunately trying to actually handle creating appropriately named and formatted storage volumes for every pool type is a giant pain in the butt. Especially a case like this where libvirt already knows what the correct answer is, but the XML parser forces us to specify a name, so there's presently no option to ask libvirt 'please just create the right volume and give us the correct name'.
In my experience very few people use libvirt to manage their disk partitions, and if they do it's just for enumerating existing partitions, not creating new ones. So while this is definitely a bug, in the absence of a report from an actual customer I think we should just defer this, it's not worth prioritizing. Closing as DEFERRED