Commit aff02701 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Make upgrade more robust



Depending on where we're upgrading from, disks may or may
not have been moved to top-level status. So use the more robust
order of first outlining disks and only then fixing indices
within the disk description.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent cdda6dfc
......@@ -373,8 +373,9 @@ def ChangeNodeIndices(config_data, old_key_field, new_key_field):
inst["primary_node"] = GetNewNodeIndex(nodes_by_old_key,
inst["primary_node"],
new_key_field)
for disk in inst["disks"]:
ChangeDiskNodeIndices(disk)
for disk in config_data["disks"].values():
ChangeDiskNodeIndices(disk)
def ChangeInstanceIndices(config_data, old_key_field, new_key_field):
......@@ -425,9 +426,9 @@ def UpgradeAll(config_data):
UpgradeCluster(config_data)
UpgradeGroups(config_data)
UpgradeInstances(config_data)
UpgradeTopLevelDisks(config_data)
UpgradeNodeIndices(config_data)
UpgradeInstanceIndices(config_data)
UpgradeTopLevelDisks(config_data)
# DOWNGRADE ------------------------------------------------------------
......
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