Revision d25643d1

b/htools/Ganeti/HTools/IAlloc.hs
67 67
  vcpus <- extract "vcpus"
68 68
  tags  <- extract "tags"
69 69
  let running = "running"
70
  return (n, Instance.create n mem disk vcpus running tags True 0 0)
70
  return (n, Instance.create n mem disk vcpus running tags True 0 0 DTDrbd8)
71 71

  
72 72
-- | Parses an instance as found in the cluster instance list.
73 73
parseInstance :: NameAssoc -- ^ The node name-to-index association list
b/htools/Ganeti/HTools/Instance.hs
65 65
    , movable      :: Bool      -- ^ Can the instance be moved?
66 66
    , autoBalance  :: Bool      -- ^ Is the instance auto-balanced?
67 67
    , tags         :: [String]  -- ^ List of instance tags
68
    , diskTemplate :: T.DiskTemplate -- ^ The disk template of the instance
68 69
    } deriving (Show, Read)
69 70

  
70 71
instance T.Element Instance where
......
91 92
-- Some parameters are not initialized by function, and must be set
92 93
-- later (via 'setIdx' for example).
93 94
create :: String -> Int -> Int -> Int -> String
94
       -> [String] -> Bool -> T.Ndx -> T.Ndx -> Instance
95
       -> [String] -> Bool -> T.Ndx -> T.Ndx -> T.DiskTemplate -> Instance
95 96
create name_init mem_init dsk_init vcpus_init run_init tags_init
96
       auto_balance_init pn sn =
97
       auto_balance_init pn sn dt =
97 98
    Instance { name = name_init
98 99
             , alias = name_init
99 100
             , mem = mem_init
......
108 109
             , tags = tags_init
109 110
             , movable = True
110 111
             , autoBalance = auto_balance_init
112
             , diskTemplate = dt
111 113
             }
112 114

  
113 115
-- | Changes the index.
b/htools/Ganeti/HTools/Luxi.hs
131 131
  xtags <- convert "tags" tags
132 132
  xauto_balance <- convert "auto_balance" auto_balance
133 133
  let inst = Instance.create xname xmem xdisk xvcpus
134
             xrunning xtags xauto_balance xpnode snode
134
             xrunning xtags xauto_balance xpnode snode DTDrbd8
135 135
  return (xname, inst)
136 136

  
137 137
parseInstance _ v = fail ("Invalid instance query result: " ++ show v)
b/htools/Ganeti/HTools/QC.hs
111 111
-- | Create an instance given its spec.
112 112
createInstance mem dsk vcpus =
113 113
    Instance.create "inst-unnamed" mem dsk vcpus "running" [] True (-1) (-1)
114
                    Types.DTDrbd8
114 115

  
115 116
-- | Create a small cluster by repeating a node spec.
116 117
makeSmallCluster :: Node.Node -> Int -> Node.List
......
191 192
      sn <- arbitrary
192 193
      vcpus <- choose (0, maxCpu)
193 194
      return $ Instance.create name mem dsk vcpus run_st [] True pn sn
195
                               Types.DTDrbd8
194 196

  
195 197
-- | Generas an arbitrary node based on sizing information.
196 198
genNode :: Maybe Int -- ^ Minimum node size in terms of units
b/htools/Ganeti/HTools/Rapi.hs
120 120
  tags <- extract "tags" a
121 121
  auto_balance <- extract "auto_balance" beparams
122 122
  let inst = Instance.create name mem disk vcpus running tags
123
             auto_balance pnode snode
123
             auto_balance pnode snode DTDrbd8
124 124
  return (name, inst)
125 125

  
126 126
-- | Construct a node from a JSON object.
b/htools/Ganeti/HTools/Text.hs
172 172
           " has same primary and secondary node - " ++ pnode
173 173
  let vtags = sepSplit ',' tags
174 174
      newinst = Instance.create name vmem vdsk vvcpus status vtags
175
                auto_balance pidx sidx
175
                auto_balance pidx sidx DTDrbd8
176 176
  return (name, newinst)
177 177
loadInst _ s = fail $ "Invalid/incomplete instance data: '" ++ show s ++ "'"
178 178

  
b/htools/hspace.hs
280 280

  
281 281
  -- utility functions
282 282
  let iofspec spx = Instance.create "new" (rspecMem spx) (rspecDsk spx)
283
                    (rspecCpu spx) "running" [] True (-1) (-1)
283
                    (rspecCpu spx) "running" [] True (-1) (-1) DTDrbd8
284 284
      exitifbad val = (case val of
285 285
                         Bad s -> do
286 286
                           hPrintf stderr "Failure: %s\n" s :: IO ()

Also available in: Unified diff