Exemplo n.º 1
0
def run():
    ipmi_manager = IPMIManager()
    result = ipmi_manager.getNodeInfoByType(HOST, TYPE)
    if result.code == "succeed":
        return True
    else:
        return False
 def __init__(self):
     # self.clusterList =
     self.nova_client = NovaClient.getInstance()
     self.ipmi_module = IPMIManager()
     self.cluster_list = ClusterManager.getClusterList()
     config = ConfigParser.RawConfigParser()
     config.read('hass.conf')
     self.port = int(config.get("detection", "polling_port"))
 def __init__(self, name, cluster_id):
     self.name = name
     # self.protected_instance_list = []
     self.cluster_id = cluster_id
     self.ipmi = IPMIManager()
     self.ipmi_status = self.ipmi._getIPMIStatus(self.name)
     self.nova_client = NovaClient.getInstance()
     self.detection_thread = None
     self.initDetectionThread()
Exemplo n.º 4
0
 def __init__(self, node, port):
     self.node = node.name
     self.ipmi_status = node.ipmi_status
     self.ipmi_manager = IPMIManager()
     self.port = port
     self.sock = None
     self.config = ConfigParser.RawConfigParser()
     self.config.read('/home/localadmin/HASS/hass.conf')
     self.connect()
def run():
    ipmi_manager = IPMIManager()
    try:
        result = ipmi_manager.getPowerStatus(HOST)
        if result == "OK":
            return True
        else:
            return False
    except:
        return False
def run(check_timeout=300):
    ipmi_manager = IPMIManager()
    result = ipmi_manager.rebootNode(HOST)
    print "wait to %s boot up" % HOST
    time.sleep(150)  # wait node to reboot
    response = _check_boot_up(check_timeout)
    print response
    if response == "OK" and result.code == "succeed":
        return True
    return False
Exemplo n.º 7
0
 def __init__(self, name, cluster_id):
     self.name = name
     self.cluster_id = cluster_id
     self.ipmi = IPMIManager()
     self.ipmi_status = self.ipmi._getIPMIStatus(self.name)
     self.nova_client = NovaClient.getInstance()
     self.detection_thread = None
     self.config = ConfigParser.RawConfigParser()
     self.config.read('/home/localadmin/HASS/hass.conf')
     self.initDetectionThread()
def run(check_timeout=60):
    ipmi_manager = IPMIManager()
    result = ipmi_manager.shutOffNode(HOST)

    while check_timeout > 0:
        power_status = ipmi_manager.getPowerStatus(HOST)
        if power_status == "Error" and result.code == "succeed":
            time.sleep(60)
            return True
        check_timeout -= 1
        time.sleep(1)
    return False
Exemplo n.º 9
0
import socket
import sys
import time

import paramiko

sys.path.insert(0, '/home/controller/Desktop/MOST/HASS')
from IPMIModule import IPMIManager
from Node import Node

CLUSTER_ID = "clusterid"
HOST = "compute4"
PORT = 2468
ipmi_manager = IPMIManager()


def run():
    try:
        client = _create_ssh_client(HOST)
        cmd = "sudo sh /home/" + HOST + "/Desktop/MOST/HASS/compute_node/os_hang.sh"
        #cmd = "kill -SEGV 1 & ; kill -SEGV 1"
        #cmd = "sudo sh /home/compute4/Desktop/test.sh"
        stdin, stdout, stderr = _remote_exec(client, cmd)
        # print stdout.read()
        result = detection_OS_fail(20)
        if result:
            print "detect os successfuly"
            recover = recover_os_fail(180)
            if recover:
                return True
            else:
Exemplo n.º 10
0
 def __init__(self, id, name):
     super(Cluster, self).__init__(id, name)
     self.ipmi = IPMIManager()
     self.config = ConfigParser.RawConfigParser()
     self.config.read('/home/localadmin/HASS/hass.conf')
Exemplo n.º 11
0
 def __init__(self):
     self.ipmi_module = IPMIManager()
     self.cluster_list = ClusterManager.getClusterList()
     self.config = ConfigParser.RawConfigParser()
     self.config.read('hass.conf')
     self.port = int(self.config.get("detection", "polling_port"))