5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00
Commit Graph

530 Commits

Author SHA1 Message Date
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
Dietmar Maurer
81d95ae1a8 code cleanup 2015-01-07 10:20:35 +01:00
Alexandre Derumier
9c2f70692e fix balloon pending update
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-01-07 08:39:08 +01:00
Alexandre Derumier
6f9a607037 don't try to hotplug|unplug ide && sata drive
We can't hotplug theses devices,
so we can avoid to throw always an error when adding them

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-01-07 08:36:02 +01:00
Alexandre Derumier
19120f9967 pending : add disk hot-unplug
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-01-07 06:54:57 +01:00
Dietmar Maurer
38c590d9f6 vmconfig_update_net: do not call vm_deviceplug() if hotplug == 0
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:44:39 +01:00
Dietmar Maurer
a05cff86e7 vmconfig_hotplug_pending : add update_disk
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:44:30 +01:00
Dietmar Maurer
fee4667503 vm_deviceplug: always raise exception on error
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:44:17 +01:00
Dietmar Maurer
63c2da2f1a vm_deviceunplug: raise expection if something fail
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:44:11 +01:00
Dietmar Maurer
3eec576714 vmconfig_hotplug_pending : add update_net
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:43:11 +01:00
Dietmar Maurer
e56beedaba vmconfig_hotplug_pending: correctly skip values
Do not use $skip variable (simply raise an exception)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:43:05 +01:00
Dietmar Maurer
281fedb364 rename qemu_bridgeadd to qemu_add_pci_bridge
To make it obvious that we add a PCI device, and not a network bridge.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:43:01 +01:00
Dietmar Maurer
3a11fadb41 vmconfig_hotplug_pending: improve hotplug error handling
Simplify code, and allow to partially apply pending changes using
a new $selection parameter.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:42:48 +01:00
Dietmar Maurer
8e90138a8a code cleanup, delete trailing white space
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:42:44 +01:00
Dietmar Maurer
c750e90abd vmconfig_cleanup_pending: new method to clenup setting in [PENDING]
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:42:39 +01:00
Dietmar Maurer
3d7389fe15 vmconfig_hotplug_pending: implement tablet hotplug
Remove special case: now, we only hotplug if 'hotplug' is enabled.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:42:35 +01:00
Dietmar Maurer
c427973b46 implement trivial hotplug
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:42:27 +01:00
Dietmar Maurer
055d554dfa vm_start: apply pending changes
I move related helper methods into PVE::QemuServer.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:42:17 +01:00
Dietmar Maurer
ef824322a0 write_vm_config : write pending change
example:

$conf->{pending}->{virtio1}
$conf->{pending}->{delete} = "net0,net1"

[PENDING]
virtio1: ...
delete: net0,net1

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:42:00 +01:00
Dietmar Maurer
e297c4903a parse_vm_config: only allow 'delete' inside [PENDING]
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:41:46 +01:00
Dietmar Maurer
0d732d1615 parse_vm_config: correctly handle $descr
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:41:36 +01:00
Alexandre Derumier
eab09f4e11 parse_vm_config : parse pending changes
example:

[PENDING]
virtio1:...
delete:net0,net1

$conf->{pending}->{virtio1}
$conf->{pending}->{del}->{net0}
$conf->{pending}->{del}->{net1}

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2015-01-07 06:41:24 +01:00
Stefan Priebe
6fab033c3c this commit:
commit 1c0c1c17b0
Author: Wolfgang Link <wolfgang@linksystems.org>
Date:   Wed Nov 26 11:11:40 2014 +0100

    shutdown by Qemu Guest Agent if the agent flag in the config is set

    Important: "guest-shutdown" returns only by error a message.

    Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>

breaks live migration as it always tries to load the vm config - even in case of $nocheck. Also it double loads the config ($conf && $config)
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-12-22 17:19:39 +01:00
Dietmar Maurer
67fb9de608 white space cleanups 2014-12-04 13:07:59 +01:00
Alexandre Derumier
2ed5d5724c add custom numa topology support
numaX: cpus=<id[-id],memory=<mb>[[,hostnodes=<id[-id]>][,policy=<preferred|bind|interleave>]]

example:
-------
sockets:4
cores:2
memory:4096
numa: 1
numa0: cpus=0-1,memory=1024,hostnodes=0-1,policy=interleave
numa1: cpus=2-3,memory=3072,hostnodes=2,policy=bind

qemu command line
-----------------
-object memory-backend-ram,size=1024M,policy=interleave,host-nodes=0-1,id=ram-node0
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0

-object memory-backend-ram,size=3072M,policy=bind,host-nodes=2,id=ram-node1
-numa node,nodeid=1,cpus=2-3,memdev=ram-node1

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-12-04 13:02:47 +01:00
Alexandre Derumier
8a010eaeb1 add numa options v3
This enable numa support inside the guest, and share the memory and cores across the sockets numa nodes.

numa: 0|1

example:
-------
sockets:2
cores:2
memory:4096
numa: 1

qemu command line
-----------------
-object memory-backend-ram,size=2048,id=ram-node0
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0
-object memory-backend-ram,size=2048,id=ram-node1
-numa node,nodeid=1,cpus=2-3,memdev=ram-node1

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-12-04 13:01:47 +01:00
Wolfgang Link
af9110ddd7 Fix in PVE::QemuServer::snapshot_create
remove the freezefs flag.
If Qemu Guest Agent flag is set in config the vm filesystem will always be frozen,
unless we save RAM.

also remove param freezefs in PVE::API2 snapshot,
because there is no use for it.

Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2014-12-04 12:30:35 +01:00
Dietmar Maurer
108864e591 snapshot_create: fix bug from prev. commit, consider $freezefs parameter 2014-12-02 13:42:51 +01:00
Wolfgang Link
65994ad73c snapshot_create: use guest-fsfreeze-freeze if possible
Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2014-12-02 13:11:42 +01:00
Dietmar Maurer
6f70864360 drive-mirror: avoid division by zero bug 2014-12-01 09:50:12 +01:00
Dietmar Maurer
c8125172c7 qmpclient: improve error handling 2014-12-01 09:50:12 +01:00
Dietmar Maurer
2ea5450311 simplify code by using vm_qmp_command() directly 2014-12-01 09:50:12 +01:00
Dietmar Maurer
7a6c215042 qmpclient: code cleanup, execute qga and qmp in parallel 2014-12-01 09:50:12 +01:00
Wolfgang Link
1c0c1c17b0 shutdown by Qemu Guest Agent if the agent flag in the config is set
Important: "guest-shutdown" returns only by error a message.

Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
2014-12-01 09:50:12 +01:00
Wolfgang Link
c5a07de5af qmpclient: now if the QMP command starts with guest-+ , it will bind dynamicly to the VMID.qga socket
Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
2014-12-01 09:50:12 +01:00
Alexandre Derumier
693d12a2c0 add vm_qga_command
and reuse vm_qmp_command && qmp_socket with $qga param

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-12-01 09:50:11 +01:00
Dietmar Maurer
f34ebd5259 code cleanups 2014-12-01 09:50:11 +01:00
Alexandre Derumier
2c9e8036f5 savevm-end : wait that savevm is finished
savevm-end is async, we need to wait that savevm is finished, before continue.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-12-01 09:50:11 +01:00
Dietmar Maurer
1b0b51ed94 serial: allow to pass arbitrary device names 2014-12-01 09:50:11 +01:00
Wolfgang Link
7626772856 Add check if host has enough real CPUs for starting VM
To prevent a Qemu CPU emualtion!

Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
2014-11-17 11:24:15 +01:00
Dietmar Maurer
883839209f qemu_drive_mirror: cleanup, avoid code duplication 2014-11-10 08:18:39 +01:00
Dietmar Maurer
08ac653fcf qemu_drive_mirror: raise exception if we cannot parse $dst_volid 2014-11-10 07:55:09 +01:00
Dietmar Maurer
b467f79a50 delete trailing whitespace 2014-11-10 06:31:08 +01:00
Alexandre Derumier
21ccdb506a block-job-complete : retry if block job cannot be complete
Even if we check the busy flag, we can have sometime race condition if new write
are coming between the query-block-job and the block-job-complete.

block-job-complete throw an error "The active block job for device '%(name)' cannot be completed"

we just need to retry in this case.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-11-10 06:26:25 +01:00
Dietmar Maurer
bcc87408c0 cleanup: do not entry wait loop if block-job-cancel() fails. 2014-11-07 15:31:56 +01:00
Alexandre Derumier
ab6ecffe53 drive-mirror : wait that busy eq false before block-job-complete
When the drive-mirror is at 100%, and write occurs, the busy flag can change from false->true

- 100% no new writes

transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: false
transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: false
transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: false

- 100% new writes

transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: true
transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: true
transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: true

- 100% no new writes

transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: false
transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: false
transferred: 1073741824 bytes remaining: 0 bytes total: 1073741824 bytes progression: 100.00 % busy: false

So, we need to check that busy is false before doing the block-job-complete.

Also, we force the vm to pause, if it's busy for more than 120s when drive-mirror is at 100%

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-11-07 15:28:13 +01:00
Alexandre Derumier
5fe03fd8ee block-job-cancel : wait that jobs is really finished
block-job-cancel is async, we need to check that job is really finished

before try to free the volume

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-11-07 15:26:21 +01:00
Alexandre Derumier
f1e053055c enable write zeroes optimisations
This enable write zeroes optimisation inside guest.

(I have tested them with qcow2,raw (ext4|xfs) , zfs|iscsi and nfs too.

No impact if the block driver don't support it yet (like rbd)

https://lists.nongnu.org/archive/html/qemu-devel/2014-04/msg00009.html

> a) mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/vdX
>
> QCOW2         [off]     [on]     [unmap]
> -----
> runtime:       14secs    1.1secs  1.1secs
> filesize:      937M      18M      18M
>
> iSCSI         [off]     [on]     [unmap]
> ----
> runtime:       9.3s      0.9s     0.9s
>
> b) dd if=/dev/zero of=/dev/vdX bs=1M oflag=direct
>
> QCOW2         [off]     [on]     [unmap]
> -----
> runtime:       246secs   18secs   18secs
> filesize:      51G       192K     192K
> throughput:    203M/s    2.3G/s   2.3G/s
>
> iSCSI*        [off]     [on]     [unmap]
> ----
> runtime:       8mins     45secs   33secs
> throughput:    106M/s    1.2G/s   1.6G/s
> allocated:     100%      100%     0%

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-10-13 10:34:41 +02:00
Alexandre Derumier
7183bd9a8f add iothread/dataplane support
new config option:

iothread: 1|0

This enable iothread/dataplane support, to improve io performance on fast storages

Currently block jobs don't work yet, it's planned for qemu 2.2.
So it's better to not expose yet this option in gui.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-10-10 10:27:41 +02:00
Alexandre Derumier
f78cc802cf vm_devices_list : also list block devices
This allow scsi disk to be plug|unplug

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-09-01 11:33:54 +02:00
Dietmar Maurer
7946e0fa42 Currently,if we don't have a "machine" option in running config, and we take a vmstate snapshot
the machine option is write in the snapshot (ok), but also in the running config (bad)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2014-08-29 11:27:27 +02:00
Alexandre Derumier
6c33c345ef allow hotplug of virtio-scsi disks
It was an old protection, it's working fine now

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-08-29 08:18:08 +02:00
Dietmar Maurer
cd11416f7a clone_vm: auto generate new uuid 2014-08-26 09:20:09 +02:00
Alexandre Derumier
3aefd6fdf9 add Broadwell cpu model
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-08-20 12:20:18 +02:00
Alexandre Derumier
d2da6d9b8e generate spice devices cmd line after pci bridge
we should push to $devices array instead $cmd array,

because pci bridges need to be create before spice devices

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-08-13 06:14:03 +02:00
Alexandre Derumier
5cffb2d2f2 bump max hostpci to 4
user need to passthough 3 devices here
http://forum.proxmox.com/threads/19134-KVM-passtrought-PciExpress-3-card

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-08-06 09:40:32 +02:00
Alexandre Derumier
137483c053 vga=none if x-vga passthrough is enabled
we need to disable virtual vga card if we passthrough a physical gpu

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-08-06 09:39:38 +02:00
Alexandre Derumier
9040435417 disable kvm cpu signature if x-vga is enabled
see
http://git.qemu.org/?p=qemu.git;a=commit;h=f522d2acc549dd11f495048330aa5f3f424a7dfa

last nvdia drivers don't install in kvm machine if they detect kvm signature.

This patch hide kvm signature in cpuflags (but don't disable kvm)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-07-24 06:51:55 +02:00
Kamil Trzciński
8f3e88af00 Reset device only if has_fl_reset is defined
Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
2014-07-23 06:11:15 +02:00
Stefan Priebe
8fd882a42b snapshot_delete: reorder parent "connection" after prepare
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-07-17 09:23:40 +02:00
Stefan Priebe
258e646c57 pass snapname to PVE::Storage::vdisk_clone
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-07-17 09:21:37 +02:00
Dietmar Maurer
2796e7d542 new option smbios1: specify SMBIOS type 1 fields (uuid, ...) 2014-06-26 11:12:25 +02:00
Alexandre Derumier
b1f72af6d4 add pci multifunction unbind support
we need to unbind each functions of a multifunction pci device

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-06-25 09:30:01 +02:00
Alexandre Derumier
4543ecf07f add pci multifunction support
multifunction device should be define without the .function

hostpci0: 00:00

example
-------
if 00:00.0
   00:00.1
   00:00.2

exists,

then we generate the multifunction devices

-device (pci-assign|vfio-pci),host=00:00.0,id=hostpci0.0,bus=...,addr=0x0.0,multifunction=on
-device (pci-assign|vfio-pci),host=00:00.1,id=hostpci0.1,bus=...,addr=0x0.1
-device (pci-assign|vfio-pci),host=00:00.2,id=hostpci0.2,bus=...,addr=0x0.2

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-06-25 09:29:53 +02:00
Alexandre Derumier
2e3b7e2a3a add pcie and x-vga passthrough
hostpci0:  .....,x-vga=on,pcie=1

x-vga require kernel 3.10 with vfio-vga support enable
if x-vga=on, we force vfio-pci device

pcie=1 choose the pciexpress bus (need q35 machine model)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-06-25 09:29:10 +02:00
Stefan Priebe
000fc0a254 added support for vfio-pci passthrough
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-06-18 07:03:09 +02:00
Dietmar Maurer
db656e5f24 cleanup previous patch 2014-06-18 06:54:45 +02:00
Alexandre Derumier
f8e83f0548 enable q35 machine support
q35 use pcie.0 root by default. so currently we can't start machine model q35.

we need to add 3 pci-bridge pci.0, pci.1, pci.2, to handle our devices.

pcie.0 does not support hotplug. so pci-bridge are defined at startup.

I use an pve-q35.cfg (mostly the same than q35-chipset.cfg from qemu docs).

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-06-18 06:03:53 +02:00
Alexandre Derumier
a9410357d2 add virtio-net multiqueue support
this a new option queue=(\d+) to net interface

Allow to use more than 1 cpu for network stream, so this can improve network bandwidth,
when vhost-net cpu is the bottleneck

http://www.linux-kvm.org/page/Multiqueue#Enable_MQ_feature

-netdev tap,vhost=on,queues=N -device virtio-net-pci,mq=on,vectors=2N+2

host requirement
----------------
this require host kernel >= 3.8 (or qemu die at start)

linux guest requirement
-----------------------
kernel >= 3.8

manual enabling multiqueue

windows guest requierement
--------------------------
recent virtio-net driver

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-06-11 09:22:01 +02:00
Dietmar Maurer
5881b913c0 add option iscsi only once
We simply add option iscsi if we have an initiator name. So we
never add this option multiple times, and it works with hotplug
in case someone plugs an 'iscsi:' drive later.
2014-05-17 09:14:58 +02:00
Dietmar Maurer
46f58b5f03 cleanup previous commit - use IO::File 2014-05-17 09:07:18 +02:00
Michael Rasmussen
15b21acc0d add initiator-name to iscsi drives if configured
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2014-05-17 08:42:54 +02:00
Alexandre Derumier
28138e9a1b print_net : add firewall option
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-05-09 11:52:15 +02:00
Alexandre Derumier
011c581720 add pve-bridgedown script
This allow to delete fwbr bridge, link interfaces, cleanup ovs
when vm is shutdown

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-05-08 08:37:04 +02:00
Alexandre Derumier
2dd4aa4c95 add firewall option to qemu network interface
this allow to disable firewall for a specific interface

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-05-08 08:35:37 +02:00
Dietmar Maurer
3cf90d7a40 qmrestore: removed short timeout 2014-04-17 10:37:46 +02:00
Dietmar Maurer
c0efd8cd0e disable cpu enforce flag
Enforce needs kernel 3.10, so we do not use it for now.
2014-04-03 09:39:54 +02:00
Alexandre Derumier
2430d37886 enforce cpu check
enable check if host support all cpu flags configured for the guests

this avoid some bad setup like Opteron vcpu on a intel host for example,
and avoid some bad live migrations

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-03-28 09:03:21 +01:00
Dietmar Maurer
22430fa2c9 remove unneeded parentheses 2014-02-10 08:05:06 +01:00
Stefan Priebe
b463a3cec0 since qemu 1.7 xbzrle is AUTOMATICALLY enabled in the end of transfer - we need to explicit disable all feature we do not want
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-02-10 08:01:19 +01:00
Dietmar Maurer
264e519fab white space cleanups 2014-01-14 10:33:36 +01:00
Alexandre Derumier
838776ab65 add cpu_hotplug
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-01-14 07:29:25 +01:00
Alexandre Derumier
3bd18e48cf add maxcpus config
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-01-14 07:26:55 +01:00
Dietmar Maurer
8b8345f3ac cleanup previous commit 2014-01-10 13:09:19 +01:00
Alexandre Derumier
a89fded11f migration : enable auto-converge capability v2
This reduce guest cpu speed if dirtied bytes is 50% more than the approx.amount of bytes that just got transferred since the last time we were in this routine.

qemu commit :
http://git.qemu.org/?p=qemu.git;a=commit;h=bde1e2ec2176c363c1783bf8887b6b1beb08dfee

tested with "stress -m 2 -c 2" under debian

without autoconvergence : downtime 12s - duration 12min
with autoconvergence : downtime 2s - duration 4min

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-01-10 13:01:55 +01:00
Dietmar Maurer
0cea6a0160 add more options for pci passthrough 2013-12-13 11:43:05 +01:00
Dietmar Maurer
dd25eecf62 code cleanup
Use new helper methods.
2013-12-10 10:46:50 +01:00
Dietmar Maurer
cd339d1fe9 use new helper PVE::Tools::next_spice_port() 2013-12-09 13:23:26 +01:00
Alexandre Derumier
74edd76ba8 qemuserver : iothrottle add support for throttling burst max
http://git.qemu.org/?p=qemu.git;a=commit;h=3e9fab690d59ac15956c3733fe0794ce1ae4c4af

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-12-05 06:31:06 +01:00
Dietmar Maurer
5b952ff541 add 'lsi53c810' to the list of scsi controllers 2013-12-04 09:11:36 +01:00
Dietmar Maurer
8d87f8aa4f add drive option 'discard' 2013-12-04 08:43:46 +01:00
Dietmar Maurer
e4c6e0b88c add vmxnet3 to list of available network card models 2013-12-04 07:37:42 +01:00
Dietmar Maurer
87c5bc3493 add 'pvscsi' to the list of scsi controllers.
QEMU can now emulate the VMware PVSCSI device.
2013-12-04 06:52:38 +01:00
Alexandre Derumier
71ddbff9cb qemu-img : qemu 1.7 use -n for skip volume create
http://git.qemu.org/?p=qemu.git;a=commit;h=b2e10493c71160d88bb823cae9a92e806a79b9d6

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-12-03 10:46:37 +01:00
Alexandre Derumier
4dc339e7b4 add +lahf_lm flag to kvm64 cpudef
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-11-29 09:17:03 +01:00
Dietmar Maurer
49ca581d5d allow to migrate VMs using SPICE usb redirection 2013-11-26 07:37:18 +01:00
Dietmar Maurer
590e698c07 cleanup spice code 2013-10-02 09:11:57 +02:00
Alexandre Derumier
2fa3151ebd add multi-monitors spice support
add qxl2 (2monitors),qxl3 (3monitors),qxl4 (4monitors) vga type.

For linux, we only need 1 qxl card with more memory

For windows, we need 1 qxl card by monitor

Original Information from spice-mailing
"
You need to specify multiple devices for Windows VMs. This is what
libvirt gives me (via 'virsh domxml-to-native qemu argv DOMAIN_XML'):
<...> -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 -device qxl,id=video1,ram_size=67108864,vram_size=33554432 -device qxl,id=video2,ram_size=67108864,vram_size=33554432 -device qxl,id=video3,ram_size=67108864,vram_size=33554432

For Linux VM, just one qxl device is OK but then it's advisable to
increase the available RAM:
<...> -vga qxl -global qxl-vga.ram_size=134217728 -global qxl-vga.vram_size=33554432

If you don't turn off surfaces, then you should increase vram size to
say 64 MB from current default of 32 MB.
"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-10-02 08:26:32 +02:00
Dietmar Maurer
990fc5e22e use warnings instead of global -w flag 2013-10-01 13:14:49 +02:00
Alexandre Derumier
6b9d84cfb2 add opensolaris ostype and disable x2apic
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-09-24 06:53:26 +02:00
Dietmar Maurer
244f2577c5 speedup restore on glusterfs (do not write zero bytes) 2013-09-17 09:12:07 +02:00
Dietmar Maurer
32e698051f fix typo - s/parallel/parport/ 2013-08-14 15:55:01 +02:00
Dietmar Maurer
4c5dbaf6ab use tty chardev for usb-to-parallel 2013-08-14 14:22:24 +02:00
Dietmar Maurer
9ecc843138 allow to use usb parallel ports 2013-08-14 12:18:54 +02:00
Dietmar Maurer
ef5e2be2a4 add ability to run without graphic card ('vga: serial[n]') 2013-07-31 09:19:36 +02:00
Dietmar Maurer
9f9d2fb261 allow to use a socket for serial devices 2013-07-31 06:58:26 +02:00
Stefan Priebe
5bc1e0397e qemu-server: add support for unsecure migration (setting in datacenter.cfg)
This patch adds support for unsecure migration using a direct tcp connection
KVM <=> KVM instead of an extra SSH tunnel. Without ssh the limit is just the
bandwith and no longer the CPU / one single core.

You can enable this by adding:
migration_unsecure: 1
to datacenter.cfg

Examples using qemu 1.4 as migration with qemu 1.3 still does not work for me:

current default with SSH Tunnel VM uses 2GB mem:
Dec 27 21:10:32 starting migration of VM 105 to node 'cloud1-1202' (10.255.0.20)
Dec 27 21:10:32 copying disk images
Dec 27 21:10:32 starting VM 105 on remote node 'cloud1-1202'
Dec 27 21:10:35 starting ssh migration tunnel
Dec 27 21:10:36 starting online/live migration on localhost:60000
Dec 27 21:10:36 migrate_set_speed: 8589934592
Dec 27 21:10:36 migrate_set_downtime: 1
Dec 27 21:10:38 migration status: active (transferred 152481002, remaining 1938546688), total 2156396544) , expected downtime 0
Dec 27 21:10:40 migration status: active (transferred 279836995, remaining 1811140608), total 2156396544) , expected downtime 0
Dec 27 21:10:42 migration status: active (transferred 421265271, remaining 1669840896), total 2156396544) , expected downtime 0
Dec 27 21:10:44 migration status: active (transferred 570987974, remaining 1520152576), total 2156396544) , expected downtime 0
Dec 27 21:10:46 migration status: active (transferred 721469404, remaining 1369939968), total 2156396544) , expected downtime 0
Dec 27 21:10:48 migration status: active (transferred 875595258, remaining 1216057344), total 2156396544) , expected downtime 0
Dec 27 21:10:50 migration status: active (transferred 1034654822, remaining 1056931840), total 2156396544) , expected downtime 0
Dec 27 21:10:54 migration status: active (transferred 1176288424, remaining 915369984), total 2156396544) , expected downtime 0
Dec 27 21:10:56 migration status: active (transferred 1339734759, remaining 752050176), total 2156396544) , expected downtime 0
Dec 27 21:10:58 migration status: active (transferred 1503743261, remaining 588206080), total 2156396544) , expected downtime 0
Dec 27 21:11:02 migration status: active (transferred 1645097827, remaining 446906368), total 2156396544) , expected downtime 0
Dec 27 21:11:04 migration status: active (transferred 1810562934, remaining 281751552), total 2156396544) , expected downtime 0
Dec 27 21:11:06 migration status: active (transferred 1964377505, remaining 126033920), total 2156396544) , expected downtime 0
Dec 27 21:11:08 migration status: active (transferred 2077930417, remaining 0), total 2156396544) , expected downtime 0
Dec 27 21:11:09 migration speed: 62.06 MB/s - downtime 37 ms
Dec 27 21:11:09 migration status: completed
Dec 27 21:11:13 migration finished successfuly (duration 00:00:41)
TASK OK

with unsecure migration without SSH Tunnel:
Dec 27 22:43:14 starting migration of VM 105 to node 'cloud1-1203' (10.255.0.22)
Dec 27 22:43:14 copying disk images
Dec 27 22:43:14 starting VM 105 on remote node 'cloud1-1203'
Dec 27 22:43:17 starting online/live migration on 10.255.0.22:60000
Dec 27 22:43:17 migrate_set_speed: 8589934592
Dec 27 22:43:17 migrate_set_downtime: 1
Dec 27 22:43:19 migration speed: 1024.00 MB/s - downtime 1100 ms
Dec 27 22:43:19 migration status: completed
Dec 27 22:43:22 migration finished successfuly (duration 00:00:09)
TASK OK
2013-07-26 11:23:49 +02:00
Dietmar Maurer
86b8228b59 new vga_conf_has_spice() helper
code cleanups
2013-07-24 12:01:03 +02:00
Dietmar Maurer
1d794448fc return spice_port from config_to_command()
That way we do not need to run qmp command to get the port.
Set spice ticket expire time to 30 (5 seconds seems a bit too short).
Coding style cleanups.
2013-07-24 11:24:20 +02:00
Alexandre Derumier
95a4b4a98b add spice migration
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-07-24 10:54:20 +02:00
Alexandre Derumier
1481f3f23c add read_x509_subject_spice
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-07-24 09:45:32 +02:00
Dietmar Maurer
d685bd1de8 remove spice cert paths
And depend on pve-qemu-kvm (>= 1.4-16), which automatically uses the correct
certs by default.
2013-07-23 10:05:36 +02:00
Dietmar Maurer
5acbfe9eea disable tablet for spice 2013-07-19 09:58:17 +02:00
Dietmar Maurer
80401dd861 support usb redirection for spice 2013-07-19 09:37:04 +02:00
Dietmar Maurer
943340a628 spice: use TLS
we now use a local tcp port instead of a unix socket, because that is
implemented and works with current spice libraries.
2013-07-17 11:33:02 +02:00
Dietmar Maurer
09984754a0 correctly return and use device type in scsi_inquiry 2013-07-15 13:46:41 +02:00
Dietmar Maurer
f334aa3e6e fix scsi inquiry command
I got wrong results if command is longer than 6 bytes.
2013-07-15 13:12:18 +02:00
Dietmar Maurer
29b1952991 fix coding style 2013-07-15 13:11:28 +02:00
Dietmar Maurer
be19058305 bump version to 3.0-22
and delete trailing white spaces
2013-07-15 09:16:01 +02:00
Alexandre Derumier
462e8d19fe add hyper-v enlightments for windows guests
This add special hyper-v cpu flags for windows guests.

This improve performance and avoid some bsod related to timer.

(I currently disable the hv_vapic flag because I can't get it working).

I have tested all theses flags with: win2003, win2008R2, winxp, linux debian 64bit, on intel and amd physicals processor

It doesn't break live migration, because new cpu flags are not see by guests until a vm reset.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-07-15 09:09:08 +02:00
Alexandre Derumier
2e1a5389f7 add +sep cpuflags to kvm32 && kvm64 cpu models
Need for win8 boot.

This flag was missing from rhel < 6.4 host kernel. It's ok now.
But it's also missing from kvm64 model. (It's exist in other cpu models, amd or intel).
So it's pretty safe to enable it.
If the host kernel is older, qemu filter the flag.

This also improve performance of winxp && win7 32 bits guests.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-07-15 09:08:50 +02:00
Alexandre Derumier
519ed28c96 enable x2apic by default for kvm machines
This reduce context switch with multicore guests.

Even if the host cpu don't have x2apic, it's working because qemu have an virtual x2apic implementation for guest.
We need  in-kernel irqchip support for this, which is enable for kvm guest since qemu 1.3.
(I don't enable it if nokvm param is set)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-07-15 09:08:34 +02:00
Dietmar Maurer
288eeea8ae add spice proxy API
This is experimental code, spice connections are not encryped and thus insecure.
We use ticket passwords for spice auth, and do direct spice connections to
the nodes instead of using a tunnel.
2013-06-25 12:09:05 +02:00
Dietmar Maurer
1011b57090 add support for spice display driver (vga=qxl)
This is based on the patch from Alexandre, but we use vga=qlx instead
of introducing a new 'spice: 1' boolean flag.
2013-06-25 07:10:42 +02:00
Dietmar Maurer
9b2c0efbd6 correctly handle undef values when calling qemu_block_set_io_throttle 2013-06-12 07:08:02 +02:00
Alexandre Derumier
0e6165343a qemu-server : bridge_add : fix uninitialized value
fix : Use of uninitialized value $bridgeid in numeric lt (<) at /usr/share/perl5/PVE/QemuServer.pm line 2774.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-06-12 06:58:20 +02:00
Dietmar Maurer
d8b916fdb0 snapshot rollback: use pc-i440fx-1.4 as default 2013-06-06 06:38:12 +02:00
Dietmar Maurer
4b15803dee snapshot: save/restore 'machine' configuration 2013-06-05 10:17:49 +02:00
Dietmar Maurer
ff556cf2a0 implement get_current_qemu_machine 2013-06-05 09:52:22 +02:00
Dietmar Maurer
952958bc87 API extension: add 'machine' parameter to vm_start
This allows us to overwrite the machine type at start - useful for
migration to make sure we use the same machine at the target node.
2013-06-05 09:27:31 +02:00
Dietmar Maurer
3bafc5106e add new 'machine' configuration 2013-06-05 09:18:23 +02:00
Dietmar Maurer
1a71fa73a4 fix typo 2013-06-04 13:33:35 +02:00
Dietmar Maurer
2fc6bc1722 qemu_drive_mirror: correctly call block-job-cancel if block-job-complete fails 2013-05-31 11:31:22 +02:00
Dietmar Maurer
1377d7b0f5 clone_disk: test if requested format is supported - else use default 2013-05-29 12:59:21 +02:00