Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17788

[Spacewalk 2.3] [CentOS7] VMs created from spacewalk are being created as QEMU and not KVM.

$
0
0

This is really just a copy/paste from my mailing to the Spacewalk mailing list, but I figured a wider audience might help with what seems like kind of an odd issue. I am working on the mythical /u/IConrad list, but I elected to roll with Cent7 because I am trying to get fluent in Cent7 as well. I am working on auto-prov with Spacewalk, but VMs are being created as QEMU (Not hardware virtualization) instead of KVM. The virt-install command being run is specifying the --virt-type qemu. If the install process didn't take 95 minutes for a QEMU VM as opposed to 5-10 in a KVM VM, I might be more likely to just change them to KVM afterward. Anyway, here is the full expanded version:

To preface this, I hit a couple different errors along the way here I wanted to bring up and see if I am missing something, or if I need to file a bug, or there is one and I can't find it. Also just to note, I understand the difference between QEMU and KVM here, these are being made as QEMU non-hardware virtual machines as opposed to proper KVM VMs. The system is a PE2950 III and is more than capable of running VMs, it is not a hardware limitation.

VM of CentOS7 with Spacewalk 2.3 installed with cobbler and the rest. I have my KVM host registered to the Spacewalk server, the KVM host is also CentOS7. The virtualization tab shows up, I am able to provision new VMs, they push to the KVM host and start installing. The installs are successful. Unfortunately the installs take 90+ minutes because the VMs are being requested with --virt-type qemu

I synced the CentOS7 packages and trees initially using spacewalk-common-channels, had to renamed the repository as the name had parenthesis in it, and defining the distribution, if the tree path had parenthesis, it would remove them when attempting to save. Also, the default label is not acceptable, but more easily fixed. The tree path required a change to the repository name, then another sync, then manual removal of the old tree path.

I created a kickstart profile, the profile has Virtualization type "KVM Virtualized Guest" selected. This is going to be kickstarted on KVM. I don't see a good text way to dump my kickstart config and also show the virtualization I have chosen. Cobbler though has the profile for this:

# cobbler profile dumpvars --name CentOS_7-KVM:1:SpacewalkDefaultOrganization | grep -i virt_type default_virt_type : kvm virt_type : qemu 

Also the system's config itself:

# cobbler system dumpvars --name node2.internal.mriswithe.com:1:test_machine | grep -i virt_type default_virt_type : kvm virt_type : qemu 

Of note at this point, is that koan will fail to run if I am running the current version of virt-install. I am running:

virt-install-0.10.0-20.el7.noarch 

Whereas the current is:

virt-install-1.1.0-12.el7.noarch 

If I do not run the older version of virt-install, the rhn_check process will error and provisioning will show as failed on the Spacewalk side. see this function/method:

https://github.com/cobbler/koan/blob/master/koan/app.py#L731-L741 

And this is what I see from an rhn_check -v on the KVM host after trimming out some irrelevant info:

- reading URL: http://spacewalk.internal.mriswithe.com/cblr/svc/op/ks/system/node2.internal.mriswithe.com:1:test_machine install_tree: http://spacewalk.internal.mriswithe.com/ty/J42MEZYS - ['/usr/bin/virt-install', '--version'] - ['virt-install', '--version'] - ['virt-install', '--os-variant', 'list'] - ['osinfo-query', 'os'] - ['qemu-img', 'create', '-f', 'raw', '/var/lib/libvirt/images/test_machine', '3G'] Formatting '/var/lib/libvirt/images/test_machine', fmt=raw size=3221225472 - adding disk: /var/lib/libvirt/images/test_machine of size 3 (driver type=raw) - ['virt-install', '--connect', 'qemu:///system', '--name', 'test_machine', '--ram', '1024', '--vcpus', '1', '--autostart', '--vnc', '--virt-type', 'qemu', '--machine', 'pc', '--hvm', '--location', 'http://spacewalk.internal.mriswithe.com/ty/J42MEZYS/', '--extra-args=ks=http://spacewalk.internal.mriswithe.com/cblr/svc/op/ks/system/node2.internal.mriswithe.com:1:test_machine ksdevice=link kssendmac lang= text ', '--arch', 'x86_64', '--os-variant', 'rhel7', '--disk', 'path=/var/lib/libvirt/images/test_machine,size=3,format=raw', '--network', 'bridge=bridge0.300,mac=00:16:3e:3b:d0:ba', '--wait', '0', '--noautoconsole'] 

Note, it does go on to create the VM, but that is irrelevant. The install will complete, after roughly 95 minutes. If I create a VM and just pxe boot it with a MAC that a system has been created with, it will install in under 10 minutes start to finish.

The settings I am seeing here and unable to change after hours of google and documentation and just brute force searching the filesystem (and a small amount of spelunking in the database).

'--virt-type', 'qemu' '--disk', 'path=/var/lib/libvirt/images/test_machine,size=3,format=raw' 

I would like to use proper KVM hardware virtualization, and the QCOW format for my storage.

To show the difference here, this is the machine Spacewalk/Koan made:

# virsh dumpxml test_machine| grep domain\ type <domain type='qemu' id='15'> 

while this is one made in virt-manager:

# virsh dumpxml made_in_virt_manager | grep domain\ type <domain type='kvm' id='16'> 

Is there somewhere where I can define these settings so that it doesn't assume settings I don't want?

*Edit: Formatting

submitted by mriswithe
[link][comment]

Viewing all articles
Browse latest Browse all 17788

Trending Articles