Commit Graph

712 Commits

Author SHA1 Message Date
Alexandre Derumier
42dbd2ee30 add qemu_machine_pxe
return machinename with .pxe suffix if a nic with pxe romfile exist

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 10:51:14 +01:00
Alexandre Derumier
7bac824e19 use qom-get to check if pxe file are used V2
fix qemu 2.4 pxe -> qemu 2.4 efi

Changelog : forget to add a check on qom-get result

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 07:55:07 +01:00
Wolfgang Bumiller
407e0b8bef migration: improve ipv6 case
Qemu parses hostnames in brackets correctly but sets an ipv6
flag for them as if they were ipv6 addresses, only insert
brackets for ipv6 addresses.
2015-11-06 07:53:03 +01:00
Dietmar Maurer
67812f9c97 simplify code: consistently use old bios files for older machine types 2015-10-29 07:37:00 +01:00
Dietmar Maurer
ba9e10002f use old netdevice bios files for older machine types 2015-10-28 09:07:03 +01:00
Alexandre Derumier
289e0b8564 migrate : add nocheck for resume
Users have reported resume bug when HA is used.

They seem to have a little race (bench show >0s < 1s) between the vm conf file move on source node and replication to,
and resume on target node.

I don't known why this is only with HA, maybe this occur will standard migration too.

Anyway, we don't need to read the vm config file to resume the vm on target host,
as we are sure that the vm is migrated, and config file move action is correct in the cluster.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-10-15 12:41:13 +02:00
Wolfgang Bumiller
0f2812c25a support serial numbers and models for disks
Note that the model is only supported for IDE harddisks via
the -device option, whereas the serial is part of the -drive
option.

Closes #153
2015-09-30 10:55:10 +02:00
Alexandre Derumier
ab7540f7e4 disable kvm_steal_time
It's currently buggy with live migration

https://bugs.launchpad.net/qemu/+bug/1494350
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-29 07:14:02 +02:00
Alexandre Derumier
b62532e4e8 migration: disable compress
it's already disable by default,
but we want to be sure if it's change in later release

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-25 17:58:44 +02:00
Alexandre Derumier
0b0a47e8ec enable xbzrle
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-25 17:58:40 +02:00
Dietmar Maurer
806873a198 fix kvm version parser for CVE stable releases, bump version to 4.0-25 2015-09-23 11:48:41 +02:00
Alexandre Derumier
6ea8cd3b52 pci passthough : make vfio default
and remove old legacy code.
(deprecated and disabled by default since kernel 4.2)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-21 06:31:33 +02:00
Wolfgang Link
6965d5d1f8 fix error message: allocate to much v-CPUs. 2015-09-14 09:42:04 +02:00
Wolfgang Link
5f96f4df75 add possibility to restore backup on rbd in krbd mode 2015-09-09 07:47:42 +02:00
Wolfgang Link
116da78402 add krbd support to online snapshot 2015-09-09 07:22:20 +02:00
Dietmar Maurer
335af808a4 improve bash completion 2015-09-07 08:13:07 +02:00
Dietmar Maurer
65e866e5da implement a few bash completion helpers 2015-09-06 16:01:59 +02:00
Alen Grizonic
cb0e4540f7 VM protection mode added
used to prevent an unintended virtual machine remove operation

v3 changes:

- changed man page message
- removed protection parameter (where not needed)
2015-09-06 11:31:05 +02:00
Wolfgang Link
1dbd6d30e0 fix move_disk on RBD
activating the disk when use RBD is necessary to have the given path.
2015-09-06 11:05:51 +02:00
Dietmar Maurer
d853f40aef fix: start kvm with os type other
this check is necessary, because we do not set ostype in qemu config when type is other

Seem that x2apic is now enabled by default when kvm is used

since this commit
http://git.qemu.org/?p=qemu.git;a=commit;h=ef02ef5f4536dba090b12360a6c862ef0e57e3bc

So we just need to disable it for solaris
2015-08-28 11:10:44 +02:00
Wolfgang Link
40b977f328 fix bug #688: if vm is not owner of this disk remove from config 2015-08-20 12:28:50 +02:00
Wolfgang Bumiller
cee01bcbd7 merge delete_drive into try_deallocate_drive
It used to be private and is only used once.
2015-08-13 12:34:12 +02:00
Wolfgang Bumiller
3dc38fbb74 pending-delete: remember force-deletes
The -force flag didn't have any effect since the pending
changes didn't carry over the the flag.
Now forced deletes have an exclamation mark prepended to the
option name.
2015-08-13 11:08:45 +02:00
Dietmar Maurer
b0ec896e43 correctly handle empty description in pending section
So that we can delete descriptions with

 qm set <vmid> --descr ''
2015-08-11 11:24:41 +02:00
Alexandre Derumier
525814b230 add memory_unplug support V2
qemu 2.4 feature

changelog: rebase on last git

Note that currently linux guest don't support unplug of dimm when it'sused by kernel memory.
They are some tunning to do with memory zone movable.
http://events.linuxfoundation.org/sites/events/files/lcjp13_chen.pdf

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-29 10:16:28 +02:00
Thomas Lamprecht
38f7f26c44 fixed bug 662, wrong subroutine for parsing startup order
Changed from old, now missing, subroutine parse_startup() to new
pve_parse_startup_order() in qemu-server and pve-manager

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-07-22 12:44:30 +02:00
Alexandre Derumier
f1f7ea886a cpuflags : don't enforce with tcg mode
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-22 12:40:47 +02:00
Alexandre Derumier
dac7c6190c cpuflags : remove enforce for cpumodel=host
Currently enforce with cpumodel=host on amd cpus don't work,
because amd cpus have unsupported flags in qemu.

This is a protection, and this is good.

but cpumodel host should be never use by users for production (only for testing).
For production and stability, users need to choose a true cpu model which filter
the supported cpuflags by qemu.

So I think we can remove the enforce for host model as for testing it's ok.

warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 0]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 1]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 2]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 3]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 4]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 5]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 6]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 7]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 8]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 9]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 12]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 13]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 14]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 15]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 16]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 17]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 23]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 24]
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-22 12:40:20 +02:00
Alexandre Derumier
0dc48c3d5b cpuflags : remove -rdtscp for Opteron cpu models
rdtscp is not supported by qemu and with enforce it's not starting
warning: host doesn't support requested feature: CPUID.80000001H:EDX.rdtscp [bit 27]

from to qemu wiki
http://wiki.qemu.org/Features/CPUModels#Disabling_features_that_were_always_disabled_on_KVM
"Fact: currently libvirt runs CPU models having rdtscp without the "enforce" flag, and rdtscp is silently disabled
Consequence: libvirt SHOULD use something like "-cpu Opteron_G5,-rdtscp",
especially when it starts using (or emulating) enforce mode
This will require a solution on libvirt side. QEMU will just provide the mechanisms to report CPU model information
and check what the host and QEMU supports, but the decision to disable rdtscp to be able
to run Opteron_G[2345] needs to be taken by libvirt."

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-22 12:38:47 +02:00
Alexandre Derumier
22967505c4 qemu-server : drive-mirror : allow to interrupts at the scanning bitmap phase
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-01 06:39:50 +02:00
Alexandre Derumier
604ea64464 qemuserver : vm_status : add extended stats (disks, nics, memory) V3
Add extended stats results for each nics,disks and memory on full stats mode only.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-06-16 13:23:24 +02:00
Dietmar Maurer
85bdc6afc0 remove outdated host_device format
Newer qemu does not need it.

https://lists.nongnu.org/archive/html/qemu-devel/2011-06/msg02790.html
2015-06-10 10:29:30 +02:00
Dietmar Maurer
d81f0f09fc parse_drive: do not overwrite configured format
Instead, we use qemu_img_format() to query the format when we need it.
We also pass the format to qemu in print_drive_full to avoid qemu warnings.
2015-06-10 10:22:42 +02:00
Wolfgang Bumiller
b2ee900e3c fix aio O_DIRECT check for cdrom drives
Only non-cdrom drives default to cache=none, so the check
for whether to default to aio=native needs to take the same
condition into account.
I combined them close together to make their relation more
visible.
2015-06-02 16:11:01 +02:00
Dietmar Maurer
c6f773b818 cpulimit: use number instead of integer 2015-06-02 16:03:25 +02:00
Alexandre Derumier
58be00f10a implement cpuunit with cgroups
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-06-02 15:56:52 +02:00
Dietmar Maurer
3a515a8805 code cleanup 2015-05-29 08:23:13 +02:00
Alexandre Derumier
ba02e591f0 remove old openvz fairscheduler code
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-29 08:11:07 +02:00
Alexandre Derumier
c8effec354 implement hotplug for cpuunits
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-29 08:11:04 +02:00
Alexandre Derumier
f08e17c7be implement cgroups through systemd-run
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-29 08:11:02 +02:00
Wolfgang Bumiller
fd1f36ac6f localhost instead of 127.0.0.1 makes ipv6 life easier 2015-05-27 08:25:38 +02:00
Wolfgang Bumiller
2fbd27eabc migration: put the source address in brackets
Always adding brackets around the address works. They're required for
ipv6 and qemu also accepts them for ipv4 and hostnames.
2015-05-21 17:30:30 +02:00
Wolfgang Bumiller
af0eba7e35 pass port family to next_*_port() calls 2015-05-12 12:28:56 +02:00
Alexandre Derumier
38e0c3b8ae qmp drive-mirror : set big timeout
drive-mirror is doing lseek on source image before starting, and this can take a lot of time for big nfs volume
during this time, qmp socket is hanging
http://lists.nongnu.org/archive/html/qemu-devel/2015-05/msg01838.html
so we need to setup a big timeout

qemu devs are currently working to fix this

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-12 08:18:42 +02:00
Alexandre Derumier
ad123d97f9 qemu-mirror : block job complete : use ready flag
Since qemu 2.2, a new "ready" flag has been added to blockjob
http://git.qemu.org/?p=qemu.git;a=commit;h=ef6dbf1e46ebd1d41ab669df5bba0bbdec6bd374
to known if we can complete it.

we can't use len==offset to known if all block are mirrored, because behaviour will change soon in qemu 2.3

http://git.qemu.org/?p=qemu.git;a=commit;h=b21c76529d55bf7bb02ac736b312f5f8bf033ea2
"block/mirror: Improve progress report

Instead of taking the total length of the block device as the block
job's length, use the number of dirty sectors. The progress is now the
number of sectors mirrored to the target block device. Note that this
may result in the job's length increasing during operation, which is
however in fact desirable.
"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-12 08:18:30 +02:00
Wolfgang Link
e5eaa02815 remove running from Storage and check it in QemuServer
It is better to check if a VM is running in QemuServer then in Storage.
for the Storage there is no difference if it is running or not.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-05-06 11:47:11 +02:00
Dietmar Maurer
43574f738d use new standard option 'pve-startup-order' 2015-04-22 10:02:33 +02:00
Alexandre Derumier
6e11f14318 implement virtio-scsi multiqueues
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-04-04 10:03:38 +02:00
Alexandre Derumier
3f548708d3 use aio=native only with O_DIRECT (cache=none|directsync)
Currently qemu auto fallback to aio=threads if cache=none|directsync
It's better to handle that correctly

see:
https://bugzilla.redhat.com/show_bug.cgi?id=1086704

http://wiki.qemu.org/ChangeLog/2.3
Future incompatible changes:
Block device parameter aio=native has no effect without cache.direct=on. It will be made an error.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-04-04 09:57:53 +02:00
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
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
Dietmar Maurer
152fe752c4 factor out clone_disk
As suggested by Alexandre. Also cleanup  qemu_drive_mirror (fix white space).
2013-05-29 08:32:10 +02:00
Dietmar Maurer
05937a147d qm rescan: do not add aliases as unused disks. 2013-05-28 12:21:14 +02:00
Dietmar Maurer
a8e2f942bd fix unused disk handling
Show unused disks even if disk is used inside snapshots. But do not allow
to remove those disks.
2013-05-28 12:08:45 +02:00
Dietmar Maurer
7a907ce612 rescan: add check if config has really changed 2013-05-27 10:51:01 +02:00
Dietmar Maurer
5996a936e3 fix bug 395: correctly handle unused disk with storage alias 2013-05-27 08:25:39 +02:00
Alexandre Derumier
e9cfd9cb01 qemu_img_format : use raw for as default for other storage (nexenta, sheepdog, ...)
Seem that something have change in qemu.

iscsi qemu block driver need to use raw, or we get a segfault. (like rbd).

sheepdog works also with .raw, so we don't need anymore specific storage format, we can use raw.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-23 11:33:17 +02:00
Dietmar Maurer
8fd5743158 fix bug #391 - restore: test if requested format is supported 2013-05-21 12:02:41 +02:00
Dietmar Maurer
f9a971e0ee fix bug #381: use PVE::Tools::next_migrate_port() 2013-05-13 07:30:50 +02:00
Dietmar Maurer
ca3e4fa4e1 restore: do not restore template flag
A restored VM is never a template. Else we would need to create
base images after the restore, and not all storages supports base
images. Anyways, the user can easily convert the restored VM into a
template later.
2013-05-08 10:19:38 +02:00
Dietmar Maurer
ccb5c001d6 qemu_img_format: use 'raw' for lvm
With host_device we get the following error:

qemu-img: error while writing sector 0: Bad file descriptor
2013-05-07 10:15:57 +02:00
Alexandre Derumier
f6ab3bdbf9 drive-mirror : die if stats are empty.
If drive have bad sectors, the block job die.
we need to die if stats are empty to avoid this:

transferred: 21440086016 bytes remaining: 34668544 bytes total: 21474754560 bytes progression: 99.84 %
Use of uninitialized value $transferred in subtraction (-) at /usr/share/perl5/PVE/QemuServer.pm line 4611.
Use of uninitialized value $total in subtraction (-) at /usr/share/perl5/PVE/QemuServer.pm line 4611.
Use of uninitialized value $transferred in multiplication (*) at /usr/share/perl5/PVE/QemuServer.pm line 4612.
Use of uninitialized value $total in division (/) at /usr/share/perl5/PVE/QemuServer.pm line 4612.
clone failed: mirroring error: Illegal division by zero at /usr/share/perl5/PVE/QemuServer.pm line 4612.

Maybe it should be improved by catching qmp events, but doesn't seem to work for now

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-06 11:29:41 +02:00
Dietmar Maurer
4fca015325 set long timeout for query-block-jobs
Like we do for other block job query commands. Seems those commands
can hangs for some time.
2013-05-06 09:25:39 +02:00
Dietmar Maurer
719893a944 has_features: also return a list of allowed nodes
This is useful if a feature is restricted to a limited set of nodes.
2013-05-06 08:56:17 +02:00
Alexandre Derumier
cfad42afd4 add qemu_drive_mirror
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-03 08:37:03 +02:00
Dietmar Maurer
4e4f83fea0 copy_vm: use exclusive lock for running VM
Because we can only run one block job to copy data.
2013-04-30 07:40:43 +02:00
Alexandre Derumier
15b1fc9395 don't send qmp balloon commands if vm is started with a state file
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-30 07:01:58 +02:00
Alexandre Derumier
bdf3f36209 parse_drive : return correct format
Currently format is always empty, we need to parse file extension

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-30 06:55:33 +02:00
Alexandre Derumier
5133de429e add qemu_img_convert
also work with snapshot as source for qcow2,rbd,sheepdog.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-29 09:30:58 +02:00