Bug 865237

Summary: RHN Registration fails with activation key defined via PXE
Product: Red Hat Enterprise Linux 6 Reporter: Nigel Jones <nigjones>
Component: ovirt-nodeAssignee: Joey Boggs <jboggs>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, bsarathy, cshao, gouyang, hadong, jbiddle, jboggs, jmoran, leiwang, mburns, mmello, nigjones, ovirt-maint, ycui
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-node-2.5.0-6.el6 Doc Type: Bug Fix
Doc Text:
Previously, attempting to register with the Red Hat Network using an activation key defined via PXE would cause the registration to fail. This has been corrected so that the registration works via PXE as normal.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-28 16:31:53 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:

Description Nigel Jones 2012-10-11 04:11:44 UTC
Description of problem:
Installing a hypervisor via PXE and the option rhn_activationkey=1-myactivationkey results in the failure to register to RHN/RHN Satellite.

Version-Release number of selected component (if applicable):
ovirt-node 2.3.0 + (based on code read) upstream ovirt-node

How reproducible:
100%

Steps to Reproduce:
1. Configure pxelinux.cfg/default with options similar to:

label r2
        KERNEL rhev-20120815/rhevh-vmlinuz
        APPEND rootflags=loop initrd=rhev-20120815/rhevh-initrd root=live:/rhevh-6.3-20120815.0.el6_3.iso rootfstype=auto ro liveimg nomodeset check rootflags=ro crashkernel=512M-2G:64M,2G-:128M elevator=deadline processor.max_cstate=1 rd_NO_LVM rd_NO_LUKS rd_NO_MD rd_NO_DM rdshell pci=bfsort upgrade storage_init=/dev/sda storage_vol=::::: ip=dhcp adminpw=[password] rhevm_admin_password=[password] rootpw=[password] management_server=rhevm.example.com mem_overcommit=1.0  ssh_pwauth=1 rhn_ca_cert=https://rhnsat.example.com/pub/RHN-ORG-TRUSTED-SSL-CERT rhn_url=https://rhnsat.example.com BOOTIF=eth0 rhn_activationkey=1-satdefault

2. Post install, examine /var/log/ovirt.log
3. Post install, try:

[root@lab2 admin]# python
Python 2.6.6 (r266:84292, May  1 2012, 13:52:17) 
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ovirtnode.ovirtfunctions import *
>>> from ovirt_config_setup.rhn import *
>>> rhn_auto()

  
Actual results:
/var/log/ovirt.log missing any references to RHN

& python resulting in:

>>> rhn_auto()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/ovirt_config_setup/rhn.py", line 358, in rhn_auto
KeyError: 'OVIRT_RHN_USERNAME'

Lastly, the system does not appear in RHN or Satellite.

Expected results:

Registration to succeed, and rhn_auto() to return True.

Additional info:

The issue appears to come down to the way we verify and check for presence of various variables during the registration process.

A patch/gerrit will be added once the bug number is generated, to ensure that this doesn't happen in other vague situations, I've implemented in a loop to set the non-present options, to "" & added a couple of comments for readability.

Comment 2 Nigel Jones 2012-10-11 04:23:25 UTC
Patch submitted to gerrit.ovirt.org: http://gerrit.ovirt.org/#/c/8481/

Comment 3 cshao 2012-10-11 10:50:42 UTC
Hi Nigjones,

I found there is no rhn_username + rhn_password in your parameters, both the rhn_username and rhn_password parameters must be provided.

There is a link for Red Hat Network (RHN) Parameters. 

http://documentation-devel.engineering.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Hypervisor_Deployment_Guide/sect-Deployment_Guide-RHEV_Hypervisor_Kernel_Parameters_and_Automated_Installation-RHN_parameters.html


RHEV-H QE test two builds with below auto parameters:
rhev-hypervisor6-6.3-20121010.2.el6_3
rhev-hypervisor6-6.3-20120815.0.el6_3

public RHN
1. auto install and register rhev-h to public rhn with rhn_username + rhn_password can successful, after reboot RHN status can show "RHN".
Search with activation key in rhn web page can find RHEV-H host.

BOOTIF=em1 storage_init=/dev/sda adminpw=[password] management_server=10.66.11.91 rhn_username=qa rhn_password=[password] rhn_activationkey=[key] firstboot 

2. without rhn_username + rhn_password parameters, register will fail.

BOOTIF=em1 storage_init=/dev/sda adminpw=[password] management_server=10.66.11.91  rhn_activationkey=[key] firstboot 

Satellite
1. auto install and register rhev-h to satellite with rhn_username + rhn_password can successful, after reboot RHN status can show "satellite".

BOOTIF=em1 storage_init=/dev/sda adminpw=[password] management_server=10.66.11.91 rhn_username=ycui rhn_password=[password] rhn_url=https://10.66.73.127 rhn_ca_cert=https://10.66.73.127/pub/RHN-ORG-TRUSTED-SSL-CERt rhn_activationkey=[key] firstboot 

2. without rhn_username + rhn_password parameters, register will fail.

BOOTIF=em1 storage_init=/dev/sda adminpw=[password] management_server=10.66.11.91 rhn_url=https://10.66.73.127 rhn_ca_cert=https://10.66.73.127/pub/RHN-ORG-TRUSTED-SSL-CERt rhn_activationkey=[key] firstboot 

Can you add username + password parameter and try again?

Thanks!

Comment 4 Mike Burns 2012-10-11 12:00:41 UTC
Either username/password or activation key should work.

Joey,  can you look at this patch upstream?

Comment 8 haiyang,dong 2012-10-27 11:29:26 UTC
Test version:
rhev-hypervisor6-6.4-20121015.1.el6
ovirt-node-2.5.0-7.el6_4.noarch

Tried:
1.BOOTIF=eth0 storage_init=/dev/sda rhn_activationkey=1-satdefault firstboot

Pass
2.BOOTIF=eth0 storage_init=/dev/sda rhn_activationkey=1-satdefault rhn_url= xxxx rhn_ca_cert=xxxxx firstboot

Pass
3.BOOTIF=eth0 storage_init=/dev/sda rhn_username=xxxxx rhn_password=xxxxx firstboot

Pass
4.BOOTIF=eth0 storage_init=/dev/sda rhn_username=xxxxx rhn_password=xxxxxx rhn_url=xxxxxx rhn_ca_cert=xxxx firstboot

Pass
So the issue has been fixed.

Comment 9 haiyang,dong 2012-12-27 07:09:37 UTC
re-test on version rhev-hypervisor6-6.4-20121212.1.el6 to try follow:
1.BOOTIF=eth0 storage_init=/dev/sda rhn_activationkey=1-satdefault firstboot

Pass
2.BOOTIF=eth0 storage_init=/dev/sda rhn_activationkey=1-satdefault rhn_url= xxxx rhn_ca_cert=xxxxx firstboot

Pass

so bug was fixed on this version.

Comment 11 errata-xmlrpc 2013-02-28 16:31:53 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/RHBA-2013-0556.html