diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index fa1377626..b5746eeff 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -334,6 +334,9 @@ rmdir \"/tmp/$userid\" \n") if not nic: return self.callback.error('Can not get facing NIC for %s' % bmcip, node) + if (netinfo[nic]['ipsrc'] == 'DHCP'): + return self.callback.error('BMC IP source is DHCP, could not set NTPServers', node) + try: obmc.set_ntp_servers(nic, servers) self.callback.info('%s: BMC Setting NTPServers...' % node) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 10b11257c..a01f4527d 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -3532,6 +3532,11 @@ sub rspconfig_response { if (defined($content{Address}) and $content{Address}) { if ($content{Address} eq $node_info{$node}{bmcip} and $node_info{$node}{cur_status} eq "RSPCONFIG_GET_NIC_RESPONSE") { $status_info{RSPCONFIG_SET_NTPSERVERS_REQUEST}{init_url} =~ s/#NIC#/$nic/g; + if (defined($content{Origin}) and $content{Origin} =~ /DHCP$/) { + xCAT::SvrUtils::sendmsg([1, "BMC IP source is DHCP, could not set NTPServers"], $callback, $node); + $wait_node_num--; + return; + } if ($next_status{"RSPCONFIG_GET_NIC_RESPONSE"}) { $node_info{$node}{cur_status} = $next_status{"RSPCONFIG_GET_NIC_RESPONSE"}; gen_send_request($node);