Commit b8291e00 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Annotate disk params on instance_os_add



We call _OpenRealBD during the process and this needs disk parameters to
work. This was reported by Constantinos.

The fix is very ugly though.
Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 81bcbbd3
......@@ -662,7 +662,7 @@ class RpcRunner(_RpcClientBase,
# Encoders requiring configuration object
rpc_defs.ED_INST_DICT: self._InstDict,
rpc_defs.ED_INST_DICT_HVP_BEP: self._InstDictHvpBep,
rpc_defs.ED_INST_DICT_OSP: self._InstDictOsp,
rpc_defs.ED_INST_DICT_OSP_DP: self._InstDictOspDp,
# Encoders annotating disk parameters
rpc_defs.ED_DISKS_DICT_DP: self._DisksDictDP,
......@@ -730,11 +730,13 @@ class RpcRunner(_RpcClientBase,
"""
return self._InstDict(instance, hvp=hvp, bep=bep)
def _InstDictOsp(self, (instance, osparams)):
def _InstDictOspDp(self, (instance, osparams)):
"""Wrapper for L{_InstDict}.
"""
return self._InstDict(instance, osp=osparams)
updated_inst = self._InstDict(instance, osp=osparams)
updated_inst["disks"] = self._DisksDictDP((instance.disks, instance))
return updated_inst
def _DisksDictDP(self, (disks, instance)):
"""Wrapper for L{AnnotateDiskParams}.
......
......@@ -66,7 +66,7 @@ ACCEPT_OFFLINE_NODE = object()
ED_INST_DICT,
ED_INST_DICT_HVP_BEP,
ED_NODE_TO_DISK_DICT,
ED_INST_DICT_OSP,
ED_INST_DICT_OSP_DP,
ED_IMPEXP_IO,
ED_FILE_DETAILS,
ED_FINALIZE_EXPORT_DISKS,
......@@ -270,7 +270,7 @@ _INSTANCE_CALLS = [
("startup_paused", None, None),
], None, None, "Starts an instance"),
("instance_os_add", SINGLE, None, TMO_1DAY, [
("instance_osp", ED_INST_DICT_OSP, None),
("instance_osp", ED_INST_DICT_OSP_DP, None),
("reinstall", None, None),
("debug", None, None),
], None, None, "Starts an instance"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment