[pve-devel] [PATCH v6 qemu-server 2/3] add QemuMigrateExternal.pm

Alexandre DERUMIER aderumier at odiso.com
Wed Apr 24 13:46:13 CEST 2019


>>Maybe split them up but keep the old phase2, i.e., just call the 
>>factored-out subs from there, not sure, must look myself what would 
>>seem better.. thanks! 

yes, I'll send patches tomorrow, for phase2 this give use something like:


sub phase2 {
    my ($self, $vmid) = @_;

    my $nodename = PVE::INotify::nodename();

    my $migration_type = $self->{opts}->{migration_type};

    my $cmd = generate_migrate_start_cmd($self, $vmid, $nodename, $migration_type);
 
    my ($raddr, $rport, $ruri, $spice_port, $spice_ticket) = find_remote_ports($self, $vmid, $cmd);

    start_remote_tunnel($self, $nodename, $migration_type, $raddr, $rport, $ruri);

    livemigrate_storage($self, $vmid);

    livemigrate($self, $vmid, $ruri, $spice_port);
}


(So I can reuse them easily for external migration, the only difference is in  generate_migrate_start_cmd)

----- Mail original -----
De: "Thomas Lamprecht" <t.lamprecht at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mercredi 24 Avril 2019 10:02:18
Objet: Re: [pve-devel] [PATCH v6 qemu-server 2/3] add QemuMigrateExternal.pm

Am 4/23/19 um 10:52 AM schrieb Alexandre DERUMIER: 
> Hi, 
> 
> I'll try to work again on theses patch this week. 
> 
> I would like to modify current phase2 of QemuMigrate, and split all the code 
> in multiple smaller subs, as it's currently pretty big, and I'll like to be able to reuse 
> them as much as possible for my migrate external code. 
> 
> Are you ok with this ? 
> 

In principle, yes, if you find some fitting parts that can/should be 
in it's own sub it could be great for readabillity! 
Maybe split them up but keep the old phase2, i.e., just call the 
factored-out subs from there, not sure, must look myself what would 
seem better.. thanks! 

> 
> 
> ----- Mail original ----- 
> De: "Alexandre Derumier" <aderumier at odiso.com> 
> À: "pve-devel" <pve-devel at pve.proxmox.com> 
> Envoyé: Mardi 2 Avril 2019 11:42:33 
> Objet: Re: [pve-devel] [PATCH v6 qemu-server 2/3] add QemuMigrateExternal.pm 
> 
>>> The VM created in the 'prepare' sub never gets deleted if it fails there 
>>> already. Cleanup only happens for phases 1, 2 and 3. 
> 
> Thanks. I'll fix that. 
> 
> ----- Mail original ----- 
> De: "Mira Limbeck" <m.limbeck at proxmox.com> 
> À: "pve-devel" <pve-devel at pve.proxmox.com> 
> Envoyé: Lundi 1 Avril 2019 10:12:02 
> Objet: Re: [pve-devel] [PATCH v6 qemu-server 2/3] add QemuMigrateExternal.pm 
> 
> The VM created in the 'prepare' sub never gets deleted if it fails there 
> already. Cleanup only happens for phases 1, 2 and 3. 
> 
> On 4/1/19 7:26 AM, Alexandre DERUMIER wrote: 
>>>> oh, and this all lacks a bit of cleanups on errors, e.g., the newly created 
>>>> VM on the target side, etc. but it's a bit of a delicate issue, maybe you 
>>>> want do have a cleanup command which is executed at the remote side, checks 
>>>> if the target vmid is still "migrate" locked and cleans up everything created 
>>>> solely for the migration? 
>> I'll veriy that again, but I'm pretty sure that vm was correctly deleted in case of errors in 
>> differents phases. 
>> 
>> 
>> ----- Mail original ----- 
>> De: "Thomas Lamprecht" <t.lamprecht at proxmox.com> 
>> À: "pve-devel" <pve-devel at pve.proxmox.com>, "aderumier" <aderumier at odiso.com> 
>> Envoyé: Samedi 30 Mars 2019 17:31:46 
>> Objet: Re: [pve-devel] [PATCH v6 qemu-server 2/3] add QemuMigrateExternal.pm 
>> 
>> On 2/20/19 1:22 AM, Alexandre Derumier wrote: 
>>> --- 
>>> PVE/Makefile | 1 + 
>>> PVE/QemuMigrateExternal.pm | 872 +++++++++++++++++++++++++++++++++++++++++++++ 
>>> 2 files changed, 873 insertions(+) 
>>> create mode 100644 PVE/QemuMigrateExternal.pm 
>>> 
>>> diff --git a/PVE/Makefile b/PVE/Makefile 
>>> index 2c800f6..0494cfb 100644 
>>> --- a/PVE/Makefile 
>>> +++ b/PVE/Makefile 
>>> @@ -1,6 +1,7 @@ 
>>> PERLSOURCE = \ 
>>> QemuServer.pm \ 
>>> QemuMigrate.pm \ 
>>> + QemuMigrateExternal.pm \ 
>>> QMPClient.pm \ 
>>> QemuConfig.pm 
>>> 
>> oh, and this all lacks a bit of cleanups on errors, e.g., the newly created 
>> VM on the target side, etc. but it's a bit of a delicate issue, maybe you 
>> want do have a cleanup command which is executed at the remote side, checks 
>> if the target vmid is still "migrate" locked and cleans up everything created 
>> solely for the migration? 
>> 
>> _______________________________________________ 
>> pve-devel mailing list 
>> pve-devel at pve.proxmox.com 
>> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
> 
> _______________________________________________ 
> pve-devel mailing list 
> pve-devel at pve.proxmox.com 
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
> 
> _______________________________________________ 
> 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