You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Being able to adopt nodes is a necessity when losing the ironic DB or
rebuilding the metalbox during upgrades or disaster recovery.
The mechanism allows to force adoption by specifiying the `--adopt`
option during baremetal sync. Nodes will automatically be adopted if
they have their `provision_state set to `active` in the NetBox.
Signed-off-by: Jan Horstmann <horstmann@osism.tech>
@@ -430,8 +435,8 @@ def _sync_ironic_device(request_id, device, node_attributes, ports_attributes, f
430
435
request_id,
431
436
f"Baremetal node for {device.name} is manageable\n",
432
437
)
433
-
# NOTE: Ironic keeps the power state found during enroll. We set the nodepower state to off in order to have a defined state for all newly synced nodes
# NOTE: Ironic keeps the power state found during enroll. We set the node power state to off in order to have a defined state for all newly synced nodes
435
440
osism_utils.push_task_output(
436
441
request_id,
437
442
f"Setting power state to 'power off' for {device.name}\n",
@@ -449,40 +454,73 @@ def _sync_ironic_device(request_id, device, node_attributes, ports_attributes, f
449
454
request_id,
450
455
f"Validation of boot interface successful for baremetal node for {device.name}\n",
# Note: Prepare adoption of available nodes by moving them to manageable
453
459
osism_utils.push_task_output(
454
460
request_id,
455
-
f"Transitioning baremetal node to available state for {device.name}\n",
461
+
f"Prepare adoption of available baremetal node by transitioning to manageable state for {device.name}\n",
456
462
)
457
-
ifnode["automated_clean"]:
458
-
# NOTE: Skip automated cleaning on transition from managable to available. We are waiting for the transition and do not want to wait on cleaning at this point
f"Transitioning baremetal node to available state for {device.name}\n",
493
+
)
494
+
ifnode["automated_clean"]:
495
+
# NOTE: Skip automated cleaning on transition from managable to available. We are waiting for the transition and do not want to wait on cleaning at this point
496
+
node=openstack.baremetal_node_update(
497
+
node["uuid"], dict(automated_clean=False)
498
+
)
499
+
try:
500
+
openstack.baremetal_node_set_boot_device(
501
+
node["uuid"], "cdrom", persistent=False
502
+
)
503
+
exceptException:
504
+
osism_utils.push_task_output(
505
+
request_id,
506
+
f"Could not set boot device to cdrom for {device.name}, continuing\n",
0 commit comments