Commit Graph

1056 Commits

Author SHA1 Message Date
Wolfgang Bumiller
175b51fdb5 Fix #1361: create disk: stricter parsing of storage:size
This fixes paths such as
/dev/disk/by-id/some-ID:0.5
being interpreted as a request to create a 0.5G-sized disk
in the storage named '/dev/disk/by-id/some-ID'.
2017-05-10 10:31:25 +02:00
Dietmar Maurer
3aa44d3b57 move get_replicatable_volumes from QemuServer.pm to QemuConfig.pm 2017-05-06 17:13:31 +02:00
Dietmar Maurer
64932aebff PVE::QemuServer::create_disks - run code inside eval
So that we can free allocated volumes ins something fails.

Thi bug was introduced with commit ae57f6b352
2017-05-06 17:00:20 +02:00
Dietmar Maurer
0342b45bee get_replicatable_volumes: replacemnet for PVE::ReplicationTools::get_syncable_guestdisks()
correctly scan for volumes inside snapshots.

This will also solve the cyclic package dependency propblem.
2017-05-06 15:11:46 +02:00
Dietmar Maurer
8557d01f75 rename drive 'replica' property to 'replicate' 2017-05-06 10:46:21 +02:00
Dietmar Maurer
46883f80f6 Revert "Integrate replica in the qemu migration."
This reverts commit 63d02c7074.

The commit changes the configuration before the VM is actually
migrated, so it is possible to have a wrong configuration when
migration fails for some reason. Also, I am quite unsure if
this automatic target change is really wanted. The patch also
contains wrong refereces to $self->{opts}->{node}.
2017-05-06 10:39:43 +02:00
Dietmar Maurer
b1c12185fb Revert "migrate: cleanup replica volume skip condition"
This reverts commit 6e8044dcea.
2017-05-06 10:38:06 +02:00
Dietmar Maurer
2286cb8c23 use a single replicate property (format pve-replicate) 2017-05-06 10:35:08 +02:00
Emmanuel Kasper
76312b862b add description of read/writes statistics in vzdump output
since this statistics are note really described, sometimes users
miss that their slow backups are caused by slow reads
2017-05-03 09:14:50 +02:00
Dominik Csapak
2c7fc94783 start vncproxy worker in the background
this allows it to use the vncproxy api call to use from pvesh,
because before we waited until the task finished to get the vncticket
which was too late

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-05-03 08:35:03 +02:00
Wolfgang Bumiller
6d449202ba api: replica: safer config update
Configuration updates should only happen if and after their
change has successfully taken effect.
2017-04-28 10:40:22 +02:00
Wolfgang Bumiller
6e8044dcea migrate: cleanup replica volume skip condition 2017-04-28 10:34:46 +02:00
Wolfgang Bumiller
1849c59288 whitespace fixup 2017-04-28 10:14:26 +02:00
Wolfgang Link
9b49ba658f Destroy all remote and local replication datasets when a VM will destroyed. 2017-04-28 10:11:33 +02:00
Wolfgang Link
63d02c7074 Integrate replica in the qemu migration.
Now it is possible to migrate a VM offline when replica is enabled.
It will reduce replication to an minimal amount.
2017-04-28 10:11:33 +02:00
Wolfgang Link
9edac22f5f Insert new properties in the Qemu config for the PVE Replica.
This patch will include all necessary properties for the replication.
Also will it enable and disable a replication job
when appointed flags are set or deleted.
2017-04-28 10:11:33 +02:00
Alexandre Derumier
6e9d255038 add rerror for all drives
it was missing for scsi, and it's supported for all kind of drive

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-04-28 10:02:38 +02:00
Alexandre Derumier
d80ad67f9d live storage migration : fix check of target storage availability
if we define a different target storeid for remote node,
and that storage is not available on source node

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-04-21 12:05:36 +02:00
Fabian Grünbichler
877e2ea746 migrate: clarify comment
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-04-21 11:43:29 +02:00
Fabian Grünbichler
28412ae488 migrate: cleanup nbd source disks earlier
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-04-21 11:43:29 +02:00
Fabian Grünbichler
504105c638 fix #1338: migrate: stop nbd before resuming
since Qemu 2.9, block device write access is limited to one
writer unless shared_rw is set to true. there is an
exception for live-migrating local disks via NBD as long as
the VM is suspended.

stop the NBD server before resuming the VM accordingly to
unbreak local disk live-migration.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-04-21 11:43:29 +02:00
Fabian Grünbichler
b37ecfe6ae start: keep VM paused when migrating via unix socket
this (correctly!) errored out with Qemu 2.9 when live-migrating
local disks, because the NBD server blocks the VM from being
resumed. was probably missed when migrating via unix domains
was originally introduced..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-04-21 11:43:29 +02:00
Dominik Csapak
058ff55b39 turn off alarm timer after accepting a vnc connection
else we always get a failed task when the vnc connection is
running longer than $timeout

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-04-18 14:14:07 +02:00
Wolfgang Bumiller
d1782ebad3 don't compare booleans
a) because perl isn't THAT bad of a language that you'd need
to do this and b) because JSON::XS version 2.90 "dropped"
this "feature"
2017-04-03 14:13:15 +02:00
Fabian Grünbichler
d2c6bf93ae update_vm: check whether opt is set before deleting
otherwise we get lots uninitialized warnings:

update VM 600: -delete unused7
Use of uninitialized value $data in split at /usr/share/perl5/PVE/JSONSchema.pm line 533.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/PVE/API2/Qemu.pm line 1012.
Use of uninitialized value $volid in pattern match (m//) at /usr/share/perl5/PVE/QemuServer.pm line 1824.
Use of uninitialized value $volid in pattern match (m//) at /usr/share/perl5/PVE/Storage/Plugin.pm line 201.
Use of uninitialized value $volid in concatenation (.) or string at /usr/share/perl5/PVE/Storage/Plugin.pm line 205.

vs:

update VM 600: -delete unused7
cannot delete 'unused7' - not set in current configuration!

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-03-23 11:41:12 +01:00
Emmanuel Kasper
e248477e92 Use backticks instead of single quotes in qm resize description
Single quoted text in asciidoc is rendered in man pages
with underlines, which makes the '+' symbol very similar to '+/-'

Backticks are rendered with monospace text in HTML, normal text
in man pages, and still readable in raw format.
2017-03-02 10:38:19 +01:00
Fabian Grünbichler
8b54f4b8db defined() style cleanup 2017-02-28 12:46:47 +01:00
Wolfgang Link
9045f57a27 Check array existed before use.
This triggers if a qemu guest has a local unused disk.
The disk will migrate by offline disk migration, so it is not in the target_drives.
2017-02-28 12:33:27 +01:00
Wolfgang Bumiller
655d746212 remove netcat6 dependency
By simply using a socket.
2017-02-28 12:23:42 +01:00
Dominik Csapak
3db920fc13 add Skylake to CPU Models
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-02-28 12:19:14 +01:00
Emmanuel Kasper
9a478b17c0 Improve error message when trying to shrink a volume, fix typo 2017-02-17 09:09:49 +01:00
Wolfgang Bumiller
7fe1b688b6 fix bad scsihw default value check
This was checking for scsihw being set in both branches
whereas lsi is also the default. Added the missing 'not'.

Fixes a bug where a VM with a disk with a scsi index >= 7
refused to start due to an invalid scsi id.

Reported-by: Friedrich Ramberger <f.ramberger@proxmox.com>
2017-02-13 14:10:00 +01:00
Wolfgang Bumiller
1e4fb053d3 skiplock standard option was moved to pve-common
this now need libpve-common-perl >= 4.0-92
2017-02-08 09:56:02 +01:00
Wolfgang Bumiller
9f11fc5fa2 don't pull HA modules for doc-generation 2017-02-06 16:13:30 +01:00
Fabian Grünbichler
5ff2bb065a change TLS cipher suite to HIGH
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-01-31 13:38:20 +01:00
Fabian Grünbichler
fbd7dcce4d fix #1260: convert moved template disk to base
this was already possible manually via "qm template", but
doing it automatically when moving a disk of a template
makes more sense.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-01-26 10:03:20 +01:00
Fabian Grünbichler
8e3c33ab64 only use scsi-block with explicit opt-in
since it can cause I/O errors and data corruption in low
memory or highly fragmented memory situations since Qemu 2.7

use scsi-hd by default instead

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-01-25 09:18:46 +01:00
Dietmar Maurer
9bb3acf155 use new PVE::Storage::check_volume_access() 2017-01-18 17:23:03 +01:00
Dmitry Petuhov
7246e8f92f Set zero $size and continue if volume_resize() returns false
Needed for some storages with backing block devices to do oonlinr resize.

Signed-off-by: Dmitry Petuhov <mityapetuhov@gmail.com>
2017-01-16 09:14:32 +01:00
Dietmar Maurer
5e4035c739 add setup_environment hook to CLIHandler classes 2017-01-12 14:10:24 +01:00
Wolfgang Bumiller
9009150b81 cleanup: drop superfluous condition in assignment
Its use later on already uses itself as condition.
2017-01-09 15:33:12 +01:00
Alexandre Derumier
456a6fec00 add romfile option to hostpci
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-09 15:31:18 +01:00
Alexandre Derumier
56af714629 add with-local-disks option for live storage migration
As Fabian as required,
add an extra flag "with-local-disks"  to enable live storage migration with localdisk.

default target storage is same sid than source, this can be overrided with
"targetstorage" option.

I will try improve this later, with optionnal mapping, disk by disk.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-06 12:10:25 +01:00
Wolfgang Bumiller
bd2d5fe6ff cleanup: error messages 2017-01-05 10:03:16 +01:00
Wolfgang Bumiller
923aaa9e1a drive-mirror: bump timeout to 5s, add 30s inactivity timeout 2017-01-05 10:03:16 +01:00
Wolfgang Bumiller
ca5c27f065 drive-mirror: warn use POSIX::_exit on exec failure 2017-01-05 10:03:16 +01:00
Wolfgang Bumiller
3b4cf0f0fc cleanup: whitespaces & style 2017-01-05 10:03:10 +01:00
Alexandre Derumier
5619e74aed live clone_vm : suspend or freezefs before block-job-cancel
if qga is enabled, we try to freeze the fs before cancelling block job.
if not , we pause the vm.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Alexandre Derumier
35e4ab0498 add socat and unix socket for storage migration
This is a workaround for nbd infinite timeout connect

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Alexandre Derumier
b74cad8ae3 add live storage migration with vm migration
This allow to migrate disks on local storage  to a remote node storage.

When the target node start, a new volumes are created and exposed through qemu embedded nbd server.

qemu drive-mirror is launch on source vm for each disk with nbd server as target.

when drive-mirror reach 100% of 1 disk, we don't complete the block jobs and begin mirror of next disk.
(mirroring are parralel, but we try to mirroring them 1 by 1 to avoid storage && network overload)

Then we live migrate the vm to destination node. (drive-mirror still occur at the same time).

We the vm is livemigrate (source vm paused, target vm pause), we complete the block jobs mirror.

When is done we stop the source vm and resume the target vm

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00