Difference between revisions of "Virtualization"

From RCS Wiki
Jump to navigation Jump to search
(Add links to more documentation)
(Link to page size)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
===Running 64KiB guests on 4KiB hosts===
 
+
When trying to start a VM on a host running with [[Page size|4KiB pages]], you might see the following error message:
===Running 64k guests on 4k hosts===
 
When trying to start a VM on a host running with 4k pages, you might see the following error message:
 
  
 
<nowiki>qemu-system-ppc64: Can't support 64 kiB guest pages with 4 kiB host pages with this KVM implementation</nowiki>
 
<nowiki>qemu-system-ppc64: Can't support 64 kiB guest pages with 4 kiB host pages with this KVM implementation</nowiki>
  
There is an easy workaround for this. If running QEMU directly, add the argument <code>-machine pseries,cap-hpt-max-page-size=4096</code>. If running QEMU via libvirt, add the following section to the guest's libvirt XML (via <code>virsh edit [guest name]</code> or the XML tab in virt-manager):
+
There is an easy workaround for this. If running QEMU directly, add the argument <code>-machine pseries,cap-hpt-max-page-size=4096</code>. If running QEMU via libvirt, add the following section<ref>https://gitlab.com/libvirt/libvirt/-/issues/227#note_705948269</ref> to the guest's libvirt XML (via <code>virsh edit [guest name]</code> or the XML tab in virt-manager):
 
  <nowiki>
 
  <nowiki>
 
   <features>
 
   <features>
Line 12: Line 10:
 
       <maxpagesize unit='KiB'>4</maxpagesize>
 
       <maxpagesize unit='KiB'>4</maxpagesize>
 
     </hpt>
 
     </hpt>
 +
  </features></nowiki>
 +
 +
===Nested KVM===
 +
 +
In order to be able to run nested KVM, two things must be satisfied:
 +
 +
# The <code>kvm_hv</code> kernel module must be loaded with the <code>nested=1</code> module argument
 +
# The L1 guest must be started with <code>-machine pseries,cap-nested-hv=on</code> as argument to qemu.  If running qemu via libvirt, add the following XML fragment to the XML:
 +
<nowiki>
 +
  <features>
 +
    <nested-hv state="on"/>
 
   </features></nowiki>
 
   </features></nowiki>
  

Latest revision as of 22:07, 17 May 2023

Running 64KiB guests on 4KiB hosts

When trying to start a VM on a host running with 4KiB pages, you might see the following error message:

qemu-system-ppc64: Can't support 64 kiB guest pages with 4 kiB host pages with this KVM implementation

There is an easy workaround for this. If running QEMU directly, add the argument -machine pseries,cap-hpt-max-page-size=4096. If running QEMU via libvirt, add the following section[1] to the guest's libvirt XML (via virsh edit [guest name] or the XML tab in virt-manager):

  <features>
    <hpt>
      <maxpagesize unit='KiB'>4</maxpagesize>
    </hpt>
  </features>

Nested KVM

In order to be able to run nested KVM, two things must be satisfied:

  1. The kvm_hv kernel module must be loaded with the nested=1 module argument
  2. The L1 guest must be started with -machine pseries,cap-nested-hv=on as argument to qemu. If running qemu via libvirt, add the following XML fragment to the XML:
  <features>
    <nested-hv state="on"/>
  </features>

Further Information

  • https://gitlab.com/libvirt/libvirt/-/issues/227#note_705948269