Enable disk growth with exclusive storage
authorBernardo Dal Seno <bdalseno@google.com>
Thu, 27 Jun 2013 16:37:36 +0000 (18:37 +0200)
committerBernardo Dal Seno <bdalseno@google.com>
Fri, 28 Jun 2013 12:38:09 +0000 (14:38 +0200)
Disk growth is now supported also with exclusive storage, so we let the
operation continue.

Enable disk growth test in qa also with exclusive storage.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

lib/cmdlib/instance_storage.py
qa/qa_instance.py

index 7a4933a..ca2facc 100644 (file)
@@ -1423,14 +1423,13 @@ class LUInstanceGrowDisk(LogicalUnit):
 
   def _CheckDiskSpace(self, node_uuids, req_vgspace):
     template = self.instance.disk_template
-    if template not in (constants.DTS_NO_FREE_SPACE_CHECK):
+    if (template not in (constants.DTS_NO_FREE_SPACE_CHECK) and
+        not any(self.node_es_flags.values())):
       # TODO: check the free disk space for file, when that feature will be
       # supported
-      if any(self.node_es_flags.values()):
-        # With exclusive storage we need to something smarter than just looking
-        # at free space; for now, let's simply abort the operation.
-        raise errors.OpPrereqError("Cannot grow disks when exclusive_storage"
-                                   " is enabled", errors.ECODE_STATE)
+      # With exclusive storage we need to do something smarter than just looking
+      # at free space, which, in the end, is basically a dry run. So we rely on
+      # the dry run performed in Exec() instead.
       CheckNodesFreeDiskPerVG(self, node_uuids, req_vgspace)
 
   def Exec(self, feedback_fn):
index e906963..e1ede85 100644 (file)
@@ -652,10 +652,6 @@ def TestInstanceModifyDisks(instance):
 @InstanceCheck(INST_DOWN, INST_DOWN, FIRST_ARG)
 def TestInstanceGrowDisk(instance):
   """gnt-instance grow-disk"""
-  if qa_config.GetExclusiveStorage():
-    print qa_utils.FormatInfo("Test not supported with exclusive_storage")
-    return
-
   if instance.disk_template == constants.DT_DISKLESS:
     print qa_utils.FormatInfo("Test not supported for diskless instances")
     return