Revision 844eff86 Ganeti/HTools/Node.hs
b/Ganeti/HTools/Node.hs | ||
---|---|---|
30 | 30 |
t_dsk, f_dsk, |
31 | 31 |
t_cpu, u_cpu, |
32 | 32 |
p_mem, p_dsk, p_rem, p_cpu, |
33 |
m_dsk, m_cpu, |
|
33 | 34 |
plist, slist, offline) |
34 | 35 |
, List |
35 | 36 |
-- * Constructor |
... | ... | |
43 | 44 |
, setFmem |
44 | 45 |
, setPri |
45 | 46 |
, setSec |
47 |
, setMdsk |
|
48 |
, setMcpu |
|
46 | 49 |
, addCpus |
47 | 50 |
-- * Instance (re)location |
48 | 51 |
, removePri |
... | ... | |
88 | 91 |
, p_dsk :: Double -- ^ Percent of free disk |
89 | 92 |
, p_rem :: Double -- ^ Percent of reserved memory |
90 | 93 |
, p_cpu :: Double -- ^ Ratio of virtual to physical CPUs |
94 |
, m_dsk :: Double -- ^ Minimum free disk ratio |
|
95 |
, m_cpu :: Double -- ^ Max ratio of virt-to-phys CPUs |
|
91 | 96 |
, offline :: Bool -- ^ Whether the node should not be used |
92 | 97 |
-- for allocations and skipped from |
93 | 98 |
-- score computations |
... | ... | |
140 | 145 |
p_rem = 0, |
141 | 146 |
p_cpu = 0, |
142 | 147 |
offline = offline_init, |
143 |
x_mem = 0 |
|
148 |
x_mem = 0, |
|
149 |
m_dsk = -1, |
|
150 |
m_cpu = -1 |
|
144 | 151 |
} |
145 | 152 |
|
146 | 153 |
-- | Changes the index. |
... | ... | |
163 | 170 |
setXmem :: Node -> Int -> Node |
164 | 171 |
setXmem t val = t { x_mem = val } |
165 | 172 |
|
173 |
-- | Sets the max disk usage ratio |
|
174 |
setMdsk :: Node -> Double -> Node |
|
175 |
setMdsk t val = t { m_dsk = val } |
|
176 |
|
|
177 |
-- | Sets the max cpu usage ratio |
|
178 |
setMcpu :: Node -> Double -> Node |
|
179 |
setMcpu t val = t { m_cpu = val } |
|
180 |
|
|
166 | 181 |
-- | Computes the maximum reserved memory for peers from a peer map. |
167 | 182 |
computeMaxRes :: PeerMap.PeerMap -> PeerMap.Elem |
168 | 183 |
computeMaxRes new_peers = PeerMap.maxElem new_peers |
Also available in: Unified diff