Skip to content

Commit fa8a62b

Browse files
committed
Don't touch any Ironic interfaces during enrol workflow
Interfaces are to be managed by a post-inspection hook
1 parent 2dad3cf commit fa8a62b

File tree

4 files changed

+5
-267
lines changed

4 files changed

+5
-267
lines changed

python/understack-workflows/understack_workflows/bmc_bios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def required_bios_settings(pxe_interface: str) -> dict:
2020
}
2121

2222

23-
def update_dell_bios_settings(bmc: Bmc, pxe_interface="NIC.Slot.1-1") -> dict:
23+
def update_dell_bios_settings(bmc: Bmc, pxe_interface="NIC.Integrated.1-1") -> dict:
2424
"""Check and update BIOS settings to standard as required.
2525
2626
Any changes take effect on next server reboot.

python/understack-workflows/understack_workflows/data_center.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

python/understack-workflows/understack_workflows/main/enroll_server.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55

66

77
from understack_workflows import ironic_node
8-
from understack_workflows.sync_interfaces import update_ironic_baremetal_ports
9-
from understack_workflows import topology
108
from understack_workflows.bmc import Bmc
119
from understack_workflows.bmc import bmc_for_ip_address
1210
from understack_workflows.bmc_bios import update_dell_bios_settings
1311
from understack_workflows.bmc_credentials import set_bmc_password
1412
from understack_workflows.bmc_hostname import bmc_set_hostname
1513
from understack_workflows.bmc_settings import update_dell_drac_settings
1614
from understack_workflows.discover import discover_chassis_info
17-
from understack_workflows.helpers import credential
1815
from understack_workflows.helpers import setup_logger
1916

2017
logger = setup_logger(__name__)
@@ -27,27 +24,13 @@
2724
def 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

python/understack-workflows/understack_workflows/sync_interfaces.py

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)