Commit 54666867 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Michele Tartara

Do not clear disk.params in UpgradeConfig()

Commits 5dbee5ea and cce46164 fix disk upgrades concerning params
slot. Since 2.7 params slot should be empty and gets filled
any time needed.

Still ext template allows passing arbitrary params per disk.
These params should be saved in config file for future use.
For instance if we have the shared-filer provider and we
specify shared_dir param during instance create, this param
is needed when we want to attach the disk e.g., during
retrieving instance info. If it gets overridden during a daemon
restart or a config reload we fail to get the instance's info.

To avoid such a failure, we set params slot to an empty dict
only if params not found in the first place.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent a63985f3
......@@ -828,7 +828,12 @@ class Disk(ConfigObject):
child.UpgradeConfig()
# FIXME: Make this configurable in Ganeti 2.7
self.params = {}
# Params should be an empty dict that gets filled any time needed
# In case of ext template we allow arbitrary params that should not
# be overrided during a config reload/upgrade.
if not self.params or not isinstance(self.params, dict):
self.params = {}
# add here config upgrade for this disk
# If the file driver is empty, fill it up with the default value
......
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