Revision c879832c lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
7452 | 7452 |
_CheckNodeOnline(self, target_node) |
7453 | 7453 |
_CheckNodeNotDrained(self, target_node) |
7454 | 7454 |
_CheckNodeVmCapable(self, target_node) |
7455 |
ipolicy = _CalculateGroupIPolicy(self.cfg.GetClusterInfo(), node.group) |
|
7455 |
ipolicy = _CalculateGroupIPolicy(self.cfg.GetClusterInfo(), |
|
7456 |
self.cfg.GetNodeGroup(node.group)) |
|
7456 | 7457 |
_CheckTargetNodeIPolicy(self, ipolicy, instance, node, |
7457 | 7458 |
ignore=self.op.ignore_ipolicy) |
7458 | 7459 |
|
... | ... | |
7722 | 7723 |
|
7723 | 7724 |
# Check that the target node is correct in terms of instance policy |
7724 | 7725 |
nodeinfo = self.cfg.GetNodeInfo(self.target_node) |
7725 |
ipolicy = _CalculateGroupIPolicy(cluster, nodeinfo.group) |
|
7726 |
group_info = self.cfg.GetNodeGroup(nodeinfo.group) |
|
7727 |
ipolicy = _CalculateGroupIPolicy(cluster, group_info) |
|
7726 | 7728 |
_CheckTargetNodeIPolicy(self.lu, ipolicy, instance, nodeinfo, |
7727 | 7729 |
ignore=self.ignore_ipolicy) |
7728 | 7730 |
|
... | ... | |
7760 | 7762 |
(instance.disk_template, text), |
7761 | 7763 |
errors.ECODE_INVAL) |
7762 | 7764 |
nodeinfo = self.cfg.GetNodeInfo(target_node) |
7763 |
ipolicy = _CalculateGroupIPolicy(cluster, nodeinfo.group) |
|
7765 |
group_info = self.cfg.GetNodeGroup(nodeinfo.group) |
|
7766 |
ipolicy = _CalculateGroupIPolicy(cluster, group_info) |
|
7764 | 7767 |
_CheckTargetNodeIPolicy(self.lu, ipolicy, instance, nodeinfo, |
7765 | 7768 |
ignore=self.ignore_ipolicy) |
7766 | 7769 |
|
... | ... | |
9644 | 9647 |
constants.ISPEC_NIC_COUNT: len(self.nics), |
9645 | 9648 |
} |
9646 | 9649 |
|
9647 |
ipolicy = _CalculateGroupIPolicy(cluster, pnode.group) |
|
9650 |
group_info = self.cfg.GetNodeGroup(pnode.group) |
|
9651 |
ipolicy = _CalculateGroupIPolicy(cluster, group_info) |
|
9648 | 9652 |
res = _ComputeIPolicyInstanceSpecViolation(ipolicy, ispec) |
9649 | 9653 |
if not self.op.ignore_ipolicy and res: |
9650 | 9654 |
raise errors.OpPrereqError(("Instance allocation to group %s violates" |
... | ... | |
9654 | 9658 |
|
9655 | 9659 |
# disk parameters (not customizable at instance or node level) |
9656 | 9660 |
# just use the primary node parameters, ignoring the secondary. |
9657 |
self.diskparams = self.cfg.GetNodeGroup(pnode.group).diskparams
|
|
9661 |
self.diskparams = group_info.diskparams
|
|
9658 | 9662 |
|
9659 | 9663 |
if not self.adopt_disks: |
9660 | 9664 |
# Check lv size requirements, if not adopting |
... | ... | |
11809 | 11813 |
_CheckNodesFreeDiskPerVG(self, [self.op.remote_node], required) |
11810 | 11814 |
|
11811 | 11815 |
snode_info = self.cfg.GetNodeInfo(self.op.remote_node) |
11812 |
ipolicy = _CalculateGroupIPolicy(cluster, snode_info.group) |
|
11816 |
snode_group = self.cfg.GetNodeGroup(snode_info.group) |
|
11817 |
ipolicy = _CalculateGroupIPolicy(cluster, snode_group) |
|
11813 | 11818 |
_CheckTargetNodeIPolicy(self, ipolicy, instance, snode_info, |
11814 | 11819 |
ignore=self.op.ignore_ipolicy) |
11815 | 11820 |
if pnode_info.group != snode_info.group: |
Also available in: Unified diff