Revision 0eca8e0c
b/lib/cmdlib.py | ||
---|---|---|
2789 | 2789 |
|
2790 | 2790 |
_StartInstanceDisks(self, instance, force) |
2791 | 2791 |
|
2792 |
result = self.rpc.call_instance_start(node_current, instance) |
|
2792 |
result = self.rpc.call_instance_start(node_current, instance, None, None)
|
|
2793 | 2793 |
msg = result.RemoteFailMsg() |
2794 | 2794 |
if msg: |
2795 | 2795 |
_ShutdownInstanceDisks(self, instance) |
... | ... | |
2871 | 2871 |
" full reboot: %s" % msg) |
2872 | 2872 |
_ShutdownInstanceDisks(self, instance) |
2873 | 2873 |
_StartInstanceDisks(self, instance, ignore_secondaries) |
2874 |
result = self.rpc.call_instance_start(node_current, instance) |
|
2874 |
result = self.rpc.call_instance_start(node_current, instance, None, None)
|
|
2875 | 2875 |
msg = result.RemoteFailMsg() |
2876 | 2876 |
if msg: |
2877 | 2877 |
_ShutdownInstanceDisks(self, instance) |
... | ... | |
3562 | 3562 |
raise errors.OpExecError("Can't activate the instance's disks") |
3563 | 3563 |
|
3564 | 3564 |
feedback_fn("* starting the instance on the target node") |
3565 |
result = self.rpc.call_instance_start(target_node, instance) |
|
3565 |
result = self.rpc.call_instance_start(target_node, instance, None, None)
|
|
3566 | 3566 |
msg = result.RemoteFailMsg() |
3567 | 3567 |
if msg: |
3568 | 3568 |
_ShutdownInstanceDisks(self, instance) |
... | ... | |
4806 | 4806 |
self.cfg.Update(iobj) |
4807 | 4807 |
logging.info("Starting instance %s on node %s", instance, pnode_name) |
4808 | 4808 |
feedback_fn("* starting instance...") |
4809 |
result = self.rpc.call_instance_start(pnode_name, iobj) |
|
4809 |
result = self.rpc.call_instance_start(pnode_name, iobj, None, None)
|
|
4810 | 4810 |
msg = result.RemoteFailMsg() |
4811 | 4811 |
if msg: |
4812 | 4812 |
raise errors.OpExecError("Could not start instance: %s" % msg) |
... | ... | |
6254 | 6254 |
|
6255 | 6255 |
finally: |
6256 | 6256 |
if self.op.shutdown and instance.admin_up: |
6257 |
result = self.rpc.call_instance_start(src_node, instance) |
|
6257 |
result = self.rpc.call_instance_start(src_node, instance, None, None)
|
|
6258 | 6258 |
msg = result.RemoteFailMsg() |
6259 | 6259 |
if msg: |
6260 | 6260 |
_ShutdownInstanceDisks(self, instance) |
b/lib/rpc.py | ||
---|---|---|
260 | 260 |
self._cfg = cfg |
261 | 261 |
self.port = utils.GetNodeDaemonPort() |
262 | 262 |
|
263 |
def _InstDict(self, instance): |
|
263 |
def _InstDict(self, instance, hvp=None, bep=None):
|
|
264 | 264 |
"""Convert the given instance to a dict. |
265 | 265 |
|
266 | 266 |
This is done via the instance's ToDict() method and additionally |
... | ... | |
268 | 268 |
|
269 | 269 |
@type instance: L{objects.Instance} |
270 | 270 |
@param instance: an Instance object |
271 |
@type hvp: dict or None |
|
272 |
@param hvp: a dictionary with overriden hypervisor parameters |
|
273 |
@type bep: dict or None |
|
274 |
@param bep: a dictionary with overriden backend parameters |
|
271 | 275 |
@rtype: dict |
272 | 276 |
@return: the instance dict, with the hvparams filled with the |
273 | 277 |
cluster defaults |
... | ... | |
276 | 280 |
idict = instance.ToDict() |
277 | 281 |
cluster = self._cfg.GetClusterInfo() |
278 | 282 |
idict["hvparams"] = cluster.FillHV(instance) |
283 |
if hvp is not None: |
|
284 |
idict["hvparams"].update(hvp) |
|
279 | 285 |
idict["beparams"] = cluster.FillBE(instance) |
286 |
if bep is not None: |
|
287 |
idict["beparams"].update(bep) |
|
280 | 288 |
return idict |
281 | 289 |
|
282 | 290 |
def _ConnectList(self, client, node_list, call): |
... | ... | |
425 | 433 |
""" |
426 | 434 |
return self._SingleNodeCall(node, "bridges_exist", [bridges_list]) |
427 | 435 |
|
428 |
def call_instance_start(self, node, instance): |
|
436 |
def call_instance_start(self, node, instance, hvp, bep):
|
|
429 | 437 |
"""Starts an instance. |
430 | 438 |
|
431 | 439 |
This is a single-node call. |
432 | 440 |
|
433 | 441 |
""" |
434 |
return self._SingleNodeCall(node, "instance_start",
|
|
435 |
[self._InstDict(instance)])
|
|
442 |
idict = self._InstDict(instance, hvp=hvp, bep=bep)
|
|
443 |
return self._SingleNodeCall(node, "instance_start", [idict])
|
|
436 | 444 |
|
437 | 445 |
def call_instance_shutdown(self, node, instance): |
438 | 446 |
"""Stops an instance. |
Also available in: Unified diff