]> git.proxmox.com Git - qemu-server.git/log
qemu-server.git
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>
5 years agofix #2101: ipv6 ending in ':' not parsed as a string
David Limbeck [Thu, 21 Feb 2019 15:18:53 +0000 (16:18 +0100)]
fix #2101: ipv6 ending in ':' not parsed as a string

Space or newline after ':' is recognized as a mapping and as a result an
ipv6 ending in ':' is not parsed as a string. The solution is to quote
the address. For consistency all other addresses (including mac) are
quoted.

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
5 years agofollowup whitespace fixes
Thomas Lamprecht [Wed, 20 Feb 2019 06:34:10 +0000 (07:34 +0100)]
followup whitespace fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoQemuMigrate : cleanup identation
Alexandre Derumier [Wed, 20 Feb 2019 00:25:51 +0000 (01:25 +0100)]
QemuMigrate : cleanup identation

5 years agomemory: fix automatic num amapping
Wolfgang Bumiller [Mon, 18 Feb 2019 09:45:16 +0000 (10:45 +0100)]
memory: fix automatic num amapping

when no numaX config options were present we returned the
hash as a list instead of a hash reference...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoUse nr_hugepages from /proc/cmdline
Kamil Trzciński [Sun, 17 Feb 2019 12:39:37 +0000 (13:39 +0100)]
Use nr_hugepages from /proc/cmdline

Currently Proxmox VE always deallocates HugePagesTLB
when starting a new machine and it makes it impossible
to preconfigure kernel /proc/cmdline with persistent allocation.

This change makes deallocation to prefer defaults set by /proc/cmdline,
by parsing the cmdline and respecting hugepages= and hugepagesz=.

Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
5 years agofix #2043: vm start: always stop existing systemd scopes
Thomas Lamprecht [Tue, 5 Feb 2019 08:40:17 +0000 (09:40 +0100)]
fix #2043: vm start: always stop existing systemd scopes

commit 3c23aa808ccc946bad92d9bc63b6f833c61d0f52 tried to fix a issue
where after a stop mode backup a scope could still linger around, but
it actually removed the wrong check. If we want to remove a
lingering, not yet cleaned up, scope we need to check if said scope
exists not if a VM process is still running. While they are corelated
the scope will always get cleaned up _after_ it's processes are gone.

Should fix #2043, but as this is seemingly not that easy to fix one
for all I'll put the should as disclaimer here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agod/control: bump version dependency of libpve-guest-common-perl
Thomas Lamprecht [Fri, 1 Feb 2019 12:15:08 +0000 (13:15 +0100)]
d/control: bump version dependency of libpve-guest-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-46
Thomas Lamprecht [Fri, 1 Feb 2019 12:05:50 +0000 (13:05 +0100)]
bump version to 5.0-46

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump version dependency of libpve-guest-common-perl
Thomas Lamprecht [Fri, 1 Feb 2019 12:03:44 +0000 (13:03 +0100)]
d/control: bump version dependency of libpve-guest-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd pre- start/stop hookscripts to VMs
Dominik Csapak [Thu, 31 Jan 2019 13:33:39 +0000 (14:33 +0100)]
add pre- start/stop hookscripts to VMs

this adds a new config option for it, and executes it on four
points in time:

'pre-start'
'post-start'
'pre-stop'
'post-stop'

on pre-start we abort if the script fails
and pre-stop will not be called if the vm crashes or if
the vm gets powered off from inside the guest

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agod/cointrol is not autogenerated anymore, remove from .gitignore
Thomas Lamprecht [Thu, 31 Jan 2019 11:10:47 +0000 (12:10 +0100)]
d/cointrol is not autogenerated anymore, remove from .gitignore

a bit ago we had a control.in file which generated the control one,
so we added the build result to the list of git ignored files.

This is not the case anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup code cleanup
Thomas Lamprecht [Wed, 30 Jan 2019 14:08:15 +0000 (15:08 +0100)]
followup code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix some indentaion errors
Thomas Lamprecht [Wed, 30 Jan 2019 14:07:56 +0000 (15:07 +0100)]
fix some indentaion errors

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoFix #1924: add snapshot parameter
Rhonda D'Vine [Wed, 30 Jan 2019 13:43:38 +0000 (14:43 +0100)]
Fix #1924: add snapshot parameter

The qm CLI command offer the config and showcmd functions. Both of those
outputs may vary with respect to a given snapshot. This adds a switch
that shows the corresponding snapshot's config and command line.

The code needs a newer libpve-guest-common-perl, thus bumping the
dependency.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agoallow explicit set vga with gpu passthrough
Dominik Csapak [Mon, 21 Jan 2019 14:56:54 +0000 (15:56 +0100)]
allow explicit set vga with gpu passthrough

this patch allows the user to explicitely set a virtual vga,
even when using the 'x-vga' flag, this is sometimes necessary,
as some users need the 'x-vga' flag on the pci device,
but still want to use a virtual vga

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoapi/create: print correct error message if cleanup fails
Thomas Lamprecht [Sat, 26 Jan 2019 13:39:38 +0000 (14:39 +0100)]
api/create: print correct error message if cleanup fails

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: HV ID description
Thomas Lamprecht [Fri, 25 Jan 2019 16:10:49 +0000 (17:10 +0100)]
followup: HV ID description

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoallow explicit hv-vendor-id
Dominik Csapak [Mon, 21 Jan 2019 14:56:53 +0000 (15:56 +0100)]
allow explicit hv-vendor-id

with this, a user can set the hv_vendor_id independently of
any 'x-vga=on' setting he may or may not have configured.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 5.0-45
Thomas Lamprecht [Mon, 21 Jan 2019 09:42:34 +0000 (10:42 +0100)]
bump version to 5.0-45

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agomigrate: fix local disk migration with online VMs
Thomas Lamprecht [Thu, 17 Jan 2019 09:53:36 +0000 (10:53 +0100)]
migrate: fix local disk migration with online VMs

commit 4530494bf9f3d45c4a405c53ef3688e641f6bd8e introduced an
regression with local disk migrations if the VM is online and thus
needs to live migrated and no target storage was passed as parameter.

We made the hack to write "1" to the targetstorage option in this
case obsolete, but it was still used on deciding if there are any
drives to mirror at all. Here it is enough to check if there are any
'online_local_volumes' because that hash gets only filled if we can
and are told to live mirror local disk on migrations anyway. Also,
we abort early if local disks are found and the 'with-local-disks'
option is not set.

This was reported at:
https://forum.proxmox.com/threads/livemigration-with-localdisk-doesnt-coppy-and-data-from-the-hdds-anymore.50744/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #2003: give 'qm terminal' a terminal over ssh
Dominik Csapak [Thu, 29 Nov 2018 09:51:50 +0000 (10:51 +0100)]
fix #2003: give 'qm terminal' a terminal over ssh

this prevents a connection loop when using novnc on a vm with
vga: serialX
when proxying via ssh

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agovnc/termproxy: use ssh_info_to_command for ssh tunnel
Dominik Csapak [Thu, 29 Nov 2018 09:51:49 +0000 (10:51 +0100)]
vnc/termproxy: use ssh_info_to_command for ssh tunnel

this way we have two places less where we define a ssh cmd

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoconfig2command test: mock kernel_has_vhost_net
Thomas Lamprecht [Thu, 20 Dec 2018 09:44:13 +0000 (10:44 +0100)]
config2command test: mock kernel_has_vhost_net

just return true for now, the use is guarded by an 'is_native($arch)'
check anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoconfig2command test: diff: use /proc/self/fd
Thomas Lamprecht [Thu, 20 Dec 2018 09:38:07 +0000 (10:38 +0100)]
config2command test: diff: use /proc/self/fd

/dev/fd works only through some compatibility hacks in some shells,
use the correct one for Linux: /proc/self/fd/*

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoconfig2command test: mock kvm_version too
Thomas Lamprecht [Thu, 20 Dec 2018 09:27:21 +0000 (10:27 +0100)]
config2command test: mock kvm_version too

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-44
Thomas Lamprecht [Thu, 20 Dec 2018 09:18:48 +0000 (10:18 +0100)]
bump version to 5.0-44

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agocleanup: use a local $override_targetsid variable
Wolfgang Bumiller [Thu, 20 Dec 2018 08:55:12 +0000 (09:55 +0100)]
cleanup: use a local $override_targetsid variable

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofix local disk migration when no target storage is set
Thomas Lamprecht [Thu, 20 Dec 2018 08:55:11 +0000 (09:55 +0100)]
fix local disk migration when no target storage is set

the check for targetstorage in:
if ($self->{running} && $self->{opts}->{targetstorage} && $local_volumes->{$volid}->{ref} eq 'config') {

was obsolete, as we always set the tragetstorage opts variable to '1'
in a broader "use same sid for remote local" check above.
So removing it leads to the same if truthtable but fixes the
check if we should fallback to the volume's SID if targetstorage is
not set, as else it seemed to be always set, and '1' is naturally not
a correct stroage ID.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofix #1013 : migrate : sync_disk : --targetstorage with offline disk
Alexandre Derumier [Thu, 20 Dec 2018 08:55:10 +0000 (09:55 +0100)]
fix #1013 : migrate : sync_disk : --targetstorage with offline disk

targetsid was not used, for disk unused (offline copy)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoadd win7 pcie quirk
Dominik Csapak [Mon, 17 Dec 2018 12:57:08 +0000 (13:57 +0100)]
add win7 pcie quirk

Win7 is very picky about pcie assignments and fails with
'error 12' the way we add hospci devices.

To combat that, we simply give the hostpci device a normal port
instead.

Start with address 0x10, so that we have space before those devices,
and between them and the ones configured in pve-q35.cfg should we
need it in the future.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #2032: check that type is set before using
Dominik Csapak [Mon, 17 Dec 2018 08:19:58 +0000 (09:19 +0100)]
fix #2032: check that type is set before using

When not setting 'vga' we would get a warning:

Use of uninitialized value $type in string eq at
/usr/share/perl5/PVE/QemuServer.pm line 2026.

This patch changes the order of the conditions and checks if $type is set
before using it, so that we do not get the warning anymore.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agot/cfg2cmd: ensure tests can pass again
Thomas Lamprecht [Mon, 10 Dec 2018 17:00:03 +0000 (18:00 +0100)]
t/cfg2cmd: ensure tests can pass again

the change to use a real diff to check tests, with it's nicer output
for failing cases, failed to ensure that the test system knew if a
case passed - earlier done indirectly by 'is_deeply', thus add a
manual 'pass' call if the tes was OK.
Further, the firs test failing aborted everything, which isn't to
nice, normally it's much more convenient if all test get run and one
can view at the results of all of them. So put the diff in an eval
and fail/note the test manually.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agot/cfg2cmd: replace is_deeply with diff
Wolfgang Bumiller [Mon, 10 Dec 2018 17:00:02 +0000 (18:00 +0100)]
t/cfg2cmd: replace is_deeply with diff

(The diff() sub is copied from our pve-common's network
interfaces test scripts)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agot/cfg2cmd: mock iscsi initiator name
Wolfgang Bumiller [Mon, 10 Dec 2018 17:00:01 +0000 (18:00 +0100)]
t/cfg2cmd: mock iscsi initiator name

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd config to command tests
Thomas Lamprecht [Mon, 10 Dec 2018 17:00:00 +0000 (18:00 +0100)]
add config to command tests

To have a better safety net for not introducing regressions and also
some functional checks as the QEMU command defines the layout
behavior of the VM.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoadd the rest of themissing lock types
Wolfgang Bumiller [Tue, 11 Dec 2018 09:09:21 +0000 (10:09 +0100)]
add the rest of themissing lock types

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoadd 'clone' to lock schema definition/confdesc.
Stoiko Ivanov [Tue, 4 Dec 2018 19:52:46 +0000 (20:52 +0100)]
add 'clone' to lock schema definition/confdesc.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agovga: allow 'none'
Dominik Csapak [Thu, 6 Dec 2018 09:17:26 +0000 (10:17 +0100)]
vga: allow 'none'

so that one can explicitly disable the vga without having to specify
a serial port as display, this is mostly useful for very special
and custom gpu passthrough setups which have to be specified with
'args' and for setups which do not care about any display (not even serial)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #1267: move args to the end of qemu commandline
Dominik Csapak [Thu, 6 Dec 2018 09:17:25 +0000 (10:17 +0100)]
fix #1267: move args to the end of qemu commandline

there is nothing that should be really affected by this, but
even then, this option is only for experts and people using this
should know what they are doing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoclone_disk : cloudinit drive: don't clone snapname
Alexandre Derumier [Fri, 7 Dec 2018 06:45:55 +0000 (07:45 +0100)]
clone_disk : cloudinit drive: don't clone snapname

we don't snapshot cloudinit drive,

this fix "qm clone <vmid> <targetvmid> --snapname mysnap" when a cloudinit drive exist

5 years agobump version to 5.0-43
Thomas Lamprecht [Thu, 29 Nov 2018 11:58:12 +0000 (12:58 +0100)]
bump version to 5.0-43

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobetter cleanup logging for migration
Dominik Csapak [Wed, 28 Nov 2018 09:40:45 +0000 (10:40 +0100)]
better cleanup logging for migration

if we migrate a vm we call cleanup but the logging looks like:

Starting cleanup for 101
trying to acquire lock...
 OK
Configuration file 'nodes/pve-ceph-01/qemu-server/101.conf' does not exist

with this patch, we omit any logging in the case we do not have the config,
since we cannot know what to clean up

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofollowup: add FIXME comment
Thomas Lamprecht [Tue, 27 Nov 2018 12:45:23 +0000 (13:45 +0100)]
followup: add FIXME comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix check if machine type is q35
Dominik Csapak [Tue, 27 Nov 2018 10:32:17 +0000 (11:32 +0100)]
fix check if machine type is q35

When live migrating, with a q35 machine will get the qemu version
encoded in the machine type, for example,'pc-q35-2.12', so we need to
allow this too and cannot expect that all q35 machine have
q35' in verbatim as their type.

So, when migrating such a machine live, we missed to include the q35
cfg because we didn't allowed versioned q35 machine types, which then
failed the migration.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 5.0-42
Thomas Lamprecht [Thu, 22 Nov 2018 10:27:35 +0000 (11:27 +0100)]
bump version to 5.0-42

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump libpve-common-perl version dependency to >= 5.0-43
Thomas Lamprecht [Thu, 22 Nov 2018 10:27:17 +0000 (11:27 +0100)]
bump libpve-common-perl version dependency to >= 5.0-43

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agouse improved lspci
Dominik Csapak [Tue, 20 Nov 2018 16:13:40 +0000 (17:13 +0100)]
use improved lspci

since lspci does not split between id and function anymore,
there is no need to plug id + function together

also we can remove the capture groups from PCIRE
since parse_property_string does this check for us

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd mediated devices support
Dominik Csapak [Tue, 20 Nov 2018 16:13:39 +0000 (17:13 +0100)]
add mediated devices support

with this, we are able to create and use mediated devices,
which include Intel GVT-g (aka KVMGT) and Nvidia vGPUs, and probably more
types of devices in the future

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 5.0-41
Thomas Lamprecht [Mon, 19 Nov 2018 13:43:32 +0000 (14:43 +0100)]
bump version to 5.0-41

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump version dependency to libpve-common-perl
Thomas Lamprecht [Mon, 19 Nov 2018 13:42:48 +0000 (14:42 +0100)]
d/control: bump version dependency to libpve-common-perl

to ensure we have the new PVE::SysFSTools module available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobsys: CFLAGS should add to existing
Thomas Lamprecht [Mon, 19 Nov 2018 14:18:01 +0000 (15:18 +0100)]
bsys: CFLAGS should add to existing

else the environment from buildpackage gets overwritten and the '-g'
misses, which results in an debug symbols file without debug
symbols.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobsys: we have a dbgsym package now too
Thomas Lamprecht [Mon, 19 Nov 2018 13:41:14 +0000 (14:41 +0100)]
bsys: we have a dbgsym package now too

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoqmeventd: fixup program name in license
Thomas Lamprecht [Mon, 19 Nov 2018 13:36:01 +0000 (14:36 +0100)]
qmeventd: fixup program name in license

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoQemuServer: remove now unused $pcisysfs
Thomas Lamprecht [Mon, 19 Nov 2018 13:07:54 +0000 (14:07 +0100)]
QemuServer: remove now unused $pcisysfs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoQemuServer: remove PCI sysfs helpers
Dominik Csapak [Fri, 16 Nov 2018 15:17:51 +0000 (16:17 +0100)]
QemuServer: remove PCI sysfs helpers

and use them from PVE::SysFSTools, where they got moved to

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agod/control: remove unused dependency
Wolfgang Bumiller [Mon, 19 Nov 2018 08:57:43 +0000 (09:57 +0100)]
d/control: remove unused dependency

this was a leftover from a previous iteration of the
qmeventd patches

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agouse qmeventd to execute qm cleanup
Dominik Csapak [Wed, 14 Nov 2018 13:59:58 +0000 (14:59 +0100)]
use qmeventd to execute qm cleanup

we reverse the direction of the event socket (this does not
prevent live migration) and point it to wher qmeventd listens

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>