5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-03-09 08:58:25 +03:00

1126 Commits

Author SHA1 Message Date
Thomas Lamprecht
5b97ef2441 restore_vma_archive: do not overwrite global signal handlers
perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-07 10:39:34 +02:00
Thomas Lamprecht
eaae66be9f API/clone: do not overwrite global signal handlers
perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-07 10:39:28 +02:00
Fabian Grünbichler
edd48c325a update_vm: sort logged parameters
otherwise the (log) output looks really strange when mass-updating VMs, e.g.:
update VM 400001: -scsi1 somestore:64 -scsi0 somestore:64 -ide2 isostore:iso/somefile.iso,media=cdrom
update VM 400002: -ide2 isostore:iso/somefile.iso,media=cdrom -scsi1 somestore:64 -scsi0 somestore:64
update VM 400003: -scsi0 somestore:64 -ide2 isostore:iso/somefile.iso,media=cdrom -scsi1 somestore:64

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 10:21:47 +02:00
Philip Abernethy
bfcd9b7eac Fix #1125. Check for KVM support before starting VM
Moved the check to the beginning of the function.
VMs configured to use KVM won't start if KVM is not available.
VMs not configured to use KVM will start regardless.
2017-08-21 16:19:20 +02:00
Philip Abernethy
74c02ef7f8 Refactors $nokvm to $kvm
for improved readability and consistency with the option name.
2017-08-21 16:19:20 +02:00
Philip Abernethy
075e8249fa Refactor HyperV enlightenments
Fixes a typo in the function name and removes the $nokvm parameter, as it's only
used to immideately exit the function. Instead calling the function
conditionally.
2017-08-21 16:19:20 +02:00
Fabian Grünbichler
4305207d61 migrate: reduce polling intervals
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
4bdd20ab14 migrate: keep track of replication
and only transfer state and switch direction if there
actually are any replicated volumes.

once we add support for live-migration with replicated
volumes, adding a set-replication-state command to the
tunnel and using that probably makes sense.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
2e7fee87df migrate: finish tunnel in phase 3
after resuming the VM over the tunnel.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
1d5aaa1db5 qm mtunnel/migrate: add resume VMID command
and reformat the legacy SSH variant for readability.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
bcb51ae8f9 mtunnel: add and handle OK/ERR replies
because we want commands to return meaningful errors, and
print them on the client/source side.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
79c9e07933 qm mtunnel: add write helper
reduce code duplication.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
58cbe63901 migrate: read mtunnel version
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
d851846929 qm mtunnel: add tunnel version
to allow detection of supported features/commands for these
and future mtunnel changes.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
e0eb1f7677 migrate: refactor mtunnel read/write
to make adding new commands and reading replies easier

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
d7b1b24b6f migrate: switch back to qm mtunnel
to allow adding guest specific commands to the tunnel

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Wolfgang Link
278e2c9dd6 Fix freeze_needed
We want freeze the filesystem if the vmstate is not saved, because when we save the state we need not to freeze the filesystem.
2017-07-31 08:28:48 +02:00
Thomas Lamprecht
a2a5cd64ab use machine version in vga default type selection
If we get an VM machine older than 2.9 we use the old selection
expression for the VGA type. This allows to live migrate VMs to PVE
5.0 from beta 1 and PVE 4.4 again.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-07-17 11:16:49 +02:00
Dominik Csapak
8aca16542e fix disk throttling syntax
the syntax was wrong, it was (e.g. for iops-write):

throttling.iops-write=-max100
instead of
throttling.iops-write-max=100

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-14 15:15:11 +02:00
Emmanuel Kasper
c7db1e40c4 Fix #1417: make sure the target storage allows disk images before importing
This was fixed in c46366fd494c7dd0cd46bf133146e6f7a98e32a4
for 'qm create', but 'qm importdisk' has the same issue
2017-07-13 06:45:58 +02:00
Emmanuel Kasper
171ed95c76 Use default values when memory is not set in vm.conf when migrating
This fixes a "Use of uninitialized value in multiplication (*) "
warning when doing a migration
2017-07-03 14:37:00 +02:00
Wolfgang Bumiller
bf1312d811 cleanup: more the new-disk regex deduplication 2017-06-30 09:31:29 +02:00
Dominik Csapak
c46366fd49 fix #1417: check if storage has 'images' set in content
otherwise, qm and the api ignore this setting completely when creating
a vm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-30 09:26:53 +02:00
Wolfgang Bumiller
85909c04c4 don't use cirrus by default for sane OS'
(It can stay for $winversion < 6 because then you probably
don't have drivers for anything else.)

this is long overdue
2017-06-28 12:07:16 +02:00
Wolfgang Link
223e032b74 Remove guest states to ensure no old states are exists 2017-06-27 15:31:41 +02:00
Wolfgang Bumiller
9b1396edd2 allow disks on shared storages on replicated VMs 2017-06-27 15:22:08 +02:00
Wolfgang Bumiller
17677004cc refuse to add non-replicatable disks to replicating VMs
Unless replication is explicitly disabled for them.
2017-06-27 10:37:07 +02:00
Thomas Lamprecht
0276584456 API HA tasks: we request states not execute them
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-06-27 07:59:12 +02:00
Wolfgang Bumiller
5282865bf8 config: has_feature() take default for backup into account 2017-06-27 06:25:24 +02:00
Thomas Lamprecht
da18cc9300 migrate: use 'mtunnel' from pvecm
qm mtunnel was deemed as deprecated but still in use here.
Switch over to pvecm's mtunnel to allow removing the qm variant in
PVE 5.1

Also use an absolute path so we do not depended on the targets
environment variables

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-06-23 11:00:52 +02:00
Wolfgang Bumiller
6f58fce9ee migrate: pass the with_snapshots parameter 2017-06-22 12:58:14 +02:00
Dietmar Maurer
54d10ab121 PVE::QemuMigrate. do not use JSON - not required here 2017-06-22 08:51:38 +02:00
Dietmar Maurer
d652f7b1ab PVE/QemuMigrate.pm: use new replication job helpers from AbstractMigrate 2017-06-21 12:27:45 +02:00
Dietmar Maurer
f6a17ff5e3 Change target in replication-state when replication direction is switched 2017-06-21 10:59:45 +02:00
Dietmar Maurer
dbc9420b0b PVE/QemuMigrate.pm: use replication job, transfer replication state 2017-06-20 12:42:51 +02:00
Dietmar Maurer
a6cb40f786 get_replicatable_volumes: move checks to top
those checks do not depend on anything we do in the sub, so we can do
them at the beginning.

Also respect the $noerr flag (do not raise exceptions in that case).
2017-06-14 07:24:29 +02:00
Dietmar Maurer
4ab3bcc82a get_replicatable_volumes: fix CDROM and local file/device handling 2017-06-14 07:01:36 +02:00
Dominik Csapak
6f249d9400 use the full package to call storage_config
because it is not in the local scope

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-13 17:09:09 +02:00
Dietmar Maurer
5009a8c755 PVE/QemuMigrate.pm: fix syntax errors 2017-06-13 11:56:26 +02:00
Dietmar Maurer
8299257eaf get_replicatable_volumes: add unused volumes 2017-06-13 11:51:14 +02:00
Dietmar Maurer
f7e7767fed get_replicatable_volumes: skip volumes if we do not 'own' them
And add and additional check for vtype 'images'.
2017-06-13 11:26:47 +02:00
Dietmar Maurer
aee6abe5ba PVE/QemuMigrate.pm - use PVE::QemuServer::foreach_volid 2017-06-13 11:26:47 +02:00
Dietmar Maurer
39019f75c7 PVE::QemuServer::foreach_volid - record snapshot references
So that we can test if a volume is referenced in the main config, and/or
inside a snapshot config.
2017-06-13 09:02:06 +02:00
Dietmar Maurer
f949eb7760 get_replicatable_volumes: use PVE::QemuServer::foreach_volid 2017-06-13 09:02:06 +02:00
Dietmar Maurer
392f8b5dff PVE::QemuServer::foreach_volid - pass $attr hash to callback
That way we can pass more informations, i.e. the 'replicate' attribute.
2017-06-13 09:02:06 +02:00
Dietmar Maurer
a722d4ffe0 get_replicatable_volumes: skip volumes on shared storage 2017-06-13 09:02:06 +02:00
Dietmar Maurer
c78f43b921 get_replicatable_volumes: add $vmid parameter 2017-06-13 09:02:06 +02:00
Dietmar Maurer
7c876ec165 PVE/API2/Qemu.pm: cleanup - remove unused $upid parameter 2017-06-12 11:09:47 +02:00
Dietmar Maurer
f53c6ad8b9 PVE/API2/Qemu.pm: aquire guest_migration_lock inside worker 2017-06-12 11:05:46 +02:00
Wolfgang Link
c068c1c3a9 Add a migration lock to avoid a replication on rollback-time. 2017-06-12 10:58:49 +02:00