Commit 9f88b0e8 authored by Iustin Pop's avatar Iustin Pop

Reuse hypervisor parameters in import

If available, we reuse the parameters from the export info.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent f276c4b5
......@@ -6265,6 +6265,16 @@ class LUCreateInstance(LogicalUnit):
" is missing the disk_template information",
errors.ECODE_INVAL)
if (self.op.hypervisor is None and
einfo.has_option(constants.INISECT_INS, "hypervisor")):
self.op.hypervisor = einfo.get(constants.INISECT_INS, "hypervisor")
if einfo.has_section(constants.INISECT_HYP):
# use the export parameters but do not override the ones
# specified by the user
for name, value in einfo.items(constants.INISECT_HYP):
if name not in self.op.hvparams:
self.op.hvparams[name] = value
def CheckPrereq(self):
"""Check prerequisites.
......
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