def wait_for_multipathd(): for i in range(0, 120): if mpath_cli.is_working(): return time.sleep(1) print("Unable to contact Multipathd daemon") sys.exit(-1)
def wait_for_multipathd(): for i in range(0,120): if mpath_cli.is_working(): return time.sleep(1) print "Unable to contact Multipathd daemon" sys.exit(-1)
def activate(): util.SMlog("MPATH: multipath activate called") # Adjust any HBAs on the host cmd = [hba_script, "enable"] util.SMlog(util.pread2(cmd)) cmd = ['ln', '-sf', iscsi_mpath_file, iscsi_file] util.pread2(cmd) # If we've got no active sessions, and the deamon is already running, # we're ok to restart the daemon if iscsilib.is_iscsi_daemon_running(): if not iscsilib._checkAnyTGT(): iscsilib.restart_daemon() # Start the updatempppathd daemon if not _is_mpp_daemon_running(): cmd = ["/etc/init.d/updatempppathd", "start"] util.pread2(cmd) if not _is_mpath_daemon_running(): util.SMlog("Warning: multipath daemon not running. Starting daemon!") cmd = ["/etc/init.d/multipathd", "start"] util.pread2(cmd) for i in range(0, 120): if mpath_cli.is_working(): util.SMlog("MPATH: dm-multipath activated.") return time.sleep(1) util.SMlog("Failed to communicate with the multipath daemon!") raise xs_errors.XenError('MultipathdCommsFailure')
def activate(): util.SMlog("MPATH: multipath activate called") # Adjust any HBAs on the host cmd = [hba_script, "enable"] util.SMlog(util.pread2(cmd)) cmd = ['ln', '-sf', iscsi_mpath_file, iscsi_file] util.pread2(cmd) # If we've got no active sessions, and the deamon is already running, # we're ok to restart the daemon if iscsilib.is_iscsi_daemon_running(): if not iscsilib._checkAnyTGT(): iscsilib.restart_daemon() # Start the updatempppathd daemon if not _is_mpp_daemon_running(): cmd = ["/etc/init.d/updatempppathd", "start"] util.pread2(cmd) if not _is_mpath_daemon_running(): util.SMlog("Warning: multipath daemon not running. Starting daemon!") cmd = ["/etc/init.d/multipathd", "start"] util.pread2(cmd) for i in range(0,120): if mpath_cli.is_working(): util.SMlog("MPATH: dm-multipath activated.") return time.sleep(1) util.SMlog("Failed to communicate with the multipath daemon!") raise xs_errors.XenError('MultipathdCommsFailure')
def activate(): util.SMlog("MPATH: multipath activate called") # If we've got no active sessions, and the deamon is already running, # we're ok to restart the daemon if iscsilib.is_iscsi_daemon_running(): if not iscsilib._checkAnyTGT(): iscsilib.restart_daemon() if not _is_mpath_daemon_running(): util.SMlog("Warning: multipath daemon not running. Starting daemon!") cmd = ["service", "multipathd", "start"] util.pread2(cmd) for i in range(0, 120): if mpath_cli.is_working(): util.SMlog("MPATH: dm-multipath activated.") return time.sleep(1) util.SMlog("Failed to communicate with the multipath daemon!") raise xs_errors.XenError('MultipathdCommsFailure')
if iscsilib.is_iscsi_daemon_running(): if not iscsilib._checkAnyTGT(): iscsilib.restart_daemon() # Start the updatempppathd daemon if not _is_mpp_daemon_running(): cmd = ["service", "updatempppathd", "start"] util.pread2(cmd) if not _is_mpath_daemon_running(): util.SMlog("Warning: multipath daemon not running. Starting daemon!") cmd = ["service", "multipathd", "start"] util.pread2(cmd) for i in range(0, 120): if mpath_cli.is_working(): util.SMlog("MPATH: dm-multipath activated.") return time.sleep(1) util.SMlog("Failed to communicate with the multipath daemon!") raise xs_errors.XenError('MultipathdCommsFailure') def deactivate(): util.SMlog("MPATH: multipath deactivate called") cmd = ['ln', '-sf', iscsi_default_file, iscsi_file] if os.path.exists(iscsi_default_file): # Only do this if using our customized open-iscsi package util.pread2(cmd)
if iscsilib.is_iscsi_daemon_running(): if not iscsilib._checkAnyTGT(): iscsilib.restart_daemon() # Start the updatempppathd daemon if not _is_mpp_daemon_running(): cmd = ["service", "updatempppathd", "start"] util.pread2(cmd) if not _is_mpath_daemon_running(): util.SMlog("Warning: multipath daemon not running. Starting daemon!") cmd = ["service", "multipathd", "start"] util.pread2(cmd) for i in range(0,120): if mpath_cli.is_working(): util.SMlog("MPATH: dm-multipath activated.") return time.sleep(1) util.SMlog("Failed to communicate with the multipath daemon!") raise xs_errors.XenError('MultipathdCommsFailure') def deactivate(): util.SMlog("MPATH: multipath deactivate called") cmd = ['ln', '-sf', iscsi_default_file, iscsi_file] if os.path.exists(iscsi_default_file): # Only do this if using our customized open-iscsi package util.pread2(cmd) # Stop the updatempppathd daemon