Refactor infrastructure network in mtce code
Updated to read the host cluster-host parameter in /etc/hosts file. Replaced references of infra network with cluster-host network Story: 2004273 Task: 29473 Change-Id: I199fb82e5f6b459b181196d0802f1a74220b796e Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
This commit is contained in:
parent
94126225d0
commit
8e51a1660a
@ -35,7 +35,7 @@
|
||||
#define MGMNT_HB_ALARM_ID ((const char *)"200.005")
|
||||
#define PMOND_ALARM_ID ((const char *)"200.006")
|
||||
#define SENSOR_ALARM_ID ((const char *)"200.007") /* Sensor read alarm ; i.e. the sensor read value bad */
|
||||
#define INFRA_HB_ALARM_ID ((const char *)"200.009")
|
||||
#define CLSTR_HB_ALARM_ID ((const char *)"200.009")
|
||||
#define BM_ALARM_ID ((const char *)"200.010")
|
||||
#define CONFIG_ALARM_ID ((const char *)"200.011")
|
||||
#define CH_CONT_ALARM_ID ((const char *)"200.012") /* Combo Host Controller Failure - with Active Compute */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*
|
||||
* - touch the 'no_mgmnt_ack' file on the mtcClient to cause
|
||||
* it to handle command requests but drop/not send the ack message
|
||||
* if it came in on themanagement network ; same for infra
|
||||
* if it came in on the management network ; same for cluster-host
|
||||
*
|
||||
* - touch the 'no_mtcAlive file to tell mtcClient to stop sending
|
||||
* its mtcAlive messages while this file is present.
|
||||
@ -41,14 +41,14 @@
|
||||
#define MTC_CMD_FIT__NO_RESET ("/var/run/fit/no_reset") /* mtcClient */
|
||||
#define MTC_CMD_FIT__NO_WIPEDISK ("/var/run/fit/no_wipedisk") /* mtcClient */
|
||||
#define MTC_CMD_FIT__NO_MGMNT_ACK ("/var/run/fit/no_mgmnt_ack") /* mtcClient */
|
||||
#define MTC_CMD_FIT__NO_INFRA_ACK ("/var/run/fit/no_infra_ack") /* mtcClient */
|
||||
#define MTC_CMD_FIT__NO_CLSTR_ACK ("/var/run/fit/no_clstr_ack") /* mtcClient */
|
||||
#define MTC_CMD_FIT__NO_MTCALIVE ("/var/run/fit/no_mtcalive") /* mtcClient */
|
||||
#define MTC_CMD_FIT__MGMNT_RXSOCK ("/var/run/fit/mgmnt_rxsock") /* mtcClient */
|
||||
#define MTC_CMD_FIT__MGMNT_TXSOCK ("/var/run/fit/mgmnt_txsock") /* mtcClient */
|
||||
#define MTC_CMD_FIT__INFRA_RXSOCK ("/var/run/fit/infra_rxsock") /* mtcClient */
|
||||
#define MTC_CMD_FIT__INFRA_TXSOCK ("/var/run/fit/infra_txsock") /* mtcClient */
|
||||
#define MTC_CMD_FIT__CLSTR_RXSOCK ("/var/run/fit/clstr_rxsock") /* mtcClient */
|
||||
#define MTC_CMD_FIT__CLSTR_TXSOCK ("/var/run/fit/clstr_txsock") /* mtcClient */
|
||||
#define MTC_CMD_FIT__AMON_SOCK ("/var/run/fit/amon_sock") /* mtcClient */
|
||||
#define MTC_CMD_FIT__NO_INFRA_RSP ("/var/run/fit/no_infra_rsp") /* hbsClient */
|
||||
#define MTC_CMD_FIT__NO_CLSTR_RSP ("/var/run/fit/no_clstr_rsp") /* hbsClient */
|
||||
#define MTC_CMD_FIT__NO_MGMNT_RSP ("/var/run/fit/no_mgmnt_rsp") /* hbsClient */
|
||||
#define MTC_CMD_FIT__LINKLIST ("/var/run/fit/linklist") /* hbsAgent */
|
||||
#define MTC_CMD_FIT__HBSSILENT ("/var/run/fit/hbs_silent_fault") /* hbsAgent */
|
||||
@ -96,7 +96,7 @@
|
||||
#define FIT_CODE__DO_NOTHING_THREAD (9)
|
||||
#define FIT_CODE__EMPTY_BM_PASSWORD (10)
|
||||
#define FIT_CODE__INVALIDATE_MGMNT_IP (11)
|
||||
#define FIT_CODE__INVALIDATE_INFRA_IP (12)
|
||||
#define FIT_CODE__INVALIDATE_CLSTR_IP (12)
|
||||
#define FIT_CODE__WORK_QUEUE (13)
|
||||
#define FIT_CODE__NO_READY_EVENT (14)
|
||||
#define FIT_CODE__NO_PULSE_REQUEST (15)
|
||||
|
@ -388,7 +388,7 @@ int jsonUtil_inv_load ( char * json_str_ptr,
|
||||
info.host[i].uptime = _json_get_key_value_string ( node_obj, MTC_JSON_INV_UPTIME );
|
||||
info.host[i].oper_subf = _json_get_key_value_string ( node_obj, MTC_JSON_INV_OPER_SUBF );
|
||||
info.host[i].avail_subf = _json_get_key_value_string ( node_obj, MTC_JSON_INV_AVAIL_SUBF);
|
||||
info.host[i].infra_ip = _json_get_key_value_string ( node_obj, MTC_JSON_INV_INFRAIP );
|
||||
info.host[i].clstr_ip = _json_get_key_value_string ( node_obj, MTC_JSON_INV_CLSTRIP );
|
||||
|
||||
if ( info.host[i].uuid.length() != UUID_LEN )
|
||||
{
|
||||
@ -445,7 +445,7 @@ int jsonUtil_patch_load ( char * json_str_ptr,
|
||||
info.uptime= _json_get_key_value_string ( node_obj, MTC_JSON_INV_UPTIME );
|
||||
info.oper_subf = _json_get_key_value_string ( node_obj, MTC_JSON_INV_OPER_SUBF );
|
||||
info.avail_subf = _json_get_key_value_string ( node_obj, MTC_JSON_INV_AVAIL_SUBF);
|
||||
info.infra_ip = _json_get_key_value_string ( node_obj, MTC_JSON_INV_INFRAIP );
|
||||
info.clstr_ip = _json_get_key_value_string ( node_obj, MTC_JSON_INV_CLSTRIP );
|
||||
|
||||
if (node_obj) json_object_put(node_obj);
|
||||
|
||||
@ -504,7 +504,7 @@ int jsonUtil_load_host ( char * json_str_ptr, node_inv_type & info )
|
||||
info.id = _json_get_key_value_string ( node_obj, "id" );
|
||||
info.oper_subf = _json_get_key_value_string ( node_obj, MTC_JSON_INV_OPER_SUBF );
|
||||
info.avail_subf = _json_get_key_value_string ( node_obj, MTC_JSON_INV_AVAIL_SUBF);
|
||||
info.infra_ip = _json_get_key_value_string ( node_obj, MTC_JSON_INV_INFRAIP );
|
||||
info.clstr_ip = _json_get_key_value_string ( node_obj, MTC_JSON_INV_CLSTRIP );
|
||||
|
||||
if ( info.uuid.length() != UUID_LEN )
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ typedef struct
|
||||
char* hbs_failure_action ; /**< action to take on host heartbeat falure*/
|
||||
|
||||
char* mgmnt_iface ; /**< management interface name pointer */
|
||||
char* infra_iface ; /**< infrastructure interface name pointer */
|
||||
char* clstr_iface ; /**< cluster-host interface name pointer */
|
||||
char* multicast ; /**< Multicast address */
|
||||
int ha_port ; /**< HA REST API Port Number */
|
||||
int vim_cmd_port ; /**< Mtce -> VIM Command REST API Port */
|
||||
@ -79,14 +79,14 @@ typedef struct
|
||||
int barbican_api_port ; /**< Barbican REST API port number */
|
||||
|
||||
int mtc_rx_mgmnt_port ; /**< mtcClient listens mgmnt nwk cmd reqs */
|
||||
int mtc_rx_infra_port ; /**< mtcClient listens infra nwk cmd reqs */
|
||||
int mtc_rx_clstr_port ; /**< mtcClient listens clstr nwk cmd reqs */
|
||||
int mtc_tx_mgmnt_port ; /**< mtcClient sends mgmnt nwk cmds/resp's */
|
||||
int mtc_tx_infra_port ; /**< mtcClient sends infra nwk cmds/resp's */
|
||||
int mtc_tx_clstr_port ; /**< mtcClient sends clstr nwk cmds/resp's */
|
||||
|
||||
int hbs_agent_mgmnt_port ; /**< hbsAgent mgmnt network pulse resp port */
|
||||
int hbs_client_mgmnt_port ; /**< hbsClient mgmnt network pulse req port */
|
||||
int hbs_agent_infra_port ; /**< hbsAgent infra network pulse resp port */
|
||||
int hbs_client_infra_port ; /**< hbsClient infra network pulse req port */
|
||||
int hbs_agent_clstr_port ; /**< hbsAgent clstr network pulse resp port */
|
||||
int hbs_client_clstr_port ; /**< hbsClient clstr network pulse req port */
|
||||
int daemon_log_port ; /**< daemon log port */
|
||||
|
||||
int mtcalarm_req_port ; /**< port daemons send alarm requests to */
|
||||
@ -94,7 +94,7 @@ typedef struct
|
||||
int agent_rx_port ;
|
||||
int client_rx_port ;
|
||||
|
||||
bool infra_degrade_only ; /**< Only degrade on infra heartbeat failure */
|
||||
bool clstr_degrade_only ; /**< Only degrade on clstr heartbeat failure */
|
||||
int mtc_to_hbs_cmd_port ; /**< mtcAgent to hbsAgent command port */
|
||||
int mtc_to_guest_cmd_port ; /**< mtcAgent to guestAgent command port */
|
||||
int hwmon_cmd_port ; /**< mtcAgent to hwmon command port */
|
||||
@ -121,7 +121,7 @@ typedef struct
|
||||
int hostwd_failure_threshold ; /**< allowed # of missed pmon/hostwd messages */
|
||||
bool hostwd_reboot_on_err ; /**< should hostwd reboot on fault detected */
|
||||
bool hostwd_use_kern_wd ; /**< use the kernel watchdog for extra safety */
|
||||
bool need_infra_poll_audit ; /**< true if we need to poll for infra */
|
||||
bool need_clstr_poll_audit ; /**< true if we need to poll for clstr */
|
||||
char *hostwd_console_path ; /**< console on which to log extreme events */
|
||||
char *mode ; /**< Test Mode String */
|
||||
int testmode ; /**< Test Head Test Mode */
|
||||
|
@ -267,39 +267,39 @@ socklen_t msgClassAddr::getSockLen() const
|
||||
/**
|
||||
* Given an interface, find the hostname that resolves on this interface
|
||||
* and use that to get the IP address of this interface. Will only resolve
|
||||
* hostnames on the Management or Infra interfaces
|
||||
* hostnames on the Management or Cluster-host interfaces
|
||||
*
|
||||
* @param Name of the interface to get address for
|
||||
* @param Character pointer to pass back address of interface
|
||||
* @param Length of character array.
|
||||
* @return Returns PASS if (mgmnt or infra) interface has address, FAIL otherwise
|
||||
* @return Returns PASS if (mgmnt or clstr) interface has address, FAIL otherwise
|
||||
*/
|
||||
int msgClassAddr::getAddressFromInterface(const char* interface, char* address, int len)
|
||||
{
|
||||
int rc = FAIL;
|
||||
|
||||
// before proceeding further, confirm if the interface
|
||||
// is either the management interface or the infra interface.
|
||||
// is either the management interface or the cluster-host interface.
|
||||
// Mtce doesn't care about others besides these.
|
||||
iface_enum interface_type = iface_enum(0);
|
||||
char *infra_iface_name = NULL;
|
||||
char *clstr_iface_name = NULL;
|
||||
|
||||
get_infra_iface(&infra_iface_name);
|
||||
if (infra_iface_name && strlen(infra_iface_name)) {
|
||||
if (!strcmp(interface, infra_iface_name)) {
|
||||
if (!strcmp(infra_iface_name, daemon_mgmnt_iface().data())) {
|
||||
// infra and mgmt interface name are the same
|
||||
get_clstr_iface(&clstr_iface_name);
|
||||
if (clstr_iface_name && strlen(clstr_iface_name)) {
|
||||
if (!strcmp(interface, clstr_iface_name)) {
|
||||
if (!strcmp(clstr_iface_name, daemon_mgmnt_iface().data())) {
|
||||
// cluster-host and mgmt interface name are the same
|
||||
interface_type = MGMNT_IFACE;
|
||||
}
|
||||
else {
|
||||
// requesting address for the infra interface
|
||||
interface_type = INFRA_IFACE;
|
||||
// requesting address for the cluster-host interface
|
||||
interface_type = CLSTR_IFACE;
|
||||
}
|
||||
}
|
||||
free (infra_iface_name);
|
||||
free (clstr_iface_name);
|
||||
}
|
||||
|
||||
if (interface_type != INFRA_IFACE) {
|
||||
if (interface_type != CLSTR_IFACE) {
|
||||
// check if this is the mgmt interface
|
||||
// otherwise return error
|
||||
if (!strcmp(interface, daemon_mgmnt_iface().data())) {
|
||||
@ -325,16 +325,16 @@ int msgClassAddr::getAddressFromInterface(const char* interface, char* address,
|
||||
return rc;
|
||||
}
|
||||
|
||||
// if it is infra then we need to determine the interface
|
||||
// if it is cluster-host then we need to determine the interface
|
||||
// host name. For management interface, the system hostname
|
||||
// is the intf hostname
|
||||
const char* infra_suffix = "-infra";
|
||||
size_t infra_suffix_len = sizeof(infra_suffix);
|
||||
char iface_hostname[MAX_HOST_NAME_SIZE+infra_suffix_len];
|
||||
const char* cluster_host_suffix = "-cluster-host";
|
||||
size_t cluster_host_suffix_len = sizeof(cluster_host_suffix);
|
||||
char iface_hostname[MAX_HOST_NAME_SIZE+cluster_host_suffix_len];
|
||||
memset(iface_hostname, 0, sizeof(iface_hostname));
|
||||
snprintf(iface_hostname, sizeof(iface_hostname),
|
||||
"%s%s", hostname,
|
||||
(((interface_type == INFRA_IFACE)) ? infra_suffix : ""));
|
||||
(((interface_type == CLSTR_IFACE)) ? cluster_host_suffix : ""));
|
||||
|
||||
struct addrinfo *res = NULL;
|
||||
int ret = getaddrinfo(iface_hostname, NULL, NULL, &res);
|
||||
|
@ -167,14 +167,14 @@ int get_netlink_events ( int nl_socket , std::list<string> & links_gone_down,
|
||||
void log_link_events ( int netlink_sock,
|
||||
int ioctl_sock,
|
||||
const char * mgmnt_iface_ptr,
|
||||
const char * infra_iface_ptr,
|
||||
const char * clstr_iface_ptr,
|
||||
bool & mgmnt_link_up_and_running,
|
||||
bool & infra_link_up_and_running)
|
||||
bool & clstr_link_up_and_running)
|
||||
{
|
||||
std::list<string> links_gone_down ;
|
||||
std::list<string> links_gone_up ;
|
||||
std::list<string>::iterator iter_curr_ptr ;
|
||||
dlog3 ("logging for interfaces %s and %s\n", mgmnt_iface_ptr, infra_iface_ptr);
|
||||
dlog3 ("logging for interfaces %s and %s\n", mgmnt_iface_ptr, clstr_iface_ptr);
|
||||
if ( get_netlink_events ( netlink_sock, links_gone_down, links_gone_up ))
|
||||
{
|
||||
bool running = false ;
|
||||
@ -190,7 +190,7 @@ void log_link_events ( int netlink_sock,
|
||||
dlog3 ( "downed link: %s (running:%d:%d)\n",
|
||||
iter_curr_ptr->c_str(),
|
||||
mgmnt_link_up_and_running,
|
||||
infra_link_up_and_running );
|
||||
clstr_link_up_and_running );
|
||||
|
||||
if ( !strcmp (mgmnt_iface_ptr, iter_curr_ptr->data()))
|
||||
{
|
||||
@ -200,12 +200,12 @@ void log_link_events ( int netlink_sock,
|
||||
wlog ("Mgmnt link %s is down\n", mgmnt_iface_ptr );
|
||||
}
|
||||
}
|
||||
if ( !strcmp (infra_iface_ptr, iter_curr_ptr->data()))
|
||||
if ( !strcmp (clstr_iface_ptr, iter_curr_ptr->data()))
|
||||
{
|
||||
if ( infra_link_up_and_running == true )
|
||||
if ( clstr_link_up_and_running == true )
|
||||
{
|
||||
infra_link_up_and_running = false ;
|
||||
wlog ("Infra link %s is down\n", infra_iface_ptr );
|
||||
clstr_link_up_and_running = false ;
|
||||
wlog ("Cluster-host link %s is down\n", clstr_iface_ptr );
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,17 +231,17 @@ void log_link_events ( int netlink_sock,
|
||||
dlog3 ( "recovered link: %s (running:%d:%d)\n",
|
||||
iter_curr_ptr->c_str(),
|
||||
mgmnt_link_up_and_running,
|
||||
infra_link_up_and_running );
|
||||
clstr_link_up_and_running );
|
||||
|
||||
if ( !strcmp (mgmnt_iface_ptr, iter_curr_ptr->data()))
|
||||
{
|
||||
mgmnt_link_up_and_running = true ;
|
||||
wlog ("Mgmnt link %s is up\n", mgmnt_iface_ptr );
|
||||
}
|
||||
if ( !strcmp (infra_iface_ptr, iter_curr_ptr->data()))
|
||||
if ( !strcmp (clstr_iface_ptr, iter_curr_ptr->data()))
|
||||
{
|
||||
infra_link_up_and_running = true ;
|
||||
wlog ("Infra link %s is up\n", infra_iface_ptr );
|
||||
clstr_link_up_and_running = true ;
|
||||
wlog ("Cluster-host link %s is up\n", clstr_iface_ptr );
|
||||
}
|
||||
|
||||
if ( get_link_state ( ioctl_sock, iter_curr_ptr->data(), &running ) == PASS )
|
||||
|
@ -18,7 +18,7 @@ int get_netlink_events ( int nl_socket ,
|
||||
void log_link_events ( int netlink_sock,
|
||||
int ioctl_sock,
|
||||
const char * mgmnt_iface_ptr,
|
||||
const char * infra_iface_ptr,
|
||||
const char * clstr_iface_ptr,
|
||||
bool & mgmnt_link_up_and_running,
|
||||
bool & infra_link_up_and_running);
|
||||
bool & clstr_link_up_and_running);
|
||||
|
||||
|
@ -184,7 +184,7 @@ void daemon_exit ( void );
|
||||
#define MTC_JSON_INV_NAME "hostname"
|
||||
#define MTC_JSON_INV_HOSTIP "mgmt_ip"
|
||||
#define MTC_JSON_INV_HOSTMAC "mgmt_mac"
|
||||
#define MTC_JSON_INV_INFRAIP "infra_ip"
|
||||
#define MTC_JSON_INV_CLSTRIP "cluster_host_ip"
|
||||
#define MTC_JSON_INV_AVAIL "availability"
|
||||
#define MTC_JSON_INV_OPER "operational"
|
||||
#define MTC_JSON_INV_ADMIN "administrative"
|
||||
@ -376,12 +376,7 @@ void daemon_exit ( void );
|
||||
#define STORAGE_0 ((const char *)"storage-0")
|
||||
#define STORAGE_1 ((const char *)"storage-1")
|
||||
|
||||
/* The infrastructure networking floating IP
|
||||
*
|
||||
* Note: If there is no infra then this label will resolve
|
||||
* to another floating IP on the management network.
|
||||
*
|
||||
* If there is no Infra network then this label is not and should not be used */
|
||||
/* This label will resolve to an IP on the management network */
|
||||
#define CONTROLLER_NFS ((const char *)"controller-nfs")
|
||||
|
||||
#define CGTS_NODE_TYPES 4
|
||||
@ -400,7 +395,7 @@ void daemon_exit ( void );
|
||||
|
||||
/** Interface Codes **/
|
||||
#define MGMNT_INTERFACE (0)
|
||||
#define INFRA_INTERFACE (1)
|
||||
#define CLSTR_INTERFACE (1)
|
||||
|
||||
|
||||
/** Maintenance Inventory struct */
|
||||
@ -412,7 +407,7 @@ typedef struct
|
||||
std::string name ;
|
||||
std::string ip ;
|
||||
std::string mac ;
|
||||
std::string infra_ip ;
|
||||
std::string clstr_ip ;
|
||||
std::string admin ;
|
||||
std::string oper ;
|
||||
std::string avail ;
|
||||
@ -634,7 +629,7 @@ typedef struct
|
||||
#define PMOND_MISSING_THRESHOLD (100) /**< Count before degrade */
|
||||
#define NULL_PULSE_FLAGS (0xffffffff) /**< Unknown flags value */
|
||||
#define PMOND_FLAG (0x00000001) /**< Process Monitor O.K. Flag */
|
||||
#define INFRA_FLAG (0x00000002) /**< Infrastructure iface provisioned Flag */
|
||||
#define CLSTR_FLAG (0x00000002) /**< Cluster-host iface provisioned Flag */
|
||||
|
||||
#define CTRLX_MASK (0x00000300) /**< From/To Controller-0/1/2/3 Number */
|
||||
#define CTRLX_BIT ((unsigned int)8) /**< used to shift right mask into bit 0 */
|
||||
@ -961,7 +956,7 @@ string get_configStages_str ( mtc_configStages_enum stage );
|
||||
* inservice test, etc. */
|
||||
#define DEGRADE_MASK_NONE 0x00000000
|
||||
#define DEGRADE_MASK_HEARTBEAT_MGMNT 0x00000001
|
||||
#define DEGRADE_MASK_HEARTBEAT_INFRA 0x00000002
|
||||
#define DEGRADE_MASK_HEARTBEAT_CLSTR 0x00000002
|
||||
#define DEGRADE_MASK_PMON 0x00000004
|
||||
#define DEGRADE_MASK_INSV_TEST 0x00000008
|
||||
#define DEGRADE_MASK_AVS_MAJOR 0x00000010
|
||||
@ -1189,7 +1184,7 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
MGMNT_IFACE = 0,
|
||||
INFRA_IFACE = 1,
|
||||
CLSTR_IFACE = 1,
|
||||
MAX_IFACES = 2
|
||||
} iface_enum ;
|
||||
|
||||
|
@ -766,26 +766,26 @@ int get_iface_address ( const char * iface_ptr, string & ip_addr , bool retry )
|
||||
return (rc);
|
||||
}
|
||||
|
||||
void get_infra_iface ( char ** infra_iface_ptr )
|
||||
void get_clstr_iface ( char ** clstr_iface_ptr )
|
||||
{
|
||||
char * iface_ptr ;
|
||||
string infra = daemon_infra_iface();
|
||||
string clstr = daemon_clstr_iface();
|
||||
|
||||
/* remove .None from the interface name if it exists */
|
||||
size_t found = infra.find(".None");
|
||||
size_t found = clstr.find(".None");
|
||||
if ( found != string::npos)
|
||||
{
|
||||
infra.erase(found, string::npos);
|
||||
clstr.erase(found, string::npos);
|
||||
}
|
||||
if ( infra.size() )
|
||||
if ( clstr.size() )
|
||||
{
|
||||
iface_ptr = daemon_get_iface_master ( (char*)infra.data());
|
||||
*infra_iface_ptr = strdup((const char*)iface_ptr);
|
||||
dlog("Infra iface : %s\n", *infra_iface_ptr );
|
||||
iface_ptr = daemon_get_iface_master ( (char*)clstr.data());
|
||||
*clstr_iface_ptr = strdup((const char*)iface_ptr);
|
||||
dlog("Clstr iface : %s\n", *clstr_iface_ptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
*infra_iface_ptr = strdup((const char*)"");
|
||||
*clstr_iface_ptr = strdup((const char*)"");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1347,7 +1347,7 @@ int get_pid_by_name_proc ( string procname )
|
||||
|
||||
|
||||
const char mgmnt_iface_str[] = { "Mgmnt" } ;
|
||||
const char infra_iface_str[] = { "Infra" } ;
|
||||
const char clstr_iface_str[] = { "Clstr" } ;
|
||||
const char null_iface_str[] = { "Null" } ;
|
||||
|
||||
const char * get_iface_name_str ( int iface )
|
||||
@ -1356,8 +1356,8 @@ const char * get_iface_name_str ( int iface )
|
||||
{
|
||||
case MGMNT_IFACE:
|
||||
return mgmnt_iface_str;
|
||||
case INFRA_IFACE:
|
||||
return infra_iface_str;
|
||||
case CLSTR_IFACE:
|
||||
return clstr_iface_str;
|
||||
default:
|
||||
return null_iface_str ;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ int get_ip_addresses ( string & my_hostname , string & my_local_ip , string &
|
||||
int get_iface_address ( const char * iface_ptr, string & ip_addr , bool retry );
|
||||
int get_iface_hostname ( const char * iface_ptr, char * hostname_ptr);
|
||||
int get_iface_macaddr ( const char * iface_ptr , string & macaddr );
|
||||
void get_infra_iface ( char ** infra_iface_ptr );
|
||||
void get_clstr_iface ( char ** clstr_iface_ptr );
|
||||
int get_hostname ( char * hostname_ptr, int max_len );
|
||||
string get_iface_mac ( const char * iface_ptr );
|
||||
|
||||
|
@ -121,7 +121,7 @@
|
||||
#define FAIL_JSON_OBJECT (97)
|
||||
#define FAIL_EXTERNAL_API (98)
|
||||
#define FAIL_PATCH_INPROGRESS (99)
|
||||
#define FAIL_NO_INFRA_PROV (100)
|
||||
#define FAIL_NO_CLSTR_PROV (100)
|
||||
#define FAIL_PATCHED_NOREBOOT (101)
|
||||
#define FAIL_NOT_SUPPORTED (102)
|
||||
#define FAIL_NO_DATA (103)
|
||||
|
@ -78,7 +78,7 @@ int daemon_get_file_int ( const char * filename );
|
||||
string daemon_get_file_str ( const char * filename );
|
||||
|
||||
string daemon_nodetype ( void );
|
||||
string daemon_infra_iface ( void );
|
||||
string daemon_clstr_iface ( void );
|
||||
string daemon_mgmnt_iface ( void );
|
||||
string daemon_sw_version ( void );
|
||||
string daemon_bmc_hosts_file ( void );
|
||||
@ -206,7 +206,7 @@ int daemon_run_testhead ( void );
|
||||
#define CONFIG_AGENT_MULTICAST 0x00000004 /**< Multicase Addr */
|
||||
#define CONFIG_SCHED_PRIORITY 0x00000008 /**< Scheduling priority */
|
||||
#define CONFIG_AGENT_HBS_MGMNT_PORT 0x00000010 /**< Management Pulse Rx Port */
|
||||
#define CONFIG_AGENT_HBS_INFRA_PORT 0x00000020 /**< Infra Pulse Rx Port */
|
||||
#define CONFIG_AGENT_HBS_CLSTR_PORT 0x00000020 /**< Cluster-host Pulse Rx Port*/
|
||||
#define CONFIG_AGENT_HBS_DEGRADE 0x00000040 /**< Heartbeat degrade */
|
||||
#define CONFIG_AGENT_HBS_FAILURE 0x00000080 /**< Heartbeat failure */
|
||||
#define CONFIG_AGENT_INV_PORT 0x00000100 /**< Inventory Port Number */
|
||||
@ -218,13 +218,13 @@ int daemon_run_testhead ( void );
|
||||
#define CONFIG_AGENT_HBS_MTC_PORT 0x00004000 /**< Heartbeat Service Port */
|
||||
#define CONFIG_AGENT_INV_EVENT_PORT 0x00008000 /**< Inventory Event Port */
|
||||
#define CONFIG_AGENT_API_RETRIES 0x00010000 /**< Num api retries b4 fail */
|
||||
#define CONFIG_AGENT_MTC_INFRA_PORT 0x00020000 /**< Agent Infr network port */
|
||||
#define CONFIG_AGENT_MTC_MGMNT_PORT 0x00040000 /**< Agent Infr network port */
|
||||
#define CONFIG_AGENT_MTC_CLSTR_PORT 0x00020000 /**< Agent Clstr network port */
|
||||
#define CONFIG_AGENT_MTC_MGMNT_PORT 0x00040000 /**< Agent Mgmnt network port */
|
||||
#define CONFIG_AGENT_TOKEN_REFRESH 0x00080000 /**< Token refresh rate mask */
|
||||
#define CONFIG_CLIENT_MTC_INFRA_PORT 0x00100000 /**< Client Infra nwk mtc port */
|
||||
#define CONFIG_CLIENT_MTC_CLSTR_PORT 0x00100000 /**< Client Clstr nwk mtc port */
|
||||
#define CONFIG_CLIENT_MTC_MGMNT_PORT 0x00200000 /**< Client mgmnt nwk mtc port */
|
||||
#define CONFIG_AGENT_SM_SERVER_PORT 0x00400000 /**< Port to RX data from SM */
|
||||
#define CONFIG_CLIENT_HBS_INFRA_PORT 0x00800000 /**< Infrastructure ntwk Port */
|
||||
#define CONFIG_CLIENT_HBS_CLSTR_PORT 0x00800000 /**< Cluster-host ntwk Port */
|
||||
#define CONFIG_CLIENT_HBS_MGMNT_PORT 0x01000000 /**< Management network Port */
|
||||
#define CONFIG_CLIENT_HBS_EVENT_PORT 0x02000000 /**< Heartbeat Event Messaging */
|
||||
#define CONFIG_MTC_TO_HBS_CMD_PORT 0x04000000 /**< Mtce to Hbs Command Port */
|
||||
|
@ -42,7 +42,7 @@ void daemon_config_default ( daemon_config_type* config_ptr )
|
||||
config_ptr->keystone_region_name = strdup("none");
|
||||
config_ptr->sysinv_mtc_inv_label = strdup("none");
|
||||
config_ptr->mgmnt_iface = strdup("none");
|
||||
config_ptr->infra_iface = strdup("none");
|
||||
config_ptr->clstr_iface = strdup("none");
|
||||
config_ptr->sysinv_api_bind_ip = strdup("none");
|
||||
config_ptr->mode = strdup("none");
|
||||
config_ptr->fit_host = strdup("none");
|
||||
@ -294,8 +294,8 @@ void daemon_dump_cfg ( void )
|
||||
ilog ("Configuration Settings ...\n");
|
||||
if ( ptr->scheduling_priority ) { ilog ("scheduling_priority = %d\n", ptr->scheduling_priority ); }
|
||||
|
||||
if ( ptr->infra_degrade_only ) { ilog ("infra_degrade_only = %s\n", ptr->infra_degrade_only ? "Yes" : "No" );}
|
||||
if ( ptr->need_infra_poll_audit ) { ilog ("need_infra_poll_audit = %s\n", ptr->need_infra_poll_audit ? "Yes" : "No" );}
|
||||
if ( ptr->clstr_degrade_only ) { ilog ("clstr_degrade_only = %s\n", ptr->clstr_degrade_only ? "Yes" : "No" );}
|
||||
if ( ptr->need_clstr_poll_audit ) { ilog ("need_clstr_poll_audit = %s\n", ptr->need_clstr_poll_audit ? "Yes" : "No" );}
|
||||
if ( ptr->active ) { ilog ("active = %s\n", ptr->active ? "Yes" : "No" );}
|
||||
|
||||
/* hbsAgent */
|
||||
@ -305,7 +305,7 @@ void daemon_dump_cfg ( void )
|
||||
if ( ptr->hbs_failure_threshold ) { ilog ("hbs_failure_threshold = %d\n", ptr->hbs_failure_threshold );}
|
||||
|
||||
if ( strcmp(ptr->mgmnt_iface, "none" )) { ilog ("mgmnt_iface = %s\n", ptr->mgmnt_iface ); }
|
||||
if ( strcmp(ptr->infra_iface, "none" )) { ilog ("infra_iface = %s\n", ptr->infra_iface );}
|
||||
if ( strcmp(ptr->clstr_iface, "none" )) { ilog ("clstr_iface = %s\n", ptr->clstr_iface );}
|
||||
if ( strcmp(ptr->multicast, "none" )) { ilog ("multicast = %s\n", ptr->multicast );}
|
||||
|
||||
if ( ptr->ha_port ) { ilog ("ha_port = %d\n", ptr->ha_port );}
|
||||
@ -331,9 +331,9 @@ void daemon_dump_cfg ( void )
|
||||
if ( ptr->barbican_api_host ) { ilog ("barbican_api_host = %s\n", ptr->barbican_api_host );}
|
||||
|
||||
if ( ptr->mtc_rx_mgmnt_port ) { ilog ("mtc_rx_mgmnt_port = %d\n", ptr->mtc_rx_mgmnt_port );}
|
||||
if ( ptr->mtc_rx_infra_port ) { ilog ("mtc_rx_infra_port = %d\n", ptr->mtc_rx_infra_port );}
|
||||
if ( ptr->mtc_rx_clstr_port ) { ilog ("mtc_rx_clstr_port = %d\n", ptr->mtc_rx_clstr_port );}
|
||||
if ( ptr->mtc_tx_mgmnt_port ) { ilog ("mtc_tx_mgmnt_port = %d\n", ptr->mtc_tx_mgmnt_port );}
|
||||
if ( ptr->mtc_tx_infra_port ) { ilog ("mtc_tx_infra_port = %d\n", ptr->mtc_tx_infra_port );}
|
||||
if ( ptr->mtc_tx_clstr_port ) { ilog ("mtc_tx_clstr_port = %d\n", ptr->mtc_tx_clstr_port );}
|
||||
if ( ptr->agent_rx_port ) { ilog ("agent_rx_port = %d\n", ptr->agent_rx_port );}
|
||||
if ( ptr->client_rx_port ) { ilog ("client_rx_port = %d\n", ptr->client_rx_port );}
|
||||
if ( ptr->mtc_to_hbs_cmd_port ) { ilog ("mtc_to_hbs_cmd_port = %d\n", ptr->mtc_to_hbs_cmd_port );}
|
||||
|
@ -267,12 +267,12 @@ int debug_config_handler ( void * user,
|
||||
ilog ("Event Filter: %s\n", config_ptr->debug_event );
|
||||
}
|
||||
}
|
||||
else if (MATCH("debug", "infra_degrade_only"))
|
||||
else if (MATCH("debug", "clstr_degrade_only"))
|
||||
{
|
||||
config_ptr->infra_degrade_only = atoi(value);
|
||||
if ( config_ptr->infra_degrade_only )
|
||||
config_ptr->clstr_degrade_only = atoi(value);
|
||||
if ( config_ptr->clstr_degrade_only )
|
||||
{
|
||||
ilog ("Infra Degrad: true\n" );
|
||||
ilog ("Cluster-host Degrad: true\n" );
|
||||
}
|
||||
}
|
||||
else if (MATCH("debug", "testmode"))
|
||||
|
@ -289,7 +289,7 @@ int daemon_get_rmem_max ( void )
|
||||
* Read the platform.conf file looking for the management_interface label.
|
||||
* If found return that value as string ; otherwise return empty string.
|
||||
*
|
||||
* const char infra_mgmt_label [] = {"management_interface"} ;
|
||||
* const char clstr_mgmt_label [] = {"management_interface"} ;
|
||||
*
|
||||
* Stay here till we get the data we need
|
||||
* Warning: Don't enable logging here
|
||||
@ -464,13 +464,13 @@ system_type_enum daemon_system_type ( void )
|
||||
|
||||
/* ********************************************************************
|
||||
*
|
||||
* Name: daemon_infra_iface
|
||||
* Name: daemon_clstr_iface
|
||||
*
|
||||
* Description: Read the platform.conf file looking for the infra
|
||||
* Description: Read the platform.conf file looking for the cluster-host
|
||||
* interface label. If found return that value as string ;
|
||||
* otherwise return empty string.
|
||||
**/
|
||||
string daemon_infra_iface ( void )
|
||||
string daemon_clstr_iface ( void )
|
||||
{
|
||||
char buffer [BUFFER];
|
||||
int line = 0 ;
|
||||
@ -482,17 +482,17 @@ string daemon_infra_iface ( void )
|
||||
int rc ;
|
||||
while ( fgets (buffer, BUFFER, cfg_file_stream) != NULL )
|
||||
{
|
||||
char* s = strstr ( buffer, "infrastructure_interface" );
|
||||
char* s = strstr ( buffer, "cluster_host_interface" );
|
||||
if(s!=NULL)
|
||||
{
|
||||
char iface_str[BUFFER];
|
||||
memset ( iface_str, 0 , BUFFER );
|
||||
rc = sscanf ( &buffer[0], "infrastructure_interface=%1023s", &iface_str[0] );
|
||||
rc = sscanf ( &buffer[0], "cluster_host_interface=%1023s", &iface_str[0] );
|
||||
if ( rc == 1 )
|
||||
{
|
||||
iface = iface_str ;
|
||||
fclose(cfg_file_stream);
|
||||
// ilog("Infra iface : %s\n", iface.c_str() );
|
||||
// ilog("Cluster-host iface : %s\n", iface.c_str() );
|
||||
return ( iface ) ;
|
||||
}
|
||||
}
|
||||
@ -501,7 +501,7 @@ string daemon_infra_iface ( void )
|
||||
/* Close the file */
|
||||
fclose(cfg_file_stream);
|
||||
}
|
||||
dlog("Infra iface : none\n");
|
||||
dlog("Cluster-host iface : none\n");
|
||||
return ( "" );
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
|
||||
|
||||
%description -n mtce-lmon
|
||||
Titanium Cloud Maintenance Link Monitor service (lmond) provides
|
||||
netlink monitoring for provisioned oam, mgmt and infra interfaces.
|
||||
netlink monitoring for provisioned oam, mgmt and cluster-host interfaces.
|
||||
|
||||
%define local_dir /usr/local
|
||||
%define local_bindir %{local_dir}/bin
|
||||
|
@ -53,7 +53,7 @@ void alarm_unregister_user ( void )
|
||||
}
|
||||
|
||||
/* Construct an alarm request json string in the following form
|
||||
{\"mtcalarm\":[{\"alarmid\":\"200.009\",\"hostname\":\"compute-3\",\"operation\":\"set\",\"severity\":\"major\",\"entity\":\"Infrastructure\",\"prefix\":\"service=heartbeat\"}, {\"alarmid\":\"200.005\",\"hostname\":\"compute-3\",\"operation\":\"set\",\"severity\":\"major\",\"entity\":\"Management\",\"prefix\":\"service=heartbeat\"}]}"
|
||||
{\"mtcalarm\":[{\"alarmid\":\"200.009\",\"hostname\":\"compute-3\",\"operation\":\"set\",\"severity\":\"major\",\"entity\":\"cluster-host\",\"prefix\":\"service=heartbeat\"}, {\"alarmid\":\"200.005\",\"hostname\":\"compute-3\",\"operation\":\"set\",\"severity\":\"major\",\"entity\":\"Management\",\"prefix\":\"service=heartbeat\"}]}"
|
||||
|
||||
or
|
||||
|
||||
@ -64,7 +64,7 @@ void alarm_unregister_user ( void )
|
||||
\"hostname\":\"compute-3\",
|
||||
\"operation\":\"set\",
|
||||
\"severity\":\"major\",
|
||||
\"entity\":\"Infrastructure\",
|
||||
\"entity\":\"cluster-host\",
|
||||
\"prefix\":\"service=heartbeat\"
|
||||
}
|
||||
]
|
||||
|
@ -34,7 +34,7 @@
|
||||
#define MGMNT_HB_ALARM_ID ((const char *)"200.005")
|
||||
#define PMOND_ALARM_ID ((const char *)"200.006")
|
||||
#define SENSOR_ALARM_ID ((const char *)"200.007") /* Sensor read alarm ; i.e. the sensor read value bad */
|
||||
#define INFRA_HB_ALARM_ID ((const char *)"200.009")
|
||||
#define CLSTR_HB_ALARM_ID ((const char *)"200.009")
|
||||
#define BM_ALARM_ID ((const char *)"200.010")
|
||||
#define CONFIG_ALARM_ID ((const char *)"200.011")
|
||||
#define CH_CONT_ALARM_ID ((const char *)"200.012") /* Combo Host Controller Failure - with Active Compute */
|
||||
@ -52,7 +52,7 @@
|
||||
typedef enum
|
||||
{
|
||||
HBS_ALARM_ID__HB_MGMNT = 0,
|
||||
HBS_ALARM_ID__HB_INFRA = 1,
|
||||
HBS_ALARM_ID__HB_CLSTR = 1,
|
||||
HBS_ALARM_ID__PMOND = 2,
|
||||
HBS_ALARM_ID__SERVICE = 3,
|
||||
HBS_ALARM_ID__LAST = 4,
|
||||
@ -103,7 +103,7 @@ typedef struct
|
||||
|
||||
/* Test Commandss
|
||||
*
|
||||
STR="{\"mtcalarm\":[{\"alarmid\":\"200.009\",\"hostname\":\"compute-3\",\"operation\":\"clear\",\"severity\":\"clear\",\"entity\":\"Infrastructure\",\"prefix\":\"service=heartbeat\"}, {\"alarmid\":\"200.005\",\"hostname\":\"compute-3\",\"operation\":\"set\",\"severity\":\"major\",\"entity\":\"Management\",\"prefix\":\"service=heartbeat\"}]}"
|
||||
STR="{\"mtcalarm\":[{\"alarmid\":\"200.009\",\"hostname\":\"compute-3\",\"operation\":\"clear\",\"severity\":\"clear\",\"entity\":\"cluster-host\",\"prefix\":\"service=heartbeat\"}, {\"alarmid\":\"200.005\",\"hostname\":\"compute-3\",\"operation\":\"set\",\"severity\":\"major\",\"entity\":\"Management\",\"prefix\":\"service=heartbeat\"}]}"
|
||||
PROTOCOL="UDP4-DATAGRAM"
|
||||
ADDRESS="127.0.0.1"
|
||||
port="2122"
|
||||
|
@ -60,8 +60,8 @@ void alarmData_init ( void )
|
||||
|
||||
alarm_id_table[HBS_ALARM_ID__HB_MGMNT].identity_str = MGMNT_HB_ALARM_ID ;
|
||||
alarm_id_table[HBS_ALARM_ID__HB_MGMNT].identity_num = HBS_ALARM_ID__HB_MGMNT ;
|
||||
alarm_id_table[HBS_ALARM_ID__HB_INFRA].identity_str = INFRA_HB_ALARM_ID;
|
||||
alarm_id_table[HBS_ALARM_ID__HB_INFRA].identity_num = HBS_ALARM_ID__HB_INFRA;
|
||||
alarm_id_table[HBS_ALARM_ID__HB_CLSTR].identity_str = CLSTR_HB_ALARM_ID;
|
||||
alarm_id_table[HBS_ALARM_ID__HB_CLSTR].identity_num = HBS_ALARM_ID__HB_CLSTR;
|
||||
alarm_id_table[HBS_ALARM_ID__PMOND].identity_str = PMOND_ALARM_ID;
|
||||
alarm_id_table[HBS_ALARM_ID__PMOND].identity_num = HBS_ALARM_ID__PMOND;
|
||||
alarm_id_table[HBS_ALARM_ID__SERVICE].identity_str = SERVICESTATUS_LOG_ID;
|
||||
@ -99,23 +99,23 @@ void alarmData_init ( void )
|
||||
"If problem consistently occurs after that and Host is reset, then"
|
||||
"contact next level of support or lock and replace failing Host.");
|
||||
|
||||
/** Infrastructure Network Heartbeat Alarm ************************************/
|
||||
/** Cluster-host Network Heartbeat Alarm ************************************/
|
||||
|
||||
ptr = &alarm_list[HBS_ALARM_ID__HB_INFRA];
|
||||
ptr = &alarm_list[HBS_ALARM_ID__HB_CLSTR];
|
||||
memset (&ptr->alarm, 0, (sizeof(SFmAlarmDataT)));
|
||||
snprintf(&ptr->alarm.alarm_id[0], FM_MAX_BUFFER_LENGTH, "%s", INFRA_HB_ALARM_ID);
|
||||
snprintf(&ptr->alarm.alarm_id[0], FM_MAX_BUFFER_LENGTH, "%s", CLSTR_HB_ALARM_ID);
|
||||
|
||||
ptr->name = "Infrastructure Network' Heartbeat" ;
|
||||
ptr->name = "Cluster-host Network' Heartbeat" ;
|
||||
ptr->instc_prefix = "network=" ;
|
||||
|
||||
ptr->critl_reason = "experienced a persistent critical 'Infrastructure Network' "
|
||||
ptr->critl_reason = "experienced a persistent critical 'Cluster-host Network' "
|
||||
"communication failure.";
|
||||
|
||||
ptr->major_reason =
|
||||
ptr->minor_reason = "is experiencing intermittent 'Infrastructure Network' "
|
||||
ptr->minor_reason = "is experiencing intermittent 'Cluster-host Network' "
|
||||
"communication failures that have exceeded its lower alarming threshold.";
|
||||
|
||||
ptr->clear_reason = "'Infrastructure Network' Heartbeat has 'resumed' if host is 'unlocked' "
|
||||
ptr->clear_reason = "'Cluster-host Network' Heartbeat has 'resumed' if host is 'unlocked' "
|
||||
"or 'stopped' if host is 'locked or deleted'";
|
||||
|
||||
ptr->alarm.alarm_type = FM_ALARM_COMM ;
|
||||
@ -128,7 +128,7 @@ void alarmData_init ( void )
|
||||
ptr->alarm.alarm_state = FM_ALARM_STATE_CLEAR ; /* Dynamic */
|
||||
|
||||
snprintf( ptr->alarm.proposed_repair_action, FM_MAX_BUFFER_LENGTH,
|
||||
"Check 'Infrastructure Network' connectivity and support for multicast messaging."
|
||||
"Check 'Cluster-host Network' connectivity and support for multicast messaging."
|
||||
"If problem consistently occurs after that and Host is reset, then"
|
||||
"contact next level of support or lock and replace failing Host.");
|
||||
|
||||
|
@ -46,9 +46,9 @@ EFmAlarmSeverityT alarmUtil_getSev_enum ( string sev )
|
||||
int alarmUtil_getId_enum ( string alarmid, alarm_id_enum & id )
|
||||
{
|
||||
/* Get the ID */
|
||||
if ( alarmid.compare(INFRA_HB_ALARM_ID) == 0 )
|
||||
if ( alarmid.compare(CLSTR_HB_ALARM_ID) == 0 )
|
||||
{
|
||||
id = HBS_ALARM_ID__HB_INFRA ;
|
||||
id = HBS_ALARM_ID__HB_CLSTR ;
|
||||
}
|
||||
else if ( alarmid.compare(MGMNT_HB_ALARM_ID) == 0 )
|
||||
{
|
||||
|
@ -291,14 +291,14 @@ nodeLinkClass::nodeLinkClass()
|
||||
/* Start with no failures */
|
||||
mnfa_awol_list.clear();
|
||||
mnfa_host_count[MGMNT_IFACE] = 0 ;
|
||||
mnfa_host_count[INFRA_IFACE] = 0 ;
|
||||
mnfa_host_count[CLSTR_IFACE] = 0 ;
|
||||
mnfa_occurances = 0 ;
|
||||
mnfa_active = false ;
|
||||
|
||||
mgmnt_link_up_and_running = false ;
|
||||
infra_link_up_and_running = false ;
|
||||
infra_network_provisioned = false ;
|
||||
infra_degrade_only = false ;
|
||||
clstr_link_up_and_running = false ;
|
||||
clstr_network_provisioned = false ;
|
||||
clstr_degrade_only = false ;
|
||||
|
||||
dor_mode_active = false ;
|
||||
dor_start_time = 0 ;
|
||||
@ -497,8 +497,8 @@ nodeLinkClass::node* nodeLinkClass::addNode( string hostname )
|
||||
|
||||
ptr->ip = "" ;
|
||||
ptr->mac = "" ;
|
||||
ptr->infra_ip = "" ;
|
||||
ptr->infra_mac = "" ;
|
||||
ptr->clstr_ip = "" ;
|
||||
ptr->clstr_mac = "" ;
|
||||
|
||||
ptr->patching = false ;
|
||||
ptr->patched = false ;
|
||||
@ -554,9 +554,9 @@ nodeLinkClass::node* nodeLinkClass::addNode( string hostname )
|
||||
|
||||
ptr->offline_search_count = 0 ;
|
||||
ptr->mtcAlive_mgmnt = false ;
|
||||
ptr->mtcAlive_infra = false ;
|
||||
ptr->mtcAlive_clstr = false ;
|
||||
ptr->reboot_cmd_ack_mgmnt = false ;
|
||||
ptr->reboot_cmd_ack_infra = false ;
|
||||
ptr->reboot_cmd_ack_clstr = false ;
|
||||
|
||||
ptr->offline_log_throttle = 0 ;
|
||||
ptr->offline_log_reported = true ;
|
||||
@ -783,8 +783,8 @@ struct nodeLinkClass::node* nodeLinkClass::getNode ( string hostname )
|
||||
{
|
||||
return ptr ;
|
||||
}
|
||||
/* Node can be looked up by infra_ip addr too */
|
||||
if ( !hostname.compare ( ptr->infra_ip ))
|
||||
/* Node can be looked up by cluster_host_ip addr too */
|
||||
if ( !hostname.compare ( ptr->clstr_ip ))
|
||||
{
|
||||
return ptr ;
|
||||
}
|
||||
@ -1172,7 +1172,7 @@ void nodeLinkClass::print_node_info ( void )
|
||||
{
|
||||
for ( int i = 0 ; i < MAX_IFACES ; i++ )
|
||||
{
|
||||
if (( i == INFRA_IFACE ) && ( infra_network_provisioned == false ))
|
||||
if (( i == CLSTR_IFACE ) && ( clstr_network_provisioned == false ))
|
||||
continue ;
|
||||
|
||||
syslog ( LOG_INFO, "+--------------+-----+-------+-------+-------+-------+------------+----------+-----------------+\n");
|
||||
@ -2330,17 +2330,17 @@ int nodeLinkClass::mod_host ( node_inv_type & inv )
|
||||
|
||||
modify = true ; /* we have a delta */
|
||||
}
|
||||
if ( node_ptr->infra_ip.compare ( inv.infra_ip ) )
|
||||
if ( node_ptr->clstr_ip.compare ( inv.clstr_ip ) )
|
||||
{
|
||||
if (( hostUtil_is_valid_ip_addr ( inv.infra_ip )) || ( hostUtil_is_valid_ip_addr ( node_ptr->infra_ip )))
|
||||
if (( hostUtil_is_valid_ip_addr ( inv.clstr_ip )) || ( hostUtil_is_valid_ip_addr ( node_ptr->clstr_ip )))
|
||||
{
|
||||
plog ("%s Modify 'infra_ip' from %s -> %s\n",
|
||||
plog ("%s Modify 'clstr_ip' from %s -> %s\n",
|
||||
node_ptr->hostname.c_str(),
|
||||
node_ptr->infra_ip.c_str(), inv.infra_ip.c_str() );
|
||||
node_ptr->clstr_ip.c_str(), inv.clstr_ip.c_str() );
|
||||
|
||||
modify = true ; /* we have a delta */
|
||||
}
|
||||
node_ptr->infra_ip = inv.infra_ip ;
|
||||
node_ptr->clstr_ip = inv.clstr_ip ;
|
||||
}
|
||||
if ( (!inv.name.empty()) && (node_ptr->hostname.compare ( inv.name)) )
|
||||
{
|
||||
@ -2708,7 +2708,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
|
||||
node_ptr->ip = inv.ip ;
|
||||
node_ptr->mac = inv.mac ;
|
||||
node_ptr->uuid = inv.uuid ;
|
||||
node_ptr->infra_ip = inv.infra_ip ;
|
||||
node_ptr->clstr_ip = inv.clstr_ip ;
|
||||
|
||||
if ( inv.uptime.length() )
|
||||
{
|
||||
@ -3256,13 +3256,13 @@ string nodeLinkClass::get_hostaddr ( string & hostname )
|
||||
return ( null_str );
|
||||
}
|
||||
|
||||
string nodeLinkClass::get_infra_hostaddr ( string & hostname )
|
||||
string nodeLinkClass::get_clstr_hostaddr ( string & hostname )
|
||||
{
|
||||
nodeLinkClass::node* node_ptr ;
|
||||
node_ptr = nodeLinkClass::getNode ( hostname );
|
||||
if ( node_ptr != NULL )
|
||||
{
|
||||
return ( node_ptr->infra_ip );
|
||||
return ( node_ptr->clstr_ip );
|
||||
}
|
||||
return ( null_str );
|
||||
}
|
||||
@ -3275,8 +3275,8 @@ string nodeLinkClass::get_hostIfaceMac ( string & hostname, int iface )
|
||||
{
|
||||
if ( iface == MGMNT_IFACE )
|
||||
return ( node_ptr->mac );
|
||||
if ( iface == INFRA_IFACE )
|
||||
return ( node_ptr->infra_mac );
|
||||
if ( iface == CLSTR_IFACE )
|
||||
return ( node_ptr->clstr_mac );
|
||||
}
|
||||
ilog ("%s has unknown mac address for %s interface\n", hostname.c_str(), get_iface_name_str(iface));
|
||||
return ( null_str );
|
||||
@ -3296,7 +3296,7 @@ int nodeLinkClass::set_hostaddr ( string & hostname, string & ip )
|
||||
return ( rc );
|
||||
}
|
||||
|
||||
int nodeLinkClass::set_infra_hostaddr ( string & hostname, string & ip )
|
||||
int nodeLinkClass::set_clstr_hostaddr ( string & hostname, string & ip )
|
||||
{
|
||||
int rc = FAIL ;
|
||||
|
||||
@ -3304,7 +3304,7 @@ int nodeLinkClass::set_infra_hostaddr ( string & hostname, string & ip )
|
||||
node_ptr = nodeLinkClass::getNode ( hostname );
|
||||
if ( node_ptr != NULL )
|
||||
{
|
||||
node_ptr->infra_ip = ip ;
|
||||
node_ptr->clstr_ip = ip ;
|
||||
rc = PASS ;
|
||||
}
|
||||
return ( rc );
|
||||
@ -3499,9 +3499,9 @@ void nodeLinkClass::set_mtcAlive ( string & hostname, int interface )
|
||||
node_ptr->mtcAlive_offline = false ;
|
||||
node_ptr->mtcAlive_count++ ;
|
||||
|
||||
if ( interface == INFRA_INTERFACE )
|
||||
if ( interface == CLSTR_INTERFACE )
|
||||
{
|
||||
node_ptr->mtcAlive_infra = true ;
|
||||
node_ptr->mtcAlive_clstr = true ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4265,7 +4265,7 @@ int nodeLinkClass::service_netlink_events ( int nl_socket , int ioctl_socket )
|
||||
if ( get_netlink_events ( nl_socket, links_gone_down, links_gone_up ))
|
||||
{
|
||||
const char * mgmnt_iface_ptr = daemon_get_cfg_ptr()->mgmnt_iface ;
|
||||
const char * infra_iface_ptr = daemon_get_cfg_ptr()->infra_iface ;
|
||||
const char * clstr_iface_ptr = daemon_get_cfg_ptr()->clstr_iface ;
|
||||
bool running = false ;
|
||||
if ( !links_gone_down.empty() )
|
||||
{
|
||||
@ -4285,11 +4285,11 @@ int nodeLinkClass::service_netlink_events ( int nl_socket , int ioctl_socket )
|
||||
mgmnt_link_up_and_running = false ;
|
||||
wlog ("Management link %s is down\n", mgmnt_iface_ptr );
|
||||
}
|
||||
if ( !strcmp (infra_iface_ptr, iter_curr_ptr->data()))
|
||||
if ( !strcmp (clstr_iface_ptr, iter_curr_ptr->data()))
|
||||
{
|
||||
care = true ;
|
||||
infra_link_up_and_running = false ;
|
||||
wlog ("Infrastructure link %s is down\n", infra_iface_ptr );
|
||||
clstr_link_up_and_running = false ;
|
||||
wlog ("Cluster-host link %s is down\n", clstr_iface_ptr );
|
||||
}
|
||||
|
||||
if ( care == true )
|
||||
@ -4321,10 +4321,10 @@ int nodeLinkClass::service_netlink_events ( int nl_socket , int ioctl_socket )
|
||||
mgmnt_link_up_and_running = true ;
|
||||
wlog ("Management link %s is up\n", mgmnt_iface_ptr );
|
||||
}
|
||||
if ( !strcmp (infra_iface_ptr, iter_curr_ptr->data()))
|
||||
if ( !strcmp (clstr_iface_ptr, iter_curr_ptr->data()))
|
||||
{
|
||||
infra_link_up_and_running = true ;
|
||||
wlog ("Infrastructure link %s is up\n", infra_iface_ptr );
|
||||
clstr_link_up_and_running = true ;
|
||||
wlog ("Cluster-host link %s is up\n", clstr_iface_ptr );
|
||||
}
|
||||
if ( care == true )
|
||||
{
|
||||
@ -4515,8 +4515,8 @@ void nodeLinkClass::manage_heartbeat_failure ( string hostname, iface_enum iface
|
||||
|
||||
plog ("%s %s Heartbeat failure clear\n", hostname.c_str(), get_iface_name_str(iface));
|
||||
|
||||
// if (( mnfa_host_count == 0 ) || ( iface == INFRA_IFACE ))
|
||||
if ( mnfa_host_count[iface] == 0 ) // || ( iface == INFRA_IFACE ))
|
||||
// if (( mnfa_host_count == 0 ) || ( iface == CLSTR_IFACE ))
|
||||
if ( mnfa_host_count[iface] == 0 ) // || ( iface == CLSTR_IFACE ))
|
||||
{
|
||||
slog ("%s %s Heartbeat failure clear\n", hostname.c_str(), get_iface_name_str(iface));
|
||||
node_ptr->hbs_failure[iface] = false ;
|
||||
@ -4553,9 +4553,9 @@ void nodeLinkClass::manage_heartbeat_failure ( string hostname, iface_enum iface
|
||||
if ( mnfa_active == false )
|
||||
{
|
||||
elog ("%s %s *** Heartbeat Loss ***\n", hostname.c_str(), get_iface_name_str(iface));
|
||||
if ( iface == INFRA_IFACE )
|
||||
if ( iface == CLSTR_IFACE )
|
||||
{
|
||||
node_ptr->heartbeat_failed[INFRA_IFACE] = true ;
|
||||
node_ptr->heartbeat_failed[CLSTR_IFACE] = true ;
|
||||
}
|
||||
else if ( iface == MGMNT_IFACE )
|
||||
{
|
||||
@ -4610,10 +4610,10 @@ void nodeLinkClass::manage_heartbeat_clear ( string hostname, iface_enum iface )
|
||||
node_ptr->alarms[HBS_ALARM_ID__HB_MGMNT] = FM_ALARM_SEVERITY_CLEAR ;
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_MGMNT ;
|
||||
}
|
||||
if ( i == INFRA_IFACE )
|
||||
if ( i == CLSTR_IFACE )
|
||||
{
|
||||
node_ptr->alarms[HBS_ALARM_ID__HB_INFRA] = FM_ALARM_SEVERITY_CLEAR ;
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_INFRA ;
|
||||
node_ptr->alarms[HBS_ALARM_ID__HB_CLSTR] = FM_ALARM_SEVERITY_CLEAR ;
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_CLSTR ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4625,10 +4625,10 @@ void nodeLinkClass::manage_heartbeat_clear ( string hostname, iface_enum iface )
|
||||
node_ptr->alarms[HBS_ALARM_ID__HB_MGMNT] = FM_ALARM_SEVERITY_CLEAR ;
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_MGMNT ;
|
||||
}
|
||||
else if ( iface == INFRA_IFACE )
|
||||
else if ( iface == CLSTR_IFACE )
|
||||
{
|
||||
node_ptr->alarms[HBS_ALARM_ID__HB_INFRA] = FM_ALARM_SEVERITY_CLEAR ;
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_INFRA ;
|
||||
node_ptr->alarms[HBS_ALARM_ID__HB_CLSTR] = FM_ALARM_SEVERITY_CLEAR ;
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_CLSTR ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4655,10 +4655,10 @@ void nodeLinkClass::manage_heartbeat_degrade ( string hostname, iface_enum iface
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_MGMNT ;
|
||||
}
|
||||
|
||||
else if ( iface == INFRA_IFACE )
|
||||
else if ( iface == CLSTR_IFACE )
|
||||
{
|
||||
node_ptr->no_work_log_throttle = 0 ;
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_INFRA ;
|
||||
node_ptr->degrade_mask &= ~DEGRADE_MASK_HEARTBEAT_CLSTR ;
|
||||
}
|
||||
|
||||
hbs_minor_clear ( node_ptr, iface );
|
||||
@ -4686,11 +4686,11 @@ void nodeLinkClass::manage_heartbeat_degrade ( string hostname, iface_enum iface
|
||||
node_ptr->degrade_mask |= DEGRADE_MASK_HEARTBEAT_MGMNT ;
|
||||
}
|
||||
}
|
||||
if ( iface == INFRA_IFACE )
|
||||
if ( iface == CLSTR_IFACE )
|
||||
{
|
||||
if ( !(node_ptr->degrade_mask & DEGRADE_MASK_HEARTBEAT_INFRA) )
|
||||
if ( !(node_ptr->degrade_mask & DEGRADE_MASK_HEARTBEAT_CLSTR) )
|
||||
{
|
||||
node_ptr->degrade_mask |= DEGRADE_MASK_HEARTBEAT_INFRA ;
|
||||
node_ptr->degrade_mask |= DEGRADE_MASK_HEARTBEAT_CLSTR ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7310,9 +7310,9 @@ int nodeLinkClass::mon_host ( const string & hostname, bool true_false, bool sen
|
||||
bool want_log = true ;
|
||||
for ( int iface = 0 ; iface < MAX_IFACES ; iface++ )
|
||||
{
|
||||
if ( iface == INFRA_IFACE )
|
||||
if ( iface == CLSTR_IFACE )
|
||||
{
|
||||
if ( this->infra_network_provisioned == false )
|
||||
if ( this->clstr_network_provisioned == false )
|
||||
continue ;
|
||||
|
||||
if ( node_ptr->monitor[MGMNT_IFACE] == true_false )
|
||||
@ -7438,21 +7438,21 @@ void nodeLinkClass::manage_pulse_flags ( struct nodeLinkClass::node * node_ptr,
|
||||
return ;
|
||||
}
|
||||
|
||||
/* Code that manages enabling of Infrastructrure network moonitoring
|
||||
/* Code that manages enabling of Cluster-host network monitoring
|
||||
*
|
||||
* Algorithm: Only monitor a hosts infrastructure network while the
|
||||
* Algorithm: Only monitor a hosts cluster-host network while the
|
||||
* management network of that same host is being monitored
|
||||
* and while that host indicates support for the infrastructure
|
||||
* network by setting the INFRA_FLAG in its management network
|
||||
* and while that host indicates support for the cluster-host
|
||||
* network by setting the CLSTR_FLAG in its management network
|
||||
* pulse responses. */
|
||||
if ( node_ptr->monitor[MGMNT_IFACE] == false )
|
||||
{
|
||||
node_ptr->monitor[INFRA_IFACE] = false ;
|
||||
node_ptr->monitor[CLSTR_IFACE] = false ;
|
||||
}
|
||||
else if ( flags & INFRA_FLAG )
|
||||
else if ( flags & CLSTR_FLAG )
|
||||
{
|
||||
/* TODO: Does this need to be debounced ??? */
|
||||
node_ptr->monitor[INFRA_IFACE] = true ;
|
||||
node_ptr->monitor[CLSTR_IFACE] = true ;
|
||||
}
|
||||
|
||||
/* A host indicates that its process monitor is running by setting the
|
||||
@ -8034,9 +8034,9 @@ void nodeLinkClass::manage_heartbeat_alarm ( struct nodeLinkClass::node * node_p
|
||||
}
|
||||
else
|
||||
{
|
||||
entity_ptr = INFRA_NAME ;
|
||||
id = HBS_ALARM_ID__HB_INFRA ;
|
||||
alarm_id_ptr = INFRA_HB_ALARM_ID;
|
||||
entity_ptr = CLSTR_NAME ;
|
||||
id = HBS_ALARM_ID__HB_CLSTR ;
|
||||
alarm_id_ptr = CLSTR_HB_ALARM_ID;
|
||||
}
|
||||
|
||||
if ( sev == FM_ALARM_SEVERITY_CLEAR )
|
||||
@ -8239,11 +8239,11 @@ int nodeLinkClass::lost_pulses ( iface_enum iface, bool & storage_0_responding )
|
||||
}
|
||||
}
|
||||
|
||||
/* Turn the infra heartbeat loss into a degrade only
|
||||
* condition if the infra_degrade_only flag is set */
|
||||
if (( iface == INFRA_IFACE ) &&
|
||||
/* Turn the cluster-host heartbeat loss into a degrade only
|
||||
* condition if the clstr_degrade_only flag is set */
|
||||
if (( iface == CLSTR_IFACE ) &&
|
||||
( pulse_ptr->b2b_misses_count[iface] >= hbs_failure_threshold ) &&
|
||||
( infra_degrade_only == true ))
|
||||
( clstr_degrade_only == true ))
|
||||
{
|
||||
/* Only print the log at the threshold boundary */
|
||||
if (( pulse_ptr->b2b_misses_count[iface]%HBS_LOSS_REPORT_THROTTLE) == hbs_failure_threshold )
|
||||
@ -8260,9 +8260,9 @@ int nodeLinkClass::lost_pulses ( iface_enum iface, bool & storage_0_responding )
|
||||
}
|
||||
}
|
||||
|
||||
/* Turn the infra heartbeat loss into a degrade only
|
||||
/* Turn the clstr heartbeat loss into a degrade only
|
||||
* condition for inactive controller on normal system. */
|
||||
else if (( iface == INFRA_IFACE ) &&
|
||||
else if (( iface == CLSTR_IFACE ) &&
|
||||
( pulse_ptr->b2b_misses_count[iface] >= hbs_failure_threshold ) &&
|
||||
( this->system_type == SYSTEM_TYPE__NORMAL ) &&
|
||||
(( pulse_ptr->nodetype & CONTROLLER_TYPE) == CONTROLLER_TYPE ))
|
||||
@ -8405,8 +8405,8 @@ void nodeLinkClass::mem_log_general ( void )
|
||||
my_float_ip.c_str(),
|
||||
daemon_get_cfg_ptr()->mgmnt_iface,
|
||||
mgmnt_link_up_and_running ? "Up" : "Down",
|
||||
daemon_get_cfg_ptr()->infra_iface,
|
||||
infra_link_up_and_running ? "Up" : "Down");
|
||||
daemon_get_cfg_ptr()->clstr_iface,
|
||||
clstr_link_up_and_running ? "Up" : "Down");
|
||||
mem_log (str);
|
||||
}
|
||||
|
||||
@ -8433,7 +8433,7 @@ void nodeLinkClass::mem_log_mnfa ( void )
|
||||
my_hostname.c_str(),
|
||||
mnfa_active ? "ACTIVE" : "inactive",
|
||||
mnfa_host_count[MGMNT_IFACE],
|
||||
mnfa_host_count[INFRA_IFACE],
|
||||
mnfa_host_count[CLSTR_IFACE],
|
||||
mnfa_threshold,
|
||||
mnfa_occurances);
|
||||
mem_log (str);
|
||||
@ -8591,11 +8591,11 @@ void nodeLinkClass::mem_log_reset_info ( struct nodeLinkClass::node * node_ptr )
|
||||
void nodeLinkClass::mem_log_network ( struct nodeLinkClass::node * node_ptr )
|
||||
{
|
||||
char str[MAX_MEM_LOG_DATA] ;
|
||||
snprintf (&str[0], MAX_MEM_LOG_DATA, "%s\t%s %s infra_ip: %s Uptime: %u\n",
|
||||
snprintf (&str[0], MAX_MEM_LOG_DATA, "%s\t%s %s cluster_host_ip: %s Uptime: %u\n",
|
||||
node_ptr->hostname.c_str(),
|
||||
node_ptr->mac.c_str(),
|
||||
node_ptr->ip.c_str(),
|
||||
node_ptr->infra_ip.c_str(),
|
||||
node_ptr->clstr_ip.c_str(),
|
||||
node_ptr->uptime );
|
||||
mem_log (str);
|
||||
}
|
||||
|
@ -115,11 +115,11 @@ private:
|
||||
/** The Mac address of the host node */
|
||||
std::string mac ;
|
||||
|
||||
/** The infrastructure network IP address of the host node */
|
||||
std::string infra_ip ;
|
||||
/** The cluster-host network IP address of the host node */
|
||||
std::string clstr_ip ;
|
||||
|
||||
/** The Mac address of the host's infra interface */
|
||||
std::string infra_mac ;
|
||||
/** The Mac address of the host's cluster-host interface */
|
||||
std::string clstr_mac ;
|
||||
|
||||
/** The type of node 'controller' or 'worker' node */
|
||||
std::string type ;
|
||||
@ -305,7 +305,7 @@ private:
|
||||
int mtcAlive_purge ;
|
||||