3 # This script restarts the cluster nodes. It can optionally cleanup the persistent data.
4 # --------------------------------------------------------------------------------------
6 # This script takes a list of hosts as parameter
9 # -------------------------------------------------------------------------------------------------------------
12 from remote_host import RemoteHost
14 parser = argparse.ArgumentParser(description="Cluster Restart")
18 help="the root directory on the remote host where the distribution is deployed",
24 help="a comma separated list of host names or ip addresses",
31 help="clean the persistent data for the current deployment",
34 "--user", default="root", help="the SSH username for the remote host(s)"
37 "--password", default="Ecp123", help="the SSH password for the remote host(s)"
39 args = parser.parse_args()
43 hosts = args.hosts.split(",")
44 for x in range(0, len(hosts)):
45 # Connect to the remote host and start doing operations
46 remote = RemoteHost(hosts[x], args.user, args.password, args.rootdir)
47 remote.kill_controller()
49 remote.exec_cmd("rm -rf " + args.rootdir + "/deploy/current/odl/*journal")
50 remote.exec_cmd("rm -rf " + args.rootdir + "/deploy/current/odl/snapshots")
51 remote.start_controller(args.rootdir + "/deploy/current")