]> git.proxmox.com Git - qemu-server.git/log
qemu-server.git
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>
6 years agoqm showcmd --pretty: indent new lines by 2 spaces
Wolfgang Bumiller [Wed, 10 Jan 2018 14:48:59 +0000 (15:48 +0100)]
qm showcmd --pretty: indent new lines by 2 spaces

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoqm showcmd: add simple 'pretty' parameter
Thomas Lamprecht [Tue, 9 Jan 2018 08:56:28 +0000 (09:56 +0100)]
qm showcmd: add simple 'pretty' parameter

Shows each parameter value pair in a new line with a backslash at the
end, so it's still possible to copy, paste and execute it, while
being easier to read and edit by humans. This is opt in.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoincrease start timeout when hugepages are enabled.
Alexandre Derumier [Tue, 9 Jan 2018 17:42:46 +0000 (18:42 +0100)]
increase start timeout when hugepages are enabled.

Hugepages can take some time to be allocated by qemu at start (60s for 120G of 1G hugepages).
This patch increase start timeout to 5min when hugepages are enabled.

6 years agobump version to 5.0-19
Fabian Grünbichler [Tue, 9 Jan 2018 14:50:06 +0000 (15:50 +0100)]
bump version to 5.0-19

6 years agoadd 'flags' property to cpu option
Wolfgang Bumiller [Tue, 9 Jan 2018 14:30:14 +0000 (15:30 +0100)]
add 'flags' property to cpu option

Currently this only allows specifying '+pcid' or '-pcid'
but might be extended in the future.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agofix efi disk format detection
Wolfgang Bumiller [Thu, 28 Dec 2017 13:25:43 +0000 (14:25 +0100)]
fix efi disk format detection

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 2bfbee039bbe ("include format for efidisk")
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoUse default values from load_defaults() when none is specified in conf
Emmanuel Kasper [Tue, 12 Dec 2017 10:56:15 +0000 (11:56 +0100)]
Use default values from load_defaults() when none is specified in conf

This also fixes a bug where VMs with no memory defined in the config
where reported as using 0MB instead of 512.

Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
6 years agobump version to 5.0-18
Wolfgang Bumiller [Wed, 13 Dec 2017 13:57:06 +0000 (14:57 +0100)]
bump version to 5.0-18

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agotermproxy, vncproxy: use -escape 0 for qm terminal
Wolfgang Bumiller [Tue, 12 Dec 2017 08:54:50 +0000 (09:54 +0100)]
termproxy, vncproxy: use -escape 0 for qm terminal

There's no reason to have Ctrl+O terminate these sessions.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoqm terminal: add --escape option
Wolfgang Bumiller [Tue, 12 Dec 2017 08:54:08 +0000 (09:54 +0100)]
qm terminal: add --escape option

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoenable vncproxy with vncterm for serial ports
Dominik Csapak [Mon, 11 Dec 2017 13:55:33 +0000 (14:55 +0100)]
enable vncproxy with vncterm for serial ports

this enables the output via vncterm when the vm has
configured a serial port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoadd termproxy api call
Dominik Csapak [Mon, 11 Dec 2017 13:55:32 +0000 (14:55 +0100)]
add termproxy api call

for xtermjs web client

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agofix #1570: fix template backup with pigz
Dominik Csapak [Fri, 1 Dec 2017 10:43:23 +0000 (11:43 +0100)]
fix #1570: fix template backup with pigz

when using pigz the resulting commandline would look like:

pigz -p 4>file

which resulted in pigz erroring out because it got no parameter for -p
(because the shell interpreted the 4>file as a file descriptor)

this patch adds a space so that the resulting line is
pigz -p 4 > file

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agodo not add unused disk when already as unused on another storage
Dominik Csapak [Thu, 16 Nov 2017 08:20:56 +0000 (09:20 +0100)]
do not add unused disk when already as unused on another storage

when having an unused disk on a storage for which there are multiple
definitions, we added it again on another storage when that storage
was alphabetically before the already existing one

this happens for example when using our automatically generated
ceph storages: 'pool_ct' and 'pool_vm' and having a vm with
an unused disk

with this patch, we also leave the unused disks in the hash

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agomake ssh connection transparent
Dominik Csapak [Fri, 17 Nov 2017 09:22:55 +0000 (10:22 +0100)]
make ssh connection transparent

do not use an escape character for vncproxy

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agofix #1471: change keyboard default to undef
Dominik Csapak [Tue, 7 Nov 2017 10:09:30 +0000 (11:09 +0100)]
fix #1471: change keyboard default to undef

this means that we do not include the '-k' parameter anymore by default
(which is deprecated by qemu)

with this, noVNC and spice always respect the guest keyboard
configuration and altgr keys work without problems

tested:
ubuntu with english intl and german with novnc and spice
windows 10 with english intl and german with novnc and spice
live migration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agofix typo
Wolfgang Bumiller [Fri, 10 Nov 2017 10:27:05 +0000 (11:27 +0100)]
fix typo

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agocheck if ga runs before a fsfreeze-freeze/thaw
Dominik Csapak [Fri, 10 Nov 2017 08:47:43 +0000 (09:47 +0100)]
check if ga runs before a fsfreeze-freeze/thaw

since the guest-fsfreeze-freeze command has a timeout of 1 hour,
we want to check if the guest-agent even runs before executing that,
or else we wait 1 hour and then continue

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoupdate ostype documentation
Thomas Lamprecht [Tue, 7 Nov 2017 07:27:37 +0000 (08:27 +0100)]
update ostype documentation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoinclude format for efidisk
Dominik Csapak [Tue, 7 Nov 2017 07:18:56 +0000 (08:18 +0100)]
include format for efidisk

if the efidisk is in 'raw' format, qemu will prevent writes
on block zero if the format is not explicitely given

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agobump version to 5.0-17
Fabian Grünbichler [Tue, 17 Oct 2017 12:58:17 +0000 (14:58 +0200)]
bump version to 5.0-17

6 years agocorrect cpuunits range
Philip Abernethy [Mon, 9 Oct 2017 11:40:23 +0000 (13:40 +0200)]
correct cpuunits range

'These options take an integer value and control the "cpu.shares"
control group attribute. The allowed range is 2 to 262144. Defaults to
1024.' – man 5 systemd.resource-control

6 years agocheck if base volumes are unused before deleting a template
Dominik Csapak [Fri, 13 Oct 2017 08:00:53 +0000 (10:00 +0200)]
check if base volumes are unused before deleting a template

we only checked if a vm had in use base disks when deleting them,
at which point we do not stop to delete the vm even when a
disk deletion fails, which means we could successfully delete the config
and all not used (base) disks of a template, resulting in left over vm disks

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agobump version to 5.0-16
Fabian Grünbichler [Thu, 5 Oct 2017 09:20:27 +0000 (11:20 +0200)]
bump version to 5.0-16

and add versioned dependency on pve-access-control >= 5.0-7, which
added the VM.Snapshot.Rollback privilege

6 years agobuild: reformat debian/control
Fabian Grünbichler [Wed, 4 Oct 2017 09:05:33 +0000 (11:05 +0200)]
build: reformat debian/control

using wrap-and-sort -abt

6 years agoimportovf: explicitly returns undef
Emmanuel Kasper [Wed, 27 Sep 2017 12:43:11 +0000 (14:43 +0200)]
importovf: explicitly returns undef

We set the returns value to  { type => 'null' } but we returned an empty
string, which was confusing the cli handler.

6 years agoqm importovf: --dryrun: use json output format
Wolfgang Bumiller [Mon, 25 Sep 2017 11:44:50 +0000 (13:44 +0200)]
qm importovf: --dryrun: use json output format

6 years agoqm importovf: set return type to null
Wolfgang Bumiller [Mon, 25 Sep 2017 11:44:26 +0000 (13:44 +0200)]
qm importovf: set return type to null

6 years agowhitespace fixup
Wolfgang Bumiller [Mon, 25 Sep 2017 11:43:58 +0000 (13:43 +0200)]
whitespace fixup

6 years agoAdd new qm command 'importovf', to create VMs from an OVF manifest
Emmanuel Kasper [Wed, 13 Sep 2017 14:10:26 +0000 (16:10 +0200)]
Add new qm command 'importovf', to create VMs from an OVF manifest

Currently the following extracted parameters are used to create a VM:
* VM name
* Memory
* Number of cores
* Disks

6 years agoRefactor defaut bootdisk and smbios1 uuid generation in own subs
Emmanuel Kasper [Wed, 13 Sep 2017 14:10:25 +0000 (16:10 +0200)]
Refactor defaut bootdisk and smbios1 uuid generation in own subs

This will allow code reuse for qm importovf

6 years agoAdd tests for parse_ovf function
Emmanuel Kasper [Wed, 13 Sep 2017 14:10:24 +0000 (16:10 +0200)]
Add tests for parse_ovf function

This includes:
 * a test script
 * the manifests generated by exports from a VmWare Workstation
 *  disk images are generated from qemu-img, with a 2KB size
(it is possible to inspect the disk images with od -bc
they contain a VMDK header and the rest are null characters)

6 years agoInitial support for importing OVF virtual machines
Emmanuel Kasper [Wed, 13 Sep 2017 14:10:23 +0000 (16:10 +0200)]
Initial support for importing OVF virtual machines

Following OVF parameters will be extracted:
 * VM name
 * Memory
 * Number of cores
 * disks and their associated controllers

6 years agoAdd a build dependency to libxml-libxml-perl, needed for OVF parsing
Emmanuel Kasper [Wed, 13 Sep 2017 14:10:22 +0000 (16:10 +0200)]
Add a build dependency to libxml-libxml-perl, needed for OVF parsing

XML::LibXML is being actively developed, and has 91 reverse
depencies in Debian Stretch, so it should not go away.

6 years agoForce overwriting existing compressed man pages and symbolic links
Emmanuel Kasper [Wed, 13 Sep 2017 14:10:21 +0000 (16:10 +0200)]
Force overwriting existing compressed man pages and symbolic links

This allows calling the 'make install' target twice in a row.

6 years agouse foreach_drive in foreach_storage_used_by_vm
Fabian Grünbichler [Mon, 15 May 2017 12:12:00 +0000 (14:12 +0200)]
use foreach_drive in foreach_storage_used_by_vm

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoconfig: make vmstatestorage hotpluggable
Fabian Grünbichler [Mon, 15 May 2017 12:11:59 +0000 (14:11 +0200)]
config: make vmstatestorage hotpluggable

since this is just an option for PVE, and does not concern the VM at all.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agorename foreach_writable_storage to foreach_storage_used_by_vm
Fabian Grünbichler [Mon, 15 May 2017 12:11:58 +0000 (14:11 +0200)]
rename foreach_writable_storage to foreach_storage_used_by_vm

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agosnapshot: use explicitly configured vmstate storage
Fabian Grünbichler [Mon, 15 May 2017 12:11:57 +0000 (14:11 +0200)]
snapshot: use explicitly configured vmstate storage

and simplify storage loop

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoconfig: add vmstatestorage option
Fabian Grünbichler [Mon, 15 May 2017 12:11:56 +0000 (14:11 +0200)]
config: add vmstatestorage option

and permission checks

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoVM.Snapshot.Rollback privilege added
Matthias Urban [Wed, 13 Sep 2017 10:30:37 +0000 (12:30 +0200)]
VM.Snapshot.Rollback privilege added

VM.Snapshot.Rollback privilege added

Signed-off-by: Matthias Urban <matthias.urban@pure-systems.com>
6 years agodo not overwrite global signal handlers
Emmanuel Kasper [Thu, 14 Sep 2017 13:19:39 +0000 (15:19 +0200)]
do not overwrite global signal handlers

perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

In all cases the global signal handlers we overwrote were in cli programs or
forked workers, not in daemons.

6 years agomigration : enable mtunnel for insecure migration V2
Alexandre Derumier [Tue, 5 Sep 2017 09:46:17 +0000 (11:46 +0200)]
migration : enable mtunnel for insecure migration V2

We only use it to send commands faster like resume

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
6 years agoovmf: deprecate old legay ovmf image and refactor
Thomas Lamprecht [Mon, 11 Sep 2017 06:40:29 +0000 (08:40 +0200)]
ovmf: deprecate old legay ovmf image and refactor

this was only kept for PVE 4.X where the switch to the newer OVMF
image with actual working persisten EFIVARS was made.

We do not ship this old image in PVE 5.0 anymore so remove this
legacy code as it can never trigger anyhow.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agocreate_disks: refactor out and improve efidisk creation
Thomas Lamprecht [Mon, 11 Sep 2017 06:40:28 +0000 (08:40 +0200)]
create_disks: refactor out and improve efidisk creation

factor out code in a new create_efidisk submethod, as else this code
is hardly readable as the efidisk0 case is a special case. Refer from
putting all this specialised handling directly to the much shorter
code for all other cases.

Also the disk was created with a specific format and then a format
detection on the newly created disk was done, which is pretty
useless, clear that up.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoefidisk: do not hard code efivar base image size
Thomas Lamprecht [Mon, 11 Sep 2017 06:40:27 +0000 (08:40 +0200)]
efidisk: do not hard code efivar base image size

The size of this image is not fixed, it increased to 528k in more
recent build of OVMF and could increase further (not likely, but
possible).

Instead of changing the hardcoded value move to a more generic
approach and read the size from the base image at creation time.

Use the new convert_size method and generalise the assignment of
size and volid between the efidisk and the normal case, as a part of
this change.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoRemove unused variable declaration
Emmanuel Kasper [Thu, 27 Jul 2017 12:32:27 +0000 (14:32 +0200)]
Remove unused variable declaration

6 years agoFix #1441: Do not unplug controllers when the mirroring is finished
Emmanuel Kasper [Thu, 27 Jul 2017 12:32:26 +0000 (14:32 +0200)]
Fix #1441: Do not unplug controllers when the mirroring is finished

This should not be needed since we call 'block-job-complete' before
in qemu_drive_mirror_monitor(), and after benchmarking it does not
appear to be needed nor provide a measurable improvement when shutting
down the source.

6 years agorestore_vma_archive: do not overwrite global signal handlers
Thomas Lamprecht [Wed, 6 Sep 2017 11:29:07 +0000 (13:29 +0200)]
restore_vma_archive: do not overwrite global signal handlers

perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoAPI/clone: do not overwrite global signal handlers
Thomas Lamprecht [Wed, 6 Sep 2017 11:29:06 +0000 (13:29 +0200)]
API/clone: do not overwrite global signal handlers

perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoupdate_vm: sort logged parameters
Fabian Grünbichler [Wed, 6 Sep 2017 09:32:13 +0000 (11:32 +0200)]
update_vm: sort logged parameters

otherwise the (log) output looks really strange when mass-updating VMs, e.g.:
update VM 400001: -scsi1 somestore:64 -scsi0 somestore:64 -ide2 isostore:iso/somefile.iso,media=cdrom
update VM 400002: -ide2 isostore:iso/somefile.iso,media=cdrom -scsi1 somestore:64 -scsi0 somestore:64
update VM 400003: -scsi0 somestore:64 -ide2 isostore:iso/somefile.iso,media=cdrom -scsi1 somestore:64

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoremove legacy sparsecp
Thomas Lamprecht [Wed, 14 Jun 2017 13:52:19 +0000 (15:52 +0200)]
remove legacy sparsecp

sparsecp gets only used in qmextract, which is part of the old backup
method (pre PVE 2.3).
Do not remove qmextract for now people could still have backups from
< PVE 2.3 around.
They could be restored manually, but we shouldn't make restoring
complicated. Thus replace sparsecp with `cp sparse=always`.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoremove unused obsolete vmtar
Thomas Lamprecht [Wed, 14 Jun 2017 13:52:18 +0000 (15:52 +0200)]
remove unused obsolete vmtar

This was used by the pre-VMA backup methods, as the new backup
process was introduced in PVE 2.3 (04.03.2013) and this would be only
used for creating new backups it can be removed safely.

Fixes Debian stretch build on the ARM64 architecture.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>