Bug 497402

Summary: Kickstart UI Allows Invalid Virt Guest Name Characters
Product: Red Hat Satellite 5 Reporter: Devan Goodwin <dgoodwin>
Component: ProvisioningAssignee: Partha Aji <paji>
Status: CLOSED CURRENTRELEASE QA Contact: Steve Salevan <ssalevan>
Severity: medium Docs Contact:
Priority: urgent    
Version: 530CC: bperkins, cperry, skarmark
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:25:16 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:
Bug Depends On:    
Bug Blocks: 457075    

Description Devan Goodwin 2009-04-23 18:47:20 UTC
Description of problem:

Virt guest kickstarts can fail is the guest name specified in the UI has invalid characters.

Version-Release number of selected component (if applicable):

Satellite-5.3.0-RHEL5-re20090422.2-i386-embedded-oracle.iso

How reproducible:

100%

Steps to Reproduce:
1. Schedule a virt kickstart in the web UI.
2. Specify a guest name of ui-guest1
3.
  
Actual results:

rhn_check prints out:

D: handle_action actionid = 89, version = 2
D: do_call kickstart_guest.initiate ('rlx-0-18.rhndev.redhat.com', 'rlx-2-14.rhndev.redhat.com:1:ui-guest1', 'xenpv', 47, 'ui-guest1', 524288, 1, 5, 'xenbr0', '/var/lib/xen/rhel5-para-virt-guest', 'ks=http://rlx-0-18.rhndev.redhat.com/ty/SCxASL4v ksdevice=eth0 ')
- looking for Cobbler at http://rlx-0-18.rhndev.redhat.com/cobbler_api
- reading URL: http://rlx-0-18.rhndev.redhat.com/cblr/svc/op/ks/system/rlx-2-14.rhndev.redhat.com:1:ui-guest1
install_tree: http://rlx-0-18.rhndev.redhat.com:80/ty/j8PDFhRC
downloading initrd initrd.img to /var/lib/xen/initrd.img
url=http://rlx-0-18.rhndev.redhat.com/cobbler/images/ks-rhel-i386-server-5:xen/initrd.img
- reading URL: http://rlx-0-18.rhndev.redhat.com/cobbler/images/ks-rhel-i386-server-5:xen/initrd.img
downloading kernel vmlinuz to /var/lib/xen/vmlinuz
url=http://rlx-0-18.rhndev.redhat.com/cobbler/images/ks-rhel-i386-server-5:xen/vmlinuz
- reading URL: http://rlx-0-18.rhndev.redhat.com/cobbler/images/ks-rhel-i386-server-5:xen/vmlinuz
exceptions.ValueError
Domain name must be alphanumeric or _
  File "/usr/share/rhn/spacewalkkoan/spacewalkkoan.py", line 116, in initiate_guest
    k.run()
   File "/usr/lib/python2.4/site-packages/koan/app.py", line 296, in run
    self.virt()
   File "/usr/lib/python2.4/site-packages/koan/app.py", line 584, in virt
    return self.net_install(after_download)
   File "/usr/lib/python2.4/site-packages/koan/app.py", line 503, in net_install
    after_download(self, profile_data)
   File "/usr/lib/python2.4/site-packages/koan/app.py", line 582, in after_download
    self.virt_net_install(profile_data)
   File "/usr/lib/python2.4/site-packages/koan/app.py", line 1051, in virt_net_install
    virt_type     =  self.virt_type
   File "/usr/lib/python2.4/site-packages/koan/xencreate.py", line 104, in start_install
    guest.set_name(name)
   File "/usr/lib/python2.4/site-packages/virtinst/XenGuest.py", line 196, in set_name
    raise ValueError, "Domain name must be alphanumeric or _"

D: Sending back response (0, 'Guest kickstart initiated successfully.', {})
D: do_call packages.checkNeedUpdate ('rhnsd=1',)
D: Called refresh_rpmlist
Updating package profile
D: local action status:  (0, 'rpmlist refreshed', {})
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: May free Score board((nil))
[root@rlx-2-14 ~]# 



Expected results:

UI should reject guest name with - in them, probably worth testing other characters.


Additional info:

Also note the "guest kickstart initiated successfully". We believe this is causing confusion in the web UI as well, not sure if it should be handled as a separate bug or not.

Comment 1 Partha Aji 2009-05-01 18:35:08 UTC
I could not reproduce this... I  tried a couple of guest installs with guest name with hyphens...

Comment 2 Partha Aji 2009-05-01 20:09:31 UTC
Forgot to add a couple of details

# rpm -q python-virtinst
python-virtinst-0.300.2-12.el5

# rpm -q redhat-release
redhat-release-5Server-5.3.0.3

and no XenGuest.py found .. I wonder what version of python-virtinst dgoodwin used;...

Comment 3 Partha Aji 2009-05-01 20:12:10 UTC
]#  yum info python-virtinst
Loaded plugins: rhnplugin, security
Installed Packages
Name       : python-virtinst
Arch       : noarch
Version    : 0.300.2
Release    : 12.el5
Size       : 614 k
Repo       : installed
Summary    : Python modules for starting Xen guest installations
URL        : http://virt-manager.org/
License    : GPLv2+
Description: virtinst is a module to help in starting installations of Fedora/Red Hat Enterprise Linux related distributions
           : inside of virtual machines.  It supports both paravirt guests (for which only FC and RHEL guests are currently
           : supported) as well as fully virtualized guests.  It uses libvirt (http://www.libvirt.org) for starting things.
           : Also contained is a simple script virt-install which uses virtinst in a command line mode.

Comment 4 Steve Salevan 2009-05-15 19:28:09 UTC
The issue as reported is VERIFIED on the 5/7 ISO; however, you should be aware of the following issue, which is related:

https://bugzilla.redhat.com/show_bug.cgi?id=501065

Comment 5 Brandon Perkins 2009-09-10 19:25:16 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 therefore 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-2009-1434.html