On Mon, Dec 9, 2013 at 1:00 PM, Dimitris Aragiorgis <[email protected]> wrote:
> SetDiskID() fills physical_id slot of a Disk object.
>
> LUInstanceSetParams() does not invoke SetDiskID() upon creation of a
> new disk. As a result the physical_id slot of the Disk object in
> config data is missing.
>
> In case of ext disk template, in AcceptInstance() we invoke
> _GatherAndLinkBlockDevices(). This takes `instance` as an argument
> which includes current disks info. So, after adding a disk,
> migration of ext instances will fail because FindDevice() expects
> the physical_id slot.
>
> With this patch we invoke SetDiskID() for every disk of the instance
> before accept_instance() RPC.
>
> Fixes Issue 633.
>
> Signed-off-by: Dimitris Aragiorgis <[email protected]>
> ---
>  lib/cmdlib/instance_migration.py |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/lib/cmdlib/instance_migration.py 
> b/lib/cmdlib/instance_migration.py
> index b8dc510..a5cbf4d 100644
> --- a/lib/cmdlib/instance_migration.py
> +++ b/lib/cmdlib/instance_migration.py
> @@ -709,6 +709,9 @@ class TLMigrateInstance(Tasklet):
>        self._WaitUntilSync()
>
>      self.feedback_fn("* preparing %s to accept the instance" % target_node)
> +    # This fills physical_id slot that may be missing on newly created disks
> +    for disk in instance.disks:
> +      self.cfg.SetDiskID(disk, target_node)
>      result = self.rpc.call_accept_instance(target_node,
>                                             instance,
>                                             migration_info,
> --
> 1.7.10.4
>

LGTM, thanks.

Michele

-- 
Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to