Bug 1251461
| Summary: | libvirt produced ambiguous error message when create disk pool with a block device which has no disk label | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | yisun |
| Component: | libvirt | Assignee: | John Ferlan <jferlan> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.2 | CC: | dyuan, jferlan, pkrempa, rbalakri, xuzhang, yanyang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.3.1-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-03 18:22:31 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
yisun
2015-08-07 11:31:51 UTC
Patch(es) posted upstream: http://www.redhat.com/archives/libvir-list/2015-October/msg00080.html http://www.redhat.com/archives/libvir-list/2015-October/msg00081.html http://www.redhat.com/archives/libvir-list/2015-October/msg00082.html http://www.redhat.com/archives/libvir-list/2015-October/msg00083.html Pushed upstream as commit id '657f3bea8ded929c16dd96bb3c02d88af4c71a1b' git describe 657f3bea8ded929c16dd96bb3c02d88af4c71a1b v1.2.20-27-g657f3be May require following commits too: 2f177c5a41de50143453aba333774f3023e946b7 05c46f5c2267a52a2011d5ce0cd4fce1f5334761 fba2076f43032632b1cbd29416c57955f943d828 Verified on libvirt-1.3.1-1.el7.x86_64
and PASSED.
Scenarios:
1. check when disk source doesn't exist, proper error message will be produced.
# cat disk.pool
<pool type='disk'>
<name>sdz</name>
<source>
<device path='/dev/sdz'>
</device>
<format type='dos'/>
</source>
<target>
<path>/dev</path>
<permissions>
<mode>0700</mode>
<owner>0</owner>
<group>0</group>
</permissions>
</target>
</pool>
#virsh pool-create disk.pool
error: Failed to create pool from disk.pool
error: invalid argument: device path '/dev/sdz' doesn't exist
# virsh pool-define disk.pool
Pool sdz defined from disk.pool
# virsh pool-start sdz
error: Failed to start pool sdz
error: invalid argument: device path '/dev/sdz' doesn't exist
===========================
2. check when a invalid disk label exist, a warning message will be properly produced.
# virsh pool-list --all
-------------------------------------------
...
sdb inactive no
...
# virsh pool-dumpxml sdb
<pool type='disk'>
<name>sdb</name>
<uuid>2961824b-a3c2-4b4d-a2b5-9f846cb040ad</uuid>
<capacity unit='bytes'>0</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>0</available>
<source>
<device path='/dev/sdb'/>
<format type='dos'/>
</source>
<target>
<path>/dev</path>
<permissions>
<mode>0700</mode>
<owner>0</owner>
<group>0</group>
</permissions>
</target>
</pool>
# parted /dev/sdb mklabel loop
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
Information: You may need to update /etc/fstab.
# parted /dev/sdb print
Model: IET VIRTUAL-DISK (scsi)
Disk /dev/sdb: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
# virsh pool-build sdb --no-overwrite
error: Failed to build pool sdb
error: operation failed: Unknown Partition Type, requires build --overwrite
# virsh pool-build sdb --overwrite
Pool sdb built
3. check when a valid disk label exists, a warning message will be properly produced.
# parted /dev/sdb mklabel gpt
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
Information: You may need to update /etc/fstab.
# virsh pool-build sdb --no-overwrite
error: Failed to build pool sdb
error: Requested operation is not valid: Valid disk label already present, requires --overwrite
# virsh pool-build sdb --overwrite
Pool sdb built
# parted /dev/sdb print
Model: IET VIRTUAL-DISK (scsi)
Disk /dev/sdb: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
4. check comment 0's scenario
# parted /dev/sdb mklabel loop
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
Information: You may need to update /etc/fstab.
# virsh pool-create disk.pool
error: Failed to create pool from disk.pool
error: operation failed: Unknown Partition Type, requires build --overwrite
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2577.html |