Author Topic: [Help] Create virtual machine based on QEMU / KVM_HW  (Read 2896 times)

tle

  • Sr. Member
  • ****
  • Posts: 434
  • Karma: +47/-0
    • View Profile
    • Trung's Personal Website
[Help] Create virtual machine based on QEMU / KVM_HW
« on: March 29, 2020, 12:56:55 am »
I am trying to create virtual machine to run Ubuntu 18.04 PPC64LE with QEMU and KVM_HW module.

Below is my config:

Code: [Select]
<domain type="kvm">
  <name>ubuntu18.04</name>
  <uuid>f121409d-6da7-49f2-ba86-e8e87ee26398</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://ubuntu.com/ubuntu/18.04"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory>4194304</memory>
  <currentMemory>4194304</currentMemory>
  <vcpu>16</vcpu>
  <os>
    <type arch="ppc64le" machine="powernv">hvm</type>
    <boot dev="hd"/>
  </os>
  <cpu mode="custom" match="exact">
    <model>POWER9</model>
  </cpu>
  <clock offset="utc"/>
  <devices>
    <emulator>/usr/bin/qemu-system-ppc64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/root/.local/share/libvirt/images/ubuntu18.04.qcow2"/>
      <target dev="sdb" bus="sata"/>
    </disk>
    <disk type="file" device="cdrom">
      <target dev="sda" bus="scsi"/>
      <readonly/>
    </disk>
    <interface type="network">
      <source network="default"/>
      <mac address="52:54:00:16:bd:e5"/>
    </interface>
    <console type="pty"/>
    <graphics type="vnc" port="-1"/>
    <video>
      <model type="vga"/>
    </video>
  </devices>
</domain>

When I start the virtual machine, I got error:

Code: [Select]
Unable to complete install: 'internal error: qemu unexpectedly closed the monitor: 2020-03-29T05:54:00.894965Z qemu-system-ppc64: invalid chip model 'host' for powernv9 machine'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2089, in _do_async_install
    guest.installer_instance.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 542, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 491, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib64/python3.8/site-packages/libvirt.py", line 4034, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2020-03-29T05:54:00.894965Z qemu-system-ppc64: invalid chip model 'host' for powernv9 machine

which is a bit peculiar because my host is actually POWER9 and AFAIK the Sforza POWER9 that Raptor CS offers for Blackbird system does support PowerNV (I could confirm that by grepping for PowerNV in /proc/cpuinfo).

I would like to ask if anyone could give me guidance to troubleshoot this issue. Much thanks in advance
« Last Edit: March 29, 2020, 07:15:07 pm by tle »
Faithful Linux enthusiast

My Raptor Blackbird

MPC7500

  • Hero Member
  • *****
  • Posts: 574
  • Karma: +40/-1
    • View Profile
    • Twitter
Re: [Help] Create virtual machine based on QEMU / KVM_HW
« Reply #1 on: March 29, 2020, 09:17:13 am »
ClassicHasClass has written articles on Talospace about that.

tle

  • Sr. Member
  • ****
  • Posts: 434
  • Karma: +47/-0
    • View Profile
    • Trung's Personal Website
Re: [Help] Create virtual machine based on QEMU / KVM_HW
« Reply #2 on: March 31, 2020, 06:23:24 am »
Thanks for the reply.

I resolve the issue by using `pseries` as machine.
Faithful Linux enthusiast

My Raptor Blackbird

tle

  • Sr. Member
  • ****
  • Posts: 434
  • Karma: +47/-0
    • View Profile
    • Trung's Personal Website
Re: [Help] Create virtual machine based on QEMU / KVM_HW
« Reply #3 on: March 31, 2020, 06:24:39 am »
I also learn that packer does support building qemu virtual machine. And there are quite a number of templates available if you are lazy to bake your own.

Here is one https://github.com/osuosl/packer-templates
Faithful Linux enthusiast

My Raptor Blackbird