Bug 673499
| Summary: | Some virsh vol-* commands require the pool option, but don't indicate this when they fail | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Justin Clift <jclift> |
| Component: | libvirt | Assignee: | Osier Yang <jyang> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 6.0 | CC: | dallan, dyuan, eblake, jyang, kwade, mzhan, rwu, syeghiay, whuang, xen-maint, yupzhang, zpeng |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
No documentation needed.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-06-20 06:25:57 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Ugh. Typo in the "Description of problem". Where is says "If the vol-path IS given... " it should be "ISN'T given". :( This is NOTABUG, as there are multiple ways to lookup a volume, 1) virStorageVolLookupByName, 2) virStorageVolLookupByPath, 3) virStorageVolLookupByKey, only 1) needs a pool as argument, the other 2 only just need a connection to hypervisor, as another argument of them is global uniq (key/path). So if no "--pool" is specified, "vol-path" and "vol-dumpxml" will try to get the volume with methods 2) or 3). Means "--pool" is not necessary. Hey Osier, When did it start checking for a volume in the available pools, before returning an error? For example, with the version I'd filed the bug against, doing "vol-path myrh6" would give an error, as there wasn't enough info available for it to figure out where to check. I guess by "So if no "--pool" is specified, "vol-path" and "vol-dumpxml" will try to get the volume with methods 2) or 3)." you're meaning it will now check for "myrh6" in all of the available pools, then provide info for first match or something. Is that correct? (In reply to comment #8) > Hey Osier, > > When did it start checking for a volume in the available pools, before > returning an error? > > For example, with the version I'd filed the bug against, doing "vol-path myrh6" > would give an error, as there wasn't enough info available for it to figure out > where to check. That's because 'myrh6' is neither a path nor a key, but a name relative to a pool. > > I guess by "So if no "--pool" is specified, "vol-path" and "vol-dumpxml" will > try to get the volume with methods 2) or 3)." you're meaning it will now check > for "myrh6" in all of the available pools, then provide info for first match or > something. No, to date, we've never had virsh look for myrh6 in all the available pools (although that might be a nice feature enhancement, if we can find a single volume named myrh6 among all the pools; while still failing if myrh6 is ambiguous between multiple pools). IMO we should just add a suggestion to the failure message as we do for some others: "perhaps you need to specify --pool?" Yeah, adjusting the failure message seems like the simplest option. Eric's sounds more user friendly though, as it lets people "type less" and still get the result they want (when it's deterministic). ;) <snip> No, to date, we've never had virsh look for myrh6 in all the available pools (although that might be a nice feature enhancement, if we can find a single volume named myrh6 among all the pools; while still failing if myrh6 is ambiguous between multiple pools). </snip> @Eric, Am I missed something? It looks to me it looks up all pools indeed. See storageVolumeLookupByPath and storageVolumeLookupByKey. Patch posted to upstream http://www.redhat.com/archives/libvir-list/2011-September/msg00803.html patch committed to upstream. Verify this bug with libvirt-0.9.9-0rc1.el6.x86_64 # virsh vol-list default Name Path ----------------------------------------- q2.img /var/lib/libvirt/images/q2.img # virsh vol-path q2.img error: failed to get vol 'q2.img', specifying --pool might help error: Storage volume not found: no storage vol with matching path # virsh vol-path q2.img --pool default /var/lib/libvirt/images/q2.img # rpm -q libvirt libvirt-0.9.9-0rc1.el6.x86_64
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
No documentation needed.
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-2012-0748.html |
Description of problem: We received a report from a RHEL 6 user, that some virsh vol-* commands are _failing_ without a useful error message when the "--pool <name>" option isn't specified. For example: virsh # vol-list guests Nom Chemin ----------------------------------------- myrh6 /dev/vg_guests/myrh6 myrh6-2 /dev/vg_guests/myrh6-2 virsh # vol-path myrh6 erreur :impossible de récupérer le volume 'myrh6' erreur :Storage volume not found: no storage vol with matching path If the vol-path command is given the "--pool guests" option (for this example), then the correct information is returned. The problem here is the vol-path seems to actually require the pool name, but isn't communicating this when it errors out. Version-Release number of selected component (if applicable): libvirt 0.8.1-27.el6 How reproducible: Every time. Steps to Reproduce: 1. Create a persistent LVM storage pool in libvirt, then add a storage volume to it (refresh if needed) 2. Run "vol-path" on the storage volume, leaving off the "--pool" option Error occurs here. Actual results: As described in the problem description. Expected results: A more informative error message should occur, indicating the requirement for the pool name Additional info: This problem was reported to occur in both the vol-path command, and vol-dumpxml commands. It may also occur on others (untested). Also note, the pool type being used was LVM. Other pool types were untested.