qemu-server.git
19 months agoAdd missing Build-Depends
Rhonda D'Vine [Mon, 12 Nov 2018 13:59:59 +0000 (14:59 +0100)]
Add missing Build-Depends

These were found while building the package within a clean chroot.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
19 months agod/control: bump version dependency for pve-edk2-firmware
Thomas Lamprecht [Tue, 13 Nov 2018 14:09:35 +0000 (15:09 +0100)]
d/control: bump version dependency for pve-edk2-firmware

to ensure that we have AAVMF available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agoarm: use virtio gpu by default
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:44 +0000 (14:10 +0100)]
arm: use virtio gpu by default

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agodon't use amd64-specific cpu options on arm
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:43 +0000 (14:10 +0100)]
don't use amd64-specific cpu options on arm

FIXME: This function needs proper reorganisation...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agoarm: pci addressing, keyboard and ehci controller
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:42 +0000 (14:10 +0100)]
arm: pci addressing, keyboard and ehci controller

On arm we start off with a pcie bridge pcie.0. We need a
keyboard in addition to the tablet device, and we need to
connect both to an 'ehci' controller.

To do all this, we also pass the $arch variable through a
whole lot of function calls to ultimately also adapt the
hotplug code to take care of the new keyboard device.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agoarm: use UART for serial0 instead of a separate device
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:41 +0000 (14:10 +0100)]
arm: use UART for serial0 instead of a separate device

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agoonly use vhost-net for native kvm machines
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:40 +0000 (14:10 +0100)]
only use vhost-net for native kvm machines

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agouse cortex-a57 as cpu for arm emulation for now...
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:39 +0000 (14:10 +0100)]
use cortex-a57 as cpu for arm emulation for now...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agomove cpu option creation into separate sub
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:38 +0000 (14:10 +0100)]
move cpu option creation into separate sub

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agouse qemu-system-aarch64 for arm machines
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:37 +0000 (14:10 +0100)]
use qemu-system-aarch64 for arm machines

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agouse AAVMF for arm
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:36 +0000 (14:10 +0100)]
use AAVMF for arm

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agocreate_vm: don't add vmgenid for ARM machines by default
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:35 +0000 (14:10 +0100)]
create_vm: don't add vmgenid for ARM machines by default

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agoadd 'arch' vm configuration
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:34 +0000 (14:10 +0100)]
add 'arch' vm configuration

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agofix and simplify kvm_version()
Wolfgang Bumiller [Mon, 12 Nov 2018 13:10:33 +0000 (14:10 +0100)]
fix and simplify kvm_version()

This was never actually used, but we want to use it as
alternative to checking /proc/cpuinfo for 'hvm' on ARM.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agofix #1959: add fallback for 'auto' previously set by SLAAC
David Limbeck [Thu, 25 Oct 2018 09:32:45 +0000 (11:32 +0200)]
fix #1959: add fallback for 'auto' previously set by SLAAC

SLAAC previously set 'auto' which is not supported by nocloud network
config. On an up-to-date Ubuntu this should work as it uses 'dhcp' for
both dhcp and SLAAC. For others it was invalid anyway.

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
19 months agobump version to 5.0-40
Thomas Lamprecht [Mon, 12 Nov 2018 16:28:45 +0000 (17:28 +0100)]
bump version to 5.0-40

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agocheck for $vga->{type} instead of $vga
Dominik Csapak [Mon, 12 Nov 2018 07:40:20 +0000 (08:40 +0100)]
check for $vga->{type} instead of $vga

with commit 55655ebc32ce4eb3fe52f233ec4ac5926b15603f
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>
19 months agoupdate bump to 5.0-39
Thomas Lamprecht [Fri, 9 Nov 2018 15:24:11 +0000 (16:24 +0100)]
update bump to 5.0-39

to include another ready fix in this release

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agofix #1969: increase max unused disks
David Limbeck [Mon, 5 Nov 2018 13:02:15 +0000 (14:02 +0100)]
fix #1969: increase max unused disks

increase to 256, same as containers

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
19 months agobump version to 5.0-39
Thomas Lamprecht [Fri, 9 Nov 2018 15:21:37 +0000 (16:21 +0100)]
bump version to 5.0-39

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agomove nbd_stop up, it's not a completion helper
Thomas Lamprecht [Fri, 9 Nov 2018 15:11:18 +0000 (16:11 +0100)]
move nbd_stop up, it's not a completion helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agofollowup for VGA memory: improve q35 comment
Thomas Lamprecht [Fri, 9 Nov 2018 13:01:45 +0000 (14:01 +0100)]
followup for VGA memory: improve q35 comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agofix #1952: make vga memory configurable
Dominik Csapak [Fri, 9 Nov 2018 12:31:09 +0000 (13:31 +0100)]
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>
20 months agoAdd `ssd` property to IDE, SATA, and SCSI drives
Nick Chevsky [Sun, 28 Oct 2018 20:41:46 +0000 (16:41 -0400)]
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>
20 months agobump version to 5.0-38
Wolfgang Bumiller [Thu, 18 Oct 2018 10:29:11 +0000 (12:29 +0200)]
bump version to 5.0-38

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agoadd second qmp socket with qemu 2.12
Dominik Csapak [Wed, 17 Oct 2018 12:31:19 +0000 (14:31 +0200)]
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>
20 months agobump version to 5.0-37
Wolfgang Bumiller [Tue, 16 Oct 2018 12:54:55 +0000 (14:54 +0200)]
bump version to 5.0-37

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agolower hv_synic, hv_stimer requirement to qemu 2.12
Wolfgang Bumiller [Tue, 16 Oct 2018 12:52:27 +0000 (14:52 +0200)]
lower hv_synic, hv_stimer requirement to qemu 2.12

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agoqemu_img_convert : use "-l snapshot.name" instead -s for internal snapshot
Alexandre Derumier [Sun, 7 Oct 2018 17:15:22 +0000 (19:15 +0200)]
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/

21 months agoadd virtio gpu to qemuserver options
Dominik Csapak [Thu, 27 Sep 2018 11:51:05 +0000 (13:51 +0200)]
add virtio gpu to qemuserver options

and sort the list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
21 months agobump version to 5.0-36
Thomas Lamprecht [Mon, 24 Sep 2018 09:39:01 +0000 (11:39 +0200)]
bump version to 5.0-36

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agouse qemu's blockdev-snapshot functions
Wolfgang Bumiller [Mon, 24 Sep 2018 08:44:22 +0000 (10:44 +0200)]
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>
21 months agorestore vm: vmgenid: fixup regex capturing group reference
Thomas Lamprecht [Wed, 19 Sep 2018 12:15:56 +0000 (14:15 +0200)]
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>
21 months agorollback: vmgenid: comment why we regenerate vmgenid
Thomas Lamprecht [Wed, 19 Sep 2018 11:34:48 +0000 (13:34 +0200)]
rollback: vmgenid: comment why we regenerate vmgenid

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agoschema: vmgenid: reword desscription, add verbose one and document default
Thomas Lamprecht [Wed, 19 Sep 2018 11:33:40 +0000 (13:33 +0200)]
schema: vmgenid: reword desscription, add verbose one and document default

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agorestore vm: vmgenid: small code cleanup
Thomas Lamprecht [Wed, 19 Sep 2018 11:31:19 +0000 (13:31 +0200)]
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>
21 months agofix #1908: add vmgenid config/device
Dominik Csapak [Wed, 19 Sep 2018 09:35:11 +0000 (11:35 +0200)]
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>
21 months agofix version check in qemu_machine_feature_enabled
Wolfgang Bumiller [Tue, 18 Sep 2018 07:35:26 +0000 (09:35 +0200)]
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>
21 months agobump version to 5.0-35
Thomas Lamprecht [Mon, 17 Sep 2018 13:30:55 +0000 (15:30 +0200)]
bump version to 5.0-35

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agod/control: bump version dependency on libpve-guest-common-perl
Thomas Lamprecht [Mon, 17 Sep 2018 13:34:19 +0000 (15:34 +0200)]
d/control: bump version dependency on libpve-guest-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agod/control: add libpve-guest-common-perl as build dependency
Thomas Lamprecht [Mon, 17 Sep 2018 13:33:56 +0000 (15:33 +0200)]
d/control: add libpve-guest-common-perl as build dependency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agoadd new tests for 'runningmachine' and rollback
Dominik Csapak [Fri, 14 Sep 2018 12:08:44 +0000 (14:08 +0200)]
add new tests for 'runningmachine' and rollback

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
21 months agofixup comment formatting
Thomas Lamprecht [Mon, 17 Sep 2018 13:49:14 +0000 (15:49 +0200)]
fixup comment formatting

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agoensure correct machine type gets saved on snapshot
Dominik Csapak [Fri, 14 Sep 2018 12:08:43 +0000 (14:08 +0200)]
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>
21 months agouse new snapshot rollback hook to handle machine type
Dominik Csapak [Fri, 14 Sep 2018 12:08:42 +0000 (14:08 +0200)]
use new snapshot rollback hook to handle machine type

this was in guest-common, makes more sense to do it here - it's not
guest agnostic after all.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
21 months agoqemu 3.0 : add hv_synic && hv_stimer hyperv enlightment
Alexandre Derumier [Fri, 31 Aug 2018 13:43:01 +0000 (15:43 +0200)]
qemu 3.0 : add hv_synic && hv_stimer hyperv enlightment

This fix cpu bug on last win10 updates

21 months agobump version to 5.0-34
Thomas Lamprecht [Thu, 13 Sep 2018 09:39:04 +0000 (11:39 +0200)]
bump version to 5.0-34

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agoimprove 'pending changes' message for clone
Dominik Csapak [Wed, 12 Sep 2018 08:53:52 +0000 (10:53 +0200)]
improve 'pending changes' message for clone

$newconf->{pending} is a reference to an empty hash, which is not falsy,
thus we always printed the warning

so check if there are actual values there and if yes,
give the names of the properties for which pending changes are found

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
22 months agod/control: add build dependency to qemu-utils
Thomas Lamprecht [Tue, 4 Sep 2018 08:22:43 +0000 (10:22 +0200)]
d/control: add build dependency to qemu-utils

the OVF tests use `qemu-img`, which is provided by either our
pve-qemu(-kvm) or qemu-utils (upstream).

Use qemu-utils as it's provided by ours and upstreams package and
thus makes bootstrapping easier, e.g., if our qemu package is not yet
installed this can still be build.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agod/control: add libio-multiplex-perl as build dependency
Thomas Lamprecht [Tue, 4 Sep 2018 08:14:41 +0000 (10:14 +0200)]
d/control: add libio-multiplex-perl as build dependency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agoadd ibpb, ssbd, virt-ssbd, amd-ssbd, amd-no-ssb, pdpe1gb cpu flags
Alexandre Derumier [Mon, 20 Aug 2018 15:53:18 +0000 (17:53 +0200)]
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/

22 months agofix #1865: CloudInit doesn't add IPv6
David Limbeck [Wed, 22 Aug 2018 09:35:49 +0000 (11:35 +0200)]
fix #1865: CloudInit doesn't add IPv6

Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agoqm rescan: fix typo in dryrun description
Thomas Lamprecht [Tue, 21 Aug 2018 07:21:41 +0000 (09:21 +0200)]
qm rescan: fix typo in dryrun description

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agobump version to 5.0-33
Thomas Lamprecht [Mon, 20 Aug 2018 12:43:37 +0000 (14:43 +0200)]
bump version to 5.0-33

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoFix #1242 : clone_disk : call qga fstrim after clone
Stoiko Ivanov [Wed, 1 Aug 2018 18:29:05 +0000 (20:29 +0200)]
Fix #1242 : clone_disk : call qga fstrim after clone

Some storage like rbd or lvm can't keep thin-provising after a qemu-mirror.

Call qga guest-fstrim if qga is available and fstrim_cloned_disks is enabled
after move_disk and migrate.

Co-Authored-By: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
23 months agoMake agent a property string, add fstrim_cloned_disks
Stoiko Ivanov [Wed, 1 Aug 2018 18:29:04 +0000 (20:29 +0200)]
Make agent a property string, add fstrim_cloned_disks

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
23 months agovmstatus: define return propertries
Dietmar Maurer [Wed, 1 Aug 2018 10:55:29 +0000 (12:55 +0200)]
vmstatus: define return propertries

We can use the same properties in vmlist and vmstatus.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
23 months agovmlist: document 'uptime' and 'cpus' returmn value
Dietmar Maurer [Tue, 31 Jul 2018 11:31:49 +0000 (13:31 +0200)]
vmlist: document 'uptime' and 'cpus' returmn value

23 months agobump version to 5.0-32
Thomas Lamprecht [Mon, 30 Jul 2018 08:56:15 +0000 (10:56 +0200)]
bump version to 5.0-32

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoagent: import used check_agent_error method
Thomas Lamprecht [Mon, 30 Jul 2018 08:59:44 +0000 (10:59 +0200)]
agent: import used check_agent_error method

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoapi/agent: do not dereference params hash before passing to agent_cmd
Thomas Lamprecht [Mon, 30 Jul 2018 08:41:48 +0000 (10:41 +0200)]
api/agent: do not dereference params hash before passing to agent_cmd

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agobump version to 5.0-31
Thomas Lamprecht [Mon, 30 Jul 2018 08:25:29 +0000 (10:25 +0200)]
bump version to 5.0-31

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoadd missing import of 'agent_cmd'
Dominik Csapak [Mon, 30 Jul 2018 06:24:59 +0000 (08:24 +0200)]
add missing import of 'agent_cmd'

see https://pve.proxmox.com/pipermail/pve-user/2018-July/169712.html

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoFix #1717: delete snapshot when vm running and drive not attached
Alexandre Derumier [Wed, 11 Jul 2018 11:55:53 +0000 (13:55 +0200)]
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

23 months agobump version to 5.0-30
Thomas Lamprecht [Tue, 17 Jul 2018 09:39:31 +0000 (11:39 +0200)]
bump version to 5.0-30

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoqm: move 'agent' command into 'guest' comand group
Thomas Lamprecht [Wed, 11 Jul 2018 11:27:51 +0000 (13:27 +0200)]
qm: move 'agent' command into 'guest' comand group

with a backwards compatible alias

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoqm: rename 'ga' command group to 'guest'
Thomas Lamprecht [Thu, 12 Jul 2018 12:44:50 +0000 (14:44 +0200)]
qm: rename 'ga' command group to 'guest'

https://pve.proxmox.com/pipermail/pve-devel/2018-July/033010.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoFix SPICE multi-monitor mode on q35
Dzmitry Kotsikau [Wed, 4 Jul 2018 11:51:32 +0000 (14:51 +0300)]
Fix SPICE multi-monitor mode on q35

Signed-off-by: Dzmitry Kotsikau <dkotsikau@gmail.com>
23 months agoqemu agent: fixup error message letter-case
Thomas Lamprecht [Wed, 11 Jul 2018 09:26:00 +0000 (11:26 +0200)]
qemu agent: fixup error message letter-case

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoimplement file-write via guest-agent in the api
Dominik Csapak [Tue, 26 Jun 2018 12:15:49 +0000 (14:15 +0200)]
implement file-write via guest-agent in the api

writes the given content to the file

the size is at the moment limited by the max post size of the
pveproxy/daemon, so we set the maxLength to 60k

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoimplement file-read api call via guest-agent
Dominik Csapak [Tue, 26 Jun 2018 12:15:48 +0000 (14:15 +0200)]
implement file-read api call via guest-agent

this api call reads a file via the guest agent,
(in 1MB chunks) but is limited to 16MiB (for now)

if the file is bigger, the output gets truncated and a
'truncated' flag is set in the return object

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoadd exec(-status) to qm
Dominik Csapak [Tue, 26 Jun 2018 12:15:47 +0000 (14:15 +0200)]
add exec(-status) to qm

on the commandline the implementation for exec is a bit different
because there we want (by default) to wait for the result,
as opposed to the api, where it is enough to return the pid and
let the client handle the polling

this behaviour is optional and can be turned off, as well as the
timeout of 30 seconds

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoimplement agent exec api call
Dominik Csapak [Tue, 26 Jun 2018 12:15:46 +0000 (14:15 +0200)]
implement agent exec api call

this imitates the qemu-guest-agent interface
with an 'exec' api call which returns a pid
and an 'exec-status' api call which takes a pid

the command for the exec call is given as an 'alist'
which means that when using we have to give the 'command'
parameter multiple times e.g.

pvesh create <...>/exec --command ls --command '-lha' --command '/home/user'

so that we avoid having to deal with shell escaping etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoadd 'passwd' to qm
Dominik Csapak [Tue, 26 Jun 2018 12:15:45 +0000 (14:15 +0200)]
add 'passwd' to qm

this adds a command 'qm ga passwd' so that we can reuse
'qm ga' for future guest agent calls

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoimplement set-user-password guest agent api call
Dominik Csapak [Tue, 26 Jun 2018 12:15:44 +0000 (14:15 +0200)]
implement set-user-password guest agent api call

this executes the guest agent command 'set-user-password'
with which one can change the password of an existing user in the vm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoadd Agent helper package
Dominik Csapak [Tue, 26 Jun 2018 12:15:43 +0000 (14:15 +0200)]
add Agent helper package

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoqm: add more return schema definitions
Dietmar Maurer [Tue, 10 Jul 2018 11:59:37 +0000 (13:59 +0200)]
qm: add more return schema definitions

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoqm rescan: add dryrun option
Thomas Lamprecht [Wed, 11 Jul 2018 06:40:07 +0000 (08:40 +0200)]
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>
23 months agorescan update_disksize: be more verbose
Thomas Lamprecht [Wed, 11 Jul 2018 06:40:06 +0000 (08:40 +0200)]
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>
2 years agorescan: comment that this is a temporarily workaround
Thomas Lamprecht [Thu, 5 Jul 2018 06:46:11 +0000 (08:46 +0200)]
rescan: comment that this is a temporarily workaround

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoFix #1650: add content type filter to rescan
Alwin Antreich [Tue, 3 Jul 2018 15:41:09 +0000 (17:41 +0200)]
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>
2 years agod/control: update pve-common version dependency
Thomas Lamprecht [Wed, 27 Jun 2018 11:40:42 +0000 (13:40 +0200)]
d/control: update pve-common version dependency

as we use the new param_mapping functionallity from PVE::CLIHandler

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoqm: PVE::PTY is not used anymore
Thomas Lamprecht [Wed, 27 Jun 2018 11:58:33 +0000 (13:58 +0200)]
qm: PVE::PTY is not used anymore

2 years agouse get_standard_mapping for cipassword_map
Dominik Csapak [Mon, 25 Jun 2018 10:33:26 +0000 (12:33 +0200)]
use get_standard_mapping for cipassword_map

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobump version to 5.0-29
Thomas Lamprecht [Fri, 15 Jun 2018 10:13:34 +0000 (12:13 +0200)]
bump version to 5.0-29

2 years agod/control: update version dependency on pve-common
Thomas Lamprecht [Fri, 15 Jun 2018 10:11:01 +0000 (12:11 +0200)]
d/control: update version dependency on pve-common

To ensure we have the enw Systemd module available to use

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agouse the new PVE::SystemD package
Wolfgang Bumiller [Fri, 15 Jun 2018 09:00:53 +0000 (11:00 +0200)]
use the new PVE::SystemD package

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agouse 'system_wakeup' to resume suspended vms
Dominik Csapak [Wed, 13 Jun 2018 09:17:26 +0000 (11:17 +0200)]
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>
2 years agoapi create: cleanup the new config log on error
Wolfgang Bumiller [Tue, 12 Jun 2018 08:50:41 +0000 (10:50 +0200)]
api create: cleanup the new config log on error

Otherwise cases like trying to restore a protected VM would
leave a lock in the config.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi create: allow auto vm start after create finished
Thomas Lamprecht [Fri, 1 Jun 2018 14:37:41 +0000 (16:37 +0200)]
api create: allow auto vm start after create finished

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoreserve config with create lock early
Thomas Lamprecht [Fri, 1 Jun 2018 14:37:40 +0000 (16:37 +0200)]
reserve config with create lock early

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoAPI/create: move locking inside worker
Thomas Lamprecht [Fri, 1 Jun 2018 14:37:39 +0000 (16:37 +0200)]
API/create: move locking inside worker

Move the locking inside worker, so that the process doing the actual
work (create or restore) holds the lock, and can call functions which
do locking without deadlocking.

This mirrors the behaviour we use for containers, and allows to add
an 'autostart' parameter which starts the VM after successful
creation. vm_start needs the lock and as not the worker but it's
parents held it, it couldn't know that it was actually save to
continue...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 5.0-28
Thomas Lamprecht [Mon, 11 Jun 2018 10:55:33 +0000 (12:55 +0200)]
bump version to 5.0-28

2 years agorefactor Makefile for PVE/QemuServer/ directory
Dominik Csapak [Thu, 7 Jun 2018 11:16:50 +0000 (13:16 +0200)]
refactor Makefile for PVE/QemuServer/ directory

this makes it easier to add new files there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agocloud-init: nocloud v1: use lower case mac address
Wolfgang Bumiller [Wed, 6 Jun 2018 14:13:26 +0000 (16:13 +0200)]
cloud-init: nocloud v1: use lower case mac address

because cloud-init...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agocloud-init: nocloud v1: set ip and netmask instead of cidr
Wolfgang Bumiller [Wed, 6 Jun 2018 14:13:25 +0000 (16:13 +0200)]
cloud-init: nocloud v1: set ip and netmask instead of cidr

because of centos7's broken cloud-init version

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 5.0-27
Thomas Lamprecht [Tue, 5 Jun 2018 13:25:03 +0000 (15:25 +0200)]
bump version to 5.0-27

2 years agoAdd .gitignore
René Jochum [Wed, 18 Apr 2018 20:26:00 +0000 (22:26 +0200)]
Add .gitignore

Signed-off-by: René Jochum <rene@jochums.at>
2 years agoadd nowarn to qga_check_running
Thomas Lamprecht [Wed, 30 May 2018 06:20:25 +0000 (08:20 +0200)]
add nowarn to qga_check_running

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoqm agent : check if qga service is running
Alexandre Derumier [Mon, 28 May 2018 15:36:29 +0000 (17:36 +0200)]
qm agent : check if qga service is running