Revision e43a624e lib/cmdlib/instance_storage.py

b/lib/cmdlib/instance_storage.py
1394 1394
    node_uuids = list(self.instance.all_nodes)
1395 1395
    for node_uuid in node_uuids:
1396 1396
      CheckNodeOnline(self, node_uuid)
1397
    self.node_es_flags = rpc.GetExclusiveStorageForNodes(self.cfg, node_uuids)
1397 1398

  
1398 1399
    if self.instance.disk_template not in constants.DTS_GROWABLE:
1399 1400
      raise errors.OpPrereqError("Instance's disk layout does not support"
......
1425 1426
    if template not in (constants.DTS_NO_FREE_SPACE_CHECK):
1426 1427
      # TODO: check the free disk space for file, when that feature will be
1427 1428
      # supported
1428
      nodes = map(self.cfg.GetNodeInfo, node_uuids)
1429
      es_nodes = filter(lambda n: IsExclusiveStorageEnabledNode(self.cfg, n),
1430
                        nodes)
1431
      if es_nodes:
1429
      if any(self.node_es_flags.values()):
1432 1430
        # With exclusive storage we need to something smarter than just looking
1433 1431
        # at free space; for now, let's simply abort the operation.
1434 1432
        raise errors.OpPrereqError("Cannot grow disks when exclusive_storage"
......
1459 1457
      self.cfg.SetDiskID(self.disk, node_uuid)
1460 1458
      result = self.rpc.call_blockdev_grow(node_uuid,
1461 1459
                                           (self.disk, self.instance),
1462
                                           self.delta, True, True)
1460
                                           self.delta, True, True,
1461
                                           self.node_es_flags[node_uuid])
1463 1462
      result.Raise("Dry-run grow request failed to node %s" %
1464 1463
                   self.cfg.GetNodeName(node_uuid))
1465 1464

  
......
1492 1491
      self.cfg.SetDiskID(self.disk, node_uuid)
1493 1492
      result = self.rpc.call_blockdev_grow(node_uuid,
1494 1493
                                           (self.disk, self.instance),
1495
                                           self.delta, False, True)
1494
                                           self.delta, False, True,
1495
                                           self.node_es_flags[node_uuid])
1496 1496
      result.Raise("Grow request failed to node %s" %
1497 1497
                   self.cfg.GetNodeName(node_uuid))
1498 1498

  
......
1500 1500
    node_uuid = self.instance.primary_node
1501 1501
    self.cfg.SetDiskID(self.disk, node_uuid)
1502 1502
    result = self.rpc.call_blockdev_grow(node_uuid, (self.disk, self.instance),
1503
                                         self.delta, False, False)
1503
                                         self.delta, False, False,
1504
                                         self.node_es_flags[node_uuid])
1504 1505
    result.Raise("Grow request failed to node %s" %
1505 1506
                 self.cfg.GetNodeName(node_uuid))
1506 1507

  

Also available in: Unified diff