Revision a0be8f1a

b/man/htools.rst
163 163
  - group uuid
164 164
  - allocation policy
165 165
  - tags (separated by comma)
166
  - networks (UUID's, separated by comma)
166 167

  
167 168
  The second sections contains node data, with the following columns:
168 169

  
b/src/Ganeti/HTools/Backend/Text.hs
69 69
-- | Serialize a single group.
70 70
serializeGroup :: Group.Group -> String
71 71
serializeGroup grp =
72
  printf "%s|%s|%s|%s" (Group.name grp) (Group.uuid grp)
72
  printf "%s|%s|%s|%s|%s" (Group.name grp) (Group.uuid grp)
73 73
           (allocPolicyToRaw (Group.allocPolicy grp))
74 74
           (intercalate "," (Group.allTags grp))
75
           (intercalate "," (Group.networks grp))
75 76

  
76 77
-- | Generate group file data from a group list.
77 78
serializeGroups :: Group.List -> String
......
182 183
loadGroup :: (Monad m) => [String]
183 184
          -> m (String, Group.Group) -- ^ The result, a tuple of group
184 185
                                     -- UUID and group object
185
loadGroup [name, gid, apol, tags] = do
186
loadGroup [name, gid, apol, tags, nets] = do
186 187
  xapol <- allocPolicyFromRaw apol
187 188
  let xtags = commaSplit tags
188
  -- TODO: parse networks to which this group is connected
189
  return (gid, Group.create name gid xapol [] defIPolicy xtags)
190

  
189
  let xnets = commaSplit nets
190
  return (gid, Group.create name gid xapol xnets defIPolicy xtags)
191
loadGroup [name, gid, apol, tags] = loadGroup [name, gid, apol, tags, ""]
191 192
loadGroup s = fail $ "Invalid/incomplete group data: '" ++ show s ++ "'"
192 193

  
193 194
-- | Load a node from a field list.
b/test/data/htools/clean-nonzero-score.data
1
group-01|fake-uuid-01|preferred|
1
group-01|fake-uuid-01|preferred||
2 2

  
3 3
node-01-001|91552|0|91424|953674|953674|16|N|fake-uuid-01|1
4 4
node-01-002|91552|0|91296|953674|953674|16|N|fake-uuid-01|1
b/test/data/htools/common-suffix.data
1
default|fake-uuid-01|preferred|
1
default|fake-uuid-01|preferred||
2 2

  
3 3
node1.example.com|1024|0|1024|95367|95367|4|N|fake-uuid-01|1
4 4
node2.example.com|1024|0|896|95367|94343|4|N|fake-uuid-01|1
b/test/data/htools/empty-cluster.data
1
group-01|fake-uuid-01|preferred|
1
group-01|fake-uuid-01|preferred||
2 2

  
3 3

  
4 4

  
b/test/data/htools/hbal-excl-tags.data
1
group-01|fake-uuid-01|preferred|
1
group-01|fake-uuid-01|preferred||
2 2

  
3 3
node-01|16384|0|14336|409600|153600|16|N|fake-uuid-01|1
4 4
node-02|16384|0|13312|409600|153600|16|N|fake-uuid-01|1
b/test/data/htools/hbal-split-insts.data
1
group-01|fake-uuid-01|preferred|
2
group-02|fake-uuid-02|preferred|
1
group-01|fake-uuid-01|preferred||
2
group-02|fake-uuid-02|preferred||
3 3

  
4 4
node-01-001|98304|0|96256|8388608|8355840|16|N|fake-uuid-01|1
5 5
node-01-002|98304|0|96256|8388608|8355840|16|N|fake-uuid-01|1
b/test/data/htools/hspace-tiered-dualspec.data
1
group-01|fake-uuid-01|preferred|
1
group-01|fake-uuid-01|preferred||
2 2

  
3 3
node-01-001|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1
4 4
node-01-002|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1
b/test/data/htools/hspace-tiered.data
1
group-01|fake-uuid-01|preferred|
1
group-01|fake-uuid-01|preferred||
2 2

  
3 3
node-01-001|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1
4 4
node-01-002|262144|65536|196608|2097152|2097152|8|N|fake-uuid-01|1
b/test/data/htools/invalid-node.data
1
group-01|fake-uuid-01|preferred|
1
group-01|fake-uuid-01|preferred||
2 2

  
3 3
node-01-001|1024|0|1024|95367|95367|4|N|fake-uuid-01|1
4 4
node-01-002|1024|0|896|95367|94343|4|N|fake-uuid-01|1
b/test/data/htools/missing-resources.data
1
default|fake-uuid-01|preferred|
1
default|fake-uuid-01|preferred||
2 2

  
3 3
node1|1024|0|1024|95367|95367|4|N|fake-uuid-01|1
4 4
node2|1024|0|0|95367|0|4|N|fake-uuid-01|1
b/test/data/htools/multiple-master.data
1
group-01|fake-uuid-01|preferred|
1
group-01|fake-uuid-01|preferred||
2 2

  
3 3
node-01-001|91552|0|91424|953674|953674|16|M|fake-uuid-01|1
4 4
node-01-002|91552|0|91296|953674|953674|16|N|fake-uuid-01|1
b/test/data/htools/n1-failure.data
1
group-01|fake-uuid-01|preferred|
2
group-02|fake-uuid-02|unallocable|
1
group-01|fake-uuid-01|preferred||
2
group-02|fake-uuid-02|unallocable||
3 3

  
4 4
node-01-001|256|0|0|7629394|7625298|16|N|fake-uuid-01|1
5 5
node-01-002|256|0|0|7629394|7625298|16|N|fake-uuid-01|1
b/test/data/htools/unique-reboot-order.data
1
group-01|fake-uuid-01|preferred|
1
group-01|fake-uuid-01|preferred||
2 2

  
3 3
node-01-001|91552|0|91424|953674|953674|16|M|fake-uuid-01|1
4 4
node-01-002|91552|0|91296|953674|953674|16|N|fake-uuid-01|1

Also available in: Unified diff