Change in vdsm[ovirt-3.5]: vdsm_reg: Make vdsm-reg persist the management bridge it cre...

asegurap at redhat.com asegurap at redhat.com
Tue Sep 30 13:49:09 UTC 2014


Antoni Segura Puimedon has uploaded a new change for review.

Change subject: vdsm_reg: Make vdsm-reg persist the management bridge it creates
......................................................................

vdsm_reg: Make vdsm-reg persist the management bridge it creates

In the vdsm_reg flow, for the oVirt node, the management bridge is
created using addNetworks. This puts the management network in the
RunningConfig ( /var/run/vdsm/netconf/nets ). Then it notifies the
engine of the registration request.

When the engine approves the request, it starts the deployment, part
of which is to start vdsmd. In the common init tasks of vdsmd there is
the restore_nets task that, if /var/run/vdsm/nets_restored does not
exist, it will clear all the networks in RunningConfig and configure
again those in PersistentConfig. The issue is that in a clean
installation there won't be any PersistentConfig, and thus the system
will lose connectivity.

In order to solve this issue, the best course of action is to persist
RunningConfig as PersistentConfig as soon as the management network
has been created by vdsm-reg (and strictly before the registration
request is sent to the engine).

Change-Id: I9d35da853df485a9196ad0657f832b77ae65d24e
Bug-Url: https://bugzilla.redhat.com/1144639
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
---
M vdsm_reg/deployUtil.py.in
1 file changed, 21 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/33541/1

diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index ad91e54..34c671e 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -52,6 +52,7 @@
 P_LIB_SYSTEMD = '/lib/systemd/systemd-'
 P_ROOT_SSH = pwd.getpwnam('root').pw_dir + '/.ssh'
 P_ROOT_AUTH_KEYS = P_ROOT_SSH + '/authorized_keys'
+P_VDSM_CONF = '/etc/vdsm/vdsm.conf'
 P_VDSM_NODE_ID = '/etc/vdsm/vdsm.id'
 P_SBIN = '/sbin/'
 P_USR_BIN = '/usr/bin/'
@@ -85,6 +86,8 @@
 ERR_NO_ROUTE = 7
 SCRIPT_NAME_ADD = "addNetwork"
 SCRIPT_NAME_DEL = "delNetwork"
+SCRIPT_NAME_GET_CONFIG = "get-conf-item"
+SCRIPT_NAME_STORE_NET_CONFIG = "vdsm-store-net-config"
 IFACE_CONFIG = "/etc/sysconfig/network-scripts/ifcfg-"
 MGT_BRIDGE_NAME = "ovirtmgmt"
 REMOTE_SSH_KEY_FILE = ('/engine.ssh.key.txt',)
@@ -1109,8 +1112,24 @@
 
     # Save current config by removing the undo files:
     try:
-        if fReturn and not fIsOvirt:
-            setSafeVdsmNetworkConfig()
+        if fReturn:
+            if fIsOvirt:
+                out, err, ret = _logExec(
+                    [os.path.join(vdsmDir, SCRIPT_NAME_GET_CONFIG),
+                     P_VDSM_CONF, 'vars', 'net_persistence', 'ifcfg'])
+                if ret:
+                    raise Exception('Failed to retrieve vdsm persistence '
+                                    'mode. Stderr: %s' % err)
+
+                net_persistence = out.strip()
+                out, err, ret = _logExec(
+                    [os.path.join(vdsmDir, SCRIPT_NAME_STORE_NET_CONFIG),
+                     net_persistence])
+                if ret:
+                    raise Exception('Failed to persist vdsm networking '
+                                    'configuration. Stderr: %s' % err)
+            else:
+                setSafeVdsmNetworkConfig()
     except:
         logging.debug(traceback.format_exc())
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d35da853df485a9196ad0657f832b77ae65d24e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>


More information about the vdsm-patches mailing list