Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
cannot create/start a disk pool without indicating disk's --source-format
Version-Release number of selected component (if applicable):
libvirt-3.1.0-2.el7.x86_64
How reproducible:
100%
This is a regression. If it's a designed change recently, pls close it and I'll modify our testcases.
Steps to Reproduce:
1. mklabel a disk to gpt
## parted /dev/sdd mklabel gpt -s
2. create disk pool of that disk as follow
## virsh pool-create-as --name virt-disk-pool --type disk --target /dev --source-dev /dev/sdd
error: Failed to create pool virt-disk-pool
error: Requested operation is not valid: Format of device '/dev/sdd' does not match the expected format 'unknown'
Actual results:
pool creation failed, this doesn't happen with libvirt-2.0.0-10.el7_3.5.x86_64
And if the --source-format provided, it'll be successful.
## virsh pool-create-as --name virt-disk-pool --type disk --target /dev --source-dev /dev/sdd --source-format gpt
Pool virt-disk-pool created
Expected results:
Should work as previous versions, as follow:
## rpm -qa | grep libvirt-2
libvirt-2.0.0-10.el7_3.5.x86_64
## virsh pool-create-as --name virt-disk-pool --type disk --target /dev --source-dev /dev/sdd **here we do not provide --source-format**
Pool virt-disk-pool created
## virsh pool-dumpxml virt-disk-pool
<pool type='disk'>
<name>virt-disk-pool</name>
<uuid>016f28b5-5777-4830-b07e-d721ae8688c6</uuid>
<capacity unit='bytes'>8004288000</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>8004270592</available>
<source>
<device path='/dev/sdd'>
<freeExtent start='17408' end='8004288000'/>
</device>
<format type='unknown'/> **a pool with format type=unknown successfully created**
</source>
<target>
<path>/dev</path>
</target>
</pool>
There were patches added to the disk backend during libvirt 3.0.0 to "try harder" to check and ensure that there wasn't something on the disk before overwriting. So this is "expected behavior" now.
In this case you specifically put a 'gpt' format on /dev/sdd, then you expected a pool-create-as to succeed "because it did before"; however, as you point out what happened before is that libvirt overwrite /dev/sde with it's default - if you had done a 'parted /dev/sdd print', then you would have seen the Partition Table had been changed to "msdos" - which is the libvirt default as described here http://libvirt.org/storage.html#StorageBackendDisk when a specific format it not requested.
If the partition of the volume had been empty ... e.g. let's say after a:
dd if=/dev/zero of=/dev/sdd bs=1M count=2
re-running your command would give:
virsh pool-create-as --name virt-disk-pool --type disk --target /dev --source-dev /dev/sdd
error: Failed to create pool virt-disk-pool
error: Storage pool probe failed: Device '/dev/sdd' is unrecognized, requires build
leading to the obvious:
virsh pool-create-as --name virt-disk-pool --type disk --target /dev --source-dev /dev/sdd --build
Pool virt-disk-pool created
where the dumpxml :
virsh pool-dumpxml virt-disk-pool
would show:
<source>
...
<format type='dos'/>
Similarly, going back to square 1:
parted /dev/sdd mklabel gpt -s
and using the --overwrite flag would provide the same result
So, providing the '--source-format gpt' and having that work makes perfect sense to me since that's what libvirt finds in the disk partition table.
Closing this as NOTABUG
Description of problem: cannot create/start a disk pool without indicating disk's --source-format Version-Release number of selected component (if applicable): libvirt-3.1.0-2.el7.x86_64 How reproducible: 100% This is a regression. If it's a designed change recently, pls close it and I'll modify our testcases. Steps to Reproduce: 1. mklabel a disk to gpt ## parted /dev/sdd mklabel gpt -s 2. create disk pool of that disk as follow ## virsh pool-create-as --name virt-disk-pool --type disk --target /dev --source-dev /dev/sdd error: Failed to create pool virt-disk-pool error: Requested operation is not valid: Format of device '/dev/sdd' does not match the expected format 'unknown' Actual results: pool creation failed, this doesn't happen with libvirt-2.0.0-10.el7_3.5.x86_64 And if the --source-format provided, it'll be successful. ## virsh pool-create-as --name virt-disk-pool --type disk --target /dev --source-dev /dev/sdd --source-format gpt Pool virt-disk-pool created Expected results: Should work as previous versions, as follow: ## rpm -qa | grep libvirt-2 libvirt-2.0.0-10.el7_3.5.x86_64 ## virsh pool-create-as --name virt-disk-pool --type disk --target /dev --source-dev /dev/sdd **here we do not provide --source-format** Pool virt-disk-pool created ## virsh pool-dumpxml virt-disk-pool <pool type='disk'> <name>virt-disk-pool</name> <uuid>016f28b5-5777-4830-b07e-d721ae8688c6</uuid> <capacity unit='bytes'>8004288000</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>8004270592</available> <source> <device path='/dev/sdd'> <freeExtent start='17408' end='8004288000'/> </device> <format type='unknown'/> **a pool with format type=unknown successfully created** </source> <target> <path>/dev</path> </target> </pool>