]> git.proxmox.com Git - qemu-server.git/log
qemu-server.git
4 years agobump version to 5.0-56 stable-5
Thomas Lamprecht [Wed, 8 Apr 2020 15:06:21 +0000 (17:06 +0200)]
bump version to 5.0-56

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd Ice Lake CPU types
Thomas Lamprecht [Wed, 8 Apr 2020 13:11:55 +0000 (15:11 +0200)]
add Ice Lake CPU types

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoconfig: harmonize bridge pattern
Fabian Grünbichler [Wed, 8 Apr 2020 12:02:49 +0000 (14:02 +0200)]
config: harmonize bridge pattern

so that pve-container and qemu-server use the same one, in preparation
for moving it to JSONSchema and having a bridgepair format.

(cherry picked from commit 5ef36728901f3ae459eb649aceea38620f0a09e2)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobump version to 5.0-55
Thomas Lamprecht [Thu, 5 Dec 2019 14:30:00 +0000 (15:30 +0100)]
bump version to 5.0-55

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoFix #2171: vm_start: volid based statefiles were not activated
Thomas Lamprecht [Thu, 17 Oct 2019 17:13:01 +0000 (19:13 +0200)]
Fix #2171: vm_start: volid based statefiles were not activated

So, while we could just make this a special case before the
config_to_command call and set the $conf->{vmstate} to the statefile
for the case were it's a valid volumeid, the special case handling
get's much easier when we do this outside of that method.

So it's basically a trade-off, and after looking far to long at all
nice revisions Alwin made for me and Fabians request, and even trying
out different approaches, it was never perfect.

But having slight code duplication over the movement mess I proposed
(as I did not had the full picture then, sorry Alwin) felt like the
slightly nicer trade off, as all worked I just use this one now, it
has very clear semantics, easy to understand and that now three lines
are duplicated is IMO irrelevant.

Co-developed-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 5c1d42b7f825fa124ff3701b32f9ecc011bece95)
[squashed the two fixups from master into this one]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd: push vmstate to volid list to ensure it gets also deactivated
Thomas Lamprecht [Thu, 17 Oct 2019 17:10:43 +0000 (19:10 +0200)]
cfg2cmd: push vmstate to volid list to ensure it gets also deactivated

the volume id list is only used to activate before real start and
deactivate later, so use it for the vmstate file too.

This not only makes config_to_command have less side effects, it also
ensures that the vmstate is deactivated again

Co-developed-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 8f899d734e1c84c0db2f70a7200854387a9e51da)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoImprove handling and description of migrate with --online
Fabian Ebner [Mon, 18 Nov 2019 14:41:15 +0000 (15:41 +0100)]
Improve handling and description of migrate with --online

Thanks to Stefan and Thomas for the suggestions.

Changes from v1:
* update parameter description
* warn instead of die

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
(cherry picked from commit 13739386276e14c98580db5fdd264041afec1492)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agoclose #2263: die on live migration with local cloudinit disk
Mira Limbeck [Mon, 18 Nov 2019 14:41:14 +0000 (15:41 +0100)]
close #2263: die on live migration with local cloudinit disk

Live migration with a local cloudinit disk was never intended to work. It did
however work to an extent that the migration completed but the disk on the
source node could not be deleted. Now die if a live migration is started with
a local cloudinit disk.

With the GUI changes live migration is already disabled as it recognizes the
cloudinit disk as a local resource.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
(cherry picked from commit 9860fe4ef992e8550f8dee9aed65e2fed75c470f)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agofix: qemu: uninitialized value in multiplication
Alwin Antreich [Mon, 18 Nov 2019 14:41:13 +0000 (15:41 +0100)]
fix: qemu: uninitialized value in multiplication

A generated VM with default values does not set the memory key in the
configuration. Hence the size of the state file for a suspend had only
the default size of the state itself and not in addition twice the
configured memory.

The patch uses the static defaults from the JSON schema if the memory
key is not set.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
(cherry picked from commit 22ea69ca65b14bf0caf64dd0daf5c6bff675edf8)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agofix #2275: die on invalid sendkey
Dominik Csapak [Mon, 18 Nov 2019 14:41:12 +0000 (15:41 +0100)]
fix #2275: die on invalid sendkey

sendkey does not return anything if it is succesful and the error otherwise

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit d30820d6c382a3c0c1979b33f2f5177900735ade)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agoFix guest agent shutdown without timeout
Stefan Reiter [Mon, 18 Nov 2019 14:41:11 +0000 (15:41 +0100)]
Fix guest agent shutdown without timeout

Regression from change allowing timeouts to be set, now shutting down
also works without timeouts again (previously qmp failed because of
the unknown "timeout" parameter passed to it).

We always delete the timeout value from the arguments, regardless of
truthiness. "delete" returns the deleted element, deleting a
non-existant hash entry returns undef, which is fine after this point:

"deleting non-existent elements returns the undefined value in their
corresponding positions."
- https://perldoc.perl.org/functions/delete.html

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
(cherry picked from commit 1688362d4e0367888c9d2f592e7948e5b4e8069a)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agofix #2244: Allow timeout for guest-agent shutdown
Stefan Reiter [Mon, 18 Nov 2019 14:41:10 +0000 (15:41 +0100)]
fix #2244: Allow timeout for guest-agent shutdown

The "guest-shutdown" guest agent call is blocking for some reason, so if
it fails (e.g. agent not installed on guest) only the default timeout of
10 minutes (see QMPClient.pm, sub cmd) would apply.

With this change, if (and only if) a timeout is specified via CLI/API,
it is used instead. In case it is not specified, behaviour stays the
same (default 10 min timeout).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
(cherry picked from commit 0eb21691361ccb9d30b10114016423e0d0defdd8)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agofix remote viewer live migration
Dominik Csapak [Tue, 20 Aug 2019 08:45:32 +0000 (10:45 +0200)]
fix remote viewer live migration

for some reason not setting port results in a port of '65535' which
triggers an execption in http-server anyevent, so we set the port to 0

also, we have to read the ticket from stdin even for 'unix' type secure
migration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit ccab68c22c2df2e75a272635d22fd19840274b17)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2382: delete cloudinit disk before restoring
Mira Limbeck [Wed, 25 Sep 2019 13:30:12 +0000 (15:30 +0200)]
fix #2382: delete cloudinit disk before restoring

The fix introduced in commit bf4a933 did not work as intended. We're
iterating over the $oldconf, not over $virtdev_hash. This means
$drive->{is_cloudinit} is always undefined. Instead use the $exclude_cloudinit
parameter from drive_is_cdrom().

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
(cherry picked from commit a82348eb343b64496035f7ed74cecfc364a046fb)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoFix: rtcflags: ignore startdate 'now'
Alwin Antreich [Thu, 4 Jul 2019 09:00:58 +0000 (11:00 +0200)]
Fix: rtcflags: ignore startdate 'now'

If 'now' is passed to the startdate option, the kvm start fails with
below failure.
 kvm: invalid datetime format
 valid formats: '2006-06-17T16:01:21' or '2006-06-17'

With this patch, 'now' is ignored and not passed to the rtcflags (-rtc).

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
(cherry picked from commit 85f0511db3a5c2ec13495100f6f7d6a6f48d7c65)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-54
Thomas Lamprecht [Mon, 24 Jun 2019 14:51:34 +0000 (16:51 +0200)]
bump version to 5.0-54

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump version dependency to libpve-common-perl
Thomas Lamprecht [Mon, 24 Jun 2019 14:50:31 +0000 (16:50 +0200)]
d/control: bump version dependency to libpve-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: wrap and sort + remove duplicates
Thomas Lamprecht [Mon, 24 Jun 2019 14:50:03 +0000 (16:50 +0200)]
d/control: wrap and sort + remove duplicates

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agowait for vm scopes to be gone
Wolfgang Bumiller [Wed, 19 Jun 2019 07:21:22 +0000 (09:21 +0200)]
wait for vm scopes to be gone

This should help with the rare case where stop mode backups
fail to restart due to the $vmid.scope not being completely
gone when we want to restart. This queries systemd via dbus,
and if the scope is still there, awaits a UnitRemoved signal
for the scope from dbus.

For now with a 5 second timeout... (given that the processes
are already gone and it's really just waiting for systemd to
wake up, this should be plenty...)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
(cherry picked from commit 4f8cfa190abe85c9db0199743668024b09a3727b)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-53
Thomas Lamprecht [Fri, 7 Jun 2019 15:25:40 +0000 (17:25 +0200)]
bump version to 5.0-53

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump pve-qemu-kvm versioned dependency to 3.0.1-3
Thomas Lamprecht [Fri, 7 Jun 2019 15:25:14 +0000 (17:25 +0200)]
bump pve-qemu-kvm versioned dependency to 3.0.1-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: mention new md-clear flag also in description
Thomas Lamprecht [Thu, 6 Jun 2019 15:47:41 +0000 (17:47 +0200)]
followup: mention new md-clear flag also in description

that should really be autogenerated!

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd md-clear cpu flag
Oguz Bektas [Mon, 3 Jun 2019 13:17:11 +0000 (15:17 +0200)]
add md-clear cpu flag

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
5 years agoFix #1999: cli: listsnapshot: handle multiple roots and mark orphaned as root
Rhonda D'Vine [Wed, 5 Jun 2019 13:30:48 +0000 (15:30 +0200)]
Fix #1999: cli: listsnapshot: handle multiple roots and mark orphaned as root

This commit addresses the following things:

* There can be multiple independent snapshot tree roots, display them
  all
* If a snapshot defines a parent that doesn't exist, it is now
  considered a snapshot root

There is a potential issue (which was also before and also affects the
GUI): circular snapshot trees.  That plays into the second mentioned
issue above.  If you manage to have a snapshot that defines a
non-existing root in the config, and then create a snapshot with that
exact name as a child of that snapshot, it would create a circular
dependency.  This would have to get addressed in the GUI too.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 3e494a3ca7715176b9b29bd6d538fab1fd9fa592)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-52
Thomas Lamprecht [Sat, 25 May 2019 12:26:23 +0000 (14:26 +0200)]
bump version to 5.0-52

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agovm_resume: correctly honor $nocheck
Fabian Grünbichler [Thu, 23 May 2019 19:22:22 +0000 (21:22 +0200)]
vm_resume: correctly honor $nocheck

for both vm_mon_cmd calls. under certain circumstances, the following
sequence of events can otherwise fail when live-migrating under load:

S...source node
T...target node

0: migration is complete, handover from S to T starts
1: S: logically move VM config file from S to T via rename()
2: S: rename returns, config file is (visibly) moved on S
3: S: trigger resume on T via mtunnel
4a: T: call vm_resume while config file move is not yet visible on T
4b: T: call vm_resume while config file move is already visible on T

4a instead of 4b means vm_mon_cmd will die in check_running unless
vm_mon_cmd_nocheck is used.

under heavy pmxcfs load and a slow cluster/corosync network, there can
be a few seconds of delay between 1 and 2, with a subsequent race ending in 4a
instead of 4b.

this issue was reported to occur on bulk migrations.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 3e24733bdf9bef232be8e5205bf5e73338e65bdb)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofixup: delete cloudinit disk before restoring
Thomas Lamprecht [Fri, 17 May 2019 10:09:51 +0000 (12:09 +0200)]
fixup: delete cloudinit disk before restoring

cloudinit is just completely broken...
Until we rewrite this to a sane designe (i.e., never backup, mirror,
... any CI disk anywhere - the state is in the config and gets
created on start and deleted on stop anyway) do this..

Co-developed-by: Mira Limbek <m.limbek@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoQemuServer: code cleanup
Thomas Lamprecht [Fri, 17 May 2019 08:53:50 +0000 (10:53 +0200)]
QemuServer: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollouwp: set is_cloudinit in drive to avoid always rechecking
Thomas Lamprecht [Fri, 17 May 2019 08:53:30 +0000 (10:53 +0200)]
follouwp: set is_cloudinit in drive to avoid always rechecking

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agomap cloudinit disk to new vmid on restore
Mira Limbeck [Thu, 16 May 2019 12:07:01 +0000 (14:07 +0200)]
map cloudinit disk to new vmid on restore

Resolves the issue of restoring a VM that has a cloudinit drive
configured to a new VMID. The VMID of the disk name gets now remapped
correctly and in the process the cloudinit disk is created with the same size
as in PVE/API2/Qemu.pm create_disks and in PVE/QemuServer/Cloudinit
commit_cloudinit_disk as the same constant is used.

This is done by matching any line starting with either 'ide', 'sata' or
'scsi' and then check if it is a cloudinit drive. As cloudinit drives
are attached as cdrom, only those 3 are possible. For the cloudinit
check we use 'parse_drive' followed by 'drive_is_cloudinit' so no custom
regex is necessary.

'--targetstorage' is also taken into account on restore now for
cloudinit disks. If a target storage is specified the format is either
kept if possible, or changed to the default of that storage.

This should fix #1807 completely. The restore error was already resolved
with commit 7e8ab2a, but the vmid of the disk might not have matched the new
one.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
5 years agointroduce one global CLOUDINIT_DISK_SIZE constant
Mira Limbeck [Thu, 16 May 2019 12:07:00 +0000 (14:07 +0200)]
introduce one global CLOUDINIT_DISK_SIZE constant

The variable is used instead of the literal value so we have one single
place to change the actual value of every use.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
5 years agofixup: shorter/conciser comment
Thomas Lamprecht [Thu, 16 May 2019 14:28:53 +0000 (16:28 +0200)]
fixup: shorter/conciser comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix clone_disk with formats other than raw/qcow2
Mira Limbeck [Thu, 16 May 2019 13:08:50 +0000 (15:08 +0200)]
fix clone_disk with formats other than raw/qcow2

with commit 64d1a6a it's now possible to specify a format other than raw
or qcow2 when creating VMs. This can lead to an error when cloning the
VMs and a cloudinit disk with a different format is attached (e.g.
vmdk).

We use QEMU_FORMAT_RE in drive_is_cloudinit and according to the
QEMU_FORMAT_RE we support 7 different formats.

With this change we add any format other than 'raw' as '.<format>' to the
name and no longer die on any other format. Cloudinit disks with invalid
format are not cloned as the drive is recognized as cdrom, not cloudinit.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
5 years agofollowup: fixup comment
Thomas Lamprecht [Wed, 15 May 2019 14:33:46 +0000 (16:33 +0200)]
followup: fixup comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix existing cloudinit volume not available for file_size_info
Mira Limbeck [Wed, 15 May 2019 10:53:24 +0000 (12:53 +0200)]
fix existing cloudinit volume not available for file_size_info

file_size_info can't find the file if it is not available, e.g.,
RBD storage with KRBD or LVM where the volume was not yet activated,
returns then 0, which we interpret as the disk not existing, thus
call vdisk_alloc which errors as the disk, in fact, really already exists.

With this patch we call activate_volume before trying
file_size_info, so if the volume exists we get it available and else
we can really create it.
If the disk does not exist and is created with vdisk_alloc we still
require an additional call to activate_volume for the new disk.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #503: print correct offline time for stop mode backups
Thomas Lamprecht [Wed, 8 May 2019 17:32:37 +0000 (17:32 +0000)]
fix #503: print correct offline time for stop mode backups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: add ${misc:Depends} to Depends list
Thomas Lamprecht [Mon, 13 May 2019 16:06:50 +0000 (16:06 +0000)]
d/control: add ${misc:Depends} to Depends list

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofixup: correct initial prefix
Thomas Lamprecht [Mon, 13 May 2019 06:05:51 +0000 (06:05 +0000)]
fixup: correct initial prefix

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agominor followup cleanups
Thomas Lamprecht [Mon, 13 May 2019 05:49:31 +0000 (05:49 +0000)]
minor followup cleanups

remove now out of date commen about 'our', left over from previous
revision

Pass firs $prefix directly to function and some other small stuff

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #1999: create a tree view for qm listsnapshot
Rhonda D'Vine [Fri, 10 May 2019 12:45:55 +0000 (14:45 +0200)]
fix #1999: create a tree view for qm listsnapshot

The look of the tree is based on the GUI variant, so that we have a
consistent output when run multiple times, too.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agomigrate: log which local resource causes error
Tim Marx [Fri, 3 May 2019 12:22:39 +0000 (14:22 +0200)]
migrate: log which local resource causes error

Signed-off-by: Tim Marx <t.marx@proxmox.com>
5 years agowhitespace cleanup
Tim Marx [Fri, 3 May 2019 12:22:38 +0000 (14:22 +0200)]
whitespace cleanup

Signed-off-by: Tim Marx <t.marx@proxmox.com>
5 years agobump version to 5.0-51
Thomas Lamprecht [Tue, 30 Apr 2019 14:08:27 +0000 (14:08 +0000)]
bump version to 5.0-51

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agocloudinit: use detected format in volname parsing
Thomas Lamprecht [Tue, 30 Apr 2019 13:24:53 +0000 (13:24 +0000)]
cloudinit: use detected format in volname parsing

keep the ?, as format is raw if no file ending is there, which we
want to handle too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: do not query size of image we just created
Thomas Lamprecht [Tue, 30 Apr 2019 13:09:21 +0000 (13:09 +0000)]
followup: do not query size of image we just created

we know the size, and even if a storage plugin pads this up (it
mustn't alloc something smaller, but something bigger can be OK) we
know that our 4MB is OK, and can only be used anyway to make this
compatible between storage plugins.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: make ISO exists check a bit stricter
Thomas Lamprecht [Tue, 30 Apr 2019 13:07:55 +0000 (13:07 +0000)]
followup: make ISO exists check a bit stricter

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #2173: use qemu-img to check cloudinit disk existence
Mira Limbeck [Tue, 30 Apr 2019 12:20:47 +0000 (14:20 +0200)]
fix #2173: use qemu-img to check cloudinit disk existence

use file_size_info to check for existence of cloudinit disk instead of
'-e'. It uses `qemu-img info` to get some file info, which can handle
rbd, and various other paths for volumes not exposed as normal file
or not mapped, yet.

this addresses a problem with rbd where the path returned available
is not checkable with '-e'.

Any size > 0 is interpreted as the image existing.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix: #1075: Restore VM template to VM and try to convert to template.
Christian Ebner [Fri, 19 Apr 2019 10:06:07 +0000 (12:06 +0200)]
fix: #1075: Restore VM template to VM and try to convert to template.

The restore of a backup from a VM template will first restore the VM and then
convert the restored VM back into a template.
This automatically performes the steps of the current behaviour, where the user
has to manually convert the restored VM back to a template.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 years agocreate ci disk: long line cleanup
Thomas Lamprecht [Wed, 24 Apr 2019 13:33:32 +0000 (13:33 +0000)]
create ci disk: long line cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: keep raw as default for non-path based stores
Thomas Lamprecht [Wed, 24 Apr 2019 13:27:16 +0000 (13:27 +0000)]
followup: keep raw as default for non-path based stores

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #1829: Cloudinit ignore format parameter
Wolfgang Link [Tue, 16 Apr 2019 07:58:22 +0000 (09:58 +0200)]
fix #1829: Cloudinit ignore format parameter

When a Cloudinit image is created, we allow choosing
the format as parameter.
So, the parameter should also be taken into account.

The default for Cloudinit will stay qcow2 on directory storages.

5 years agofollowup: expand check_vm_modify_config_perm comment
Thomas Lamprecht [Fri, 12 Apr 2019 14:19:45 +0000 (16:19 +0200)]
followup: expand check_vm_modify_config_perm comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoallow non root users to add spice usb port
Dominik Csapak [Fri, 12 Apr 2019 14:08:37 +0000 (16:08 +0200)]
allow non root users to add spice usb port

using the same logic like serialX: socket
users need VM.Config.HWType for usbX: spice
but only root can add/remove real devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agomove check for serialX: socket
Dominik Csapak [Fri, 12 Apr 2019 14:08:36 +0000 (16:08 +0200)]
move check for serialX: socket

since we do not want the user to change a device which has a real
devices already set, we have to check it later when we have the config

so we do not have to give the params to vm_check_modify_config_perm anymore

also improve the regex to \d+

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #1811: allow non root user to edit serialX: socket entries
Dominik Csapak [Thu, 11 Apr 2019 11:39:49 +0000 (13:39 +0200)]
fix #1811: allow non root user to edit serialX: socket entries

use VM.Config.HWType for 'socket' and root@pam for real serial devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocode cleanup
Thomas Lamprecht [Fri, 5 Apr 2019 15:37:18 +0000 (17:37 +0200)]
code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix creating clone if target storage is same as source storage
Alwin Antreich [Fri, 5 Apr 2019 12:35:45 +0000 (14:35 +0200)]
fix creating clone if target storage is same as source storage

the clone API calls (target) 'storage' parameter is optional as we
simply use the source storage in this case, but we did not handle
this case when we added the bandwidth_limit abillity, address that.

This patch only pushes the storage parameter into the storage_list array
if it is defined.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-50
Thomas Lamprecht [Thu, 4 Apr 2019 14:22:39 +0000 (16:22 +0200)]
bump version to 5.0-50

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: remove unused variable and add spave between value and unit
Thomas Lamprecht [Tue, 2 Apr 2019 12:33:10 +0000 (14:33 +0200)]
followup: remove unused variable and add spave between value and unit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: reword bwlimit default wording
Thomas Lamprecht [Tue, 2 Apr 2019 08:37:40 +0000 (10:37 +0200)]
followup: reword bwlimit default wording

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobwlimit: add parameter to API2 calls
Stoiko Ivanov [Mon, 1 Apr 2019 09:31:05 +0000 (11:31 +0200)]
bwlimit: add parameter to API2 calls

for migrate_vm, clone_vm and move_vm_disk and extract it. The 'migrate_vm' call
passes it to PVE::QemuMigrate->migrate for handling.

Additionally the bwlimit option's description of the 'create_vm' call gets
consistent capitalization of I/O.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobwlimit: add parameter to QemuServer::clone_disk
Stoiko Ivanov [Mon, 1 Apr 2019 09:31:04 +0000 (11:31 +0200)]
bwlimit: add parameter to QemuServer::clone_disk

and pass it to qemu_drive_mirror (used for online disks).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobwlimit: add parameter for QemuMigrate::phase2
Stoiko Ivanov [Mon, 1 Apr 2019 09:31:02 +0000 (11:31 +0200)]
bwlimit: add parameter for QemuMigrate::phase2

used for online local disks via qemu_drive_mirror

Add TODO comment for offline disks, as clone_disk calls `qemu-img
convert`, which does not have a bandwidth limit parameter.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobwlimit: add parameter to QemuMigrate::sync_disks
Stoiko Ivanov [Mon, 1 Apr 2019 09:31:00 +0000 (11:31 +0200)]
bwlimit: add parameter to QemuMigrate::sync_disks

used for offline migration of local volumes

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobwlimit: add parameter to qemu_drive_mirror
Stoiko Ivanov [Mon, 1 Apr 2019 09:30:59 +0000 (11:30 +0200)]
bwlimit: add parameter to qemu_drive_mirror

used for online drive migrations, move_disk and clone calls.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobwlimit: honor bwlimit for migrate qmp call
Stoiko Ivanov [Mon, 1 Apr 2019 09:30:58 +0000 (11:30 +0200)]
bwlimit: honor bwlimit for migrate qmp call

The 'migrate_speed' can be set in the VM config. Additionally the 'migrate'
bwlimit from datacenter.cfg (storage-specific limits play no role for
memory+state migration) or the parameter provided to the API call can restrict
the speed. Take the lower of the two.

This patch also refactors the setting of migrate_speed and comments for clarity.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agochange task name for suspend with and without disk
Dominik Csapak [Fri, 29 Mar 2019 09:44:31 +0000 (10:44 +0100)]
change task name for suspend with and without disk

so that we can differentiate in the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agodrive mirror: cleanup exception handling code a bit
Thomas Lamprecht [Sat, 30 Mar 2019 08:36:30 +0000 (09:36 +0100)]
drive mirror: cleanup exception handling code a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #2100: ignore cloudinit drive on offline migration
Mira Limbeck [Fri, 29 Mar 2019 15:32:04 +0000 (16:32 +0100)]
fix #2100: ignore cloudinit drive on offline migration

disk is not copied to the target node but still deleted on cleanup
(phase3_cleanup).

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocloudinit: create disk if it does not exist on start
Mira Limbeck [Fri, 29 Mar 2019 15:32:03 +0000 (16:32 +0100)]
cloudinit: create disk if it does not exist on start

create a fixed size cloudinit disk if it is referenced in config and
does not exist. the size of the disk created when first added to the
config is reduced to 4MiB to match the one created in
commit_cloudinit_disk.
maximum file size per snippet file (network, user, meta) is increased to 1MiB.
preparation for offline migration without the cloudinit disk (that is
always regenerated on start).

also fixes #1807, although a further patch is required to change the
vmid on restore

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agopartially revert 4efb58a - unquote configdrive2 ips
Mira Limbeck [Mon, 25 Mar 2019 11:34:44 +0000 (12:34 +0100)]
partially revert 4efb58a - unquote configdrive2 ips

configdrive2 uses /etc/network/interfaces style config instead of the
official yaml one. this does not allow quoting of the ip addresses.

Tested with Windows Server 2016.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
5 years agobump version to 5.0-49
Thomas Lamprecht [Thu, 21 Mar 2019 11:56:02 +0000 (12:56 +0100)]
bump version to 5.0-49

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoremove registering 'pve-snapshot-name', now in common
Thomas Lamprecht [Thu, 21 Mar 2019 11:53:45 +0000 (12:53 +0100)]
remove registering 'pve-snapshot-name', now in common

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: which lock
Thomas Lamprecht [Thu, 21 Mar 2019 11:53:17 +0000 (12:53 +0100)]
followup: which lock

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd lock to vm status
Dominik Csapak [Wed, 20 Mar 2019 10:29:01 +0000 (11:29 +0100)]
add lock to vm status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 5.0-48
Thomas Lamprecht [Tue, 19 Mar 2019 12:26:20 +0000 (13:26 +0100)]
bump version to 5.0-48

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoapi/resume: allow to resume 'to-disk suspended' VMs
Thomas Lamprecht [Tue, 19 Mar 2019 11:57:08 +0000 (12:57 +0100)]
api/resume: allow to resume 'to-disk suspended' VMs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik CSapak <d.csapak@proxmox.com>
5 years agoincrease timeout when resuming suspended VM
Dominik Csapak [Tue, 19 Mar 2019 08:17:31 +0000 (09:17 +0100)]
increase timeout when resuming suspended VM

when the state is on a slow storage, it can take a while to load it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agosuspend: output some information about progress
Dominik Csapak [Tue, 19 Mar 2019 08:17:30 +0000 (09:17 +0100)]
suspend: output some information about progress

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd correct comment about savevm-start
Dominik Csapak [Tue, 19 Mar 2019 08:17:29 +0000 (09:17 +0100)]
add correct comment about savevm-start

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd statestorage parameter to suspend API
Dominik Csapak [Thu, 14 Mar 2019 16:04:50 +0000 (17:04 +0100)]
add statestorage parameter to suspend API

this makes it possible to give a storage for state saving, if one
wants to use a different storage than for snapshots or does not
want to save this info into the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd ability to suspend a vm to disk from the api
Dominik Csapak [Thu, 14 Mar 2019 16:04:49 +0000 (17:04 +0100)]
add ability to suspend a vm to disk from the api

this enables the use of the suspend to disk code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoresume suspended vm on start
Dominik Csapak [Thu, 14 Mar 2019 16:04:48 +0000 (17:04 +0100)]
resume suspended vm on start

if a vm has the 'suspended' lock, we resume with the saved state
and remove the lock, the saved vmstate and the saved runningmachine
after the vm started

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoimplement suspend to disk for running vms
Dominik Csapak [Thu, 14 Mar 2019 16:04:47 +0000 (17:04 +0100)]
implement suspend to disk for running vms

the idea is to have the same logic as with snapshots, but without
the snapshotting of the disks, and after saving the vm state (incl memory),
we hard shut off the guest.

this way the disks will not be touched anymore by the guest

to prevent any alteration of the vm (incl migration, hw changes, etc) we
add a config lock 'suspend'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocorrect comment about size
Dominik Csapak [Thu, 14 Mar 2019 16:04:46 +0000 (17:04 +0100)]
correct comment about size

and remove comment that makes no sense

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agod/control: bump version dependency of libpve-common-perl
Stoiko Ivanov [Tue, 12 Mar 2019 15:07:46 +0000 (16:07 +0100)]
d/control: bump version dependency of libpve-common-perl

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoconfig: NIC macaddr: enforce unicast MAC addresses
Stoiko Ivanov [Tue, 12 Mar 2019 15:07:45 +0000 (16:07 +0100)]
config: NIC macaddr: enforce unicast MAC addresses

creating a VM with a NIC with multicast mac (see [1]) is possible, but setting
the interface's link up inside the guest fails (tested on Debian stable).
The issue was noted with LXC first (see [0,2]) and then tested with Qemu.

This patch uses the 'mac-addr' standard_option defined in PVE::JSONSchema to
ensure only unicast MAC addresses are used for netconfig.

[0] https://lists.linuxcontainers.org/pipermail/lxc-users/2010-August/000783.html
[1] https://en.wikipedia.org/wiki/MAC_address
[2] https://pve.proxmox.com/pipermail/pve-devel/2019-March/035996.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #2131: get correct device when deleting iothreads
Dominik Csapak [Wed, 13 Mar 2019 16:28:04 +0000 (17:28 +0100)]
fix #2131: get correct device when deleting iothreads

we map scsiX to virtioscsiX/scsihwX when we use virtio-scsi-single to add
and iothread so we have to map it back when we delete an iothread, else the
parsing fails with

'invalid drive key: virtioscsi0'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #2120: use hosts initiator name with qemu-img
Dominik Csapak [Thu, 7 Mar 2019 12:43:11 +0000 (13:43 +0100)]
fix #2120: use hosts initiator name with qemu-img

qemu-img uses the qemu default initiator name 'iqn.2008-11.org.linux-kvm'
since we use the one of the host (/etc/iscsi/initiatorname.iscsi) when
using it with a running vm, we want to using it also when moving a disk
with qemu-img

to do that we have give qemu-img the image in as a full option string

this fixes the issue that we could not move an zfs-over-iscsi disk
without allowing the default qemu initiator

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocloud-init: allow custom network/user data files via snippets
David Limbeck [Thu, 7 Feb 2019 14:12:35 +0000 (15:12 +0100)]
cloud-init: allow custom network/user data files via snippets

Adds the 'cicustom' option to specify either or both network and user
options as property strings. Their parameters are files in a snippets
storage (e.g. local:snippets/network.yaml). If one or both are specified
they are used instead of their respective generated configuration.
This allows the use of completely custom configurations and is also a
possible solution for bug #2068 by specifying a custom user file that
contains package_upgrade: false.

Tested with Ubuntu 18.10 and cloud-init 18.4.7

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
5 years agobump version to 5.0-47
Thomas Lamprecht [Mon, 4 Mar 2019 09:09:23 +0000 (10:09 +0100)]
bump version to 5.0-47

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix indentation and trailing whitespace
Dominik Csapak [Thu, 28 Feb 2019 08:16:00 +0000 (09:16 +0100)]
fix indentation and trailing whitespace

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #2114: set correct link status on hotplug
Dominik Csapak [Thu, 28 Feb 2019 08:15:59 +0000 (09:15 +0100)]
fix #2114: set correct link status on hotplug

we also need to set the link status if the whole device changed,
otherwise a change of macaddress allows a network connection even
if link_down is set to 1

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocode cleanup
Thomas Lamprecht [Tue, 26 Feb 2019 07:21:04 +0000 (08:21 +0100)]
code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoivmshmem: comment deletion of shm on VM stop in code
Thomas Lamprecht [Tue, 26 Feb 2019 07:20:37 +0000 (08:20 +0100)]
ivmshmem: comment deletion of shm on VM stop in code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoivmshmem: follouwp code cleanup
Thomas Lamprecht [Tue, 26 Feb 2019 07:09:43 +0000 (08:09 +0100)]
ivmshmem: follouwp code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd ivshmem device to config
Dominik Csapak [Fri, 22 Feb 2019 10:38:33 +0000 (11:38 +0100)]
add ivshmem device to config

with such a shared memory device, a vm can share data with other
vms or with the host via memory

one of the use cases is looking-glass[1] with pci-passthrough, which copies
the guest fb to the host and you get a high-speed, low-latency
display client for the vm

on vm stop we delete the file again

1: https://looking-glass.hostfission.com/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoFix 2097 allow to set and pass wwn parameter for ide, sata and scsi disks
Christian Ebner [Mon, 25 Feb 2019 16:30:48 +0000 (17:30 +0100)]
Fix 2097 allow to set and pass wwn parameter for ide, sata and scsi disks

This allows to set the wwn parameter for ide, sata and scsi disks in the VM
config and passes it to the qemu command on execution.

VirtIO Block does not supports this property, so exclude it from
there.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump version dependency to pve-doc-generator
Thomas Lamprecht [Fri, 22 Feb 2019 12:31:32 +0000 (13:31 +0100)]
d/control: bump version dependency to pve-doc-generator

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years ago1891 Add zsh command completion for qm and qmrestore
Christian Ebner [Thu, 21 Feb 2019 13:25:04 +0000 (14:25 +0100)]
1891 Add zsh command completion for qm and qmrestore

This adds the zsh command completion for qm and qmrestore.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>