Commit 130f0966 authored by Iustin Pop's avatar Iustin Pop
Browse files

RAPI: Add os params to instance creation v1

Since the RAPI QA suite doesn't seem to offer easy testing of failed
creations, I didn't add this to the QA. Pointers on how to do it are

The patch also changes the 'os' argument to be required, since that is
how the LU expects it, and without it we just fail later instead of
directly at submission time.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 74fa8200
......@@ -590,7 +590,8 @@ def _ParseInstanceCreateRequestVersion1(data, dry_run):
return opcodes.OpCreateInstance(
mode=baserlib.CheckParameter(data, "mode"),
instance_name=baserlib.CheckParameter(data, "name"),
os_type=baserlib.CheckParameter(data, "os", default=None),
os_type=baserlib.CheckParameter(data, "os"),
osparams=baserlib.CheckParameter(data, "osparams", default={}),
force_variant=baserlib.CheckParameter(data, "force_variant",
pnode=baserlib.CheckParameter(data, "pnode", default=None),
......@@ -107,6 +107,7 @@ class TestParseInstanceCreateRequestVersion1(testutils.GanetiTestCase):
"nics": nics,
"mode": mode,
"disk_template": disk_template,
"os": "debootstrap",
if beparams is not None:
......@@ -152,7 +153,8 @@ class TestParseInstanceCreateRequestVersion1(testutils.GanetiTestCase):
"disks": [],
"nics": [],
"mode": constants.INSTANCE_CREATE,
"disk_template": constants.DT_PLAIN
"disk_template": constants.DT_PLAIN,
"os": "debootstrap",
for name in reqfields.keys():
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