Commit Graph

771 Commits

Author SHA1 Message Date
Alexandre Derumier
a2f1554b6e Fix #1717: delete snapshot when vm running and drive not attached
changelog v2:
 - remove hash
 - remove check if cdrom

if we try to delete a snapshot, and that is disk from the snapshot
is not attached anymore (unused), we can't delete the snapshot
with qemu snapshot delete command (for storage which use it (qcow2,rbd,...))

example:

...
unused0: rbd:vm-107-disk-3

[snap1]
...
scsi2: rbd:vm-107-disk-3,size=1G

-> die
 qmp command 'delete-drive-snapshot' failed - Device 'drive-scsi2' not found

If drive is not attached, we need to use the storage snapshot delete command
2018-07-19 10:42:03 +02:00
Dzmitry Kotsikau
a489dd9c81 Fix SPICE multi-monitor mode on q35
Signed-off-by: Dzmitry Kotsikau <dkotsikau@gmail.com>
2018-07-13 09:51:36 +02:00
Thomas Lamprecht
9224dceefe qm rescan: add dryrun option
tells an user what would get touched, so he has a chance to fix
unwanted things before changes are actually made.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-11 09:35:45 +02:00
Thomas Lamprecht
53b81297c4 rescan update_disksize: be more verbose
Else an user has no idea what, or if something happened.

Gets printed to tty when using qm rescan or to tasklog for the case
where we do a rescan after restoring a backup.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-11 09:35:43 +02:00
Thomas Lamprecht
b9a1a3aba5 rescan: comment that this is a temporarily workaround
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-05 08:46:11 +02:00
Alwin Antreich
4771526af1 Fix #1650: add content type filter to rescan
Unused disk(s) appeared after a rescan of storages. Especially shown
with ceph pools, where two storage entries are made, <storage>_ct and
<storage>_vm. The rescan method did include images from both storages.

This patch filters any storage not containing the content type 'images'.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2018-07-05 08:35:06 +02:00
Wolfgang Bumiller
d04d6af1f2 use the new PVE::SystemD package
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-15 11:50:23 +02:00
Dominik Csapak
c2786bedc6 use 'system_wakeup' to resume suspended vms
when a vm is suspended (e.g. autosuspend on windows)
we detect that it is not running, display the resume button,
but 'cont' does not wakeup the system from suspend

with this we can wake up suspended vms

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-13 12:46:01 +02:00
Thomas Lamprecht
a4938c7217 add nowarn to qga_check_running
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-05-30 09:01:11 +02:00
Dominik Csapak
f889aa0fbb fix #1780: change datacenter.conf to datacenter.cfg
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-23 10:28:40 +02:00
Dominik Csapak
51153f86ce cleanup balloon after start call
the not definedness check is unecessary here, since it does not
do anything then, and to check balloon twice is also not necessary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-22 13:23:29 +02:00
Dominik Csapak
75b51053cc fix logic of deleting balloon
Deleting the balloon config entry means resetting it to its
default. This means having a balloon device but not actually
doing any ballooning with it (iow. resetting the VM's
'balloon' value to its specified memory.).
Hotplugging a balloon device (coming from explicit '0' to
any other value (including deleting it)) is not possible.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-22 13:20:16 +02:00
Dominik Csapak
82329cd55b note that auto-ballooning is done by pvestatd
so that one is not confused when seeing that the shares
parameter does nothing in qemu-server

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-22 13:20:11 +02:00
Wolfgang Bumiller
503308ed91 start: fork before entering scope
To avoid potential cleanup & post-start actions to cause
unwanted processes (such as gpg-agent) to be started as part
of the scope, as the enter_systemd_scope() function causes
the current process to enter the scope.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-08 08:40:24 +02:00
Dominik Csapak
f721624b8e collect device list for nested pci-bridges
when using q35 as machine type, there are nested pci-bridges,
but we only checked the first layer

this resulted in not being able to hotplug scsi devices,
because scsihw0 was deeper in the pci-bridge construct, we did not see
it and tried to add it (which fails of course)

this patch checks all bridges, regardless how deeply nested they are

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-04-13 14:44:22 +02:00
Dominik Csapak
3807f3e4ee fix #1697: only check machine type for pxe
it is not necessary to check the romfile of the running vm
for .pxe machine types, since the machine type itself is not
hot-pluggable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-04-13 14:41:10 +02:00
Dominik Csapak
fd950b2385 readd nbd_stop
we accidentally moved nbd_stop to CloudInit.pm in
commit 0c9a7596f6

and removed it in
commit 3db6e4ab70

without realizing that live local storage migration still depends on it

readd it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-04-13 14:39:06 +02:00
Thomas Lamprecht
a70e7e6caf disk: serial no must now be passed to device not drive
With QEMU 2.10 the serial parameter of the -drive command line option
was deprecated [1], so move the logic which adds this parameter now
to the -drive analogue -device CLI option.

Features marked deprecated will continue to work for two releases[2],
so we need to switch over before 2.12, AFAICT.

[1]: https://wiki.qemu.org/ChangeLog/2.10#Deprecated_options
[2]: https://qemu.weilnetz.de/doc/qemu-doc.html#Deprecated-features

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-04-09 11:03:02 +02:00
Fabian Grünbichler
d494009179 qemu-img convert: use cache=none for ZFS only
since this requires O_DIRECT support by the underlying storage, which
might not be available.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-26 11:38:40 +02:00
Fabian Grünbichler
2715f95970 qemu-img convert: use cache=none
this fixes an issue with zvols, which require cache=none and eat up all
free memory as buffered pages otherwise

https://github.com/zfsonlinux/zfs/issues/7235

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-23 14:57:49 +01:00
Thomas Lamprecht
102cf9d81e use pve-edk2-firmware for supporting OVMF
depend on new pve-edk2-firmware package and adapt the OVMF CODE/VARS
path accordingly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-22 08:19:46 +01:00
Thomas Lamprecht
9444c6e42c fixup: remove unneeded if branch
$readfrom equals $archive here, and we're already in the branch with
the condition that both are not equal to '-'
2018-03-21 11:15:35 +01:00
Wolfgang Bumiller
7c536e11c4 restore: implement rate limiting
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-21 11:15:35 +01:00
Thomas Lamprecht
b20df606a1 stop passing default '-k' QEMU option from datacenter.cfg
Modern noVNC does not needs this anymore, actually things may get
worse if it's used. E.g., when one sets 'de' and the VM locale is
'de' you may get a 'ĸ' (unicode kra) if you want to send an ampersand
character through pressing SHIFT + 6.

Qemus manual pages confirms that this is most times not needed
anymore:

 > -k language
 >    Use keyboard layout language (for example "fr" for
 >    French). This option is only needed where it is not
 >    easy to get raw PC keycodes (e.g. on Macs, with some
 >    X11 servers or with a VNC or curses display). You don't
 >    normally need to use it on PC/Linux or PC/Windows
 >    hosts.
 -- man kvm

An user can always set it per VM, wew simply remove the implict
default derived from the cluster wide datacenter.cfg

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-21 10:48:07 +01:00
Wolfgang Bumiller
345d263f6c cleanup: remove duplicate mac address assignment
The git history of this is not immediately obvious due to
the date of the cloud init patches, but the removal of this
line was basically reverted by them later at merge-time.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-21 10:33:39 +01:00
Thomas Lamprecht
6de521e984 remove legacy vm_monitor_command
We introduced our QMP socket with commit
c971c4f221 (29.05.2012)

Already tried to remove this with commit
7b7c6d1b5d (13.07.2012)

But reverted that to allow migration of VMs still using the old
montior to ones which already switched over to the new QMP one,
in commit dab36e1ee9 (17.08.2012)
see bug #242 for reference

This was all done  and released in PVE 2.2, as no migration through
nodes differing more than one major version is possible we can
finally remove this code for good.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-14 11:18:56 +01:00
Herman van Rink
e4d4cda113 Move name argument to improve visibility in a process list
Signed-off-by: Herman van Rink <rink@initfour.nl>
2018-03-12 14:26:10 +01:00
Wolfgang Bumiller
3c23aa808c start: always stop an existing $vmid.scope
Checking for the cgroup directory is a kind of time-of-check
time-of-use race condition stop-mode backups seem to
occasionally run into on some systems.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-12 09:14:17 +01:00
Dietmar Maurer
1d1c4e1c1c cleanup cloud-init option descriptions 2018-03-07 10:53:41 +01:00
Dietmar Maurer
498cdc36dc document defaults for citype 2018-03-07 09:31:44 +01:00
Dietmar Maurer
d41121fdc4 new helper cloudinit_config_properties()
Only used to generate documentation.
2018-03-07 09:26:33 +01:00
Wolfgang Bumiller
e8ac21381e cloud-init: remove separate hostname config entry
Use the vm name and set hostname and fqdn in user data
again.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 09:15:42 +01:00
Wolfgang Bumiller
7b42f95142 cloud-init: add ciuser and cipassword config options
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 09:11:32 +01:00
Wolfgang Bumiller
41cd94a01e cloud-init: nocloud image support
With configdrives we end up with the /etc/network/interfaces
file containing the interface names we use on the disk, ie.
eth0/eth1/..., which doesn't work on systems which do not
use this name.

With the 'nocloud' image type we can provide a
network-config in yaml which matches mac addresses. Ideally
we'd use version 2, but debian stretch ships with a too old
cloud-init for this, so for now we're writing version 1.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 09:11:31 +01:00
Wolfgang Bumiller
931432bd2d cloud-init: clone/move support
move: don't error out with "you can't move a cdrom"
clone: always full-clone cloud-init images
  They get completely replaced anyway at the next start, so
  there's no point in keeping them.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 09:11:31 +01:00
Wolfgang Bumiller
9ed7a77c6e cloud-init: hotplug support
*) always replace old cloudinit images
*) apply pending cloudinit changes when generating a new
image

For cloudinit we now always use vdisk_free before
vdisk_alloc in order to always replace old images, this
allows us to hotplug a new drive by setting it to
`none,media=cdrom` first (to eject the disk), then setting
it back to 'storage:cloudinit' to have a new image generated
after applying the currently pending changes.
2018-03-07 09:11:31 +01:00
Wolfgang Bumiller
2d9ddec5af cloud-init: don't add cloudinit isos as 'unused'
They're regenerated anyway as needed.
2018-03-07 09:11:31 +01:00
Wolfgang Bumiller
9c52f5edb6 cloud-init: delete cloudinit images as if they weren't cdroms 2018-03-07 09:11:31 +01:00
Alexandre Derumier
0c9a7596f6 implement cloudinit
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Co-developed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 09:11:31 +01:00
Wolfgang Bumiller
15cf76988d parse_vm_config: allow spaces in values
This time we can't avoid it: nameservers are listed with
separating spaces in LXC and we want to stay consistent and
use the same format in qemu.
2018-03-01 10:51:41 +01:00
Alexandre Derumier
b796ac7365 allow virtio-scsi + iothread controller hot-unplug 2018-02-22 10:50:37 +01:00
Wolfgang Bumiller
2a850ee870 CPU types: add EPYC and EPYC-IBPB
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-02-21 09:51:01 +01:00
Thomas Lamprecht
1e5143de74 nbd mirror: no need applying full regex on volid string anymore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-02-16 14:43:56 +01:00
Alexandre Derumier
87955688fd Fix #1664: nbd mirror : remove socat tunnel
socat tunnel for nbd mirror was introduce here
https://pve.proxmox.com/pipermail/pve-devel/2017-January/024777.html
to workaround when nbd client was hanging on non responding nbd server.

We have added a 30s timeout on socat tunnel, but when we migrate
multiple disks, it can break migration if for example first disk
is already finished and don't send any new datas in the tunnel.

The connect timeout bug has been fixed in qemu 2.9,
so we can remove the socat tunnel now.
2018-02-16 13:58:56 +01:00
Chris Hofstaedtler
ec82e3eee4 fix #1569: add shared flag to disks
With shared=1, (live) migration ignores the disk and assumes it is
present on all target nodes. This works similar to shared=1 on LXC
mountpoints.

Signed-off-by: Chris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-02-15 15:19:29 +01:00
Wolfgang Bumiller
bfb04cfc01 correct 'snapshot' flag description
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-02-08 13:41:27 +01:00
Dominik Csapak
5fc748614f append option to drive if the option is defined
if the value was '0', we did not append the option to the drive,
resulting in wrong command line if the qemu default of an option is not
'0'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-02-08 13:29:06 +01:00
Dominik Csapak
8a2677081d fix #1662: use special case for 'snapshot' disk parameter
since qemu expects on|off (not 1|0),
we have to do it different

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-02-08 13:28:55 +01:00
Wolfgang Link
19a5dd551d Make the smbios UUID unique if --unique is used.
When we clone a VM we also make the smbios unique.
2018-02-05 14:38:41 +01:00
Dominik Csapak
8107b378c9 add serial:1 to vmstatus when config has a serial device configured
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-30 16:36:38 +01:00