stackhpc / ansible-role-libvirt-vm

This role configures and creates VMs on a KVM hypervisor.
128 stars 67 forks source link

Can't detect path to qemu-system-x86_64 #22

Closed tekenny closed 5 years ago

tekenny commented 5 years ago

This might be a config problem on my hypervisor but haven't determined why qemu-system-x86_64 does not exist.

Attached are my simple playbook that fails and the output.

Any insights or suggestions on the cause are appreciated.

makeVM.yml.txt

makeVM.output.txt

markgoddard commented 5 years ago

How have you installed libvirt and qemu? What emulator would you expect to use?

tekenny commented 5 years ago

I should have mentioned that this is on an x86_64 RHEL 7.6 system and I used the attached playbook using your stackhpc.libvirt-host role. Thanks for these roles btw. I was creating an x86_64 VM.

I tried to work around the issue by adding "ignore_errors: yes" in autodetect.yml (after line 52) and it did proceed further but failed at the "Ensure the VM is defined" task stating "XML error: No PCI buses available"

Sorry but I don't know kvm/qemu that well so I don't know what may be missing or mis-configured.

kvm.yml.txt

markgoddard commented 5 years ago

I'm not sure that this has been tested on RHEL yet, only CentOS and Ubuntu.

Are you aiming to use KVM rather than qemu? Your initial makeVM.yml has libvirt_vm_engine: qemu. If you want hardware virtualisation I'd expect that to be kvm. If you ran the libvirt-host role and it detected hardware virtualisation is available, it won't install the qemu software virtualisation packages that provide the qemu-system-x86_64 emulator. I'd suggest setting libvirt_vm_engine: kvm.

markgoddard commented 5 years ago

Or you can leave it unset, and it should autodetect.

tekenny commented 5 years ago

I reinstalled the role and used libvirt_vm_engine: kvm as well as not set it and this issue did not exist. So this issue was due to me specifying the wrong engine. Sorry about that and thanks for pointing it out and for the great kvm roles!

I still have a No PCI buses issue but I see that the virsh create is failing and the XML generated look fine to me.

Thanks again for your help!

markgoddard commented 5 years ago

Great, glad to hear it helped.