Revision 647a5d80
b/lib/cmdlib.py | ||
---|---|---|
4622 | 4622 |
self.hv_new = self.hv_inst = {} |
4623 | 4623 |
|
4624 | 4624 |
self.warn = [] |
4625 |
|
|
4625 | 4626 |
if constants.BE_MEMORY in self.op.beparams and not self.force: |
4627 |
mem_check_list = [pnode] |
|
4628 |
if be_new[constants.BE_AUTOBALANCE]: |
|
4629 |
# either we changed autobalance to yes or it was from before |
|
4630 |
mem_check_list.extend(instance.secondary_nodes) |
|
4626 | 4631 |
instance_info = self.rpc.call_instance_info(pnode, instance.name, |
4627 | 4632 |
instance.hypervisor) |
4628 |
nodeinfo = self.rpc.call_node_info(nodelist, self.cfg.GetVGName(),
|
|
4633 |
nodeinfo = self.rpc.call_node_info(mem_check_list, self.cfg.GetVGName(),
|
|
4629 | 4634 |
instance.hypervisor) |
4630 | 4635 |
|
4631 | 4636 |
if pnode not in nodeinfo or not isinstance(nodeinfo[pnode], dict): |
... | ... | |
4646 | 4651 |
" from starting, due to %d MB of memory" |
4647 | 4652 |
" missing on its primary node" % miss_mem) |
4648 | 4653 |
|
4649 |
for node in instance.secondary_nodes: |
|
4650 |
if node not in nodeinfo or not isinstance(nodeinfo[node], dict): |
|
4651 |
self.warn.append("Can't get info from secondary node %s" % node) |
|
4652 |
elif be_new[constants.BE_MEMORY] > nodeinfo[node]['memory_free']: |
|
4653 |
self.warn.append("Not enough memory to failover instance to" |
|
4654 |
" secondary node %s" % node) |
|
4654 |
if be_new[constants.BE_AUTOBALANCE]: |
|
4655 |
for node in instance.secondary_nodes: |
|
4656 |
if node not in nodeinfo or not isinstance(nodeinfo[node], dict): |
|
4657 |
self.warn.append("Can't get info from secondary node %s" % node) |
|
4658 |
elif be_new[constants.BE_MEMORY] > nodeinfo[node]['memory_free']: |
|
4659 |
self.warn.append("Not enough memory to failover instance to" |
|
4660 |
" secondary node %s" % node) |
|
4655 | 4661 |
|
4656 | 4662 |
return |
4657 | 4663 |
|
Also available in: Unified diff