Exemplo n.º 1
0
 def _run(self):
   node = self.scenario.cluster.nodes()[self.node_index]
   address = node.metadata().node_out_of_band_management_info.ip_address
   if not CurieUtil.ping_ip(address):
     raise CurieTestException(
       cause=
       "Out-of-band power management for node '%d' with address '%s' did not "
       "respond to a network ping." % (node.node_index(), address),
       impact=
       "There is no network connectivity to '%s'." % address,
       corrective_action=
       "Please troubleshoot network connectivity to the power management "
       "controller with address '%s'." % address
     )
   try:
     node.power_management_util.get_chassis_status()
   except Exception:
     raise CurieTestException(
       cause=
       "Command failure occurred on the out-of-band power management for "
       "node '%d' with address '%s'." % (node.node_index(), address),
       impact=
       "There is network connectivity to '%s', but power management commands "
       "are failing." % address,
       corrective_action=
       "Please check the configured username and password for the power "
       "management controller with address '%s'. Please also ensure that "
       "'IPMI over LAN' is enabled for the power management controller, and "
       "that network connections to '%s' on UDP port 623 are allowed." %
       (address, address)
     )
Exemplo n.º 2
0
 def validate_host_connectivity(cluster_pb):
   cluster_cls = get_cluster_class(cluster_pb)
   cluster = cluster_cls(cluster_pb)
   for node in cluster.nodes():
     if not CurieUtil.ping_ip(node.node_ip()):
       raise CurieException(CurieError.kInternalError,
                             "Host %s - %s not reachable." %
                             (node.node_id(), node.node_ip()))
Exemplo n.º 3
0
 def _run(self):
   node = self.scenario.cluster.nodes()[self.node_index]
   if not CurieUtil.ping_ip(node.node_ip()):
     raise CurieTestException(
       cause=
       "Hypervisor for node '%s' with address %s did not respond to a "
       "network ping." % (node, node.node_ip()),
       impact=
       "There is no network connectivity to %s." % node.node_ip(),
       corrective_action=
       "Please troubleshoot network connectivity to the hypervisor for node "
       "'%s' with address %s." % (node, node.node_ip())
     )
Exemplo n.º 4
0
  def validate_oob_config(cluster_pb):
    """
    Validates provided out-of-band management config in 'cluster_pb'.

    Args:
      cluster_pb (curie_server_state_pb2.CurieSettings.Cluster): Populated
        cluster proto whose data to validate.

    Raises: CurieException on any error encountered.
    """
    for node in cluster_pb.cluster_nodes:
      if (node.node_out_of_band_management_info.interface_type
          == node.NodeOutOfBandManagementInfo.kNone):
        continue

      if not CurieUtil.ping_ip(
        node.node_out_of_band_management_info.ip_address):
        raise CurieException(CurieError.kInternalError,
          "Out-of-band management at '%s' is unreachable" %
          node.node_out_of_band_management_info.ip_address)

      oob_util = get_power_management_util(
        node.node_out_of_band_management_info)
      try:
        oob_util.get_chassis_status()
      except CurieException as exc:
        # Not all OoB implementations will explicitly distinguish an
        # authentication error. Tailor error message appropriately.
        if exc.error_code == CurieError.kOobAuthenticationError:
          raise CurieException(
            error_code=exc.error_code,
            error_msg="Out-of-band management authentication failed for node"
                      " %s" % node.id)
        else:
          raise CurieException(
            error_code=exc.error_code,
            error_msg="Failed to query out-of-band management for node %s. "
                      "Please re-enter credentials" % node.id)