Bug 824253

Summary: manpage: document limitations on identifying domains with numeric names
Product: Red Hat Enterprise Linux 6 Reporter: dyuan
Component: libvirtAssignee: Gunannan Ren <gren>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, berrange, bili, dallan, dyasny, jdenemar, lnovich, mzhan, pkrempa, pschiffe, rwu
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.10.2-10.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:15:21 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: 851047, 881827    

Description dyuan 2012-05-23 05:23:20 UTC
Description of problem:
Intend to destroy a domain named "001", but the domain whose id is "1" was destroyed.

Version-Release number of selected component (if applicable):
libvirt-0.9.10-20.el6

How reproducible:
always

Steps to Reproduce:
1. # virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     xp                              running
 2     001                            running

2. # virsh destroy 001
Domain 001 destroyed

3. # virsh list --all
 Id    Name                           State
----------------------------------------------------
 -      xp                              shut off
 2     001                            running
 
4. # virsh destroy 001
Domain 001 destroyed

5. # virsh list --all
 Id    Name                           State
----------------------------------------------------
 -      xp                              shut off
 -     001                             shut off

Actual results:
I can't specify the "001" is for domain name or domain id,
I didn't want to destroy the "xp" but it's destroyed by default.

Expected results:
Can specify the option for command such as "destroy", "shutdown"

Additional info:

Comment 1 Daniel Berrangé 2012-05-23 10:55:43 UTC
This is a known limitation of virsh, which we can't do anything about. If you have named your guests soley using numeric digits, then you can only use ID numbers or UUID to refer to them unambiguously.

Comment 2 Daniel Berrangé 2012-05-23 10:56:11 UTC
We should document this limitation in the man page if it isn't already present.

Comment 3 Dave Allan 2012-10-01 21:05:49 UTC
commit 13c69cd0b446669dc53417cb5207c51167a9c14f
Author: Dave Allan <dallan>
Date:   Mon Oct 1 14:01:36 2012 -0400

    Add note about numeric domain names to manpage
    
    Clarify that domains with numeric names can only be identified by
    their domain id.

Comment 4 Jiri Denemark 2012-10-08 18:16:06 UTC
The last rebase to libvirt-0.10.2 was completed and all patches need
to be explicitly backported and sent to rhvirt-patches for review.
Please, set bugs to POST only after sending the backported patches.

Comment 7 Dave Allan 2012-11-20 01:43:22 UTC
Guannan, does 13c69cd0b446669dc53417cb5207c51167a9c14f backport cleanly?

Comment 11 EricLee 2012-11-28 07:38:34 UTC
Verified this bug in libvirt-0.10.2-10.el6:

# man virsh:
....
       The basic structure of most virsh usage is:

         virsh [OPTION]... <command> <domain> [ARG]...

       Where command is one of the commands listed below; domain is the numeric domain id, or the domain name,
       or the domain UUID; and ARGS are command specific options.  There are a few exceptions to this rule in
       the cases where the command in question acts on all domains, the entire machine, or directly on the xen
       hypervisor.  Those exceptions will be clear for each of those commands.  Note: it is permissible to give
       numeric names to domains, however, doing so will result in a domain that can only be identified by
       domain id. In other words, if a numeric value is supplied it will be interpreted as a domain id, not as
       a name.

       The virsh program can be used either to run one COMMAND by giving the command and its arguments on the
       shell command line, or a COMMAND_STRING which is a single shell argument consisting of multiple COMMAND
....

And can reproduce it with libvirt-0.2-10.9.el6:
# man virsh
...
       The basic structure of most virsh usage is:

         virsh [OPTION]... <command> <domain> [ARG]...

       Where command is one of the commands listed below, domain is the numeric domain id, or the domain name,
       or the domain UUID and ARGS are command specific options.  There are a few exceptions to this rule in
       the cases where the command in question acts on all domains, the entire machine, or directly on the xen
       hypervisor.  Those exceptions will be clear for each of those commands.

       The virsh program can be used either to run one COMMAND by giving the command and its arguments on the
       shell command line, or a COMMAND_STRING which is a single shell argument consisting of multiple COMMAND
...

So changing to VERIFIED.

Comment 12 errata-xmlrpc 2013-02-21 07:15:21 UTC
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