Bug 832302
Summary: | libvirt shouldn't delete an existing unregistered volume in vol-create | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | yuping zhang <yupzhang> |
Component: | libvirt | Assignee: | Osier Yang <jyang> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | 6.3 | CC: | acathrow, dallan, dyasny, dyuan, jwu, lcui, mzhan, rwu, tzheng, whuang, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.10.2-12.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-21 07:17:38 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: | |||
Bug Depends On: | |||
Bug Blocks: | 888457 |
Description
yuping zhang
2012-06-15 05:49:23 UTC
This is a libvirt bug. I've updated the title and reassigned it accordingly. Here's a simple reproducer: # cat /tmp/disk.xml <volume> <name>unregistered.img</name> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <target> <format type='raw'/> </target> </volume> # touch /var/lib/libvirt/images/unregistered.img # virsh vol-create default /tmp/disk.xml error: Failed to create vol from /tmp/disk.xml error: cannot create path '/var/lib/libvirt/images/unregistered.img': File exists # ls /var/lib/libvirt/images/unregistered.img ls: cannot access /var/lib/libvirt/images/unregistered.img: No such file or directory Note that libvirt has deleted the existing disk image. It should instead have not deleted it and indicated that the volume already exists, as it would have done if the volume was already registered in the pool. patch committed into upstream. https://www.redhat.com/archives/libvir-list/2012-December/msg00159.html I can reproduce this with pkg: libvirt-0.10.2-7.el6.x86_64 virt-v2v-0.8.9-2.el6.x86_64 verify with: libvirt-0.10.2-12.el6.x86_64 virt-v2v-0.8.9-2.el6.x86_64 step: 1.Create a image in local host default pool. # qemu-img create /var/lib/libvirt/images/xen-pv-rhel5.8-x86_64.img 1G Formatting '/var/lib/libvirt/images/xen-pv-rhel5.8-x86_64.img', fmt=raw size=1073741824 # ll /var/lib/libvirt/images/xen-pv-rhel5.8-x86_64.img -rw-r--r--. 1 root root 1073741824 Dec 13 02:16 /var/lib/libvirt/images/xen-pv-rhel5.8-x86_64.img 2.Convert a guest which image name is xen-pv-rhel5.8-x86_64.img # virt-v2v -ic xen+ssh://10.66.72.23/ -os default xen-pv-rhel5.9-x86_64 root.72.123's password: virt-v2v: Failed to create storage volume: libvirt error code: 55, message: Requested operation is not valid: volume target path '/var/lib/libvirt/images/xen-pv-rhel5.8-x86_64.img' already exists # echo $? 2 3.# ll /var/lib/libvirt/images/xen-pv-rhel5.8-x86_64.img -rw-r--r--. 1 root root 1073741824 Dec 13 02:16 /var/lib/libvirt/images/xen-pv-rhel5.8-x86_64.img the image not be removed. verification passed. 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. http://rhn.redhat.com/errata/RHSA-2013-0276.html |