From d14e3f5d974b93d40e89ba56fa005fe6b1042285 Mon Sep 17 00:00:00 2001 From: Julien Escario Date: Wed, 29 Sep 2021 08:41:31 +0200 Subject: [PATCH] Added udev rules file to hot add cpu on QEMU hardware --- cloud-init/41-qemu-hot-add-cpu.rules | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cloud-init/41-qemu-hot-add-cpu.rules diff --git a/cloud-init/41-qemu-hot-add-cpu.rules b/cloud-init/41-qemu-hot-add-cpu.rules new file mode 100644 index 0000000..4a2f35e --- /dev/null +++ b/cloud-init/41-qemu-hot-add-cpu.rules @@ -0,0 +1,14 @@ +# On QEMU/KVM machines we want to add memory and cpus as soon as they appear +# As of 2021-09-29, the file 40-vm-hotadd.rules does exactly the same thing for Xen and Hyper-V +ATTR{[dmi/id]sys_vendor}=="QEMU", GOTO="vm_hotadd_apply" +GOTO="vm_hotadd_end" + +LABEL="vm_hotadd_apply" + +# Memory hotadd request +SUBSYSTEM=="memory", ACTION=="add", DEVPATH=="/devices/system/memory/memory[0-9]*", TEST=="state", ATTR{state}!="online", ATTR{state}="online" + +# CPU hotadd request +SUBSYSTEM=="cpu", ACTION=="add", DEVPATH=="/devices/system/cpu/cpu[0-9]*", TEST=="online", ATTR{online}!="1", ATTR{online}="1" + +LABEL="vm_hotadd_end"