Revision c69b147d lib/cmdlib/cluster.py

b/lib/cmdlib/cluster.py
1900 1900
             utils.CommaJoin(inst_config.secondary_nodes),
1901 1901
             code=self.ETYPE_WARNING)
1902 1902

  
1903
    if inst_config.disk_template not in constants.DTS_EXCL_STORAGE:
1904
      # Disk template not compatible with exclusive_storage: no instance
1905
      # node should have the flag set
1906
      es_flags = rpc.GetExclusiveStorageForNodeNames(self.cfg,
1907
                                                     inst_config.all_nodes)
1908
      es_nodes = [n for (n, es) in es_flags.items()
1909
                  if es]
1910
      _ErrorIf(es_nodes, constants.CV_EINSTANCEUNSUITABLENODE, instance,
1911
               "instance has template %s, which is not supported on nodes"
1912
               " that have exclusive storage set: %s",
1913
               inst_config.disk_template, utils.CommaJoin(es_nodes))
1903
    es_flags = rpc.GetExclusiveStorageForNodeNames(self.cfg,
1904
                                                   inst_config.all_nodes)
1905
    if any(es_flags.values()):
1906
      if inst_config.disk_template not in constants.DTS_EXCL_STORAGE:
1907
        # Disk template not compatible with exclusive_storage: no instance
1908
        # node should have the flag set
1909
        es_nodes = [n
1910
                    for (n, es) in es_flags.items()
1911
                    if es]
1912
        self._Error(constants.CV_EINSTANCEUNSUITABLENODE, instance,
1913
                    "instance has template %s, which is not supported on nodes"
1914
                    " that have exclusive storage set: %s",
1915
                    inst_config.disk_template, utils.CommaJoin(es_nodes))
1916
      for (idx, disk) in enumerate(inst_config.disks):
1917
        _ErrorIf(disk.spindles is None,
1918
                 constants.CV_EINSTANCEMISSINGCFGPARAMETER, instance,
1919
                 "number of spindles not configured for disk %s while"
1920
                 " exclusive storage is enabled, try running"
1921
                 " gnt-cluster repair-disk-sizes",
1922
                 idx)
1914 1923

  
1915 1924
    if inst_config.disk_template in constants.DTS_INT_MIRROR:
1916 1925
      instance_nodes = utils.NiceSort(inst_config.all_nodes)

Also available in: Unified diff