5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-03-12 20:58:26 +03:00

1488 Commits

Author SHA1 Message Date
Thomas Lamprecht
41756a3b8a followup: reword bwlimit default wording
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-02 11:01:35 +02:00
Stoiko Ivanov
0aab5a16b3 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>
2019-04-02 11:01:35 +02:00
Stoiko Ivanov
7e303ef3e4 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>
2019-04-02 11:01:35 +02:00
Stoiko Ivanov
d189e5901b 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>
2019-04-02 11:00:28 +02:00
Stoiko Ivanov
15a37695b6 bwlimit: add parameter to QemuMigrate::sync_disks
used for offline migration of local volumes

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-04-02 10:58:35 +02:00
Stoiko Ivanov
9fa05d31de 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>
2019-04-02 10:34:40 +02:00
Stoiko Ivanov
ddd664d739 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>
2019-04-02 10:34:40 +02:00
Dominik Csapak
f17fb184c6 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>
2019-03-30 14:36:50 +01:00
Thomas Lamprecht
6dde5ea273 drive mirror: cleanup exception handling code a bit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-30 09:36:30 +01:00
Mira Limbeck
9e93a63fe4 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>
2019-03-29 18:11:33 +01:00
Mira Limbeck
7e8ab2a9ab 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>
2019-03-29 18:11:33 +01:00
Mira Limbeck
6f3999e0f5 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>
2019-03-27 17:12:48 +01:00
Thomas Lamprecht
3ff84d6fe6 remove registering 'pve-snapshot-name', now in common
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-21 12:56:39 +01:00
Thomas Lamprecht
11efdfa5a9 followup: which lock
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-21 12:53:17 +01:00
Dominik Csapak
e6ed61b4bd add lock to vm status
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-20 11:50:09 +01:00
Thomas Lamprecht
cd9a035b56 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>
2019-03-19 13:24:06 +01:00
Dominik Csapak
ccb2e2eaeb 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>
2019-03-19 09:26:56 +01:00
Dominik Csapak
b0a9a38568 suspend: output some information about progress
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-19 09:26:56 +01:00
Dominik Csapak
b3983fa1dc add correct comment about savevm-start
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-19 09:26:56 +01:00
Dominik Csapak
48b4cdc210 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>
2019-03-19 08:53:14 +01:00
Dominik Csapak
22371fe00e 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>
2019-03-19 08:53:14 +01:00
Dominik Csapak
7ceade4cb3 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>
2019-03-19 08:53:14 +01:00
Dominik Csapak
159719e55b 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>
2019-03-19 08:53:14 +01:00
Dominik Csapak
566caaa4f1 correct comment about size
and remove comment that makes no sense

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-19 08:53:14 +01:00
Stoiko Ivanov
399d96dbee 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>
2019-03-14 09:21:24 +01:00
Dominik Csapak
7820eae438 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>
2019-03-14 08:25:48 +01:00
Dominik Csapak
92bdc3f0e3 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>
2019-03-07 15:59:56 +01:00
David Limbeck
cb702ebe0f 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>
2019-03-07 09:02:33 +01:00
Dominik Csapak
95d3be5879 fix indentation and trailing whitespace
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-02-28 10:02:23 +01:00
Dominik Csapak
79046fd12e 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>
2019-02-28 10:02:23 +01:00
Thomas Lamprecht
bd772c2e87 code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 08:30:13 +01:00
Thomas Lamprecht
4c5a6a2419 ivmshmem: comment deletion of shm on VM stop in code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 08:30:13 +01:00
Thomas Lamprecht
e3c27a6afe ivmshmem: follouwp code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 08:30:10 +01:00
Dominik Csapak
6dbcb07367 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>
2019-02-26 08:01:12 +01:00
Christian Ebner
e741c51696 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>
2019-02-26 07:55:04 +01:00
David Limbeck
4efb58a96e 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>
2019-02-22 10:21:10 +01:00
Thomas Lamprecht
769f187df5 followup whitespace fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-20 07:34:10 +01:00
Alexandre Derumier
f3a483b682 QemuMigrate : cleanup identation 2019-02-20 07:32:23 +01:00
Wolfgang Bumiller
1d68295172 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>
2019-02-18 10:45:17 +01:00
Kamil Trzciński
ca0ef6b148 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>
2019-02-18 10:39:18 +01:00
Thomas Lamprecht
f5c673cba7 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>
2019-02-11 08:12:32 +01:00
Dominik Csapak
9e784b1154 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>
2019-02-01 12:58:37 +01:00
Thomas Lamprecht
87d92707b6 followup code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-30 15:08:15 +01:00
Thomas Lamprecht
2a68ec7893 fix some indentaion errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-30 15:08:00 +01:00
Rhonda D'Vine
b14477e718 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>
2019-01-30 14:56:43 +01:00
Dominik Csapak
bfc0bb8179 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>
2019-01-28 17:38:55 +01:00
Thomas Lamprecht
f1e277cd88 api/create: print correct error message if cleanup fails
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-26 14:39:38 +01:00
Thomas Lamprecht
fc5c194b5d followup: HV ID description
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-25 17:10:49 +01:00
Dominik Csapak
2894c24745 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>
2019-01-25 17:06:43 +01:00
Thomas Lamprecht
c7789f54ad 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>
2019-01-17 10:58:50 +01:00