Merge branch 'stable-2.8' into stable-2.9
[ganeti-local] / src / Ganeti / HTools / Backend / IAlloc.hs
index dd92497..6c8c8ab 100644 (file)
@@ -135,7 +135,7 @@ parseNode ktg n a = do
   gidx <- lookupGroup ktg n guuid
   ndparams <- extract "ndparams" >>= asJSObject
   excl_stor <- tryFromObj desc (fromJSObject ndparams) "exclusive_storage"
-  let live = not offline && not drained && vm_capable'
+  let live = not offline && vm_capable'
       lvextract def = eitherLive live def . extract
   sptotal <- if excl_stor
              then lvextract 0 "total_spindles"
@@ -149,7 +149,7 @@ parseNode ktg n a = do
   ctotal <- lvextract 0.0 "total_cpus"
   cnos <- lvextract 0 "reserved_cpus"
   let node = Node.create n mtotal mnode mfree dtotal dfree ctotal cnos
-             (not live) sptotal spfree gidx excl_stor
+             (not live || drained) sptotal spfree gidx excl_stor
   return (n, node)
 
 -- | Parses a group as found in the cluster group list.