diff --git a/htools/Ganeti/HTools/IAlloc.hs b/htools/Ganeti/HTools/IAlloc.hs index b53d7747aca920601c86d940d41a33238929c96a..d45559f3245e5a067c5bd3b2440428ebead2389b 100644 --- a/htools/Ganeti/HTools/IAlloc.hs +++ b/htools/Ganeti/HTools/IAlloc.hs @@ -67,7 +67,7 @@ parseBaseInstance n a = do vcpus <- extract "vcpus" tags <- extract "tags" let running = "running" - return (n, Instance.create n mem disk vcpus running tags True 0 0) + return (n, Instance.create n mem disk vcpus running tags True 0 0 DTDrbd8) -- | Parses an instance as found in the cluster instance list. parseInstance :: NameAssoc -- ^ The node name-to-index association list diff --git a/htools/Ganeti/HTools/Instance.hs b/htools/Ganeti/HTools/Instance.hs index 4cf80586d290685c3a634cecef39f0e2c21e6cc8..dc070e488bd313f4699f873a248a64f1d77e1b56 100644 --- a/htools/Ganeti/HTools/Instance.hs +++ b/htools/Ganeti/HTools/Instance.hs @@ -65,6 +65,7 @@ data Instance = Instance , movable :: Bool -- ^ Can the instance be moved? , autoBalance :: Bool -- ^ Is the instance auto-balanced? , tags :: [String] -- ^ List of instance tags + , diskTemplate :: T.DiskTemplate -- ^ The disk template of the instance } deriving (Show, Read) instance T.Element Instance where @@ -91,9 +92,9 @@ type List = Container.Container Instance -- Some parameters are not initialized by function, and must be set -- later (via 'setIdx' for example). create :: String -> Int -> Int -> Int -> String - -> [String] -> Bool -> T.Ndx -> T.Ndx -> Instance + -> [String] -> Bool -> T.Ndx -> T.Ndx -> T.DiskTemplate -> Instance create name_init mem_init dsk_init vcpus_init run_init tags_init - auto_balance_init pn sn = + auto_balance_init pn sn dt = Instance { name = name_init , alias = name_init , mem = mem_init @@ -108,6 +109,7 @@ create name_init mem_init dsk_init vcpus_init run_init tags_init , tags = tags_init , movable = True , autoBalance = auto_balance_init + , diskTemplate = dt } -- | Changes the index. diff --git a/htools/Ganeti/HTools/Luxi.hs b/htools/Ganeti/HTools/Luxi.hs index 1fd3bf3df7ddfa7ed0f9f087365f7c2e3c634f3a..ce0f21aa809bc7ea1535889bde1e1963003cfa00 100644 --- a/htools/Ganeti/HTools/Luxi.hs +++ b/htools/Ganeti/HTools/Luxi.hs @@ -131,7 +131,7 @@ parseInstance ktn (JSArray [ name, disk, mem, vcpus xtags <- convert "tags" tags xauto_balance <- convert "auto_balance" auto_balance let inst = Instance.create xname xmem xdisk xvcpus - xrunning xtags xauto_balance xpnode snode + xrunning xtags xauto_balance xpnode snode DTDrbd8 return (xname, inst) parseInstance _ v = fail ("Invalid instance query result: " ++ show v) diff --git a/htools/Ganeti/HTools/QC.hs b/htools/Ganeti/HTools/QC.hs index a033026291861a351a7b696cbc93a8a95dda1fd9..12d0d220401a10b950e807f0cba9bb0cd8d63703 100644 --- a/htools/Ganeti/HTools/QC.hs +++ b/htools/Ganeti/HTools/QC.hs @@ -111,6 +111,7 @@ setInstanceSmallerThanNode node inst = -- | Create an instance given its spec. createInstance mem dsk vcpus = Instance.create "inst-unnamed" mem dsk vcpus "running" [] True (-1) (-1) + Types.DTDrbd8 -- | Create a small cluster by repeating a node spec. makeSmallCluster :: Node.Node -> Int -> Node.List @@ -191,6 +192,7 @@ instance Arbitrary Instance.Instance where sn <- arbitrary vcpus <- choose (0, maxCpu) return $ Instance.create name mem dsk vcpus run_st [] True pn sn + Types.DTDrbd8 -- | Generas an arbitrary node based on sizing information. genNode :: Maybe Int -- ^ Minimum node size in terms of units diff --git a/htools/Ganeti/HTools/Rapi.hs b/htools/Ganeti/HTools/Rapi.hs index e9eb4ccba8f93aad96ebacee0f18de586f3a728f..0808822c3532448933f5995b6b2d21760f9a4848 100644 --- a/htools/Ganeti/HTools/Rapi.hs +++ b/htools/Ganeti/HTools/Rapi.hs @@ -120,7 +120,7 @@ parseInstance ktn a = do tags <- extract "tags" a auto_balance <- extract "auto_balance" beparams let inst = Instance.create name mem disk vcpus running tags - auto_balance pnode snode + auto_balance pnode snode DTDrbd8 return (name, inst) -- | Construct a node from a JSON object. diff --git a/htools/Ganeti/HTools/Text.hs b/htools/Ganeti/HTools/Text.hs index fccb65237264600247f8f8def0df184deb553cf5..4e8c2377e96982989587501c5a131b0ff4cd0ab5 100644 --- a/htools/Ganeti/HTools/Text.hs +++ b/htools/Ganeti/HTools/Text.hs @@ -172,7 +172,7 @@ loadInst ktn [name, mem, dsk, vcpus, status, auto_bal, pnode, snode, tags] = do " has same primary and secondary node - " ++ pnode let vtags = sepSplit ',' tags newinst = Instance.create name vmem vdsk vvcpus status vtags - auto_balance pidx sidx + auto_balance pidx sidx DTDrbd8 return (name, newinst) loadInst _ s = fail $ "Invalid/incomplete instance data: '" ++ show s ++ "'" diff --git a/htools/hspace.hs b/htools/hspace.hs index 89d2f7320c9be7e8a74ffa08e120950c59d7c20e..a9148be25f9e28400a40381c103f37590d9be3cb 100644 --- a/htools/hspace.hs +++ b/htools/hspace.hs @@ -280,7 +280,7 @@ main = do -- utility functions let iofspec spx = Instance.create "new" (rspecMem spx) (rspecDsk spx) - (rspecCpu spx) "running" [] True (-1) (-1) + (rspecCpu spx) "running" [] True (-1) (-1) DTDrbd8 exitifbad val = (case val of Bad s -> do hPrintf stderr "Failure: %s\n" s :: IO ()