Commit Graph

1373 Commits

Author SHA1 Message Date
Wolfgang Bumiller
387ba25792 split old style pipe open call 2016-06-09 18:12:26 +02:00
Alexandre Derumier
9a1c413f4b fix raise_param_exc in PVE::QemuServer::Memory::memory_unplug v2
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-06-08 18:52:01 +02:00
Alexandre Derumier
37dbec899d fix check_running in PVE::QemuServer::Memory::qemu_memory_hotplug
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-06-08 12:49:29 +02:00
Alexandre Derumier
7a131888d7 add hyperv enlightments : hv_reset, hv_vpindex, hv_runtime
add them by default for qemu 2.6
(support is already present in qemu 2.5, but we don't want to break live migration for current running vm)

vpindex && runtime need host kernel 4.4

Theses 3 enlightements are needed by windows to use vmbus
http://searchwindowsserver.techtarget.com/definition/Microsoft-Virtual-Machine-Bus-VMBus

details :

- When Hyper-V "vpindex" is on, guest can use MSR HV_X64_MSR_VP_INDEX
to get virtual processor ID.

- Hyper-V "runtime" enlightement feature allows to use MSR
HV_X64_MSR_VP_RUNTIME to get the time the virtual processor consumes
running guest code, as well as the time the hypervisor spends running
code on behalf of that guest.

- Hyper-V "reset" allows guest to reset VM.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-06-07 10:08:25 +02:00
Thomas Lamprecht
e858e9d241 do not open forward tunnel on insecure migrations
Restore previous behaviour and do not request a forward tunnel on
insecure migrations.

For the migrations of all kind this has no direct impact, they all
worked, but an port to much requested from an limited pool is still
not ideal. Also an open tunnel, if not needed.

This is a light regression introduced from commit 1c9d54b.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-06-06 14:51:34 +02:00
Thomas Lamprecht
54323eed5f migrate: unlink unix socket before starting migration
Just to be sure nobody else has (wrongfully) left that file here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-06-03 16:02:25 +02:00
Dietmar Maurer
a3f2f97156 bump version to 4.0-79 2016-06-03 12:16:56 +02:00
Thomas Lamprecht
f34d146679 migrate: add some more log output
Output all errors - if any - and add some log outputs on what we qmp
commands we do with which parameters, may be helpful when debugging
or analyzing a users problem.

Also check if the queried status is defined, as on a error this may
not be.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-06-03 12:00:50 +02:00
Thomas Lamprecht
92437b8de0 migrate: close tunnel after dest. VM stopped on error
On error let phase2_cleanup close the tunnel as it stops the for
incoming migration waiting VM on the destination first, to be safe.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-06-03 12:00:25 +02:00
Thomas Lamprecht
1c9d54bfd0 migrate: use ssh forwarded UNIX socket tunnel
We cannot guarantee when the SSH forward Tunnel really becomes
ready. The check with the mtunnel API call did not help for this
prolem as it only checked that the SSH connection itself works and
that the destination node has quorum but the forwarded tunnel itself
was not checked.

The Forward tunnel is a different channel in the SSH connection,
independent of the SSH `qm mtunnel` channel, so only if that works
it does not guarantees that our migration tunnel is up and ready.

When the node(s) where under load, or when we did parallel
migrations (migrateall), the migrate command was often started
before a tunnel was open and ready to receive data. This led to
a direct abortion of the migration and is the main cause in why
parallel migrations often leave two thirds or more VMs on the
source node.
The issue was tracked down to SSH after debugging the QEMU
process and enabling debug logging showed that the tunnel became
often to late available and ready, or not at all.

Fixing the TCP forward tunnel is quirky and not straight ahead, the
only way SSH gives as a possibility is to use -N (no command)
-f (background) and -o "ExitOnForwardFailure=yes", then it would
wait in the foreground until the tunnel is ready and only then
background itself. This is not quite the nicest way for our special
use case and our code base.
Waiting for the local port to become open and ready (through
/proc/net/tcp[6]] as a proof of concept is not enough, even if the
port is in the listening state and should theoretically accept
connections this still failed often as the tunnel was not yet fully
ready.

Further another problem would still be open if we tried to patch the
SSH Forward method we currently use - which we solve for free with
the approach of this patch - namely the problem that the method
to get an available port (next_migration_port) has a serious race
condition which could lead to multiple use of the same port on a
parallel migration (I observed this on my many test, seldom but if
it happens its really bad).

So lets now use UNIX sockets, which ssh supports since version 5.7.
The end points are UNIX socket bound to the VMID - thus no port so
no race and also no limitation of available ports (we reserved 50 for
migration).

The endpoints get created in /run/qemu-server/VMID.migrate and as
KVM/QEMU in current versions is able to use UNIX socket just as well
as TCP we have not to change much on the interaction with QEMU.
QEMU is started with the migrate_incoming url at the local
destination endpoint and creates the socket file, we then create
a listening socket on the source side and connect over SSH to the
destination.
Now the migration can be started by issuing the migrate qmp command
with an updated uri.

This breaks live migration from new to old, but *not* from old to
new, so there is a upgrade path.
If a live migration from new to old must be made (for whatever
reason), use the unsecure_migration setting (man datacenter.conf)
to allow this, although that should only be done in trusted network.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-06-03 11:51:46 +02:00
Thomas Lamprecht
61b04c6d5a migrate: collect migration tunnel child process
use waitpid with WNO_HANG to check if the ssh tunnel child process
is still running and collect at the same time if it exited.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-06-03 11:47:13 +02:00
Dietmar Maurer
052702921e bump version to 4.0-78 2016-06-03 11:43:48 +02:00
Wolfgang Bumiller
8e59d952be use enter_systemd_scope instead of systemd-run
With systemd-run qemu's --daemonize forks often happen
before systemd finishes setting up the scopes, which means
the limits we apply often don't work.
We now use enter_systemd_scope() to create the scope before
running qemu directly without systemd-run.

Note that vm_start() runs in a forked-worker or qm cli
command, so entering the scope in such a process should not
affect the rest of the pve daemon.
2016-06-03 11:41:31 +02:00
Wolfgang Link
674051dcac fix typo 2016-06-02 09:59:51 +02:00
Dominik Csapak
6bcacc21b3 fix serial/parallel/numa permissions
moved numa\d+ persmission to VM.Config.CPU
and serial/parallel to root since it accesses the host hardware

also renamed remainingoptions to generaloptions to
reduce confusion, since the real remaining options
(those that we do not specify) require root

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-01 12:56:54 +02:00
Dominik Csapak
58cb690b06 fix #1010: whitelist options for permissions
instead of defaulting to VM.Config.Options for
all options not checked seperately, we
now have lists for the different config permissions
and check them accordingly.

for everything not given, we require root access
this is important especially for usbN and hostpciN
since they can change the host configuration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-01 12:19:37 +02:00
Dietmar Maurer
344b2f9965 bump version to 4.0-77 2016-05-31 12:16:14 +02:00
Dominik Csapak
596a0a2056 do not ignore hotplug parse errors
if we got an option which was not valid, we still
wrote it to the config, and subsequently returned
it on every api call

instead, now we die instead of warn and do not accept
invalid options

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-31 12:15:32 +02:00
Alexandre Derumier
0567a4d572 move memory config generation to QemuServer::Memory::config
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-05-23 10:04:31 +02:00
Alexandre Derumier
6779f1ac3c move qemu_memory_hotplug && qemu_dimm_list to QemuServer::Memory
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-05-23 10:03:40 +02:00
Alexandre Derumier
3f669af25d move foreach_dimm && foreach_reverse_dimm to QemuServer::Memory
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-05-23 10:02:29 +02:00
Alexandre Derumier
a0649da28b add QemuServer::Memory
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-05-23 10:02:07 +02:00
Dietmar Maurer
faab53066c hostpci docs: move notes into verbose_description 2016-05-20 11:59:30 +02:00
Dietmar Maurer
fad17f04fc add full path reference to datacenter.conf file 2016-05-19 16:27:30 +02:00
Dietmar Maurer
522619458c improve documentation 2016-05-19 13:13:25 +02:00
Dietmar Maurer
b7f0df66b6 bump version to 4.0-76 2016-05-18 11:26:09 +02:00
Dominik Csapak
9f41a659a1 allow VLAN 1 tag in qemu-kvm vms
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-18 11:25:29 +02:00
Fabian Grünbichler
19333c9b82 add --description to systemd scope unit
otherwise, long kvm commands lead to systemd unit files with
very long lines, with confuses the systemd unit file parser.

apparently systemd has a length limit for unit file lines and
(line-)breaks the description string at that point. since
the rest of the description is probably not a valid key/value
pair, this leads to warnings. the default semantics of systemd-run
is to use the executed command as description unless a description
is specified explicitly.

note that this behaviour of systemd could allow an attacker
with access to the VM configuration to craft a kvm commandline
that starts or stops arbitrary systemd units.
2016-05-14 09:02:58 +02:00
Dietmar Maurer
30983c3bac remove unneeded keyAlias option 2016-05-11 13:04:59 +02:00
Dietmar Maurer
4b4e568023 bump version to 4.0-75 2016-05-11 11:20:35 +02:00
Dietmar Maurer
7f694a7113 fix #975, use new keyAlias feature.
Also remove unneccessary format_descriptions for boolean and enums.
2016-05-11 10:11:49 +02:00
Fabian Grünbichler
391c2230d4 fix #987: don't detect pending changes as snapshots
when copying the VM configuration in vzdump. instead detect
them as pending changes and warn about them separately.
2016-05-10 10:35:59 +02:00
Dominik Csapak
e7a5104daa add warning for iothread with invalid scsi controller
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-04 11:11:32 +02:00
Dietmar Maurer
90cc48095f update changelog 2016-05-04 10:49:01 +02:00
Fabian Grünbichler
e1fc368d6b fix typos 2016-05-04 10:47:23 +02:00
Fabian Grünbichler
73f5ee92af fix #971: don't activate shared storage in offline migration
instead, just print a warning if the connection check fails.
as long as the storage is online on the target node, the VM
will start fine after migration.
2016-05-04 10:47:15 +02:00
Fabian Grünbichler
29701766ae migrate: check if storage is available 2016-05-04 10:47:04 +02:00
Dietmar Maurer
33eb09935e bump version to 4.0-74 2016-05-01 09:25:46 +02:00
Dietmar Maurer
8930da746f correctly set cpu vendor 2016-05-01 09:24:25 +02:00
Dietmar Maurer
298fefcc5d bump version to 4.0-73 2016-04-29 09:03:38 +02:00
Wolfgang Bumiller
3c525055dd restore: pass format to vma extract
This silences the "probing guessed raw" warnings of
'qmrestore'.
2016-04-29 09:02:34 +02:00
Dietmar Maurer
3f565071e5 bump version to 4.0-72 2016-04-22 11:10:16 +02:00
Alexandre Derumier
2b401189e3 vm_start : force systemctl stop if orphan scope exist
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-04-22 11:09:09 +02:00
Dominik Csapak
ffa42b860d fix #947: reenable disk/cdrom passthrough
previously, we did not check the file parameter of a disk,
allowing passthrough of a block device (by design)

with the change to the json parser for the disks, the format
became 'pve-volume-id' which is only valid for our volume ids
(and later we also allowed the value 'none')

this patch alternatively checks if the parameter is a path
or 'cdrom'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-21 11:54:55 +02:00
Dietmar Maurer
de7c2026f7 bump version to 4.0-71 2016-04-21 10:35:15 +02:00
Wolfgang Bumiller
b572a6065a Fix #643: activate volumes before resizing
The volume_size_info() call was what actually failed, but
the error reported to the gui came from afterwards trying to
resize the disk to a garabge size.
2016-04-21 10:33:36 +02:00
Dietmar Maurer
681e12ba37 bump version to 4.0-70 2016-04-19 09:02:05 +02:00
Thomas Lamprecht
4d2a734e1b vm_status: return more verbose HA state
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-04-19 09:01:02 +02:00
Fabian Grünbichler
c7a8aad601 docs: cleanup 2016-04-15 16:37:41 +02:00
Dietmar Maurer
ef99513e37 bump version to 4.0-69 2016-04-13 08:25:17 +02:00