R&D/Hypervisor

vCPU hotplug automation

sunshout 2014. 4. 29. 09:29

then CPUs are correctly added to system.

All you need to do now is write to corresponding sysfs nodes to bring those CPUs online.

To automate this process, simply create a `cpu-online.rules` under /etc/udev/rules.d in target domain and tell udev to reload its rules with udevadm control --reload-rules (or restart udevd).

Content of `cpu-online.rules`:

SUBSYSTEM=="cpu",ACTION=="add",RUN+="/bin/sh -c '[ ! -e /sys$devpath/online ] || echo 1 > /sys$devpath/online'"