Bug 221542 - Changes to python-virtinst have caused virt-install to reject a VM name that contains a hyphen
Summary: Changes to python-virtinst have caused virt-install to reject a VM name that ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python-virtinst
Version: 5.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 221664 (view as bug list)
Depends On: 221485
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-01-05 00:00 UTC by Nate Straz
Modified: 2009-12-14 21:09 UTC (History)
2 users (show)

Fixed In Version: RHEA-2008-0371
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 16:44:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
5.2 virtinst validation overhaul which fixes this issue (17.88 KB, application/octet-stream)
2008-01-03 22:26 UTC, Cole Robinson
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2008:0371 0 normal SHIPPED_LIVE python-virtinst enhancement and bug fix update 2008-05-20 13:36:35 UTC

Description Nate Straz 2007-01-05 00:00:59 UTC
I think this is something that should be fixed in RHEL5 too.

+++ This bug was initially created as a clone of Bug #221485 +++

Description of problem: Changes to
/usr/lib/python2.4/site-packages/virtinst/XenGuest.py have changed the behavior
of virt-install in a way that I find irritating.  Our Xen guests have a hyphen
in their names, but virt-install rejects any name that has a hyphen in it now. 
It was not this way in python-virtinst-0.95.0-1.fc6 , but it is so in
python-virtinst-0.98.0-1.fc6 .  I traced the error back to this chunk of
/usr/lib/python2.4/site-packages/virtinst/XenGuest.py : 

    def set_name(self, val):
        # FIXME: need some validation here
        if re.match("^[a-zA-Z0-9_]*$", val) == None:
            raise ValueError, "Domain name must be alphanumeric or _"

This is unfortunate, because this new code restricts virtual machine names to
alphanumeric characters and the underscore.  Now, a hyphen is a valid character
in a DNS A record (while an underscore character is not).  I like my Xen guest
OS domain names to match their DNS names for obvious reasons.  XenGuest.py
should allow any characters allowed in DNS names as a minimum.  

Version-Release number of selected component (if applicable):
python-virtinst-0.98.0-1.fc6


How reproducible: Try supplying a hyphenated name to virt-install, either on the
command line with the -n argument, or manually when virt-install prompts for a
name.  It will reject any name with a hyphen in it.  

Steps to Reproduce:
1. virt-install -n host-name


Actual results: ERROR:  Domain name must be alphanumeric or _


Expected results: Completed virt-install with no errors 


Additional info: There is a workaround: I created the virtual machine with an
underscore in the name instead of a hyphen.  After the virt-install process and
Kickstart were finished, I renamed the /etc/xen/host_name file to
/etc/xen/host-name.  Then I started the virtual machine and it is fine.

-- Additional comment from katzj on 2007-01-04 16:41 EST --
The regex is just a bit too restrictive.  You should be able to add - to it
without problems and I've done so in hg, will be in the next build.

Comment 1 Hugh Brock 2007-03-21 17:51:11 UTC
Fixed at
http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=aec5777422c0 . Be
nice to get it into 5.1...


Comment 2 Nate Straz 2007-06-18 17:55:39 UTC
Should have proposed this for 5.1 much earlier.  Is this getting pulled in already?

Comment 3 RHEL Program Management 2007-06-18 18:03:56 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 RHEL Program Management 2007-09-07 19:57:08 UTC
This request was previously evaluated by Red Hat Product Management
for inclusion in the current Red Hat Enterprise Linux release, but
Red Hat was unable to resolve it in time.  This request will be
reviewed for a future Red Hat Enterprise Linux release.

Comment 5 Cole Robinson 2007-10-24 14:25:35 UTC
*** Bug 221664 has been marked as a duplicate of this bug. ***

Comment 6 Cole Robinson 2007-11-06 15:29:09 UTC
As mentioned this fix is upstream and has been for awhile, so it should be easy
and low risk to bring in for RHEL5.2

Comment 7 Cole Robinson 2008-01-03 22:26:42 UTC
Created attachment 290794 [details]
5.2 virtinst validation overhaul which fixes this issue

Comment 8 Bill Burns 2008-01-03 23:52:15 UTC
Setting dev ack for Dan.


Comment 9 Cole Robinson 2008-01-07 20:43:25 UTC
Committed and built.

* Fri Jan 04 2008 Cole Robinson <crobinso> - 0.103.0-6.el5
- Validation and error message fixes across the board.
- (rhbz #201948 #249424 #372001 #221542)

Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
python-virtinst-0.103.0-6.el5             dist-5E-qu-candidate  crobinso

Comment 12 errata-xmlrpc 2008-05-21 16:44:40 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2008-0371.html



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