Bug 824253 - manpage: document limitations on identifying domains with numeric names
manpage: document limitations on identifying domains with numeric names
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Gunannan Ren
Virtualization Bugs
: FutureFeature
Depends On:
Blocks: 851047 881827
  Show dependency treegraph
 
Reported: 2012-05-23 01:23 EDT by dyuan
Modified: 2013-02-21 02:15 EST (History)
11 users (show)

See Also:
Fixed In Version: libvirt-0.10.2-10.el6
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:15:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description dyuan 2012-05-23 01:23:20 EDT
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 Berrange 2012-05-23 06:55:43 EDT
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 Berrange 2012-05-23 06:56:11 EDT
We should document this limitation in the man page if it isn't already present.
Comment 3 Dave Allan 2012-10-01 17:05:49 EDT
commit 13c69cd0b446669dc53417cb5207c51167a9c14f
Author: Dave Allan <dallan@redhat.com>
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 14:16:06 EDT
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-19 20:43:22 EST
Guannan, does 13c69cd0b446669dc53417cb5207c51167a9c14f backport cleanly?
Comment 11 EricLee 2012-11-28 02:38:34 EST
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 02:15:21 EST
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

Note You need to log in before you can comment on or make changes to this bug.