Revision 4e7f986e lib/cmdlib/instance.py
b/lib/cmdlib/instance.py | ||
---|---|---|
1571 | 1571 |
False, self.op.reason) |
1572 | 1572 |
result.Raise("Could not start instance") |
1573 | 1573 |
|
1574 |
return self.cfg.GetNodeNames(list(iobj.all_nodes))
|
|
1574 |
return self.cfg.GetNodeNames(list(self.cfg.GetInstanceNodes(iobj)))
|
|
1575 | 1575 |
|
1576 | 1576 |
|
1577 | 1577 |
class LUInstanceRename(LogicalUnit): |
... | ... | |
1604 | 1604 |
"""Build hooks nodes. |
1605 | 1605 |
|
1606 | 1606 |
""" |
1607 |
nl = [self.cfg.GetMasterNode()] + list(self.instance.all_nodes) |
|
1607 |
nl = [self.cfg.GetMasterNode()] + \ |
|
1608 |
list(self.cfg.GetInstanceNodes(self.instance)) |
|
1608 | 1609 |
return (nl, nl) |
1609 | 1610 |
|
1610 | 1611 |
def CheckPrereq(self): |
... | ... | |
1688 | 1689 |
# update info on disks |
1689 | 1690 |
info = GetInstanceInfoText(renamed_inst) |
1690 | 1691 |
for (idx, disk) in enumerate(renamed_inst.disks): |
1691 |
for node_uuid in renamed_inst.all_nodes:
|
|
1692 |
for node_uuid in self.cfg.GetInstanceNodes(renamed_inst):
|
|
1692 | 1693 |
result = self.rpc.call_blockdev_setinfo(node_uuid, |
1693 | 1694 |
(disk, renamed_inst), info) |
1694 | 1695 |
result.Warn("Error setting info on node %s for disk %s" % |
... | ... | |
1745 | 1746 |
|
1746 | 1747 |
""" |
1747 | 1748 |
nl = [self.cfg.GetMasterNode()] |
1748 |
nl_post = list(self.instance.all_nodes) + nl
|
|
1749 |
nl_post = list(self.cfg.GetInstanceNodes(self.instance)) + nl
|
|
1749 | 1750 |
return (nl, nl_post) |
1750 | 1751 |
|
1751 | 1752 |
def CheckPrereq(self): |
... | ... | |
1778 | 1779 |
|
1779 | 1780 |
assert (self.owned_locks(locking.LEVEL_NODE) == |
1780 | 1781 |
self.owned_locks(locking.LEVEL_NODE_RES)) |
1781 |
assert not (set(self.instance.all_nodes) -
|
|
1782 |
assert not (set(self.cfg.GetInstanceNodes(self.instance)) -
|
|
1782 | 1783 |
self.owned_locks(locking.LEVEL_NODE)), \ |
1783 | 1784 |
"Not owning correct locks" |
1784 | 1785 |
|
... | ... | |
2622 | 2623 |
"""Build hooks nodes. |
2623 | 2624 |
|
2624 | 2625 |
""" |
2625 |
nl = [self.cfg.GetMasterNode()] + list(self.instance.all_nodes) |
|
2626 |
nl = [self.cfg.GetMasterNode()] + \ |
|
2627 |
list(self.cfg.GetInstanceNodes(self.instance)) |
|
2626 | 2628 |
return (nl, nl) |
2627 | 2629 |
|
2628 | 2630 |
def _PrepareNicModification(self, params, private, old_ip, old_net_uuid, |
... | ... | |
2837 | 2839 |
""" |
2838 | 2840 |
self.diskparams = self.cfg.GetInstanceDiskParams(self.instance) |
2839 | 2841 |
|
2842 |
inst_nodes = self.cfg.GetInstanceNodes(self.instance) |
|
2840 | 2843 |
excl_stor = compat.any( |
2841 |
rpc.GetExclusiveStorageForNodes(self.cfg, |
|
2842 |
self.instance.all_nodes).values() |
|
2844 |
rpc.GetExclusiveStorageForNodes(self.cfg, inst_nodes).values() |
|
2843 | 2845 |
) |
2844 | 2846 |
|
2845 | 2847 |
# Check disk modifications. This is done here and not in CheckArguments |
... | ... | |
3003 | 3005 |
errors.ECODE_STATE) |
3004 | 3006 |
|
3005 | 3007 |
assert pnode_uuid in self.owned_locks(locking.LEVEL_NODE) |
3006 |
node_uuids = list(self.instance.all_nodes)
|
|
3008 |
node_uuids = list(self.cfg.GetInstanceNodes(self.instance))
|
|
3007 | 3009 |
pnode_info = self.cfg.GetNodeInfo(pnode_uuid) |
3008 | 3010 |
|
3009 | 3011 |
#_CheckInstanceNodeGroups(self.cfg, self.op.instance_name, owned_groups) |
... | ... | |
3113 | 3115 |
hvspecs = [(self.instance.hypervisor, |
3114 | 3116 |
self.cfg.GetClusterInfo() |
3115 | 3117 |
.hvparams[self.instance.hypervisor])] |
3116 |
_CheckNodesPhysicalCPUs(self, self.instance.all_nodes,
|
|
3118 |
_CheckNodesPhysicalCPUs(self, self.cfg.GetInstanceNodes(self.instance),
|
|
3117 | 3119 |
max_requested_cpu + 1, |
3118 | 3120 |
hvspecs) |
3119 | 3121 |
|
... | ... | |
3682 | 3684 |
|
3683 | 3685 |
if self.op.disk_template: |
3684 | 3686 |
if __debug__: |
3685 |
check_nodes = set(self.instance.all_nodes)
|
|
3687 |
check_nodes = set(self.cfg.GetInstanceNodes(self.instance))
|
|
3686 | 3688 |
if self.op.remote_node_uuid: |
3687 | 3689 |
check_nodes.add(self.op.remote_node_uuid) |
3688 | 3690 |
for level in [locking.LEVEL_NODE, locking.LEVEL_NODE_RES]: |
... | ... | |
3842 | 3844 |
self.instance = self.cfg.GetInstanceInfo(self.op.instance_uuid) |
3843 | 3845 |
|
3844 | 3846 |
# Check if node groups for locked instance are still correct |
3845 |
assert owned_nodes.issuperset(self.instance.all_nodes), \
|
|
3847 |
assert owned_nodes.issuperset(self.cfg.GetInstanceNodes(self.instance)), \
|
|
3846 | 3848 |
("Instance %s's nodes changed while we kept the lock" % |
3847 | 3849 |
self.op.instance_name) |
3848 | 3850 |
|
Also available in: Unified diff