Commit Graph

1530 Commits

Author SHA1 Message Date
Dominik Csapak
aaa36aee18 improve PVE/API2/Makefile
remove unnecessary SOURCES variable and add the directory

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-02-20 09:55:15 +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
Wolfgang Bumiller
45cc6761db bump version to 5.0-21
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-22 15:13:33 +01:00
Thomas Lamprecht
e5caa02e05 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>
2018-01-22 14:56:27 +01:00
Wolfgang Bumiller
332a2f2bae bump version to 5.0-20
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-16 14:27:43 +01:00
Fabian Grünbichler
049fc9ebe7 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>
2018-01-16 14:12:18 +01:00
Fabian Grünbichler
a446dbf46b 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>
2018-01-16 14:10:57 +01:00
Fabian Grünbichler
9052cabab6 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>
2018-01-16 14:10:57 +01:00
Wolfgang Bumiller
108899b48f qm showcmd --pretty: indent new lines by 2 spaces
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-10 15:48:59 +01:00
Thomas Lamprecht
16a01738cb 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>
2018-01-10 15:47:05 +01:00
Alexandre Derumier
f38de678e4 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.
2018-01-10 15:08:26 +01:00
Fabian Grünbichler
d40d949455 bump version to 5.0-19 2018-01-09 15:50:06 +01:00
Wolfgang Bumiller
39fd79e2ad 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>
2018-01-09 15:42:53 +01:00
Wolfgang Bumiller
13bca7b4de fix efi disk format detection
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 2bfbee039b ("include format for efidisk")
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-09 15:20:51 +01:00
Emmanuel Kasper
3618ee99aa 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>
2017-12-15 13:05:59 +01:00
Wolfgang Bumiller
ca7be99668 bump version to 5.0-18
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-12-13 15:13:42 +01:00
Wolfgang Bumiller
ccb88f4578 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>
2017-12-13 14:52:28 +01:00
Wolfgang Bumiller
aa320bcd16 qm terminal: add --escape option
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-13 14:52:28 +01:00
Dominik Csapak
9e6d6e97c4 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>
2017-12-12 08:34:03 +01:00
Dominik Csapak
8730200273 add termproxy api call
for xtermjs web client

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-12 08:34:03 +01:00
Dominik Csapak
a2fab11a46 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>
2017-12-06 14:54:00 +01:00
Dominik Csapak
c449137a04 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>
2017-11-20 14:38:48 +01:00
Dominik Csapak
6a567ae731 make ssh connection transparent
do not use an escape character for vncproxy

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-17 10:38:26 +01:00
Dominik Csapak
aea47dd6a0 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>
2017-11-15 13:16:38 +01:00
Wolfgang Bumiller
6941ee4e1c fix typo
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-11-10 11:27:05 +01:00
Dominik Csapak
1a988fd2e8 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>
2017-11-10 11:20:55 +01:00
Thomas Lamprecht
44c2a647ff update ostype documentation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-07 08:47:15 +01:00
Dominik Csapak
2bfbee039b 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>
2017-11-07 08:45:25 +01:00
Fabian Grünbichler
af736d4d0b bump version to 5.0-17 2017-10-17 14:58:17 +02:00
Philip Abernethy
237239bf60 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
2017-10-17 14:10:49 +02:00
Dominik Csapak
5e67a2d2c4 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>
2017-10-13 10:18:34 +02:00
Fabian Grünbichler
8f943606bd bump version to 5.0-16
and add versioned dependency on pve-access-control >= 5.0-7, which
added the VM.Snapshot.Rollback privilege
2017-10-05 11:26:05 +02:00
Fabian Grünbichler
83be65a4e6 build: reformat debian/control
using wrap-and-sort -abt
2017-10-04 11:05:33 +02:00
Emmanuel Kasper
5d942f5aff importovf: explicitly returns undef
We set the returns value to  { type => 'null' } but we returned an empty
string, which was confusing the cli handler.
2017-09-27 14:54:56 +02:00
Wolfgang Bumiller
0f80f1ab6d qm importovf: --dryrun: use json output format 2017-09-25 13:51:53 +02:00
Wolfgang Bumiller
b533b99534 qm importovf: set return type to null 2017-09-25 13:51:53 +02:00
Wolfgang Bumiller
f6306646d8 whitespace fixup 2017-09-25 13:51:53 +02:00
Emmanuel Kasper
7cd9f6d77e 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
2017-09-25 13:31:55 +02:00
Emmanuel Kasper
ae2fcb3be6 Refactor defaut bootdisk and smbios1 uuid generation in own subs
This will allow code reuse for qm importovf
2017-09-25 13:31:55 +02:00
Emmanuel Kasper
5fd0910be3 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)
2017-09-25 13:31:55 +02:00
Emmanuel Kasper
d16287d8d2 Initial support for importing OVF virtual machines
Following OVF parameters will be extracted:
 * VM name
 * Memory
 * Number of cores
 * disks and their associated controllers
2017-09-25 13:31:55 +02:00
Emmanuel Kasper
5092c86904 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.
2017-09-25 13:31:55 +02:00
Emmanuel Kasper
9d699c4993 Force overwriting existing compressed man pages and symbolic links
This allows calling the 'make install' target twice in a row.
2017-09-25 13:31:55 +02:00