When switching form plain to DRBD, a suitable secondary node has to
be choosen. As this is part of an allocation process, extend the
IAllocator interface by declaring a new mode for this.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 src/Ganeti/Constants.hs | 4 ++++
 src/Ganeti/Types.hs     | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs
index b4ffcce..6463bb3 100644
--- a/src/Ganeti/Constants.hs
+++ b/src/Ganeti/Constants.hs
@@ -3409,6 +3409,10 @@ validIallocatorDirections =
 iallocatorModeAlloc :: String
 iallocatorModeAlloc = Types.iAllocatorModeToRaw IAllocatorAlloc
 
+iallocatorModeAllocateSecondary :: String
+iallocatorModeAllocateSecondary =
+  Types.iAllocatorModeToRaw IAllocatorAllocateSecondary
+
 iallocatorModeChgGroup :: String
 iallocatorModeChgGroup = Types.iAllocatorModeToRaw IAllocatorChangeGroup
 
diff --git a/src/Ganeti/Types.hs b/src/Ganeti/Types.hs
index 0e2ae95..9984848 100644
--- a/src/Ganeti/Types.hs
+++ b/src/Ganeti/Types.hs
@@ -651,6 +651,7 @@ $(THH.makeJSONInstance ''IAllocatorTestDir)
 -- | IAllocator mode. FIXME: use this in "HTools.Backend.IAlloc".
 $(THH.declareLADT ''String "IAllocatorMode"
   [ ("IAllocatorAlloc",       "allocate")
+  , ("IAllocatorAllocateSecondary", "allocate-secondary")
   , ("IAllocatorMultiAlloc",  "multi-allocate")
   , ("IAllocatorReloc",       "relocate")
   , ("IAllocatorNodeEvac",    "node-evacuate")
-- 
2.2.0.rc0.207.ga3a616c

Reply via email to