Deprovision mtcClient bmc info when bmc for node is deprovisioned
A node's BMC is provisioned and deprovisioned through the system CLI. Maintenance shares controller node BMC provisioning info with the mtcClient on each controller node. The mtcClient uses this BMC provisioning info to reset its peer controller when it sees the appropriate signal from SM (a flag file). However, when a controller node's BMC is deprovisioned from the system CLI, the mtcAgent does not send a the deprovisioned data to the mtcClient. Without getting the deprovisioning data the mtcClient will continue to use the previous provisioning data. This is incorrect and the reason for this fix. This update fixes this by having the mtcAgent periodically share controller node BMC provisioning data to each controller's mtcClient regardless of its provisioning state. The BMC provisioning data update period remains the same as it was while the BMCs were provisioned. This update also offers the followiong messaging/logging improvements. - restrict the updates to the management network only. There is no need to send the same data over the pxeboot. - stop logging while the BMC is deprovisioned. The absence/presence of the logs is sufficient to know what the provisioning state is without needlessly logging when the BMCs are not provisioned. - bypasses sending the bmc provisioning data to the controller-0 mtcClient in an SX system. The data is only needed in a DX system. Test Plan: PASS: Verify mtcClient gets BMC deprovisioning data ; fix for this bug. PASS: Verify mtcClient periodically logs valid BMC provisioning data. PASS: Verify mtcClient doesn't log unprovisioned BMC provisioning data. PASS: Verify mtcAgent does not send bmc provision data on SX systems. PASS: Verify mtcAgent does send bmc provision data on DX systems. PASS: Verify worker and storage never receive bmc provisioning data. Closes-Bug: 2067925 Change-Id: I29e5eb0b072ee38358d99d682555c466de322f2d Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
This commit is contained in:
parent
42253f7b25
commit
508b619400
@ -506,27 +506,23 @@ int mtc_service_inbox ( nodeLinkClass * obj_ptr,
|
||||
}
|
||||
obj_ptr->declare_service_ready ( hostname, MTC_SERVICE_MTCCLIENT, features );
|
||||
|
||||
/* if this ready event is from the mtcClient of a
|
||||
* controller that has valid bmc access info then
|
||||
* build the 'peer controller kill' mtcInfo and
|
||||
* send it to that mtcClient */
|
||||
if ( obj_ptr->get_nodetype ( hostname ) & CONTROLLER_TYPE )
|
||||
/* The mtcInfo in this context currently only contains
|
||||
* bmc provisioning info for the purpose of telling
|
||||
* the mtcClient what its peer bmc priovisioning data is.
|
||||
*
|
||||
* No need to send this on an SX system as there
|
||||
* is no peer controller.
|
||||
*
|
||||
* The network check avoids sending duplicate on
|
||||
* the pxeboot network.
|
||||
*
|
||||
* Only applies to mtcClients that run on controllers */
|
||||
if (( iface == MGMNT_INTERFACE ) &&
|
||||
( obj_ptr->system_type != SYSTEM_TYPE__AIO__SIMPLEX ) &&
|
||||
( obj_ptr->get_nodetype ( hostname ) & CONTROLLER_TYPE ))
|
||||
{
|
||||
string bm_pw = obj_ptr->get_bm_pw ( hostname ) ;
|
||||
if ( !bm_pw.empty() && ( bm_pw != NONE ))
|
||||
{
|
||||
string bm_un = obj_ptr->get_bm_un ( hostname ) ;
|
||||
string bm_ip = obj_ptr->get_bm_ip ( hostname ) ;
|
||||
if (( hostUtil_is_valid_username ( bm_un )) &&
|
||||
( hostUtil_is_valid_ip_addr ( bm_ip )))
|
||||
{
|
||||
send_mtc_cmd ( hostname,
|
||||
MTC_MSG_INFO,
|
||||
MGMNT_INTERFACE,
|
||||
obj_ptr->build_mtcInfo_dict (
|
||||
MTC_INFO_CODE__PEER_CONTROLLER_KILL_INFO));
|
||||
}
|
||||
}
|
||||
send_mtc_cmd ( hostname, MTC_MSG_INFO, MGMNT_INTERFACE,
|
||||
obj_ptr->build_mtcInfo_dict ( MTC_INFO_CODE__PEER_CONTROLLER_KILL_INFO));
|
||||
}
|
||||
return (PASS);
|
||||
}
|
||||
|
@ -2375,16 +2375,20 @@ void load_mtcInfo_msg ( mtc_message_type & msg )
|
||||
peer_controller.bm_un = jsonUtil_get_key_value_string(ctrl_obj, "bm_un");
|
||||
peer_controller.bm_pw = jsonUtil_get_key_value_string(ctrl_obj, "bm_pw");
|
||||
|
||||
/* log the mc info but not the bmc password ; only
|
||||
* indicate that it looks 'ok' or 'is 'none' */
|
||||
ilog ("%s is my peer [host:%s bmc:%s:%s:%s]",
|
||||
peer_controller.hostname.c_str(),
|
||||
peer_controller.host_ip.c_str(),
|
||||
peer_controller.bm_ip.c_str(),
|
||||
peer_controller.bm_un.c_str(),
|
||||
hostUtil_is_valid_pw(peer_controller.bm_pw) ? "ok":"none");
|
||||
/* Log the mc info but not the bmc password.
|
||||
* Only indicate that it looks 'ok' or 'is 'none'.
|
||||
* However, don't log if the bmc ip is none */
|
||||
if ( peer_controller.bm_ip.compare("none") )
|
||||
{
|
||||
ilog ("%s is my peer [host:%s bmc:%s:%s:%s]",
|
||||
peer_controller.hostname.c_str(),
|
||||
peer_controller.host_ip.c_str(),
|
||||
peer_controller.bm_ip.c_str(),
|
||||
peer_controller.bm_un.c_str(),
|
||||
hostUtil_is_valid_pw(peer_controller.bm_pw) ? "ok":"none");
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ( ctrl.system_type != SYSTEM_TYPE__AIO__SIMPLEX )
|
||||
{
|
||||
wlog("peer mtcInfo missing (rc:%d) ; %s",
|
||||
json_rc, &msg.buf[0]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user