-> Node.Node -- ^ The node to be serialised
-> String
serializeNode gl node =
- printf "%s|%.0f|%d|%d|%.0f|%d|%.0f|%c|%s" (Node.name node)
+ printf "%s|%.0f|%d|%d|%.0f|%d|%.0f|%c|%s|%d" (Node.name node)
(Node.tMem node) (Node.nMem node) (Node.fMem node)
(Node.tDsk node) (Node.fDsk node) (Node.tCpu node)
(if Node.offline node then 'Y' else 'N')
(Group.uuid grp)
+ (Node.spindleCount node)
where grp = Container.find (Node.group node) gl
-- | Generate node file data from node objects.
-> [String] -- ^ Input data as a list of fields
-> m (String, Node.Node) -- ^ The result, a tuple o node name
-- and node object
-loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu] = do
+loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, spindles] = do
gdx <- lookupGroup ktg name gu
new_node <-
if any (== "?") [tm,nm,fm,td,fd,tc] || fo == "Y" then
vtd <- tryRead name td
vfd <- tryRead name fd
vtc <- tryRead name tc
- return $ Node.create name vtm vnm vfm vtd vfd vtc False 1 gdx
+ vspindles <- tryRead name spindles
+ return $ Node.create name vtm vnm vfm vtd vfd vtc False vspindles gdx
return (name, new_node)
+
+loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu] =
+ loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, "1"]
+
loadNode _ s = fail $ "Invalid/incomplete node data: '" ++ show s ++ "'"
-- | Load an instance from a field list.
- node physical cores
- offline field (as ``Y`` or ``N``)
- group UUID
+ - node spindle count
The third section contains instance data, with the fields:
- instance disk type (e.g. ``plain`` or ``drbd``)
- instance tags
- The fourth and last section contains the cluster tags, with one tag
- per line (no columns/no column processing).
+ The fourth section contains the cluster tags, with one tag per line
+ (no columns/no column processing).
+
+ The fifth section contains the ipolicies of the cluster and the node
+ groups, in the following format (separated by ``|``):
+
+ - owner (empty if cluster, group name otherwise)
+ - standard, min, max instance specs, containing the following values
+ separated by commas:
+ - memory size
+ - cpu count
+ - disk size
+ - disk count
+ - nic count
+ - disk templates
+ - vcpu ratio
+ - spindle ratio
-m *cluster*
Backend specification: collect data directly from the *cluster* given