Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix proxmox mem hotplug, improve virtual hw support #2138

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

ioctl2
Copy link
Contributor

@ioctl2 ioctl2 commented Sep 17, 2022

Main changes:

  • Enables memory hot plug and hot remove in Proxmox VE (tested in version 7.2-7)
  • Fixes guest incorrect memory detection in Proxmox when memory hot plug is enabled for the VM. Without this fix, enabling mem hot plug would result in <1G of memory being seen by the guest, regardless of the amount (>1G) allocated for the VM.
  • Adds missing VirtualBox guest additions (CONFIG_VBOXGUEST=m). You will now see memory utilization in VirtualBox'es Performance Monitor.
  • Adds missing symbols for PCI/PCIe hot plug support on hypervisors where this feature is present (ACPI, SHPC, and native PCIe).
  • Enables support for virtio crypto device.

Tests performed:

[CPU hot plug was working previously; I tested it again to rule out unexpected behaviour.]

Proxmox VE 7.2-7:

  • MEM hotplug:
    -- ovmf+qxl+i440fx [acpi=y, kvm=y, qemu-guest=y] -> plug ok, remove ok
    -- ovmf+qxl+q35 [acpi=y, kvm=y, qemu-guest=y] -> plug ok, remove ok (not always possible when allotted mem <~4G)
  • CPU hotplug:
    -- ovmf+qxl+i440fx [acpi=y, kvm=y, qemu-guest=y] -> plug ok, remove ok
    -- ovmf+qxl+q35 [acpi=y, kvm=y, qemu-guest=y] -> plug ok, remove ok

VMWare Workstation 16.2.4 build-20089737:

  • MEM hotplug - hw compatibility set to 16.2.x - (with mem.hotadd = "TRUE" in the vmx): hot plug ok, hot unplug unsupported.
  • CPU hotplug - hw compatibility set to 16.2.x - (with vcpu.hotadd = "TRUE" in the vmx): hot plug ok, hot unplug unsupported.

Oracle VirtualBox Version 6.1.36 r152435 (Qt5.6.2):

  • Guest additions reported as 6.0.0 r127566] (when compiled on 2022SEP17 from dev branch)
  • MEM hot plug: Appears to still be unsupported by VirtualBox.
  • CPU hot plug:
    -- piix3/kvm/ee:vt-x: works, unplug doesn't
    -- ICH9/kvm/ee:vt-x: plug works, unplug doens't

VMWare ESXi 7.0 Update 3:

  • Virtual HW compatibility left as 'ESXi 5.5 virtual machine', OS set to rhel7, hotplug enabled for vm ->
    -- CPU hot plug ok, hot remove unsupported
  • Virtual HW compatibility left as 'ESXi 5.5 virtual machine', OS set to rhel7, hotplug enabled for vm ->
    -- MEM hot plug ok, hot remove unsupported

Untested / TODO:

QEMU - not tested - TODO - looking for community testers.
Hyper-V - not tested - TODO - looking for community testers.
-- I have only tested the changes on a Windows 10 21H2 host. The VMWare ESXi instance was virtualized inside VMWare Workstation.

This is my first PR for this project, so please do let me know what I can improve in future PRs. This took some research, and I'm not sure how much is expected in these PRs by way of reference and details. I'm happy to answer any questions you may have. And of course, happy to make changes if required.

@homeassistant
Copy link

Hi @ioctl2,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@ioctl2 ioctl2 marked this pull request as ready for review September 17, 2022 09:27
jens-maus added a commit to jens-maus/RaspberryMatic that referenced this pull request Sep 17, 2022
hotplug capabilities for the ova platform. Furthermore, compatibility to
VirtualBox is improved as well as enabling VirtIO based crypto devices.
This refs home-assistant/operating-system#2138
@ioctl2 ioctl2 changed the title Fixed proxmox mem hotplug, improved virtual hw support Fixe proxmox mem hotplug, improve virtual hw support Sep 18, 2022
@ioctl2 ioctl2 changed the title Fixe proxmox mem hotplug, improve virtual hw support Fix proxmox mem hotplug, improve virtual hw support Sep 18, 2022
@agners
Copy link
Member

agners commented Sep 19, 2022

CPU and Memory hot-plug and removal seems to work with libvirt/qemu. Virtual Machine Manager supports to change memory from the UI, however, for CPU I had to use the console:

virsh # setvcpus --count 2 HomeAssistant

I did use this vcpus section in the domain XML

  <vcpus>
    <vcpu id="0" enabled="yes" hotpluggable="no"/>
    <vcpu id="1" enabled="yes" hotpluggable="yes"/>
    <vcpu id="2" enabled="no" hotpluggable="yes"/>
    <vcpu id="3" enabled="no" hotpluggable="yes"/>
  </vcpus>

@agners agners merged commit eafbf61 into home-assistant:dev Sep 19, 2022
@ioctl2 ioctl2 deleted the hotplugfixes branch September 19, 2022 21:51
@agners agners added board/ova Open Virtual Appliance (Virtual Machine) REL-9 labels Oct 6, 2022
agners pushed a commit to agners/operating-system that referenced this pull request Oct 6, 2022
agners added a commit that referenced this pull request Oct 7, 2022
agners added a commit that referenced this pull request Mar 23, 2023
Drop PCIe hotplug since this causes network interfaces name changes
which aren't handled gracefully right now. People are left with no
network configuration.
agners added a commit that referenced this pull request Mar 23, 2023
Drop PCIe hotplug since this causes network interfaces name changes
which aren't handled gracefully right now. People are left with no
network configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board/ova Open Virtual Appliance (Virtual Machine) cla-signed REL-9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants