Hello Douglas Schilling Landgraf, Dima Kuznetsov, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/29822
to review the following change.
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]>
Reviewed-on: http://gerrit.ovirt.org/29545
Reviewed-by: Dan Kenigsberg <[email protected]>
Reviewed-by: Dima Kuznetsov <[email protected]>
Reviewed-by: Douglas Schilling Landgraf <[email protected]>
Tested-by: Douglas Schilling Landgraf <[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/22/29822/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/29822
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bd945ae9fc2b5687a1f216f67711dc5fa3e41aa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Dima Kuznetsov <[email protected]>
Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches