Commit Graph

335 Commits

Author SHA1 Message Date
Dominik Csapak
af6d2db4b3 check also pending changes when reverting/deleting
otherwise we are not able to revert/delete pending changes which
introduce a new config line

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-05-31 11:40:14 +02:00
Dietmar Maurer
95f42d61fa migrate: aquire guest_migration_lock during migration
To block replication jobs.
2017-05-31 07:57:03 +02:00
Dietmar Maurer
628bb7f231 do not allow destroy if there are replication jobs 2017-05-31 07:53:58 +02:00
Dietmar Maurer
3ab7663a91 remove 'replicate' configuration - we will store that in another file 2017-05-31 07:53:57 +02:00
Thomas Lamprecht
6318daca96 improve error on '{full, linked} clone not available' error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-05-24 11:29:26 +02:00
Dominik Csapak
dd32a4664f use ReuseAddr for vncproxy
to avoid "Socket already in use" errors, when quickly opening/closing
console sessions on the webinterface

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-05-17 13:38:54 +02:00
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
2286cb8c23 use a single replicate property (format pve-replicate) 2017-05-06 10:35:08 +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 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