Go to file
Alexandre Derumier 4d3f29edd4 memory hotplug patch v10
This patch allow to hotplug memory dimm modules
though a new option : dimm_memory

The dimm modules are generated from a map

     dimmid       size  dimm_memory
     dimm0        512        512     100.00 0
     dimm1        512       1024      50.00 1
     dimm2        512       1536      33.33 2
     dimm3        512       2048      25.00 3
     dimm4        512       2560      20.00 0
     dimm5        512       3072      16.67 1
     dimm6        512       3584      14.29 2
     dimm7        512       4096      12.50 3
     dimm8        512       4608      11.11 0
     dimm9        512       5120      10.00 1
    dimm10        512       5632       9.09 2
    dimm11        512       6144       8.33 3
    dimm12        512       6656       7.69 0
    dimm13        512       7168       7.14 1
    dimm14        512       7680       6.67 2
    dimm15        512       8192       6.25 3
    dimm16        512       8704       5.88 0
    dimm17        512       9216       5.56 1
    dimm18        512       9728       5.26 2
    dimm19        512      10240       5.00 3
    dimm20        512      10752       4.76 0
    ...

   dimm241      65536    3260416       2.01 1
   dimm242      65536    3325952       1.97 2
   dimm243      65536    3391488       1.93 3
   dimm244      65536    3457024       1.90 0
   dimm245      65536    3522560       1.86 1
   dimm246      65536    3588096       1.83 2
   dimm247      65536    3653632       1.79 3
   dimm248      65536    3719168       1.76 0
   dimm249      65536    3784704       1.73 1
   dimm250      65536    3850240       1.70 2
   dimm251      65536    3915776       1.67 3
   dimm252      65536    3981312       1.65 0
   dimm253      65536    4046848       1.62 1
   dimm254      65536    4112384       1.59 2
   dimm255      65536    4177920       1.57 3

max dimm_memory size is 4TB, which is the current qemu limit

If the dimm_memory value is not aligned on memory module, we align the dimm_memory on the next module.

vmid.conf
---------
memory: 1024
numa:1
hotplug: memmory

when hotplug memory option is enabled, the minimum memory value must be 1GB, and also numa need to be enabled.

we assign the first 1GB as static memory, splitted on each numa nodes.
The remaining memory is assigned on hotpluggable dimm devices.

The static memory need to be also 128MB aligned, to have other dimm devices aligned too.

This 128MB alignment is a linux limitation, windows can align on 2MB size.

Numa need to be aligned, as linux guest don't boot on some setup with multi sockets,
and windows need numa to be able to hotplug memory

hotplug
----
qm set <vmid> -memory X    (where X is bigger than current value)

unplug (not yet implemented in qemu)
------
qm set <vmid> -memory X  (where X is lower than current value)

linux guest
-----------
-acpi hotplug module should be loaded in guest
-need a recent kernel. (tested with 3.10)

can be enable automaticaly, adding:

/lib/udev/rules.d/80-hotplug-cpu-mem.rules
SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", \
 ATTR{online}="1"

SUBSYSTEM=="memory", ACTION=="add", TEST=="state", ATTR{state}=="offline", \
 ATTR{state}="online"

windows guest
-------------

tested with:

- windows 2012 standard
- windows 2008 enterprise/datacenter

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-01-28 07:06:37 +01:00
PVE memory hotplug patch v10 2015-01-28 07:06:37 +01:00
.gitignore use better name for build dir 2011-08-24 11:08:33 +02:00
changelog.Debian bump version to 3.3-13 2015-01-27 12:39:48 +01:00
control.in auto generate uuid on VM create 2014-06-26 11:51:52 +02:00
copyright change license to AGPL3 2011-08-24 10:07:52 +02:00
gen-vmconf-pod.pl use warnings instead of global -w flag 2013-10-01 13:14:49 +02:00
Makefile bump version to 3.3-13 2015-01-27 12:39:48 +01:00
pcitest.pl use warnings instead of global -w flag 2013-10-01 13:14:49 +02:00
postinst Fix startup order 2011-08-30 15:11:54 +02:00
postrm imported from svn 'qemu-server/pve2' 2011-08-23 07:47:04 +02:00
pve-bridge vmconfig_hotplug_pending : add update_net 2015-01-07 06:43:11 +01:00
pve-bridgedown add pve-bridgedown script 2014-05-08 08:37:04 +02:00
pve-q35.cfg enable q35 machine support 2014-06-18 06:03:53 +02:00
pve-usb.cfg imported from svn 'qemu-server/pve2' 2011-08-23 07:47:04 +02:00
qemu.init.d removed startall/stopall commands 2012-04-20 09:30:42 +02:00
qm implement API/CLI to get pending changes 2015-01-07 06:42:55 +01:00
qmextract use warnings instead of global -w flag 2013-10-01 13:14:49 +02:00
qmrestore use warnings instead of global -w flag 2013-10-01 13:14:49 +02:00
qmupdate use warnings instead of global -w flag 2013-10-01 13:14:49 +02:00
sparsecp.c use correct format to print time_t (%zd) 2012-02-13 11:22:03 +01:00
utils.c fix bug in vmtar 2012-10-25 10:01:24 +02:00
vmtar.c fix bug in vmtar 2012-10-25 10:01:24 +02:00