Revision 6a0f22e1

b/qa/ganeti-qa.py
129 129
  """
130 130
  RunTestIf("create-cluster", qa_cluster.TestClusterInit,
131 131
            rapi_user, rapi_secret)
132
  if not qa_config.TestEnabled("create-cluster"):
133
    # If the cluster is already in place, we assume that exclusive-storage is
134
    # already set according to the configuration
135
    qa_config.SetExclusiveStorage(qa_config.get("exclusive-storage", False))
132 136

  
133 137
  # Test on empty cluster
134 138
  RunTestIf("node-list", qa_node.TestNodeList)
b/qa/qa-sample.json
21 21
  "primary_ip_version": 4,
22 22
  "# Name of the LVM group for the cluster": null,
23 23
  "vg-name": "xenvg",
24
  "# Cluster-level value of the exclusive-storage flag": null,
25
  "exclusive-storage": null,
24 26

  
25 27
  "# Network interface for master role": null,
26 28
  "#master-netdev": "xen-br0",
b/qa/qa_cluster.py
201 201
    cmd.append("--nic-parameters=%s" %
202 202
               ",".join(utils.FormatKeyValue(nicparams)))
203 203

  
204
  # Cluster value of the exclusive-storage node parameter
205
  e_s = qa_config.get("exclusive-storage")
206
  if e_s is not None:
207
    cmd.extend(["--node-parameters", "exclusive_storage=%s" % e_s])
208
  else:
209
    e_s = False
210
  qa_config.SetExclusiveStorage(e_s)
211

  
204 212
  cmd.append(qa_config.get("name"))
205 213
  AssertCommand(cmd)
206 214

  
......
655 663
  if effvalue != newvalue:
656 664
    raise qa_error.Error("exclusive_storage has the wrong value: %s instead"
657 665
                         " of %s" % (effvalue, newvalue))
666
  qa_config.SetExclusiveStorage(newvalue)
658 667
  return oldvalue
659 668

  
660 669

  
b/qa/qa_config.py
35 35

  
36 36
_INSTANCE_CHECK_KEY = "instance-check"
37 37
_ENABLED_HV_KEY = "enabled-hypervisors"
38
# Key to store the cluster-wide run-time value of the exclusive storage flag
39
_EXCLUSIVE_STORAGE_KEY = "_exclusive_storage"
38 40

  
39 41

  
40 42
cfg = {}
......
242 244
  inst["_template"] = template
243 245

  
244 246

  
247
def SetExclusiveStorage(value):
248
  """Set the expected value of the exclusive_storage flag for the cluster.
249

  
250
  """
251
  cfg[_EXCLUSIVE_STORAGE_KEY] = bool(value)
252

  
253

  
254
def GetExclusiveStorage():
255
  """Get the expected value of the exclusive_storage flag for the cluster.
256

  
257
  """
258
  val = cfg.get(_EXCLUSIVE_STORAGE_KEY)
259
  assert val is not None
260
  return val
261

  
262

  
245 263
def AcquireNode(exclude=None):
246 264
  """Returns the least used node.
247 265

  

Also available in: Unified diff