diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 288a9cd1..33b8f5ad 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -2723,10 +2723,16 @@ __PACKAGE__->register_method({ description => "CIDR of the (sub) network that is used for migration.", optional => 1, }, - targetstorage => get_standard_option('pve-storage-id', { - description => "Target storage.", + "with-local-disks" => { + type => 'boolean', + description => "Enable live storage migration for local disk", optional => 1, - }), + }, + targetstorage => get_standard_option('pve-storage-id', { + description => "Default target storage.", + optional => 1, + completion => \&PVE::QemuServer::complete_storage, + }), }, }, returns => { diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index a5de8d04..cd1fc2b3 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -348,6 +348,7 @@ sub sync_disks { if ($local_volumes->{$vol} eq 'storage') { $self->log('info', "found local disk '$vol' (via storage)\n"); } elsif ($local_volumes->{$vol} eq 'config') { + die "can't live migrate attached local disks without with-local-disks option\n" if $self->{running} && !$self->{opts}->{"with-local-disks"}; $self->log('info', "found local disk '$vol' (in current VM config)\n"); } elsif ($local_volumes->{$vol} eq 'snapshot') { $self->log('info', "found local disk '$vol' (referenced by snapshot(s))\n");