From 5e0ebce300f639ce4083910f13668b45582e6745 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 29 Mar 2021 16:58:03 -0400 Subject: [PATCH] Add logs for offering boot Make it easier to debug a failure to boot due to misconfiguration. --- confluent_server/confluent/discovery/protocols/pxe.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/confluent_server/confluent/discovery/protocols/pxe.py b/confluent_server/confluent/discovery/protocols/pxe.py index 0882e737..7dba1850 100644 --- a/confluent_server/confluent/discovery/protocols/pxe.py +++ b/confluent_server/confluent/discovery/protocols/pxe.py @@ -494,6 +494,7 @@ def check_reply(node, info, packet, sock, cfg, reqview): log.log({'error': nicerr}) if niccfg.get('ipv4_broken', False): # Received a request over a nic with no ipv4 configured, ignore it + log.log({'error': 'Skipping boot reply to {0} due to no viable IPv4 configuration on deployment system'.format(node)}) return clipn = None if niccfg['ipv4_address'] and niccfg['ipv4_method'] != 'firmwaredhcp': @@ -557,6 +558,16 @@ def check_reply(node, info, packet, sock, cfg, reqview): staticassigns[fulladdr] = (clipn, repview[:replen + 28].tobytes()) elif fulladdr in staticassigns: del staticassigns[fulladdr] + if httpboot: + boottype = 'HTTP' + else: + boottype = 'PXE' + if clipn: + ipinfo = 'with static address {0}'.format(niccfg['ipv4_address']) + else: + ipinfo = 'without address' + log.log({ + 'info': 'Offering {0} boot {1} to {2}'.format(boottype, ipinfo, node)}) send_raw_packet(repview, replen + 28, reqview, info) def send_raw_packet(repview, replen, reqview, info):