Bug 1088667
Summary: | [storage] some volume related virsh commands work when the passed volume is not one volume of the passed pool | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Yang Yang <yanyang> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | CC: | dyuan, mzhan, pkrempa, pzhang, rbalakri, shyu, xuzhang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.7-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-03-05 07:34:13 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
Yang Yang
2014-04-17 01:10:49 UTC
Fixed upstream: commit 6ef0b03483281659f2e1e321da9c56c97e05a305 Author: Peter Krempa <pkrempa> Date: Fri May 30 14:44:55 2014 +0200 virsh: Check whether found volume is member of the specified storage pool When looking up storage volumes virsh uses multiple lookup steps. Some of the steps don't require a pool name specified. This resulted into a possibility that a volume would be part of a different pool than the user specified: Let's have a /var/lib/libvirt/images/test.qcow image in the 'default' pool and a second pool 'emptypool': Currently we'd return: $ virsh vol-info --pool emptypool /var/lib/libvirt/images/test.qcow Name: test.qcow Type: file Capacity: 100.00 MiB Allocation: 212.00 KiB After the fix: $ tools/virsh vol-info --pool emptypool /var/lib/libvirt/images/test.qcow error: Requested volume '/var/lib/libvirt/images/test.qcow' is not in pool 'emptypool' verify version: libvirt-1.2.8-9.el7.x86_64 qemu-kvm-rhev-2.1.2-13.el7.x86_64 kernel-3.10.0-211.el7.x86_64 steps: prepare a pool of other type and create volumes in the pool. 1.check the volume in pool # virsh vol-list default --details| grep test.img test.img /var/lib/libvirt/images/test.img file 1.00 GiB 1.00 GiB # virsh vol-list fs-pool1 --details| grep test.img test.img /var/lib/libvirt/images/fs-pool/test.img file 1.00 GiB 1.00 GiB # virsh vol-list dir-pool --details | grep vol1.xml vol1.xml /tmp/dir-pool/vol1.xml file 358.00 B 4.00 KiB 2.test commands vol-X using mismatching pool and volume. # virsh vol-info --pool fs-pool1 /var/lib/libvirt/images/test.img error: Requested volume '/var/lib/libvirt/images/test.img' is not in pool 'fs-pool1' # virsh vol-resize --pool fs-pool1 /var/lib/libvirt/images/test.img 2G error: Requested volume '/var/lib/libvirt/images/test.img' is not in pool 'fs-pool1' # virsh vol-upload --pool default /tmp/dir-pool/vol1.xml disk-volume.xml error: Requested volume '/tmp/dir-pool/vol1.xml' is not in pool 'default' # virsh vol-download /tmp/dir-pool/vol1.xml test-pool.xml --pool default error: Requested volume '/tmp/dir-pool/vol1.xml' is not in pool 'default' # virsh vol-key --pool fs-pool1 /var/lib/libvirt/images/test.img error: Requested volume '/var/lib/libvirt/images/test.img' is not in pool 'fs-pool1' Tt will give a clear error message if the volume does not match the pool when using other vol-X commands . 3.test commands vol-X using matched pool and volume. # virsh vol-key /var/lib/libvirt/images/fs-pool/test.img --pool fs-pool1 /var/lib/libvirt/images/fs-pool/test.img # virsh vol-key --pool fs-pool1 /var/lib/libvirt/images/fs-pool/test.img /var/lib/libvirt/images/fs-pool/test.img # virsh vol-resize --pool fs-pool1 /var/lib/libvirt/images/fs-pool/test.img 2G Size of volume 'test.img' successfully changed to 2G # ll /var/lib/libvirt/images/fs-pool/test.img -h -rw-------. 1 root root 2.0G Dec 1 14:31 /var/lib/libvirt/images/fs-pool/test.img 4. test command vol-X just using volume name and matched pool name instead of absolute path when the two volume has a same name. # virsh vol-info test.img default Name: test.img Type: file Capacity: 1.00 GiB Allocation: 1.00 GiB # virsh vol-info test.img fs-pool1 Name: test.img Type: file Capacity: 2.00 GiB Allocation: 1.00 GiB # virsh vol-key test.img fs-pool1 /var/lib/libvirt/images/fs-pool/test.img # virsh vol-key test.img default /var/lib/libvirt/images/test.img it will check the specified storage pool .move to verified. 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-2015-0323.html |