LGTM, thanks
On 11/26/2015 05:35 PM, Lisa Velden wrote:
Suggestion for a new commit message:
Allow disk attachment to diskless instances
As only DRBD disks can be associated to more nodes than the instance
where we want to attach the disk to, we have to change the check for
associated nodes, too.
On Thu, Nov 26, 2015 at 4:28 PM Oleg Ponomarev <[email protected]
<mailto:[email protected]>> wrote:
LGTM with a small nit.
On 11/26/2015 01:36 PM, 'Lisa Velden' via ganeti-devel wrote:
> As only DRBD disks can be associated to more nodes than the instance
> where we want to attach the disk to, we have to check for that, too.
The commit message as is introduces one more check in addition to the
existing check set.
But the patch fixes the existing check instead.
>
> Signed-off-by: Lisa Velden <[email protected]
<mailto:[email protected]>>
> ---
> lib/cmdlib/instance_set_params.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/cmdlib/instance_set_params.py
b/lib/cmdlib/instance_set_params.py
> index 4958a91..911203e 100644
> --- a/lib/cmdlib/instance_set_params.py
> +++ b/lib/cmdlib/instance_set_params.py
> @@ -391,15 +391,15 @@ class LUInstanceSetParams(LogicalUnit):
>
> disk = self.GenericGetDiskInfo(uuid, name)
> instance_template =
self.cfg.GetInstanceDiskTemplate(self.instance.uuid)
> - if (disk.dev_type != instance_template or
> - instance_template == constants.DT_DISKLESS):
> + if (disk.dev_type != instance_template and
> + instance_template != constants.DT_DISKLESS):
> raise errors.OpPrereqError("Instance has '%s' template
while disk has"
> " '%s' template" %
> (instance_template,
disk.dev_type),
> errors.ECODE_INVAL)
>
> instance_nodes = self.cfg.GetInstanceNodes(self.instance.uuid)
> - if not set(disk.nodes).issubset(set(instance_nodes)):
> + if not set(instance_nodes).issubset(set(disk.nodes)):
> raise errors.OpPrereqError("Disk nodes are %s while the
instance's nodes"
> " are %s" %
> (disk.nodes, instance_nodes),
--
Lisa Velden
Software Engineer
[email protected] <mailto:[email protected]>
Google Germany GmbH
Dienerstraße 12
80331 München
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg