55
66
77from understack_workflows import ironic_node
8- from understack_workflows .sync_interfaces import update_ironic_baremetal_ports
9- from understack_workflows import topology
108from understack_workflows .bmc import Bmc
119from understack_workflows .bmc import bmc_for_ip_address
1210from understack_workflows .bmc_bios import update_dell_bios_settings
1311from understack_workflows .bmc_credentials import set_bmc_password
1412from understack_workflows .bmc_hostname import bmc_set_hostname
1513from understack_workflows .bmc_settings import update_dell_drac_settings
1614from understack_workflows .discover import discover_chassis_info
17- from understack_workflows .helpers import credential
1815from understack_workflows .helpers import setup_logger
1916
2017logger = setup_logger (__name__ )
2724def main ():
2825 """On-board new or Refresh existing baremetal node.
2926
30- We have been invoked because a baremetal node is available.
31-
32- Pre-requisites:
33-
34- All connected switches must be known to us via the base MAC address in our
35- data center yaml data.
36-
37- The server Device type must exist, with a name that matches the "model" as
38- reported by the BMC.
39-
40- This script has the following order of operations:
41-
4227 - connect to the BMC using standard password, if that fails then use
4328 password supplied in --old-bmc-password option, or factory default
4429
4530 - ensure standard BMC password is set
4631
4732 - if DHCP, set permanent IP address, netmask, default gw
4833
49- - if server is off, power it on and wait (otherwise LLDP doesn't work)
50-
5134 - TODO: create and install SSL certificate
5235
5336 - TODO: set NTP Server IPs for DRAC
@@ -56,6 +39,7 @@ def main():
5639 - Using BMC, configure our standard BIOS settings
5740 - set PXE boot device
5841 - set timezone to UTC
42+ - set the hostname
5943
6044 - from BMC, discover basic hardware info:
6145 - manufacturer, model number, serial number
@@ -65,11 +49,9 @@ def main():
6549 - MAC address
6650 - LLDP connections [{remote_mac, remote_interface_name}]
6751
68- - Determine flavor of the server based on the information collected from BMC
69-
7052 - Find or create this baremetal node in Ironic
71- - create baremetal ports for each NIC except BMC. Set one of them to PXE.
72- - set flavor
53+ - set the name to "{manufacturer}-{servicetag}"
54+ - set the driver as appropriate
7355 """
7456 args = argument_parser ().parse_args ()
7557
@@ -99,27 +81,18 @@ def enroll_server(bmc: Bmc, old_password: str | None) -> str:
9981
10082 update_dell_drac_settings (bmc )
10183
102- pxe_interface = topology .pxe_interface_name (device_info .interfaces )
103-
10484 bmc_set_hostname (bmc , device_info .bmc_hostname , device_name )
10585
10686 # Note the above may require a restart of the DRAC, which in turn may delete
10787 # any pending BIOS jobs, so do BIOS settings after the DRAC settings.
108- update_dell_bios_settings (bmc , pxe_interface = pxe_interface )
88+ update_dell_bios_settings (bmc )
10989
11090 node = ironic_node .create_or_update (
11191 bmc = bmc ,
11292 name = device_name ,
11393 manufacturer = device_info .manufacturer ,
11494 )
11595 logger .info ("%s _ironic_provision_state=%s" , device_name , node .provision_state )
116-
117- update_ironic_baremetal_ports (
118- ironic_node = node ,
119- discovered_interfaces = device_info .interfaces ,
120- pxe_interface_name = pxe_interface ,
121- )
122-
12396 logger .info ("%s complete for %s" , __file__ , bmc .ip_address )
12497
12598 return node .uuid
0 commit comments