Revision f951bd09
b/htools/Ganeti/HTools/Text.hs | ||
---|---|---|
78 | 78 |
-> Node.Node -- ^ The node to be serialised |
79 | 79 |
-> String |
80 | 80 |
serializeNode gl node = |
81 |
printf "%s|%.0f|%d|%d|%.0f|%d|%.0f|%c|%s" (Node.name node) |
|
81 |
printf "%s|%.0f|%d|%d|%.0f|%d|%.0f|%c|%s|%d" (Node.name node)
|
|
82 | 82 |
(Node.tMem node) (Node.nMem node) (Node.fMem node) |
83 | 83 |
(Node.tDsk node) (Node.fDsk node) (Node.tCpu node) |
84 | 84 |
(if Node.offline node then 'Y' else 'N') |
85 | 85 |
(Group.uuid grp) |
86 |
(Node.spindleCount node) |
|
86 | 87 |
where grp = Container.find (Node.group node) gl |
87 | 88 |
|
88 | 89 |
-- | Generate node file data from node objects. |
... | ... | |
177 | 178 |
-> [String] -- ^ Input data as a list of fields |
178 | 179 |
-> m (String, Node.Node) -- ^ The result, a tuple o node name |
179 | 180 |
-- and node object |
180 |
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu] = do |
|
181 |
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, spindles] = do
|
|
181 | 182 |
gdx <- lookupGroup ktg name gu |
182 | 183 |
new_node <- |
183 | 184 |
if any (== "?") [tm,nm,fm,td,fd,tc] || fo == "Y" then |
... | ... | |
189 | 190 |
vtd <- tryRead name td |
190 | 191 |
vfd <- tryRead name fd |
191 | 192 |
vtc <- tryRead name tc |
192 |
return $ Node.create name vtm vnm vfm vtd vfd vtc False 1 gdx |
|
193 |
vspindles <- tryRead name spindles |
|
194 |
return $ Node.create name vtm vnm vfm vtd vfd vtc False vspindles gdx |
|
193 | 195 |
return (name, new_node) |
196 |
|
|
197 |
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu] = |
|
198 |
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, "1"] |
|
199 |
|
|
194 | 200 |
loadNode _ s = fail $ "Invalid/incomplete node data: '" ++ show s ++ "'" |
195 | 201 |
|
196 | 202 |
-- | Load an instance from a field list. |
b/man/htools.rst | ||
---|---|---|
156 | 156 |
- node physical cores |
157 | 157 |
- offline field (as ``Y`` or ``N``) |
158 | 158 |
- group UUID |
159 |
- node spindle count |
|
159 | 160 |
|
160 | 161 |
The third section contains instance data, with the fields: |
161 | 162 |
|
... | ... | |
170 | 171 |
- instance disk type (e.g. ``plain`` or ``drbd``) |
171 | 172 |
- instance tags |
172 | 173 |
|
173 |
The fourth and last section contains the cluster tags, with one tag |
|
174 |
per line (no columns/no column processing). |
|
174 |
The fourth section contains the cluster tags, with one tag per line |
|
175 |
(no columns/no column processing). |
|
176 |
|
|
177 |
The fifth section contains the ipolicies of the cluster and the node |
|
178 |
groups, in the following format (separated by ``|``): |
|
179 |
|
|
180 |
- owner (empty if cluster, group name otherwise) |
|
181 |
- standard, min, max instance specs, containing the following values |
|
182 |
separated by commas: |
|
183 |
- memory size |
|
184 |
- cpu count |
|
185 |
- disk size |
|
186 |
- disk count |
|
187 |
- nic count |
|
188 |
- disk templates |
|
189 |
- vcpu ratio |
|
190 |
- spindle ratio |
|
175 | 191 |
|
176 | 192 |
-m *cluster* |
177 | 193 |
Backend specification: collect data directly from the *cluster* given |
Also available in: Unified diff