Commit Graph

463 Commits

Author SHA1 Message Date
Alexandre Derumier
8bcf3068eb forbid hot-unplug of virtioscsi + iothread drive
qemu (<=2.3) currently segfault on drive_del

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-04-01 06:16:16 +02:00
Alexandre Derumier
fc8b40fd5f add virtio-scsi iothread support
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-04-01 06:16:16 +02:00
Dietmar Maurer
a1b7d57901 delete trailing white spaces 2015-03-27 06:16:24 +01:00
Dietmar Maurer
a1511b3c42 cleanup: do not use regex 2015-03-27 06:15:01 +01:00
Alexandre Derumier
ee034f5c9c new scsihw_infos sub : code factorization
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-27 06:05:34 +01:00
Alexandre Derumier
2733141ce3 implement virtio-scsi-single hotplug
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-27 06:05:31 +01:00
Alexandre Derumier
6731a4cfa9 implement virtio-scsi-single
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-27 06:05:27 +01:00
Alexandre Derumier
22de899a80 implement virtio iothread hotplug
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-20 06:18:19 +01:00
Alexandre Derumier
51f492cd6d add virtio iothread option
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-20 06:18:15 +01:00
Alexandre Derumier
8ce30ddea0 unplug scsi controller if no more disk exist
we need to remove scsi controller, because live migration will crash,

as on migration target node, we'll start the vm without controller if no disk exist

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-19 06:55:03 +01:00
Alexandre Derumier
8bb5e28d50 add IvyBridge cpu model (qemu >= 2.3)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-19 06:50:27 +01:00
Alexandre Derumier
fc79e81353 add pci bridges by default for qemu > 2.3
pci bridge are not hot-unplugglable,
which can give us live migration problem,
if we hot-unplug a device on pcibridge 1 or 2, we don't create the pci bridge on target guest

and pci bridge hotplug is not working on all os (windows for example).

So it's better to always add them at startup.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-18 06:26:55 +01:00
Alexandre Derumier
6a33d44a91 enable cpu enforce
It wasn't working with 2.6.32,
now that 3.10 kernel is the default, we can enable it.

It's help to be sure that all cpu flags are supported by host && qemu,
to be sure that nothing break

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-17 08:58:14 +01:00
Alexandre Derumier
0da5a08cb4 enable kvm_pv_eoi cpuflag
Paravirtualized End-of-Interrupt Indication (PV-EOI)
Hosts and guests require two VM exits (context switches from a VM to a Hypervisor) for each interrupt:
one to inject the interrupt, and another to signal the end of the interrupt.

With pv_eoi , they can negotiate a paravirtualized end-of-interrupt feature and only require one switch per interrupt.
Number of exits is reduced by half for interrupt-intensive workloads,
such as incoming network traffic with a virtio network device.
This leads to significant reduction in host CPU utilization for such workloads.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-17 08:57:47 +01:00
Alexandre Derumier
117a041466 add kvm_pv_unhalt cpu flag
require pvticketlocks from kernel 3.12 (backported in redhat 3.10 kernel)

see:
http://lwn.net/Articles/493402/

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-17 08:57:32 +01:00
Alexandre Derumier
cfac0be43d enable hv_time hyperv-v enlightment
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-17 08:56:59 +01:00
Alexandre Derumier
8a054ffd81 enable hv_vapic hyperv enlightment
works fine now with rhel 7.1 kernel
https://bugzilla.redhat.com/show_bug.cgi?id=1091818

(It's wasn't working on newer intel xeon)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-17 08:56:51 +01:00
Alexandre Derumier
8f3f959d46 hv_spinlocks : use 0x1fff instead 0xffff
redhat use 0x1fff (8191)  vs 0xffff (65535)
This is the number of retries of spinlocks

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-17 08:56:36 +01:00
Alexandre Derumier
23f73120b7 add qemu_machine_feature_enabled sub
This sub compare current machine type to a specific version,
and return 1 if machinetype is bigger or equal to version

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-17 08:55:49 +01:00
Alexandre Derumier
eb06531726 always setup balloon polling interval.
we always need to enable pooling interval, because it doesn't seem to be setup with -machine option

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-09 08:30:32 +01:00
Alexandre Derumier
d7c8364b22 vmstatus : use vcpus if defined
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-09 08:22:05 +01:00
Dietmar Maurer
38babf816c Revert "balloon: use qom-get for guest balloon statistics V5"
This reverts commit 0ea19b9cf7.
2015-03-09 08:14:37 +01:00
Alexandre Derumier
0ea19b9cf7 balloon: use qom-get for guest balloon statistics V5
changelog:

we use MB, not bytes

$d->{balloon} = int($info->{stats}->{"stat-total-memory"}/1024/1024);
$d->{freemem} = int($info->{stats}->{"stat-free-memory"}/1024/1024);

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-06 10:19:28 +01:00
Alexandre Derumier
7a69fc3cd1 drive_add : escape \ character
storage.cfg
-----------
rbd mystorage
    monhost 10.5.0.11:6789; 10.5.0.12:6789; 10.5.0.13:6789

drive_add auto "file=rbd:poolceph1/vm-101-disk-8:mon_host=10.5.0.11\\:6789; 10.5.0.12\\:6789; 10.5.0.13\\:6789:id=admin:auth_supported=cephx:keyring=/etc/pve/priv/ceph/cephzimbra.keyring,if=none,id=drive-virtio2,aio=native,cache=none,detect-zeroes=on"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-06 10:19:09 +01:00
Alexandre Derumier
4cc1efa615 bugfix : allow manual balloning if shares = 0
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-03 06:28:37 +01:00
Dietmar Maurer
7498eb64a3 correctly set and remove lock 2015-02-15 09:04:30 +01:00
Dietmar Maurer
34758d6608 commit pending values when changing CDROM 2015-02-14 09:20:41 +01:00
Alexandre Derumier
8b6c557980 bugfix : add missing queues nic option in print_net
Currently the nic queues option is removed when we try to update config

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-02-13 06:59:50 +01:00
Wolfgang Link
ba4eea15e6 QemuServer: check snapshot befor rollback
this will check, if it is possibel to rollback a snapshot befor VM will shutdown and get locked.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-02-12 10:17:53 +01:00
Dietmar Maurer
6e62a21f17 vm_devices_list: make sure $device->{'qdev_id'} is set 2015-02-12 08:31:22 +01:00
Alexandre Derumier
200644a7f9 vm_devices_list : list devices behind pci bridge
This fix hotplug for devices behind bridges, like nic6->24 for example

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-02-12 08:31:22 +01:00
Dietmar Maurer
4de1bb2523 fix CDROM hotplug 2015-02-12 08:00:14 +01:00
Dietmar Maurer
996635e58d cleanup error messages 2015-02-12 07:11:17 +01:00
Stefan Priebe
f8fa2ed734 QemuServer: fix wrong binding of pci root ports, bridges or switches to vfio
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2015-02-11 06:31:41 +01:00
Wolfgang Link
8ead5ec7dc bug 597: hotplug fix
wrap params in dopple quotes, so spaces will accept.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-02-10 13:01:24 +01:00
Alexandre Derumier
51a6f637d2 memory hotplug option is not hotpluggable
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-02-10 06:32:08 +01:00
Alexandre Derumier
e059fb4ded add foreach_dimm sub
and use it in memory hotplug and config_to_cmd

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-02-09 07:04:16 +01:00
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
Dietmar Maurer
45827685a7 use PVE::Tools::split_list 2015-01-27 11:05:36 +01:00
Dietmar Maurer
b3c2bdd1f1 hotplug config: allow to enable specific features 2015-01-27 07:16:22 +01:00
Alexandre Derumier
8edc9c08aa enable vcpus hotplug
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-01-22 11:01:21 +01:00
Alexandre Derumier
de9d1e5574 add vcpus option
vcpus = current allocate vpus to virtual machine

maxcpus is now compute from $sockets*cores
vcpus = maxcpus if not defined

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-01-22 11:01:15 +01:00
Dietmar Maurer
70b048219e apply pending changes at vm_stop 2015-01-21 10:42:43 +01:00
Dietmar Maurer
7196b757e7 enable hotplug by default 2015-01-21 08:57:44 +01:00
Dietmar Maurer
25088687fe Add link_down flag to network config
Original patch by Wolfgang, adopted for new hotplug implementation.

I do not verify link status, because that patch was rejected upstream.

Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-20 11:51:19 +01:00
Wolfgang Link
fbda796564 Change check for better understanding!
Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
2015-01-20 07:57:42 +01:00
Kamil Trzcinski
55034103fe Support additional e1000 variants for VM machines
It is required for OS X on qemu

Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
2015-01-20 07:15:05 +01:00
Dietmar Maurer
8fe689e7fd fix test for ballon hotplug 2015-01-12 15:04:31 +01:00
Stefan Priebe
cf71f776cb set boot strict=on to prevent booting from not listed boot devices
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2015-01-12 15:00:58 +01:00
Stefan Priebe
5e2068d285 do not set romfile= if network is not in boot order
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2015-01-12 15:00:55 +01:00