[pve-devel] applied: [PATCH qemu-server 1/2] migrate: only stop NBD if we got a NBD url from the target
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Apr 30 08:41:27 CEST 2020
On 4/30/20 8:35 AM, Fabian Grünbichler wrote:
> On April 29, 2020 4:24 pm, Thomas Lamprecht wrote:
>> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
>> ---
>>
>> This was rather quickly assembled to fix an obvious issue, some in depth look
>> at this would be nice, @Fabi or @Fabian :)
>
> LGTM!
>
It really should be OK, but I'm still a bit wondering why "$self->{storage_migration}"
was true in my case, a VM with only a single disk on ceph..
Not that the reason for this can have other fallout.
>>
>> PVE/QemuMigrate.pm | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
>> index 7472e9d..7644922 100644
>> --- a/PVE/QemuMigrate.pm
>> +++ b/PVE/QemuMigrate.pm
>> @@ -750,6 +750,7 @@ sub phase2 {
>> my $targetdrive = $3;
>> $targetdrive =~ s/drive-//g;
>>
>> + $self->{stopnbd} = 1;
>> $self->{target_drive}->{$targetdrive}->{drivestr} = $drivestr;
>> $self->{target_drive}->{$targetdrive}->{nbd_uri} = $nbd_uri;
>> } elsif ($line =~ m!^storage migration listens on nbd:unix:(/run/qemu-server/(\d+)_nbd\.migrate):exportname=(\S+) volume:(\S+)$!) {
>> @@ -760,6 +761,7 @@ sub phase2 {
>> my $targetdrive = $3;
>> $targetdrive =~ s/drive-//g;
>>
>> + $self->{stopnbd} = 1;
>> $self->{target_drive}->{$targetdrive}->{drivestr} = $drivestr;
>> $self->{target_drive}->{$targetdrive}->{nbd_uri} = $nbd_uri;
>> push @$tunnel_addr, "$nbd_unix_addr:$nbd_unix_addr";
>> @@ -1177,7 +1179,8 @@ sub phase3_cleanup {
>> $self->switch_replication_job_target() if $self->{replicated_volumes};
>>
>> if ($self->{livemigration}) {
>> - if ($self->{storage_migration}) {
>> + if ($self->{stopnbd}) {
>> + $self->log('info', "stopping NBD storage migration server on target.");
>> # stop nbd server on remote vm - requirement for resume since 2.9
>> my $cmd = [@{$self->{rem_ssh}}, 'qm', 'nbdstop', $vmid];
>>
>> --
>> 2.20.1
More information about the pve-devel
mailing list