5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-02-16 09:57:38 +03:00

1209 Commits

Author SHA1 Message Date
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
Wolfgang Bumiller
230406dc52 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>
2018-03-08 14:59:27 +01:00
Wolfgang Bumiller
231f824b1a whitespace fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-08 14:58:34 +01:00
Wolfgang Bumiller
67864d1940 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>
2018-03-07 15:03:39 +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
f62c36cffa 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>
2018-03-07 09:15:50 +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
3351aacc70 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>
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
Wolfgang Bumiller
3db6e4ab70 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>
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
50d8dd5dc7 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
2018-02-22 16:27:48 +01:00
Herman van Rink
d108cb1eb2 migrate: task log: fix typo
Signed-off-by: Herman van Rink <rink@initfour.nl>
2018-02-22 14:50:00 +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
Dominik Csapak
1928c20188 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>
2018-02-20 09:56:59 +01:00
Dominik Csapak
5667cc55fe 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>
2018-02-20 09:56:53 +01:00
Dominik Csapak
e6bd703b4e change some guest agent commands to GET api calls
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-02-20 09:56:50 +01:00
Dominik Csapak
ad1f73b9e4 add an guest agent index call
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-02-20 09:56:46 +01:00
Dominik Csapak
ea2bceaf19 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>
2018-02-20 09:56:36 +01:00
Dominik Csapak
b8158701aa 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>
2018-02-20 09:55:15 +01:00
Dominik Csapak
c9a074b8bf 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>
2018-02-20 09:55:15 +01:00
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
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
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
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: 2bfbee039bbe ("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
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