Commit Graph

323 Commits

Author SHA1 Message Date
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 Link
9b49ba658f Destroy all remote and local replication datasets when a VM will destroyed. 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
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
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
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
Wolfgang Bumiller
655d746212 remove netcat6 dependency
By simply using a socket.
2017-02-28 12:23:42 +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
9f11fc5fa2 don't pull HA modules for doc-generation 2017-02-06 16:13:30 +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
Dietmar Maurer
9bb3acf155 use new PVE::Storage::check_volume_access() 2017-01-18 17:23:03 +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
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
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
Alexandre Derumier
2189246c5c add targetstorage to vm_start
This will create a new drive for each local drive found,
and start the vm with this new drives.

if targetstorage == 1, we use same sid than original vm disk

a nbd server is started in qemu and expose local volumes to network port

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Alexandre Derumier
c6fdd002b2 clone live vm : add support for multiple jobs
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Dietmar Maurer
249d8fedd8 qm agent: remove 'guest-' prefix from commands 2016-12-01 07:57:26 +01:00
Dietmar Maurer
57bdd45943 qm agent: directly return result
This is required for correct error handling. The previous
code simply cought all exceptions.
2016-12-01 07:23:16 +01:00
Dietmar Maurer
a5d5341cb2 qm agent: enumerate possible guest commands 2016-12-01 07:18:31 +01:00
Dietmar Maurer
c07a9e3d64 cleanup: reorder code so that emacs font-lock-mode works again
This is just a work around for emacs bugs.
2016-11-30 13:07:52 +01:00
Dietmar Maurer
f38c5e270f qm agent: add command line completion for vmid 2016-11-30 12:47:03 +01:00
Wolfgang Link
d1a474273b Add qm agent.
This command makes it possible to run commnads on the Qemu-Guest-Agent if it is installed and running.
2016-11-30 12:30:31 +01:00
Fabian Grünbichler
a8f2f42714 restrict monitor API to Sys.Modify for most commands
because these allow adding arbitrary devices to VMs (and
other potentially dangerous things).

whitelist 'info *' and 'help' as usable with just
VM.Monitor, if more are desired and requested they can be
added later.
2016-11-23 10:02:06 +01:00
Dietmar Maurer
ae849692d9 vm_shutdown: request 'stopped' state for HA enabled VMs 2016-11-23 08:03:08 +01:00
Dietmar Maurer
29ddbe702b combine option 'format' with previous line (avoid emacs confusion) 2016-11-23 06:40:33 +01:00
Dietmar Maurer
e0feef86ee use ha-manager 'stopped' state instead of 'disabled' 2016-11-23 06:23:21 +01:00
Thomas Lamprecht
2a7e2b82bb switch to 'ha-manager set'
ha-manager enabled/disabled will get removed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-11-19 10:02:45 +01:00
Wolfgang Bumiller
f90912016a fix a perl warning when failing to parse a new drive string 2016-11-03 09:57:40 +01:00
Thomas Lamprecht
2de2d6f74e allow dedicated migration network, bug #1177
Without this patch we use the network were the cluster traffic runs
for sending migration traffic. This is not ideal as it may hinder
cluster traffic. Further some users have a powerful network which
would be perfect for migrations, with this patch they can run the
migration traffic over such a network without having the corosync
traffic on the same network.

The network is configurable through /etc/pve/datacenter.cfg which
got a new property, namely migration. migration has two
subproperties: type (replaces the old migration_unsecure property)
and network.

For the case of a network failure or that a VM has to be moved over
another network for arbitrary other reasons I added the
migration_type and migration_network parameters to qm migrate (and
respectively vm_start as this gets used on migration).
They allow overwriting the datacenter.cfg settings.

Fixes bug #1177

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-11-03 09:51:23 +01:00
Dietmar Maurer
e261de405e snapshot_list: add bash completion for vmid 2016-10-19 11:57:53 +02:00
Emmanuel Kasper
94a17e1dea Fix typo 2016-10-18 09:09:10 +02:00
Dominik Csapak
02daf96a15 fix #1131: activate volume before copying efidisk
before copying the efidisk image to a storage,
we first have to activate the volume

also, add the -n flag to qemu-img convert (prevents
creation of the target volume)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-07 08:20:51 +02:00
Fabian Grünbichler
3a07a8a9ff forbid restore into existing template 2016-09-15 14:14:46 +02:00
Dominik Csapak
1a35631aab copy efivars disk on create
when we create the efidisk0 over the api,
we discard the size, and create a 128kbyte vdisk
and copy it there with qemu-img convert

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-08 11:19:04 +02:00
Fabian Grünbichler
dcce9b468d add lock check for move_disk API call
this API call changes the config quite drastically, and as
such should not be possible while an operation that holds a
lock is ongoing (e.g., migration, backup, snapshot).
2016-07-26 11:31:32 +02:00
Fabian Grünbichler
32acc380d3 deactivate new volumes after clone to other node
this might otherwise lead to volumes activated on the
source and target node, which is problematic for at least
LVM and Ceph.
2016-07-14 12:31:36 +02:00
Wolfgang Bumiller
b5b9979081 pass datacenter.cfg's mac_prefix to random_ether_addr 2016-07-14 09:02:24 +02:00
Wolfgang Bumiller
84b31f488c Fix #1051: typo: vpcus -> vcpus
Otherwise only root can change this setting.
2016-07-11 14:47:04 +02:00
Fabian Grünbichler
a3d0bafba5 remove old move disk snapshot check
this is no longer needed, if the moved disk was referenced
by a snapshot we have already died early, and the config is
locked.
2016-07-04 08:29:16 +02:00
Fabian Grünbichler
9dbf9b5417 fix #1040: warn early about moving a snapshotted disk
die if "delete source disk" is enabled, because a disk that
is referenced by snapshots must not be deleted.
2016-07-04 08:29:16 +02:00
Dominik Csapak
63d269d79e fix unnecessary root check for unused disks
we needed root@pam rights to remove an unused disk
from a vm (instead of the correct Storage rights)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-10 10:36:34 +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
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
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
Wolfgang Bumiller
2e953867ad Fix #848: deactivate old volume after clone before deletion
Otherwise some move operations will fail to delete the old
disk (eg. when moving from ceph to local storage).

Note that in order for the deactivation to succeed we need
to make sure qemu has closed its file descriptors, so we
need to wait for the job to disappear the same way we do in
$cancel_job().
Factored the waiting out into $finish_job().
2016-04-13 08:24:13 +02:00
Dominik Csapak
8989736707 change shutdown behaviour on suspended vm
previously, when shutting down a suspended vm,
we successfully send the shutdown command to it,
but it will not shutdown (because it is suspended)

there we will run into the timeout and either
bail out with an error, or kill the process

when we not kill the process and resume the vm,
it will instantly shutdown, because of the previous
command

this patch checks the status of the vm beforehand,
and either bails out with an error that you cannot
shutdown a suspended vm, or stops the vm with the
correct qmp command (depending of forceStop)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-12 17:18:55 +02:00