Change in vdsm[master]: Unified persistence [3/4] - Restore network config

asegurap at redhat.com asegurap at redhat.com
Fri Oct 4 09:28:14 UTC 2013


Antoni Segura Puimedon has posted comments on this change.

Change subject: Unified persistence [3/4] - Restore network config
......................................................................


Patch Set 20:

(10 comments)

....................................................
Commit Message
Line 6: 
Line 7: Unified persistence [3/4] - Restore network config
Line 8: 
Line 9: Add vdsm-restore-net-config support for unified persistence.
Line 10: It relies on configurator specific persistence removal, i.e.,
Done
Line 11: each configurator should remove their persisted conf, leaving
Line 12: only unified persistence as source of persistence.
Line 13: 
Line 14: After the configurator persistence is flushed, the unified


Line 7: Unified persistence [3/4] - Restore network config
Line 8: 
Line 9: Add vdsm-restore-net-config support for unified persistence.
Line 10: It relies on configurator specific persistence removal, i.e.,
Line 11: each configurator should remove their persisted conf, leaving
Done
Line 12: only unified persistence as source of persistence.
Line 13: 
Line 14: After the configurator persistence is flushed, the unified
Line 15: persisted nets and bonds are passed to a setupNetworks call.


Line 15: persisted nets and bonds are passed to a setupNetworks call.
Line 16: 
Line 17: Since we want vdsm-restore-net-config to be run at boot after
Line 18: libvirtd but before vdsmd listens, the service was removed
Line 19: and it was integrated as one of the start tasks.
Done
Line 20: 
Line 21: If the restoration is run via vdsmd_init_common.sh we touch
Line 22: /var/run/vdsm/nets_restored that, if present, prevents the
Line 23: next vdsmd starts and restarts without boot from restoring


Line 18: libvirtd but before vdsmd listens, the service was removed
Line 19: and it was integrated as one of the start tasks.
Line 20: 
Line 21: If the restoration is run via vdsmd_init_common.sh we touch
Line 22: /var/run/vdsm/nets_restored that, if present, prevents the
Done
Line 23: next vdsmd starts and restarts without boot from restoring
Line 24: the nets.
Line 25: 
Line 26: The user can explicitly restore the nets by explicitly calling


Line 22: /var/run/vdsm/nets_restored that, if present, prevents the
Line 23: next vdsmd starts and restarts without boot from restoring
Line 24: the nets.
Line 25: 
Line 26: The user can explicitly restore the nets by explicitly calling
Done
Line 27: /usr/share/vdsm/vdsm-restore-net-config or via vdsm-tool:
Line 28: vdsm-tool restore-nets
Line 29: 
Line 30: Change-Id: I73462b160ecfbaa7efe71eed905a3bbd69ee6c23


....................................................
File init/vdsmd_init_common.sh.in
Line 173: }
Line 174: 
Line 175: task_restore_nets(){
Line 176:     RESTORATION_FILE="@VDSMRUNDIR@/nets_restored"
Line 177:     if [ ! -f $RESTORATION_FILE ]; then
Done
Line 178:         "@PYTHON@" "@VDSMDIR@/vdsm-restore-net-config"
Line 179:         touch $RESTORATION_FILE
Line 180:     fi
Line 181: }


Line 206:         fi
Line 207:     done
Line 208: }
Line 209: 
Line 210: 
Done
Line 211: case "$1" in
Line 212:     --pre-start)
Line 213:         run_tasks " \
Line 214:             run_init_hooks gencerts reconfigure_sanlock reconfigure_libvirt \


....................................................
File lib/vdsm/netconfpersistence.py
Line 23: import logging
Line 24: import os
Line 25: 
Line 26: from config import config
Line 27: from tool.restore_nets import restore
Because of it's usage in lib/vdsm/netinfo in for getBootProto in Assaf's patch.
Line 28: import constants
Line 29: import utils
Line 30: 
Line 31: 


....................................................
File lib/vdsm/tool/restore_nets.py
Line 30:     """
Line 31:     Restores the networks to what was previously persisted via vdsm.
Line 32:     """
Line 33:     rc, out, err = utils.execCmd([os.path.join(
Line 34:         P_VDSM, 'vdsm-restore-net-config')], raw=True, sudo=True)
Yes, I put it because of the functional tests.
Line 35:     sys.stdout.write(out)
Line 36:     sys.stderr.write(err)


....................................................
File vdsm/netconf/ifcfg.py
Line 220:         self._removeSourceRouteFile('route', device)
Line 221: 
Line 222:     def flush(self):
Line 223:         libvirtCfg.flush()
Line 224:         service_stop('network')
Ok, I'll use _ownedFiles together with sorting to do it. It will need deeper testing.
Line 225:         self.configApplier.flush()
Line 226:         service_start('network')
Line 227: 
Line 228: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I73462b160ecfbaa7efe71eed905a3bbd69ee6c23
Gerrit-PatchSet: 20
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Petr Ĺ ebek <psebek at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list