Revision b92a2f3e lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
9390 | 9390 |
self.be_inst = i_bedict # the new dict (without defaults) |
9391 | 9391 |
else: |
9392 | 9392 |
self.be_new = self.be_inst = {} |
9393 |
be_old = cluster.FillBE(instance) |
|
9393 | 9394 |
|
9394 | 9395 |
# osparams processing |
9395 | 9396 |
if self.op.osparams: |
... | ... | |
9401 | 9402 |
|
9402 | 9403 |
self.warn = [] |
9403 | 9404 |
|
9404 |
if constants.BE_MEMORY in self.op.beparams and not self.op.force: |
|
9405 |
if (constants.BE_MEMORY in self.op.beparams and not self.op.force and |
|
9406 |
be_new[constants.BE_MEMORY] > be_old[constants.BE_MEMORY]): |
|
9405 | 9407 |
mem_check_list = [pnode] |
9406 | 9408 |
if be_new[constants.BE_AUTO_BALANCE]: |
9407 | 9409 |
# either we changed auto_balance to yes or it was from before |
... | ... | |
9442 | 9444 |
for node, nres in nodeinfo.items(): |
9443 | 9445 |
if node not in instance.secondary_nodes: |
9444 | 9446 |
continue |
9445 |
msg = nres.fail_msg |
|
9446 |
if msg: |
|
9447 |
self.warn.append("Can't get info from secondary node %s: %s" % |
|
9448 |
(node, msg)) |
|
9449 |
elif not isinstance(nres.payload.get('memory_free', None), int): |
|
9450 |
self.warn.append("Secondary node %s didn't return free" |
|
9451 |
" memory information" % node) |
|
9447 |
nres.Raise("Can't get info from secondary node %s" % node, |
|
9448 |
prereq=True, ecode=errors.ECODE_STATE) |
|
9449 |
if not isinstance(nres.payload.get('memory_free', None), int): |
|
9450 |
raise errors.OpPrereqError("Secondary node %s didn't return free" |
|
9451 |
" memory information" % node, |
|
9452 |
errors.ECODE_STATE) |
|
9452 | 9453 |
elif be_new[constants.BE_MEMORY] > nres.payload['memory_free']: |
9453 |
self.warn.append("Not enough memory to failover instance to" |
|
9454 |
" secondary node %s" % node) |
|
9454 |
raise errors.OpPrereqError("This change will prevent the instance" |
|
9455 |
" from failover to its secondary node" |
|
9456 |
" %s, due to not enough memory" % node, |
|
9457 |
errors.ECODE_STATE) |
|
9455 | 9458 |
|
9456 | 9459 |
# NIC processing |
9457 | 9460 |
self.nic_pnew = {} |
Also available in: Unified diff