Commit 429ae766 authored by René Nussbaumer's avatar René Nussbaumer Committed by Michael Hanselmann
Browse files

Add “gnt-os modify” for per-os-hypervisor parameters



Introduce “gnt-os modify” command to make it possible to set the
per-os-hypervisor parameters.
Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 664a9d73
...@@ -156,11 +156,39 @@ def DiagnoseOS(opts, args): ...@@ -156,11 +156,39 @@ def DiagnoseOS(opts, args):
return int(has_bad) return int(has_bad)
def ModifyOS(opts, args):
"""Modify OS parameters for one OS.
@param opts: the command line options selected by the user
@type args: list
@param args: should be a list with one entry
@rtype: int
@return: the desired exit code
"""
os = args[0]
op = opcodes.OpSetClusterParams(vg_name=None,
enabled_hypervisors=None,
hvparams=None,
beparams=None,
nicparams=None,
candidate_pool_size=None,
os_hvp={
os: dict(opts.hvparams)
})
SubmitOpCode(op)
return 0
commands = { commands = {
'list': ( 'list': (
ListOS, ARGS_NONE, [NOHDR_OPT], "", "Lists all valid OSes on the master"), ListOS, ARGS_NONE, [NOHDR_OPT], "", "Lists all valid OSes on the master"),
'diagnose': ( 'diagnose': (
DiagnoseOS, ARGS_NONE, [], "", "Diagnose all OSes"), DiagnoseOS, ARGS_NONE, [], "", "Diagnose all OSes"),
'modify': (
ModifyOS, ARGS_ONE_OS, [HVLIST_OPT], "", "Modify os parameters"),
} }
if __name__ == '__main__': if __name__ == '__main__':
......
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