From c47478f97b844fe49c821f92650afe8862767727 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sun, 13 Jun 2010 07:19:37 +0200
Subject: [PATCH] Fix a bug in instance startup with custom hvparams

Since the introduction of OS-specific hvparams, we shouldn't ever use
objects.FillDict directly for instances, but instead go via the cluster
object. Otherwise the os_hvp will be ignored.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/cmdlib.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index baa0a9ab8..880c5a0b7 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -4197,8 +4197,7 @@ class LUStartupInstance(LogicalUnit):
       # check hypervisor parameter syntax (locally)
       cluster = self.cfg.GetClusterInfo()
       utils.ForceDictType(self.hvparams, constants.HVS_PARAMETER_TYPES)
-      filled_hvp = objects.FillDict(cluster.hvparams[instance.hypervisor],
-                                    instance.hvparams)
+      filled_hvp = cluster.FillHV(instance)
       filled_hvp.update(self.hvparams)
       hv_type = hypervisor.GetHypervisor(instance.hypervisor)
       hv_type.CheckParameterSyntax(filled_hvp)
-- 
GitLab