Changing BMC Address
There are situations where you may need to change the BMC (Baseboard Management Controller) address of a BareMetalHost:
- The BMC hardware has failed and been replaced
- The BMC network configuration has changed (e.g., IP address reassignment)
- A mistake was made when initially setting the BMC address
- Network infrastructure changes require BMC address updates
This document explains how to update the BMC address of an existing BareMetalHost.
When Can the BMC Address Be Changed?
The BMC address can be updated in the following scenarios:
-
When the host is in the
registeringstate - This is the initial state when a BareMetalHost is first created and Ironic is attempting to register it. -
When the host is detached - By using the detached annotation, you can temporarily remove the host from Ironic’s management, update the BMC address, and then reattach it.
The BMC address cannot be changed while the host is actively managed by Ironic in other states without first detaching it.
Procedure for changing the BMC address
-
Check the current status of your BareMetalHost(s):
$ kubectl get baremetalhost -o wide NAME STATUS STATE CONSUMER BMC ONLINE ERROR AGE bmh1 detached provisioned metal3-k8s-426jf redfish-virtualmedia://192.168.1.32 true 108d bmh2 OK registering redfish-virtualmedia://192.168.1.33 true 3s -
If the state is
registeringor the status isdetached, you can directly edit the BMC address. -
If this is not the case, you need to detach the host first. NOTE: Make sure it is in a stable provisioning state, e.g.
ProvisionedorAvailablebefore this!kubectl annotate baremetalhost -n <namespace> <host-name> \ baremetalhost.metal3.io/detached="updating-bmc" -
Wait for the host to become detached:
kubectl -n <namespace> wait baremetalhost <host-name> --for=jsonpath='{.status.operationalStatus}'=detached -
Edit the BareMetalHost resource:
kubectl edit baremetalhost -n <namespace> <host-name> -
Update the
spec.bmc.addressfield to the new BMC address:spec: bmc: address: redfish://192.168.1.100 # Update to new address credentialsName: host-bmc-secret -
If needed, also update the BMC credentials secret.
-
Remove the detached annotation to reattach the host:
kubectl annotate baremetalhost -n <namespace> <host-name> \ baremetalhost.metal3.io/detached-Note the trailing
-which removes the annotation. -
Wait for the host to be reattached:
kubectl -n <namespace> wait baremetalhost <host-name> --for=jsonpath='{.status.operationalStatus}'=OK
Important Considerations
-
Ensure stable state: Do not try to change the BMC address in the middle of other operations, or if external processes or tools are interacting with the host. Make sure it is in a stable provisioning state, e.g.
ProvisionedorAvailablebefore considering a change. -
Host state is preserved: When you detach and reattach a host, the provisioning state is preserved. A
Provisionedhost will remainProvisioned, and anAvailablehost will remainAvailable. -
No deprovisioning occurs: Using the detached annotation ensures that the host is not deprovisioned when you update the BMC address.
-
BMC credentials: If the BMC replacement also changed the username or password, make sure to update the credentials secret before removing the detached annotation.
-
MAC address remains the same: The
bootMACAddressshould remain unchanged even when the BMC is replaced, as it refers to the server’s network interface, not the BMC.
Related Documentation
- Detaching Hosts from Provisioner - Detailed information about the detached annotation