5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-21 18:03:56 +03:00

1783 Commits

Author SHA1 Message Date
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
c893f574d3 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>
2019-03-14 09:56:59 +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
Thomas Lamprecht
0a6f7cc601 bump version to 5.0-47
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-04 10:11:26 +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
Thomas Lamprecht
eff36b2caa d/control: bump version dependency to pve-doc-generator
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-22 13:31:32 +01:00
Christian Ebner
efcd6784cb 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>
2019-02-22 11:52:29 +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
Thomas Lamprecht
24466eb53d d/control: bump version dependency of libpve-guest-common-perl
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-01 13:15:08 +01:00
Thomas Lamprecht
a60ba460e9 bump version to 5.0-46
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-01 13:05:50 +01:00
Thomas Lamprecht
4962130fe1 d/control: bump version dependency of libpve-guest-common-perl
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-01 13:03:44 +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
5442d14e6d 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>
2019-01-31 12:10:51 +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
15147c74b3 bump version to 5.0-45
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-21 10:42:58 +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
Dominik Csapak
8fef2bdb95 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>
2019-01-03 09:07:54 +01:00
Dominik Csapak
414b42d8ef 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>
2019-01-03 09:07:54 +01:00
Thomas Lamprecht
db70021bcf 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>
2018-12-20 10:44:15 +01:00
Thomas Lamprecht
e1bdc0debc 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>
2018-12-20 10:38:09 +01:00
Thomas Lamprecht
66c539947a config2command test: mock kvm_version too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-20 10:27:21 +01:00
Thomas Lamprecht
b74f5794d3 bump version to 5.0-44
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-20 10:19:52 +01:00
Wolfgang Bumiller
8c58b12d0d cleanup: use a local $override_targetsid variable
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-20 10:11:32 +01:00