Antoni Segura Puimedon has uploaded a new change for review.

Change subject: upgrade: fix seal persistence for oVirt node
......................................................................

upgrade: fix seal persistence for oVirt node

The oVirt node filesystem is not persistent by default. However, it
has a mechanism to persist files and directories. It is necessary
for a mechanism such as the upgrade sealing, that depends on files
surviving reboots, to make sure that the files are persisted.

This bug had a crucial effect on the referenced bug. On boot:
- the upgrade to unified script would run before restore-nets
- Since restore-nets hadn't run, nothing would be on running config
- upgrade to unified would save that empty running config as
  persisted
- restore-nets would then run and restore to a non existing
  configuration.

Change-Id: I7bd945ae9fc2b5687a1f216f67711dc5fa3e41aa
Bug-Url: https://bugzilla.redhat.com/1108571
Signed-off-by: Antoni S. Puimedon <[email protected]>
---
M lib/vdsm/tool/upgrade.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/29545/1

diff --git a/lib/vdsm/tool/upgrade.py b/lib/vdsm/tool/upgrade.py
index 0050832..ca61929 100644
--- a/lib/vdsm/tool/upgrade.py
+++ b/lib/vdsm/tool/upgrade.py
@@ -23,7 +23,7 @@
 import os
 
 from ..constants import P_VDSM_LIB
-from ..utils import touchFile
+from ..utils import touchFile, isOvirtNode
 
 
 def _get_upgrade_log():
@@ -39,11 +39,15 @@
 
 
 def _upgrade_seal(upgrade):
+    seal_file = _upgrade_seal_path(upgrade)
     try:
-        touchFile(_upgrade_seal_path(upgrade))
+        touchFile(seal_file)
     except (OSError, IOError):
         _get_upgrade_log().exception("Failed to seal upgrade %s", upgrade.name)
     else:
+        if isOvirtNode():
+            from ovirt.node.utils import fs
+            fs.Config().persist(seal_file)
         _get_upgrade_log().debug("Upgrade %s successfully performed",
                                  upgrade.name)
 


-- 
To view, visit http://gerrit.ovirt.org/29545
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bd945ae9fc2b5687a1f216f67711dc5fa3e41aa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to