]> git.proxmox.com Git - qemu-server.git/log
qemu-server.git
5 years agouse the new PVE::SystemD package
Wolfgang Bumiller [Fri, 15 Jun 2018 09:00:53 +0000 (11:00 +0200)]
use the new PVE::SystemD package

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agouse 'system_wakeup' to resume suspended vms
Dominik Csapak [Wed, 13 Jun 2018 09:17:26 +0000 (11:17 +0200)]
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>
5 years agoapi create: cleanup the new config log on error
Wolfgang Bumiller [Tue, 12 Jun 2018 08:50:41 +0000 (10:50 +0200)]
api create: cleanup the new config log on error

Otherwise cases like trying to restore a protected VM would
leave a lock in the config.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoapi create: allow auto vm start after create finished
Thomas Lamprecht [Fri, 1 Jun 2018 14:37:41 +0000 (16:37 +0200)]
api create: allow auto vm start after create finished

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoreserve config with create lock early
Thomas Lamprecht [Fri, 1 Jun 2018 14:37:40 +0000 (16:37 +0200)]
reserve config with create lock early

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoAPI/create: move locking inside worker
Thomas Lamprecht [Fri, 1 Jun 2018 14:37:39 +0000 (16:37 +0200)]
API/create: move locking inside worker

Move the locking inside worker, so that the process doing the actual
work (create or restore) holds the lock, and can call functions which
do locking without deadlocking.

This mirrors the behaviour we use for containers, and allows to add
an 'autostart' parameter which starts the VM after successful
creation. vm_start needs the lock and as not the worker but it's
parents held it, it couldn't know that it was actually save to
continue...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-28
Thomas Lamprecht [Mon, 11 Jun 2018 10:55:33 +0000 (12:55 +0200)]
bump version to 5.0-28

5 years agorefactor Makefile for PVE/QemuServer/ directory
Dominik Csapak [Thu, 7 Jun 2018 11:16:50 +0000 (13:16 +0200)]
refactor Makefile for PVE/QemuServer/ directory

this makes it easier to add new files there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocloud-init: nocloud v1: use lower case mac address
Wolfgang Bumiller [Wed, 6 Jun 2018 14:13:26 +0000 (16:13 +0200)]
cloud-init: nocloud v1: use lower case mac address

because cloud-init...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agocloud-init: nocloud v1: set ip and netmask instead of cidr
Wolfgang Bumiller [Wed, 6 Jun 2018 14:13:25 +0000 (16:13 +0200)]
cloud-init: nocloud v1: set ip and netmask instead of cidr

because of centos7's broken cloud-init version

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agobump version to 5.0-27
Thomas Lamprecht [Tue, 5 Jun 2018 13:25:03 +0000 (15:25 +0200)]
bump version to 5.0-27

5 years agoAdd .gitignore
René Jochum [Wed, 18 Apr 2018 20:26:00 +0000 (22:26 +0200)]
Add .gitignore

Signed-off-by: René Jochum <rene@jochums.at>
5 years agoadd nowarn to qga_check_running
Thomas Lamprecht [Wed, 30 May 2018 06:20:25 +0000 (08:20 +0200)]
add nowarn to qga_check_running

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoqm agent : check if qga service is running
Alexandre Derumier [Mon, 28 May 2018 15:36:29 +0000 (17:36 +0200)]
qm agent : check if qga service is running

5 years agofix #1779: vzdump: ensure guest-fsfreeze-thaw is called on error
Wolfgang Bumiller [Wed, 23 May 2018 09:07:39 +0000 (11:07 +0200)]
fix #1779: vzdump: ensure guest-fsfreeze-thaw is called on error

as QMPClient's queue_execute can throw an error

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofix #1780: change datacenter.conf to datacenter.cfg
Dominik Csapak [Tue, 22 May 2018 14:44:33 +0000 (16:44 +0200)]
fix #1780: change datacenter.conf to datacenter.cfg

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocleanup balloon after start call
Dominik Csapak [Mon, 14 May 2018 12:03:05 +0000 (14:03 +0200)]
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>
5 years agofix logic of deleting balloon
Dominik Csapak [Mon, 14 May 2018 12:03:04 +0000 (14:03 +0200)]
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>
5 years agonote that auto-ballooning is done by pvestatd
Dominik Csapak [Mon, 14 May 2018 12:03:03 +0000 (14:03 +0200)]
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>
5 years agoactivate volume for cloudinit disk
Dominik Csapak [Fri, 18 May 2018 12:59:02 +0000 (14:59 +0200)]
activate volume for cloudinit disk

because it does not have to be activated (e.g. in case of lvm)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 5.0-26
Wolfgang Bumiller [Mon, 14 May 2018 12:08:39 +0000 (14:08 +0200)]
bump version to 5.0-26

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoimplement permission checks for cloud-init related options
Dietmar Maurer [Thu, 3 May 2018 12:10:57 +0000 (14:10 +0200)]
implement permission checks for cloud-init related options

Most cloud-init options are network related, so we simply check
for VM.Config.Network priviledge.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 years agostart: fork before entering scope
Wolfgang Bumiller [Mon, 7 May 2018 10:09:10 +0000 (12:09 +0200)]
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>
5 years agofix #1749: do not copy pending changes when cloning a vm
Dominik Csapak [Wed, 2 May 2018 09:23:59 +0000 (11:23 +0200)]
fix #1749: do not copy pending changes when cloning a vm

cloning a vm means copying the current state, not the
state of 'some time in the future, when the vm is started again'
we should not copy the pending changes, which also fixes the
issue that we got a wrong pending change on the disks,net,smbios,etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoAdd pci.3 to pve-q35.cfg required by virtio-scsi-single
Kamil Trzciński [Sun, 29 Apr 2018 16:17:08 +0000 (18:17 +0200)]
Add pci.3 to pve-q35.cfg required by virtio-scsi-single

(commit message reworked from original[1])
As a temporary workaround add always a pci.3 bridge so that if
virtio-scsi-single is used, either directly or indirectly if SCSI and
iothread is selected, the respective bridge is available:

> The case where we do miss the pci.3 bridge is when using
> virtio-scsi-single, regardless of whether io threads are enabled,
> because we always put those controllers on pci bus 3 (see
> QemuServer/PCI.pm)
-- [2]

A long term solution would be to always add those bridges dynamically
and just filter out the ones which are already inside the pve-q35.cfg
file .

[1]: https://pve.proxmox.com/pipermail/pve-devel/2018-April/031768.html
[2]: https://pve.proxmox.com/pipermail/pve-devel/2018-April/031787.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agobump version to 5.0-25
Wolfgang Bumiller [Fri, 13 Apr 2018 13:12:09 +0000 (15:12 +0200)]
bump version to 5.0-25

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agocollect device list for nested pci-bridges
Dominik Csapak [Thu, 12 Apr 2018 15:04:56 +0000 (17:04 +0200)]
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>
6 years agofix #1697: only check machine type for pxe
Dominik Csapak [Fri, 13 Apr 2018 09:59:08 +0000 (11:59 +0200)]
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>
6 years agoreadd nbd_stop
Dominik Csapak [Fri, 13 Apr 2018 12:13:42 +0000 (14:13 +0200)]
readd nbd_stop

we accidentally moved nbd_stop to CloudInit.pm in
commit 0c9a7596f6b686ead232927851200554c997fa44

and removed it in
commit 3db6e4ab708b29e9e59572efd8e44558c84bad6d

without realizing that live local storage migration still depends on it

readd it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agodisk: serial no must now be passed to device not drive
Thomas Lamprecht [Thu, 5 Apr 2018 08:54:41 +0000 (10:54 +0200)]
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>
6 years agoqemu-img convert: use cache=none for ZFS only
Fabian Grünbichler [Mon, 26 Mar 2018 08:15:51 +0000 (10:15 +0200)]
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>
6 years agoqemu-img convert: use cache=none
Fabian Grünbichler [Fri, 23 Mar 2018 10:12:16 +0000 (11:12 +0100)]
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>
6 years agobump version to 5.0-24
Thomas Lamprecht [Thu, 22 Mar 2018 08:29:30 +0000 (09:29 +0100)]
bump version to 5.0-24

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agodeps: cloud-init now needs qemu >= 2.11.1-4
Wolfgang Bumiller [Thu, 22 Mar 2018 07:20:30 +0000 (08:20 +0100)]
deps: cloud-init now needs qemu >= 2.11.1-4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agouse pve-edk2-firmware for supporting OVMF
Thomas Lamprecht [Fri, 16 Mar 2018 12:58:27 +0000 (13:58 +0100)]
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>
6 years agocommit_cloudinit_disk : add -n option to qemu-img dd
Alexandre Derumier [Wed, 21 Mar 2018 11:19:17 +0000 (12:19 +0100)]
commit_cloudinit_disk : add -n option to qemu-img dd

6 years agosync bwlimit description with the container one
Thomas Lamprecht [Wed, 21 Mar 2018 10:15:09 +0000 (11:15 +0100)]
sync bwlimit description with the container one

6 years agofixup: remove unneeded if branch
Thomas Lamprecht [Wed, 21 Mar 2018 10:12:26 +0000 (11:12 +0100)]
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 '-'

6 years agorestore: implement rate limiting
Wolfgang Bumiller [Thu, 22 Feb 2018 16:15:24 +0000 (17:15 +0100)]
restore: implement rate limiting

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agostop passing default '-k' QEMU option from datacenter.cfg
Thomas Lamprecht [Tue, 20 Mar 2018 13:26:43 +0000 (14:26 +0100)]
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>
6 years agocleanup: remove duplicate mac address assignment
Wolfgang Bumiller [Wed, 21 Mar 2018 09:33:39 +0000 (10:33 +0100)]
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>
6 years agoclone: add command line completion for newid
Dietmar Maurer [Fri, 16 Mar 2018 10:05:56 +0000 (11:05 +0100)]
clone: add command line completion for newid

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
6 years agoclone: use better default for parameter 'full'
Dietmar Maurer [Fri, 16 Mar 2018 10:05:55 +0000 (11:05 +0100)]
clone: use better default for parameter 'full'

template => linked clone
normal VM => full clone

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
6 years agocloudinit: hide password on the api
Dominik Csapak [Thu, 15 Mar 2018 14:36:50 +0000 (15:36 +0100)]
cloudinit: hide password on the api

since password is easily decrypted, hide it on the api
if someone needs it, they can get it directly from the
config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoremove legacy vm_monitor_command
Thomas Lamprecht [Tue, 13 Mar 2018 07:21:59 +0000 (08:21 +0100)]
remove legacy vm_monitor_command

We introduced our QMP socket with commit
c971c4f2213524f27125f558978a428b53628f34 (29.05.2012)

Already tried to remove this with commit
7b7c6d1b5dcee25e1194d4b8a0219bd5c31a5639 (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 dab36e1ee924be0efab3f85937c23910b456f4b9 (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>
6 years agocloud-init: make parameter order consistent
Dominik Csapak [Mon, 12 Mar 2018 15:25:06 +0000 (16:25 +0100)]
cloud-init: make parameter order consistent

we have '$conf, $vmid' elsewhere for cloudinit, this was the only
function which had them in reverse

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agocloud-init: add manage_etc_hosts to cloud init config
Dominik Csapak [Mon, 12 Mar 2018 15:25:05 +0000 (16:25 +0100)]
cloud-init: add manage_etc_hosts to cloud init config

so that we get the hostname there
(e.g. sudo complains that it cannot resolve the hostname)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agocloud-init: use default hostname when none is set
Dominik Csapak [Mon, 12 Mar 2018 15:25:04 +0000 (16:25 +0100)]
cloud-init: use default hostname when none is set

use "VM$vmid" like we do in a container

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agocloud-init: make cipassword interactive on the CLI
Wolfgang Bumiller [Mon, 12 Mar 2018 12:04:16 +0000 (13:04 +0100)]
cloud-init: make cipassword interactive on the CLI

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoMove name argument to improve visibility in a process list
Herman van Rink [Mon, 12 Mar 2018 12:28:14 +0000 (13:28 +0100)]
Move name argument to improve visibility in a process list

Signed-off-by: Herman van Rink <rink@initfour.nl>
6 years agocloud-init: replace password parameter in log messages
Wolfgang Bumiller [Mon, 12 Mar 2018 11:28:49 +0000 (12:28 +0100)]
cloud-init: replace password parameter in log messages

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agostart: always stop an existing $vmid.scope
Wolfgang Bumiller [Fri, 16 Feb 2018 11:44:58 +0000 (12:44 +0100)]
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>
6 years agocloud-init: pre-hash passwords
Wolfgang Bumiller [Thu, 8 Mar 2018 13:57:19 +0000 (14:57 +0100)]
cloud-init: pre-hash passwords

We don't leave this up to cloud-init as we don't want
un-hashed values at all in our configs.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agowhitespace fixup
Wolfgang Bumiller [Thu, 8 Mar 2018 13:58:25 +0000 (14:58 +0100)]
whitespace fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agocloud-init: fall back to host's resolv.conf
Wolfgang Bumiller [Wed, 7 Mar 2018 12:04:46 +0000 (13:04 +0100)]
cloud-init: fall back to host's resolv.conf

As with containers, if no dns settings are configured, use
the ones from the host.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agocleanup cloud-init option descriptions
Dietmar Maurer [Wed, 7 Mar 2018 09:53:41 +0000 (10:53 +0100)]
cleanup cloud-init option descriptions

6 years agodocument defaults for citype
Dietmar Maurer [Wed, 7 Mar 2018 08:31:44 +0000 (09:31 +0100)]
document defaults for citype

6 years agonew helper cloudinit_config_properties()
Dietmar Maurer [Wed, 7 Mar 2018 08:26:33 +0000 (09:26 +0100)]
new helper cloudinit_config_properties()

Only used to generate documentation.

6 years agocloud-init: don't use /tmp for config files
Wolfgang Bumiller [Wed, 7 Mar 2018 08:04:12 +0000 (09:04 +0100)]
cloud-init: don't use /tmp for config files

Leaving files in /tmp was mostly useful for debugging
purposes initially. Also /tmp is a rather insecure option
for this for a final version, so use
/run/pve/cloudinit/$vmid, and move the file writing into
commit_cloudinit_disk() which now takes a hash mapping file
paths to contents, to not duplicate the temp-file logic for
the different citypes.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agocloud-init: remove separate hostname config entry
Wolfgang Bumiller [Wed, 7 Mar 2018 07:08:03 +0000 (08:08 +0100)]
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>
6 years agocloud-init: add ciuser and cipassword config options
Wolfgang Bumiller [Tue, 6 Mar 2018 14:08:23 +0000 (15:08 +0100)]
cloud-init: add ciuser and cipassword config options

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agocloud-init: nocloud image support
Wolfgang Bumiller [Tue, 27 Feb 2018 09:45:08 +0000 (10:45 +0100)]
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>
6 years agocloud-init: clone/move support
Wolfgang Bumiller [Fri, 23 Feb 2018 10:07:19 +0000 (11:07 +0100)]
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>
6 years agocloud-init: sshkeys are now files on the CLI
Wolfgang Bumiller [Wed, 28 Feb 2018 11:41:46 +0000 (12:41 +0100)]
cloud-init: sshkeys are now files on the CLI

This requires a pve-common patch since we need to not only
load the file but also url-encode it.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agocloud-init: hotplug support
Wolfgang Bumiller [Mon, 17 Aug 2015 13:46:07 +0000 (15:46 +0200)]
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.

6 years agocloud-init: don't add cloudinit isos as 'unused'
Wolfgang Bumiller [Mon, 4 Apr 2016 08:04:10 +0000 (10:04 +0200)]
cloud-init: don't add cloudinit isos as 'unused'

They're regenerated anyway as needed.

6 years agocloud-init: delete cloudinit images as if they weren't cdroms
Wolfgang Bumiller [Tue, 4 Aug 2015 12:31:19 +0000 (14:31 +0200)]
cloud-init: delete cloudinit images as if they weren't cdroms

6 years agocloud-init: use qemu-img dd instead of nbd
Wolfgang Bumiller [Fri, 23 Feb 2018 09:27:30 +0000 (10:27 +0100)]
cloud-init: use qemu-img dd instead of nbd

We now have a patch on top of qemu to allow 'qemu-img dd'
to read from stdin when specifying input and output sizes,
as well as a way to tell it that the size of the source is
not known.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoimplement cloudinit
Alexandre Derumier [Tue, 16 Jun 2015 12:26:43 +0000 (14:26 +0200)]
implement cloudinit

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Co-developed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoparse_vm_config: allow spaces in values
Wolfgang Bumiller [Mon, 4 Apr 2016 10:15:34 +0000 (12:15 +0200)]
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.

6 years agobuildsys: use git rev-parse HEAD for GITVERSION
Wolfgang Bumiller [Tue, 27 Feb 2018 09:11:51 +0000 (10:11 +0100)]
buildsys: use git rev-parse HEAD for GITVERSION

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agobump version to 5.0-23
Wolfgang Bumiller [Fri, 23 Feb 2018 12:21:18 +0000 (13:21 +0100)]
bump version to 5.0-23

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agomigrate cache-size : power of 2
Alexandre Derumier [Tue, 13 Feb 2018 07:51:15 +0000 (08:51 +0100)]
migrate cache-size : power of 2

qemu 2.11 need a power of 2 cache size.

"
Parameter 'xbzrle_cache_size' expects is invalid,
it should be bigger than target page size and a power of two
"

roundup to near power of 2 value

6 years agomigrate: task log: fix typo
Herman van Rink [Wed, 21 Feb 2018 08:59:00 +0000 (09:59 +0100)]
migrate: task log: fix typo

Signed-off-by: Herman van Rink <rink@initfour.nl>
6 years agod/control: control: on newer pve-qemu-kvm 2.9.1-9
Thomas Lamprecht [Thu, 22 Feb 2018 09:55:39 +0000 (10:55 +0100)]
d/control: control: on newer pve-qemu-kvm 2.9.1-9

The NBD drive mirror workaround requires this, also the new -IBRS
machine types, and EPYC cpu models are only available in the newer
qemu versions

Also ensures that we can now allow to hot-unplug virtio-scsi disk
with iothread active, as the fix for it is also in v2.9.1
(virtio-scsi: Unset hotplug handler when unrealize)

6 years agoallow virtio-scsi + iothread controller hot-unplug
Alexandre Derumier [Wed, 21 Feb 2018 10:28:05 +0000 (11:28 +0100)]
allow virtio-scsi + iothread controller hot-unplug

6 years agobump version to 5.0-22
Wolfgang Bumiller [Wed, 21 Feb 2018 08:56:21 +0000 (09:56 +0100)]
bump version to 5.0-22

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoCPU types: add EPYC and EPYC-IBPB
Wolfgang Bumiller [Wed, 21 Feb 2018 08:51:01 +0000 (09:51 +0100)]
CPU types: add EPYC and EPYC-IBPB

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoreturn error from guest-agent
Dominik Csapak [Tue, 20 Feb 2018 08:43:44 +0000 (09:43 +0100)]
return error from guest-agent

in case of e.g. a non-existant guest-agent command, it would return
{ error: {someerrorobject} }
but we did only include the 'return' property

in case we do not get any and the error property is set,
return that

i looked at all the paths were we use the QMPClient, and either
we have our own callback for the result,
or we do not rely on the result being empty upon an error, so this
should not break anything

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoadd new guest-agent commands
Dominik Csapak [Thu, 15 Feb 2018 13:04:52 +0000 (14:04 +0100)]
add new guest-agent commands

between qemu 2.9 and 2.11 there were added some new commands,
the guest agent inside the vm has to support these

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agochange some guest agent commands to GET api calls
Dominik Csapak [Thu, 15 Feb 2018 13:04:51 +0000 (14:04 +0100)]
change some guest agent commands to GET api calls

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoadd an guest agent index call
Dominik Csapak [Thu, 15 Feb 2018 13:04:50 +0000 (14:04 +0100)]
add an guest agent index call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agomake an api call for each guest agent command
Dominik Csapak [Fri, 16 Feb 2018 11:06:36 +0000 (12:06 +0100)]
make an api call for each guest agent command

with a 'register_command' sub, which generates an api call
we call it for each command in the list, and one time for
the old general {vmid}/agent endpoint (for compatibility)

permissions/methods are the same as previously, but can
be overriden

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agomove guest agent api call to its own file
Dominik Csapak [Tue, 13 Feb 2018 15:47:09 +0000 (16:47 +0100)]
move guest agent api call to its own file

so we do not pollute the Qemu.pm too much

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoadd agent flag to vm status api call
Dominik Csapak [Tue, 13 Feb 2018 15:47:08 +0000 (16:47 +0100)]
add agent flag to vm status api call

so that we can check in the gui if we have the agent set without
having to load the whole config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoimprove PVE/API2/Makefile
Dominik Csapak [Tue, 13 Feb 2018 15:47:07 +0000 (16:47 +0100)]
improve PVE/API2/Makefile

remove unnecessary SOURCES variable and add the directory

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agonbd mirror: no need applying full regex on volid string anymore
Thomas Lamprecht [Fri, 16 Feb 2018 13:43:36 +0000 (14:43 +0100)]
nbd mirror: no need applying full regex on volid string anymore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoFix #1664: nbd mirror : remove socat tunnel
Alexandre Derumier [Thu, 15 Feb 2018 12:43:10 +0000 (13:43 +0100)]
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.

6 years agofix #1569: add shared flag to disks
Chris Hofstaedtler [Thu, 15 Feb 2018 13:22:24 +0000 (14:22 +0100)]
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>
6 years agocorrect 'snapshot' flag description
Wolfgang Bumiller [Thu, 8 Feb 2018 12:41:27 +0000 (13:41 +0100)]
correct 'snapshot' flag description

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoappend option to drive if the option is defined
Dominik Csapak [Thu, 8 Feb 2018 11:09:24 +0000 (12:09 +0100)]
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>
6 years agofix #1662: use special case for 'snapshot' disk parameter
Dominik Csapak [Thu, 8 Feb 2018 11:09:23 +0000 (12:09 +0100)]
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>
6 years agoMake the smbios UUID unique if --unique is used.
Wolfgang Link [Thu, 1 Feb 2018 13:51:05 +0000 (14:51 +0100)]
Make the smbios UUID unique if --unique is used.

When we clone a VM we also make the smbios unique.

6 years agoadd serial:1 to vmstatus when config has a serial device configured
Dominik Csapak [Fri, 26 Jan 2018 10:57:59 +0000 (11:57 +0100)]
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>
6 years agobump version to 5.0-21
Wolfgang Bumiller [Mon, 22 Jan 2018 14:13:33 +0000 (15:13 +0100)]
bump version to 5.0-21

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoavoid harmful '<>' pattern, explicitly read from STDIN
Thomas Lamprecht [Mon, 22 Jan 2018 09:52:11 +0000 (10:52 +0100)]
avoid harmful '<>' pattern, explicitly read from STDIN

Fixes problems in CLIHandler using the code pattern:

while (my $line = <>) {
    ...
}

For why this causes only _now_ problems lets first look how <>
behaves:

"The null filehandle <> is special: [...] Input from <> comes either
from standard input, or from each file listed on the command line.
Here's how it works: the first time <> is evaluated, the @ARGV array
is checked, and if it is empty, $ARGV[0] is set to "-" , which when
opened gives you standard input.  The @ARGV array is then processed
as a list of filenames." - 'perldoc perlop'

Recent changes in the CLIHandler code changed how we modfiied @ARGV
Earlier we assumed that the first argument must be the command and
thus shifted it out of @ARGV, now we can have multiple levels of
(sub)commands. This change also changed how we handle @ARGV, we do
not unshift anything but go through the arguments until we got to
the final command and copy the rest of @ARGV as we know that this
must be the commandos arguments.

For '<>' this means that ARGV was still fully populated and perl
tried to open element as a file, which naturally failed.
Thus the change in pve-common only exposed this 'dangerous' code
pattern.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agobump version to 5.0-20
Wolfgang Bumiller [Tue, 16 Jan 2018 13:27:43 +0000 (14:27 +0100)]
bump version to 5.0-20

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoCPU flags: add spec-ctrl
Fabian Grünbichler [Tue, 16 Jan 2018 09:06:41 +0000 (10:06 +0100)]
CPU flags: add spec-ctrl

to allow VMs to use IBRS/IBPB on systems with patched microcode

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoCPU types: add missing types
Fabian Grünbichler [Tue, 16 Jan 2018 09:21:42 +0000 (10:21 +0100)]
CPU types: add missing types

Skylake-Server is the Xeon variant of Skylake

max is "all features supported by the accelerator in the current host"

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoCPU types: add -IBRS variants
Fabian Grünbichler [Tue, 16 Jan 2018 09:21:41 +0000 (10:21 +0100)]
CPU types: add -IBRS variants

this have the 'spec-ctrl' flag by default to allow IBRS based Spectre
mitigation by the guest kernel.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>