Revision 129734d3 htools/Ganeti/HTools/QC.hs

b/htools/Ganeti/HTools/QC.hs
860 860
       Cluster.tryAlloc nl il inst' of
861 861
         Types.Bad _ -> False
862 862
         Types.Ok as ->
863
             case Cluster.asSolutions as of
864
               [] -> False
865
               (xnl, xi, _, cv):[] ->
863
             case Cluster.asSolution as of
864
               Nothing -> False
865
               Just (xnl, xi, _, cv) ->
866 866
                   let il' = Container.add (Instance.idx xi) xi il
867 867
                       tbl = Cluster.Table xnl il' cv []
868 868
                   in not (canBalance tbl True True False)
869
               _ -> False
870 869

  
871 870
-- | Checks that on a 2-5 node cluster, we can allocate a random
872 871
-- instance spec via tiered allocation (whatever the original instance
......
903 902
       Cluster.tryAlloc nl il inst' of
904 903
         Types.Bad _ -> False
905 904
         Types.Ok as ->
906
             case Cluster.asSolutions as of
907
               [] -> False
908
               (xnl, xi, _, _):[] ->
905
             case Cluster.asSolution as of
906
               Nothing -> False
907
               Just (xnl, xi, _, _) ->
909 908
                   let sdx = Instance.sNode xi
910 909
                       il' = Container.add (Instance.idx xi) xi il
911 910
                   in case IAlloc.processRelocate defGroupList xnl il'
912 911
                          (Instance.idx xi) 1 [sdx] of
913 912
                        Types.Ok _ -> True
914 913
                        _ -> False
915
               _ -> False
916 914

  
917 915
-- | Check that allocating multiple instances on a cluster, then
918 916
-- adding an empty node, results in a valid rebalance.

Also available in: Unified diff