Bug 1012896

Summary: koan creates i386 guest even if the ks profile is for x86_64
Product: [Fedora] Fedora Reporter: Ken Sugawara <ksugawar>
Component: koanAssignee: Orphan Owner <extras-orphan>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 18CC: awood, extras-orphan, jeckersb, scott, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-30 09:07:58 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 Ken Sugawara 2013-09-27 10:42:02 UTC
Description of problem:
koan creates an i386 guest even if the install tree of the ks profile given is one for x86_64. As a result, the guest fails to install.


Version-Release number of selected component (if applicable):
koan-2.4.0-1.fc18.noarch
python-2.7.3-13.fc18.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Create a kickstart profile on Spacewalk or RHN Satellite for an x86_64 OS (rhel-x86_64-server-6 for instance)
2. Try to install an instance of the above profile with koan:

# koan --server=satellite.example.com --virt --profile=sample-profile:1:YourOrganization

3. 

Actual results:
Guest starts but fails to install.

# koan --server=sat.34x27.org --virt --profile=puppet-clients:1:RedHatConsultantsGPS-APAC
- looking for Cobbler at http://sat.34x27.org:80/cobbler_api
- reading URL: http://sat.34x27.org/cblr/svc/op/ks/profile/puppet-clients:1:RedHatConsultantsGPS-APAC
install_tree: http://sat.34x27.org/ks/dist/ks-rhel-x86_64-server-6-6.4
- ['qemu-img', 'create', '-f', 'raw', '/var/lib/libvirt/images//Fri_Sep_27_18_38_08_2013-disk0', '3G']
Formatting '/var/lib/libvirt/images//Fri_Sep_27_18_38_08_2013-disk0', fmt=raw size=3221225472 
- adding disk: /var/lib/libvirt/images//Fri_Sep_27_18_38_08_2013-disk0 of size 3 (driver type=raw)
- ['virt-install', '--connect', 'qemu:///system', '--name', 'Fri_Sep_27_18_38_08_2013', '--ram', '512', '--vcpus', '1', '--autostart', '--vnc', '--virt-type', 'qemu', '--machine', 'pc', '--hvm', '--extra-args=ks=http://sat.34x27.org/cblr/svc/op/ks/profile/puppet-clients:1:RedHatConsultantsGPS-APAC ksdevice=link kssendmac lang= text ', '--location', 'http://sat.34x27.org/ks/dist/ks-rhel-x86_64-server-6-6.4/', '--arch', 'i386', '--os-variant', 'generic26', '--disk', 'path=/var/lib/libvirt/images//Fri_Sep_27_18_38_08_2013-disk0,size=3,format=raw', '--network', 'bridge=virbr0', '--wait', '0', '--noautoconsole']

Note the '--arch i386' argument given to virt-install above.

Expected results:
Ideally, koan should extract the architecture from the URI to the kickstart tree, or at least there should be a way to instruct koan to create a 64-bit guest instead of 32-bit one (or maybe it should defaults to creating 64-bit guests since 64-bit guests should be able to run and install 32-bit OSes?).


Additional info:
I took a look at koan source and straced it. It does not seem to get the arch by running 'uname -m' as written in the app.py, which implies that it sets ANCIENT_PYTHON to 1 whereas the actual python version is not quite ancient (2.7.3-13.fc18). Maybe the way app.py detects ancient versions of python no longer works with newer python versions?

Comment 1 Ken Sugawara 2013-09-30 09:07:58 UTC
I've been doing some diggin' on this, and it turns out this is not a koan bug, but there is a dict entry 'arch':'i386' in the profile data koan receives from cobbler via xmlrpc (that happens to be Satellite 5.4).

Now I have to figure out how to override this parameter for my guest profile...