Exemple #1
0
 def reset_ilo(self, ilo_bay_number, force="false"):
     """
         Description   :    This function will reset ilo present in a bay. It will reset based on the force parameter
         Params        :
                         ilo_bay_number--> Bay number of server which should be resetted
                         force    --> a boolean parameter based on which ilo will be reset. By default this parameter will be false.
         Return        :    Returns a message if command is executed else returns false
     """
     try:
         output1 = False
         output2 = False
         if force == "false":
             output1 = ha_library.runOAcommands(
                 self.oa_ip, self.oa_username, self.oa_password,
                 "reset iLO %s" % (ilo_bay_number),
                 "Successfully reset iLO through IPMI")
         else:
             output2 = ha_library.runOAcommands(
                 self.oa_ip, self.oa_username, self.oa_password,
                 "reset iLO %s force" % (ilo_bay_number),
                 "Successfully reset iLO through IPMI")
             log._debug(output2)
         if output1 or output2:
             log._info("ILO is successfully reset")
         else:
             log._error("ILO is not successfully reset")
     except:
         raise Exception("Failed to reset iLO")
Exemple #2
0
 def set_ebipa_for_interconnect(self, start_server_address, subnetmask):
     """
         Description : This function sets an IP address for the four interconnect bays
         Params      :
                         start_server_address --> starting address of interconnect bays
                         subnetmask   --> subnet mask
         Usage       : set_ebipa_interconnect()
         Return      : return a message if there is no excpetion else return false
     """
     try:
         output1 = False
         output2 = False
         output1 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "set ebipa interconnect %s %s 1-4" %
             (start_server_address, subnetmask),
             "Successfully set interconnect bay # 1 to IP address")
         output2 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password, "SAVE EBIPA",
             "EBIPA configuration was saved.")
         if output1 and output2:
             log._info(
                 "EBIPA Interconnect Address set for all the interconnects")
         else:
             log._error(
                 "EBIPA Interconnect Address not set for all the interconnects"
             )
     except:
         raise Exception("Failed to set EBIPA Interconnect Address")
Exemple #3
0
 def set_ebipa_server_and_inter_gateway(self, gateway):
     """
         Description : This function sets EBIPA server and interconnect gateway ip address
         Params      :
                       gateway    --> gateway for OA
         Usage       : set_ebipa_ser_inter_gateway("172.24.110.2", "Admin", "Insight7", "172.24.110.1")
         Return      : return output if there is no exception else return false
     """
     try:
         output1 = False
         output2 = False
         output3 = False
         output4 = False
         output1 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "set ebipa server gateway %s 1-16" % (gateway),
             "Successfully set the gateway")
         output2 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password, "SAVE EBIPA",
             "EBIPA configuration was saved.")
         output3 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "set ebipa interconnect gateway %s 1-4" % (gateway),
             "Successfully set the gateway")
         output4 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password, "SAVE EBIPA",
             "EBIPA configuration was saved.")
         if output1 and output2 and output3 and output4:
             log._info("EBIPA interconnect and server gateway is set")
         else:
             log._error("EBIPA interconnect and server gateway is not set")
     except:
         raise Exception("Failed to set EBIPA Server Gateway")
Exemple #4
0
 def set_ebipa_servers(self, start_server_address, subnetmask):
     """
         Description : This function sets the IP address for all 16 bays
         Params      :
                         start_server_address --> starting Address of Bays
                         subnetmask -->  The subnet mask
         Usage       : set_ebipa_address("172.24.110.45", "255.255.255.0")
         Return      : return message if there is no exception else return false
     """
     try:
         output1 = False
         output2 = False
         output1 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "set ebipa server %s %s 1-16" %
             (start_server_address, subnetmask),
             "Successfully set device (iLO) bay # 1 to IP address")
         output2 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password, "SAVE EBIPA",
             "EBIPA configuration was saved.")
         if output1 and output2:
             log._info("EBIPA Address set for all the bays")
         else:
             log._error("EBIPA Address not set for all the bays")
     except:
         raise Exception("Failed to set EBIPA Address")
Exemple #5
0
 def enable_ebipa_for_server(self):
     """
         Description : This function enables EBIPA checkbox in OA
         Params      :
         Usage       : enable_ebipa_for_server()
         Return      : return message if there is no exception else return false
     """
     try:
         output1 = False
         output2 = False
         output1 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "enable ebipa server 1-16",
             "EBIPA is enabled for device (iLO) bay #")
         output2 = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password, "SAVE EBIPA",
             "EBIPA configuration was saved.")
         if output1 and output2:
             log._info("EBIPA is set")
         else:
             log._error("EBIPA is not set")
     except:
         raise Exception("Failed to set EBIPA Address")
Exemple #6
0
 def restart_interconnect(self):
     """
         Description : This function restarts interconnects e.i., VC module
         Params      : none
         Usage       : restart_interconnect()
         Return      : return output if there is no exception else return false
     """
     try:
         output = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "restart interconnect 1", "Resetting Interconnect tray in bay")
         if output:
             log._info("VC module has been restarted successfully")
         else:
             log._error("Failed to restart VC module")
     except:
         raise Exception("Failed to clear VC mode")
 def enable_force_downgrade(self):
     """
         Description : This function is to enable force downgrade the firmware to lower versions on devices within the enclosure
         Usage       : enable_force_downgrade()
         Return      : output message from console interaction
     """
     try:
         output = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "set firmware management force downgrade enable",
             "Operation was successful.")
         if output:
             log._info("Force downgrade is enabled")
         else:
             log._warn("Failed to enable force downgrade")
     except:
         log._error("Unable to enable force downgrade")
 def set_power_policy(self):
     """
         Description : This function is to set power policy while firmware update initiated
         Usage       : set_power_policy()
         Return      : output message from console interaction
     """
     try:
         output = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "SET FIRMWARE MANAGEMENT POWER force",
             "Power policy successfully changed to FORCE.")
         if output:
             log._info("Server power policy applied successfully")
         else:
             log._warn("Server power policy not applied")
     except:
         log._error("Unable to apply Server power policy")
 def select_bays_for_firmware_deployment(self):
     """
         Description : This function is to select the device for firmware upgrade
         Usage       : select_bays_for_firmware_deployment()
         Return      : output message from console interaction
     """
     try:
         output = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "set firmware management BAYS_TO_INCLUDE Server 1-16",
             "Enclosure Firmware Management settings applied successfully.")
         if output:
             log._info("Server bay selection done")
         else:
             log._warn("server bay not selected")
     except:
         log._error("Unable to select Server Bay")
 def set_firmware_management_policy(self):
     """
         Description : This function is to set firmware update policy when a blade is insrted into enclosure
         Usage       : set_firmware_management_policy()
         Return      : output message from console interaction
     """
     try:
         output = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "set firmware  management policy manual",
             "Enclosure Firmware Management policy set to manual update and discovery."
         )
         if output:
             log._info("Firmware management policy set to manual")
         else:
             log._warn("Firmware management policy falied")
     except:
         log._error("Unable to set firmware deployment policy")
 def set_spp_url_for_firmware_management(self, url):
     """
         Description : This function sets SPP url to OA
         Params      : url --> http url where SPP iso is been served
         Usage       : set_spp_url_for_firmware_management("http://172.24.36.85/SPP2013020.2013_0204.107.iso")
         Return      : output message from console interaction
     """
     try:
         output = ha_library.runOAcommands(
             self.oa_ip, self.oa_username, self.oa_password,
             "set firmware management url " + url,
             "Enclosure Firmware Management URL set to")
         if output:
             log._info("Successfully set the SPP ISO URL")
         else:
             log._warn("Error setting SPP ISO URL")
     except:
         log._error("Unable to set Firmware management URL")
 def add_networks(self, netName):
     """
             Descirption : This function Adds networks to the VC domain
             Params      :
                                             netName   -->	 Network name listed in xml
             Usage       : add_networks(self, "netName")
             Return      : return true if there is no exception else return false
     """
     try:
         output = False
         output = ha_library.runOAcommands(self.vc_ip, self.vc_username,
                                           self.vc_password,
                                           "add network %s" % netName,
                                           "SUCCESS: Network added :")
         if output:
             return "network added"
         else:
             return "network not added"
     except:
         raise Exception("Failed to add network")
 def set_mac_addr_default_type(self, macAddrType):
     """
             Descirption : This function Sets MAC address type to be used
             Params      :
                                       macAddrType   -->	 Type such as factory default or hp defined
             Usage       : add_networks(self, "macAddrType")
             Return      : return true if there is no exception else return false
     """
     try:
         output = False
         output = ha_library.runOAcommands(
             self.vc_ip, self.vc_username, self.vc_password,
             "set domain MacType=%s" % macAddrType,
             "SUCCESS: Domain settings modified")
         if output:
             return "Mac Type modified successfully"
         else:
             return "Mac type was not modified"
     except:
         raise Exception("Failed to change Mac Type for the domain")
 def add_vc_user(self, VCusername, VCpassword):
     """
             Descirption : This function Adds a user specified in XML with adiministrator previlege
             Params      :
                                     VCusername -->  VC user name to be added
                                     VCpassword -->  password for user to be added
             Usage       : delete_domain(self, "VC user to be added", "password")
             Return      : return true if there is no exception else return false
     """
     try:
         output = False
         output = ha_library.runOAcommands(
             self.vc_ip, self.vc_username, self.vc_password,
             "add user %s password=%s Privileges=*" %
             (VCusername, VCpassword), "SUCCESS: User added :")
         if output:
             return "user added"
         else:
             return "user not added"
     except:
         raise Exception("Failed to create user")
 def import_enclosure(self, OAusername, OApassword):
     """
             Descirption : This function imports an enclosure to VC domain
             Params      :
                                     OAusername   -->  OA user name of enclosure to be added
                                     OApassword   -->  OA password of enclosure to be added
             Usage       : import_enclosure(self,"OA user name","OA password")
             Return      : return true if there is no exception else return false
     """
     try:
         output1 = False
         output1 = ha_library.runOAcommands(
             self.vc_ip, self.vc_username, self.vc_password,
             "import enclosure username=%s password=%s" %
             (OAusername, OApassword), "SUCCESS: Enclosure imported")
         if output1:
             return "Import successful"
         else:
             return "Import not successful"
     except:
         raise Exception("Failed to Import enclosure")
    def delete_domain(self):
        """
                Descirption : This function deletes VC domain present in  VC module

                Usage       : delete_domain(self)
                Return      : return true if there is no exception else return false
        """
        try:
            output = False
            output = ha_library.runOAcommands(self.vc_ip, self.vc_username,
                                              self.vc_password,
                                              "delete domain -quiet",
                                              "SUCCESS: Domain deleted")
            if output:
                ha_library.closeConnection()
                return "Domain delete successful"
            else:
                ha_library.closeConnection()
                return "Domain delete is not successful"
        except:
            raise Exception("Failed to delete VC Domain")