Bug 1686794

Summary: can not provision VM on RHEL8 with satellite
Product: Red Hat Enterprise Linux 8 Reporter: Jan Hutař <jhutar>
Component: cobblerAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: jwboyer, kcarcia, rdrazny, tkasparek, tlestach, wchadwic
Target Milestone: rcKeywords: Regression
Target Release: 8.1Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cobbler-2.0.7.1-5-el8 rhn-tools-1.0-820190321094720.e122ddfa Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-21 11:27:44 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:
Bug Depends On: 1689252    
Bug Blocks: 1578342    

Description Jan Hutař 2019-03-08 10:25:25 UTC
Description of problem:
Can not provision VM on RHEL8 with Satellite. I think this consists of 2 issues:

D: do_call kickstart_guest.initiate('sat580.example.com', 'RHEL8_KVM_host:1:test2', 'qemu', 58, 'test2', 2048, 1, 5, 'virbr0', '/var/lib/libvirt/images/test2', ' '){'cache_only': None}
- looking for Cobbler at http://sat580.example.com/cobbler_api
--virt-type should be qemu, xenpv, xenfv, vmware, vmwarew, or auto but is kvm
D: Sending back response(1, 'Virtual kickstart failed. Koan error.', {'koan': '--virt-type should be qemu, xenpv, xenfv, vmware, vmwarew, or auto but is kvm'})

and if you overcome this (see "patch" below), then this:

- ['virt-install', '--connect', 'qemu:///system', '--name', 'test', '--ram', '2048', '--vcpus', '1', '--autostart', '--vnc', '--virt-type', 'kvm', '--machine', 'pc', '--extra-args=ks=http://sat580.example.com/cblr/svc/op/ks/system/RHEL8_KVM_host:1:test ksdevice=link lang= kssendmac text ', '--location', 'http://sat580.example.com/ty/7ruqSBLI/', '--os-variant', 'rhel8.0', '--disk', 'path=/var/lib/libvirt/images/test,size=5', '--network', 'bridge=virbr0,mac=00:16:3e:37:f1:64', '--wait', '0', '--noautoconsole']
ERROR    Error validating install location: Could not find an installable distribution at 'http://sat580.example.com/ty/7ruqSBLI/'

The location must be the root directory of an install tree.
See virt-install man page for various distro examples.
command failed (1)
D: Sending back response(1, 'Virtual kickstart failed. Koan error.', {'koan': 'command failed (1)'})


Version-Release number of selected component (if applicable):
[root@localhost ~]# rpm -qa | grep -e koan -e virt | sort
koan-2.0.7.1-2.module+el8+2757+b847be8a.noarch
libvirt-bash-completion-4.5.0-23.module+el8+2800+2d311f65.x86_64
libvirt-client-4.5.0-23.module+el8+2800+2d311f65.x86_64
libvirt-daemon-4.5.0-23.module+el8+2800+2d311f65.x86_64
libvirt-daemon-config-network-4.5.0-23.module+el8+2800+2d311f65.x86_64
libvirt-daemon-config-nwfilter-4.5.0-23.module+el8+2800+2d311f65.x86_64
libvirt-daemon-driver-interface-4.5.0-23.module+el8+2800+2d311f65.x86_64
[...]
libvirt-daemon-kvm-4.5.0-23.module+el8+2800+2d311f65.x86_64
libvirt-libs-4.5.0-23.module+el8+2800+2d311f65.x86_64
python3-koan-2.0.7.1-2.module+el8+2757+b847be8a.noarch
python3-libvirt-4.5.0-1.module+el8+2529+a9686a4d.x86_64
python3-rhn-virtualization-common-5.4.70-4.module+el8+2757+b847be8a.noarch
python3-rhn-virtualization-host-5.4.70-4.module+el8+2757+b847be8a.noarch
python3-spacewalk-koan-2.8.6-6.module+el8+2757+b847be8a.noarch
rhn-virtualization-host-5.4.70-4.module+el8+2757+b847be8a.noarch
spacewalk-koan-2.8.6-6.module+el8+2757+b847be8a.noarch
virt-install-2.0.0-4.el8.noarch
virt-manager-common-2.0.0-4.el8.noarch
virt-what-1.18-6.el8.x86_64


How reproducible:
always


Steps to Reproduce:
1. Sync RHEL and its KSs
2. Create kickstart profile with "KVM Virtualized Guest" virtualization type
3. Register KVM hypervisor and install rhn-virtualization-host package, add
   "Virtualization" entitlement to it
4. Attempt to provision a VM on the host
    Systems -> <kvm_host> -> Virtualization -> Provisioning
   select KS profile, fill in VM name and click "Schedule Kickstart and Finish"


Actual results:
See the first (and then the second) error above.


Expected results:
Should work, VM should be created


Additional info:
To workaround first issue, comment out this code:


--- /usr/lib/python3.6/site-packages/spacewalkkoan/spacewalkkoan.py.ORIG	2019-03-07 18:37:53.361329079 -0500
+++ /usr/lib/python3.6/site-packages/spacewalkkoan/spacewalkkoan.py	2019-03-07 18:49:10.366772611 -0500
@@ -229,12 +229,12 @@
         else:
             if os.path.exists(disk_path):
                 raise VirtDiskPathExistsError(disk_path)
-        # Switch to KVM if possible
-        if virt_type == "qemu":
-            if os.path.exists("/dev/kvm"):
-                virt_type = "kvm"
-            else:
-                print("Warning: KVM not available, using QEMU.")
+        ## Switch to KVM if possible
+        #if virt_type == "qemu":
+        #    if os.path.exists("/dev/kvm"):
+        #        virt_type = "kvm"
+        #    else:
+        #        print("Warning: KVM not available, using QEMU.")
         k = Koan()
         k.list_items          = 0
         k.server              = kickstart_host


Then code will go on and will fail on distro check (virt-manager-common package code differs on RHEL7 and RHEL8 - see '/usr/share/virt-manager/virtinst/installer.py' class 'Installer' method 'check_location') which can be fixed like this (on Satellite):


# cp /var/satellite/rhn/kickstart/ks-rhel-x86_64-baseos-8-8.0/treeinfo /var/satellite/rhn/kickstart/ks-rhel-x86_64-baseos-8-8.0/.treeinfo
# chown apache:apache /var/satellite/rhn/kickstart/ks-rhel-x86_64-baseos-8-8.0/.treeinfo

Comment 1 Tomas Lestach 2019-03-08 10:49:12 UTC
Michael, can you confirm this bug report is valid?
(I think we were able to successfully provision VMs on RHEL8.)

Is the problem in the client package?

Comment 2 Michael Mráka 2019-03-14 14:55:24 UTC
Yes, I can reproduce the issue. There are missing some patches from upstream koan (cobbler).

Comment 3 Michael Mráka 2019-03-15 14:18:29 UTC
The first issue has been fixed in upstream spacewalk cobbler.git by
commit 53b4932a705653c45228db287fc933a1288b5108
    support kvm type

The second issue is a regression in virt-install, see bug 1689252.

Comment 5 Michael Mráka 2019-03-21 13:14:06 UTC
Fixed in satellite.git CLIENT-RHEL-8
commit b3ac47f2e55a8b181df66cdc1409605663661a8b 
    1686794 - backported koan kvm support patch

Comment 7 Radovan Drazny 2019-03-21 13:22:12 UTC
Verified with cobbler-2.0.7.1-5-el8

Comment 10 Michael Mráka 2019-05-21 11:27:44 UTC
The bug has been addressed and released as a part of Red Hat Enterprise Linux 8 GA.