Hi!

On Tue, Oct 7, 2014 at 4:53 PM, 'Klaus Aehlig' via ganeti-devel <
ganeti-devel@googlegroups.com> wrote:

> In the htools loader, set the migration restrictions correctly from
> the node and cluster tags.
>
> Signed-off-by: Klaus Aehlig <aeh...@google.com>
> ---
>  src/Ganeti/HTools/Loader.hs | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/src/Ganeti/HTools/Loader.hs b/src/Ganeti/HTools/Loader.hs
> index bd5e42f..b588547 100644
> --- a/src/Ganeti/HTools/Loader.hs
> +++ b/src/Ganeti/HTools/Loader.hs
> @@ -259,6 +259,16 @@ commonSuffix nl il =
>        inst_names = map Instance.name $ Container.elems il
>    in longestDomain (node_names ++ inst_names)
>
> +-- | Set the migration-related tags on a node given the cluster tags;
> +-- this assumes that the node tags are already set on that node.
> +addMigrationTags :: [String]  -- ^ cluster tags
> +                 -> Node.Node -> Node.Node
> +addMigrationTags ctags node =
> +  let ntags = Node.nTags node
> +      migTags = Tags.getMigRestrictions ctags ntags
> +      rmigTags = Tags.getRecvMigRestrictions ctags ntags
> +  in Node.setRecvMigrationTags (Node.setMigrationTags node migTags)
> rmigTags
> +
>  -- | Initializer function that loads the data from a node and instance
>  -- list and massages it into the correct format.
>  mergeData :: [(String, DynUtil)]  -- ^ Instance utilisation data
> @@ -294,8 +304,9 @@ mergeData um extags selinsts exinsts time 
> cdata@(ClusterData
> gl nl il ctags _) =
>                             computeAlias common_suffix .
>                             (`Node.buildPeers` il4)) nl2
>        il5 = Container.map (disableSplitMoves nl3) il4
> +      nl4 = Container.map (addMigrationTags ctags) nl3
>    in if' (null lkp_unknown)
> -         (Ok cdata { cdNodes = nl3, cdInstances = il5 })
> +         (Ok cdata { cdNodes = nl4, cdInstances = il5 })
>           (Bad $ "Unknown instance(s): " ++ show(map lrContent
> lkp_unknown))
>
>  -- | In a cluster description, clear dynamic utilisation information.
> --
> 2.1.0.rc2.206.gedb03e5
>
>
LGTM, thanks

-- 
Helga Velroyen | Software Engineer | hel...@google.com |

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