Revision d04aaa2f lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
2761 | 2761 |
assert self.instance is not None, \ |
2762 | 2762 |
"Cannot retrieve locked instance %s" % self.op.instance_name |
2763 | 2763 |
|
2764 |
# extra beparams |
|
2765 |
self.beparams = getattr(self.op, "beparams", {}) |
|
2766 |
if self.beparams: |
|
2767 |
if not isinstance(self.beparams, dict): |
|
2768 |
raise errors.OpPrereqError("Invalid beparams passed: %s, expected" |
|
2769 |
" dict" % (type(self.beparams), )) |
|
2770 |
# fill the beparams dict |
|
2771 |
utils.ForceDictType(self.beparams, constants.BES_PARAMETER_TYPES) |
|
2772 |
self.op.beparams = self.beparams |
|
2773 |
|
|
2774 |
# extra hvparams |
|
2775 |
self.hvparams = getattr(self.op, "hvparams", {}) |
|
2776 |
if self.hvparams: |
|
2777 |
if not isinstance(self.hvparams, dict): |
|
2778 |
raise errors.OpPrereqError("Invalid hvparams passed: %s, expected" |
|
2779 |
" dict" % (type(self.hvparams), )) |
|
2780 |
|
|
2781 |
# check hypervisor parameter syntax (locally) |
|
2782 |
cluster = self.cfg.GetClusterInfo() |
|
2783 |
utils.ForceDictType(self.hvparams, constants.HVS_PARAMETER_TYPES) |
|
2784 |
filled_hvp = cluster.FillDict(cluster.hvparams[instance.hypervisor], |
|
2785 |
instance.hvparams) |
|
2786 |
filled_hvp.update(self.hvparams) |
|
2787 |
hv_type = hypervisor.GetHypervisor(instance.hypervisor) |
|
2788 |
hv_type.CheckParameterSyntax(filled_hvp) |
|
2789 |
_CheckHVParams(self, instance.all_nodes, instance.hypervisor, filled_hvp) |
|
2790 |
self.op.hvparams = self.hvparams |
|
2791 |
|
|
2764 | 2792 |
_CheckNodeOnline(self, instance.primary_node) |
2765 | 2793 |
|
2766 | 2794 |
bep = self.cfg.GetClusterInfo().FillBE(instance) |
... | ... | |
2789 | 2817 |
|
2790 | 2818 |
_StartInstanceDisks(self, instance, force) |
2791 | 2819 |
|
2792 |
result = self.rpc.call_instance_start(node_current, instance, None, None) |
|
2820 |
result = self.rpc.call_instance_start(node_current, instance, |
|
2821 |
self.hvparams, self.beparams) |
|
2793 | 2822 |
msg = result.RemoteFailMsg() |
2794 | 2823 |
if msg: |
2795 | 2824 |
_ShutdownInstanceDisks(self, instance) |
Also available in: Unified diff