[pve-devel] applied: [PATCH qemu-server 1/2] migrate: only stop NBD if we got a NBD url from the target

Mira Limbeck m.limbeck at proxmox.com
Thu Apr 30 10:04:18 CEST 2020


On 4/30/20 8:41 AM, Thomas Lamprecht wrote:
> 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.

I'm wondering that too. I tried reproducing it with qemu-server 6.1-14 
and could not (using an external ceph cluster as storage).

Did you test it with qemu-server 6.1-15 or an even newer version? Was 
the disk in $local_volumes for some reason?

>
>>>   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
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list