Hide Forgot
Created attachment 529645 [details] Patch to ignore virtual backing stores of LVM sparse volumes Description of problem: When one creates a sparse volume in LVM, its backing store is a "virtual" volume which is not normally displayed and has no /dev entry of the form "/dev/$pool/$volume". libvirt fails to recognize the backing store as virtual and fails the pool after attempting to open this nonexistent device path. Version-Release number of selected component (if applicable): git head, 0.9.6, 0.9.2 at least (tested on Ubuntu, FWIW) How reproducible: 100% Steps to Reproduce: 1. create an LVM pool in libvirt 2. manually add a volume using the lvcreate "--virtualsize" option 3. refresh the pool Actual results: error : virStorageBackendVolOpenCheckMode:1020 : cannot open volume '/dev/xxx/[yyy_vorigin]': No such file or directory Expected results: Addition of the sparse LVM volume to the pool's volume list, ignoring the existence of the virtual volume. Additional info: Patch attached
Hi Ryan, If you haven't already, would you mind submitting your patch to the upstream list (libvir-list) for discussion? Thanks, Dave
Fixed upstream by: commit d26b73ca2b1c35957b3c709a6cd9b3fd6a3d332a Author: Osier Yang <jyang> AuthorDate: 2011-11-18 19:15:10 +0800 Commit: Osier Yang <jyang> CommitDate: 2011-11-21 11:26:54 +0800 storage: Skips backingStore of virtual snapshot lv lvs outputs "[$lvname_vorigin]" for the virtual snapshot lv (created with "--virtualsize"), and the original device pointed by "$lvname_vorigin" is just for lvm internal use, one should never use it. Per lvm's nameing rules, "[" is not valid as part of the vg/lv name. (man 8 lvm). <quote> VALID NAMES The following characters are valid for VG and LV names: a-z A-Z 0-9 + _ . - VG and LV names cannot begin with a hyphen. There are also various reserved names that are used internally by lvm that can not be used as LV or VG names. A VG cannot be called anything that exists in /dev/ at the time of creation, nor can it be called '.' or '..'. A LV cannot be called '.' '..' 'snapshot' or 'pvmove'. The LV name may also not con‐ tain the strings '_mlog' or '_mimage' </quote> So we can skip the set the lv's backingStore by checking if the name begins with a "[". git describe: v0.9.7-109-gd26b73c contains: v0.9.8-rc1~123