Commit Graph

792 Commits

Author SHA1 Message Date
Dominik Csapak
8490283721 check for $vga->{type} instead of $vga
with commit 55655ebc32
we changed $vga to a parsed hash instead of a string
and forgot to check the property type in one place

this fixes an issue where a vm with a gpu passed through
with x-vga=on could not start

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-12 09:27:21 +01:00
David Limbeck
c9db224015 fix #1969: increase max unused disks
increase to 256, same as containers

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2018-11-09 16:23:07 +01:00
Thomas Lamprecht
9c152e87f5 move nbd_stop up, it's not a completion helper
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-09 16:11:18 +01:00
Thomas Lamprecht
daadd5a4e7 followup for VGA memory: improve q35 comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-09 14:01:45 +01:00
Dominik Csapak
55655ebc32 fix #1952: make vga memory configurable
we change 'vga' to a property string and add a 'memory' property
with this, the user can better control the memory given to the virtual
gpu, this is especially useful for spice/qxl since high resolutions need
more memory

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-09 13:45:07 +01:00
Nick Chevsky
6c875f9f31 Add ssd property to IDE, SATA, and SCSI drives
When enabled, the `ssd` property exposes drives as SSDs (rather than
rotational hard disks) by setting QEMU's `rotation_rate` property [1,
2] on `ide-hd`, `scsi-block`, and `scsi-hd` devices. This is required
to enable support for TRIM and SSD-specific optimizations in certain
guest operating systems that are limited to emulated controller types
(IDE, AHCI, and non-VirtIO SCSI).

This change also unifies the diverging IDE and SATA code paths in
QemuServer::print_drivedevice_full(), which suffered from:
* Code duplication: The only differences between IDE and SATA were in
bus-unit specification and maximum device counts.
* Inconsistent implementation: The IDE code used the new `ide-hd`
and `ide-cd` device types, whereas SATA still relied on the deprecated
`ide-drive` [3, 4] (which doesn't support `rotation_rate`).
* Different feature sets: The IDE code exposed a `model` property that
the SATA code didn't, even though QEMU supports it for both.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1498042
[2] https://lists.gnu.org/archive/html/qemu-devel/2017-10/msg00698.html
[3] https://www.redhat.com/archives/libvir-list/2012-March/msg00684.html
[4] https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg02024.html

Signed-off-by: Nick Chevsky <nchevsky@gmail.com>
2018-10-30 09:22:20 +01:00
Dominik Csapak
71bd73b534 add second qmp socket with qemu 2.12
we will use this for the qmeventd, but we have to limit this
to qemu 2.12, because we cannot add this during a live migration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-10-18 12:23:48 +02:00
Wolfgang Bumiller
df648a6a7a lower hv_synic, hv_stimer requirement to qemu 2.12
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-16 14:52:28 +02:00
Alexandre Derumier
29004a20ca qemu_img_convert : use "-l snapshot.name" instead -s for internal snapshot
qemu-img convert -s has been removed in qemu 3.0
https://git.qemu.org/?p=qemu.git;a=commit;h=46e8d272baa0608adcfdbd8bc1d2312bea06da40

we should use qemu-img convert -l snapshot.name=<snapname>,
introduced in qemu 2.0 in 2013
http://patchwork.ozlabs.org/patch/296457/
2018-10-08 13:16:12 +02:00
Dominik Csapak
64a320303f add virtio gpu to qemuserver options
and sort the list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-28 09:59:05 +02:00
Wolfgang Bumiller
eba2b72199 use qemu's blockdev-snapshot functions
Instead of our own. The code is almost the same, but the
upstream implementation uses qemu's transactional system and
performs a drain() on the block device first. This seems to
help avoid some issues we run into with qcow2 files when
creating snapshots.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-09-24 11:12:34 +02:00
Thomas Lamprecht
babecffe00 restore vm: vmgenid: fixup regex capturing group reference
Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-19 14:16:02 +02:00
Thomas Lamprecht
f7ed64e7b9 schema: vmgenid: reword desscription, add verbose one and document default
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-19 14:01:05 +02:00
Thomas Lamprecht
1a0c2f032c restore vm: vmgenid: small code cleanup
do not use $1 do write out config, if code gets added this may easily
get overwritten, as vmgenid is a fixed key just hardcode it.

also move the comment to where it actually belongs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-19 13:31:26 +02:00
Dominik Csapak
6ee499fff8 fix #1908: add vmgenid config/device
this adds a VM Generation ID device uses by Windows (Server) to determine
some specific actions that may have happened with the vm
such as rollback, restore, etc.

see:

https://docs.microsoft.com/en-us/windows/desktop/hyperv_v2/virtual-machine-generation-identifier

for details on how it works and when it should change

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-19 12:23:24 +02:00
Wolfgang Bumiller
dd84e5ec14 fix version check in qemu_machine_feature_enabled
This caused a few hiccups with qemu 3.0...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-18 09:37:32 +02:00
Dominik Csapak
c6737ef18b ensure correct machine type gets saved on snapshot
instead of overwriting the 'machine' config in the snapshot,
use its own 'runningmachine' config only for the snapshot

this way, we do not lose the machine type if it was
explicitely set during the snapshot, but deleted afterwards

we also have to adapt the tests for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-17 15:48:05 +02:00
Alexandre Derumier
ebb346d6fa qemu 3.0 : add hv_synic && hv_stimer hyperv enlightment
This fix cpu bug on last win10 updates
2018-09-17 13:40:28 +02:00
Alexandre Derumier
eabc189ee8 add ibpb, ssbd, virt-ssbd, amd-ssbd, amd-no-ssb, pdpe1gb cpu flags
> The following are important CPU features that should be used on
> Intel x86 hosts, when available in the host CPU. Some of them
> require explicit configuration to enable, as they are not included
> by default in some, or all, of the named CPU models listed above.
> In general all of these features are included if using “Host
> passthrough” or “Host model”.
>
> pcid: Recommended to mitigate the cost of the Meltdown
> (CVE-2017-5754) fix. Included by default in Haswell, Broadwell &
> Skylake Intel CPU models. Should be explicitly turned on for
> Westmere, SandyBridge, and IvyBridge Intel CPU models. Note that
> some desktop/mobile Westmere CPUs cannot support this feature.
>
> spec-ctrl: Required to enable the Spectre (CVE-2017-5753 and
> CVE-2017-5715) fix, in cases where retpolines are not sufficient.
> Included by default in Intel CPU models with -IBRS suffix. Must be
> explicitly turned on for Intel CPU models without -IBRS suffix.
> Requires the host CPU microcode to support this feature before it
> can be used for guest CPUs.
>
> ssbd: Required to enable the CVE-2018-3639 fix. Not included by
> default in any Intel CPU model. Must be explicitly turned on for
> all Intel CPU models. Requires the host CPU microcode to support
> this feature before it can be used for guest CPUs.
>
> pdpe1gbr: Recommended to allow guest OS to use 1GB size pages.Not
> included by default in any Intel CPU model. Should be explicitly
> turned on for all Intel CPU models. Note that not all CPU hardware
> will support this feature.
-- https://www.berrange.com/posts/2018/06/29/cpu-model-configuration-for-qemu-kvm-on-x86-hosts/
2018-08-28 11:19:10 +02:00
Stoiko Ivanov
9d66b39769 Make agent a property string, add fstrim_cloned_disks
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-08-02 11:35:50 +02:00
Dietmar Maurer
b1a70cab3d vmstatus: define return propertries
We can use the same properties in vmlist and vmstatus.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-08-01 12:58:21 +02:00
Alexandre Derumier
a2f1554b6e Fix #1717: delete snapshot when vm running and drive not attached
changelog v2:
 - remove hash
 - remove check if cdrom

if we try to delete a snapshot, and that is disk from the snapshot
is not attached anymore (unused), we can't delete the snapshot
with qemu snapshot delete command (for storage which use it (qcow2,rbd,...))

example:

...
unused0: rbd:vm-107-disk-3

[snap1]
...
scsi2: rbd:vm-107-disk-3,size=1G

-> die
 qmp command 'delete-drive-snapshot' failed - Device 'drive-scsi2' not found

If drive is not attached, we need to use the storage snapshot delete command
2018-07-19 10:42:03 +02:00
Dzmitry Kotsikau
a489dd9c81 Fix SPICE multi-monitor mode on q35
Signed-off-by: Dzmitry Kotsikau <dkotsikau@gmail.com>
2018-07-13 09:51:36 +02:00
Thomas Lamprecht
9224dceefe qm rescan: add dryrun option
tells an user what would get touched, so he has a chance to fix
unwanted things before changes are actually made.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-11 09:35:45 +02:00
Thomas Lamprecht
53b81297c4 rescan update_disksize: be more verbose
Else an user has no idea what, or if something happened.

Gets printed to tty when using qm rescan or to tasklog for the case
where we do a rescan after restoring a backup.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-11 09:35:43 +02:00
Thomas Lamprecht
b9a1a3aba5 rescan: comment that this is a temporarily workaround
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-05 08:46:11 +02:00
Alwin Antreich
4771526af1 Fix #1650: add content type filter to rescan
Unused disk(s) appeared after a rescan of storages. Especially shown
with ceph pools, where two storage entries are made, <storage>_ct and
<storage>_vm. The rescan method did include images from both storages.

This patch filters any storage not containing the content type 'images'.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2018-07-05 08:35:06 +02:00
Wolfgang Bumiller
d04d6af1f2 use the new PVE::SystemD package
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-15 11:50:23 +02:00
Dominik Csapak
c2786bedc6 use 'system_wakeup' to resume suspended vms
when a vm is suspended (e.g. autosuspend on windows)
we detect that it is not running, display the resume button,
but 'cont' does not wakeup the system from suspend

with this we can wake up suspended vms

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-13 12:46:01 +02:00
Thomas Lamprecht
a4938c7217 add nowarn to qga_check_running
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-05-30 09:01:11 +02:00
Dominik Csapak
f889aa0fbb fix #1780: change datacenter.conf to datacenter.cfg
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-23 10:28:40 +02:00
Dominik Csapak
51153f86ce cleanup balloon after start call
the not definedness check is unecessary here, since it does not
do anything then, and to check balloon twice is also not necessary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-22 13:23:29 +02:00
Dominik Csapak
75b51053cc fix logic of deleting balloon
Deleting the balloon config entry means resetting it to its
default. This means having a balloon device but not actually
doing any ballooning with it (iow. resetting the VM's
'balloon' value to its specified memory.).
Hotplugging a balloon device (coming from explicit '0' to
any other value (including deleting it)) is not possible.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-22 13:20:16 +02:00
Dominik Csapak
82329cd55b note that auto-ballooning is done by pvestatd
so that one is not confused when seeing that the shares
parameter does nothing in qemu-server

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-22 13:20:11 +02:00
Wolfgang Bumiller
503308ed91 start: fork before entering scope
To avoid potential cleanup & post-start actions to cause
unwanted processes (such as gpg-agent) to be started as part
of the scope, as the enter_systemd_scope() function causes
the current process to enter the scope.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-08 08:40:24 +02:00
Dominik Csapak
f721624b8e collect device list for nested pci-bridges
when using q35 as machine type, there are nested pci-bridges,
but we only checked the first layer

this resulted in not being able to hotplug scsi devices,
because scsihw0 was deeper in the pci-bridge construct, we did not see
it and tried to add it (which fails of course)

this patch checks all bridges, regardless how deeply nested they are

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-04-13 14:44:22 +02:00
Dominik Csapak
3807f3e4ee fix #1697: only check machine type for pxe
it is not necessary to check the romfile of the running vm
for .pxe machine types, since the machine type itself is not
hot-pluggable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-04-13 14:41:10 +02:00
Dominik Csapak
fd950b2385 readd nbd_stop
we accidentally moved nbd_stop to CloudInit.pm in
commit 0c9a7596f6

and removed it in
commit 3db6e4ab70

without realizing that live local storage migration still depends on it

readd it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-04-13 14:39:06 +02:00
Thomas Lamprecht
a70e7e6caf disk: serial no must now be passed to device not drive
With QEMU 2.10 the serial parameter of the -drive command line option
was deprecated [1], so move the logic which adds this parameter now
to the -drive analogue -device CLI option.

Features marked deprecated will continue to work for two releases[2],
so we need to switch over before 2.12, AFAICT.

[1]: https://wiki.qemu.org/ChangeLog/2.10#Deprecated_options
[2]: https://qemu.weilnetz.de/doc/qemu-doc.html#Deprecated-features

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-04-09 11:03:02 +02:00
Fabian Grünbichler
d494009179 qemu-img convert: use cache=none for ZFS only
since this requires O_DIRECT support by the underlying storage, which
might not be available.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-26 11:38:40 +02:00
Fabian Grünbichler
2715f95970 qemu-img convert: use cache=none
this fixes an issue with zvols, which require cache=none and eat up all
free memory as buffered pages otherwise

https://github.com/zfsonlinux/zfs/issues/7235

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-23 14:57:49 +01:00
Thomas Lamprecht
102cf9d81e use pve-edk2-firmware for supporting OVMF
depend on new pve-edk2-firmware package and adapt the OVMF CODE/VARS
path accordingly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-22 08:19:46 +01:00
Thomas Lamprecht
9444c6e42c fixup: remove unneeded if branch
$readfrom equals $archive here, and we're already in the branch with
the condition that both are not equal to '-'
2018-03-21 11:15:35 +01:00
Wolfgang Bumiller
7c536e11c4 restore: implement rate limiting
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-21 11:15:35 +01:00
Thomas Lamprecht
b20df606a1 stop passing default '-k' QEMU option from datacenter.cfg
Modern noVNC does not needs this anymore, actually things may get
worse if it's used. E.g., when one sets 'de' and the VM locale is
'de' you may get a 'ĸ' (unicode kra) if you want to send an ampersand
character through pressing SHIFT + 6.

Qemus manual pages confirms that this is most times not needed
anymore:

 > -k language
 >    Use keyboard layout language (for example "fr" for
 >    French). This option is only needed where it is not
 >    easy to get raw PC keycodes (e.g. on Macs, with some
 >    X11 servers or with a VNC or curses display). You don't
 >    normally need to use it on PC/Linux or PC/Windows
 >    hosts.
 -- man kvm

An user can always set it per VM, wew simply remove the implict
default derived from the cluster wide datacenter.cfg

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-21 10:48:07 +01:00
Wolfgang Bumiller
345d263f6c cleanup: remove duplicate mac address assignment
The git history of this is not immediately obvious due to
the date of the cloud init patches, but the removal of this
line was basically reverted by them later at merge-time.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-21 10:33:39 +01:00
Thomas Lamprecht
6de521e984 remove legacy vm_monitor_command
We introduced our QMP socket with commit
c971c4f221 (29.05.2012)

Already tried to remove this with commit
7b7c6d1b5d (13.07.2012)

But reverted that to allow migration of VMs still using the old
montior to ones which already switched over to the new QMP one,
in commit dab36e1ee9 (17.08.2012)
see bug #242 for reference

This was all done  and released in PVE 2.2, as no migration through
nodes differing more than one major version is possible we can
finally remove this code for good.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-14 11:18:56 +01:00
Herman van Rink
e4d4cda113 Move name argument to improve visibility in a process list
Signed-off-by: Herman van Rink <rink@initfour.nl>
2018-03-12 14:26:10 +01:00
Wolfgang Bumiller
3c23aa808c start: always stop an existing $vmid.scope
Checking for the cgroup directory is a kind of time-of-check
time-of-use race condition stop-mode backups seem to
occasionally run into on some systems.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-12 09:14:17 +01:00
Dietmar Maurer
1d1c4e1c1c cleanup cloud-init option descriptions 2018-03-07 10:53:41 +01:00