-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
4.18.z
-
None
-
None
-
False
-
-
None
-
Moderate
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description:
When `openshift-baremetal-install create cluster` fails on a baremetal IPI cluster configured with `provisioningNetwork: Disabled`, the installer's automatic post-failure debug log gather fails with the following error:
```
level=warning msg="Failed to extract host addresses: open /home/kni/clusterconfigs/.masters.json: no such file or directory"
level=error msg="Attempted to gather debug logs after installation failure: must provide bootstrap host address"
```
Root Cause (from install log analysis):
The installer's gather logic attempts to resolve the bootstrap host address by reading `/home/kni/clusterconfigs/.masters.json`. This path is hardcoded (or incorrectly resolved) and does not match the actual install directory passed via `--dir ./`. When `provisioningNetwork: Disabled` is set, the bootstrap VM is created via libvirt on the external/baremetal bridge and acquires its IP via DHCP — the `.masters.json` file is either never written in this flow, or is written to a different directory than where the gather code expects to find it.
Additionally, although `bootstrapExternalStaticIP` is a valid `install-config.yaml` field (which the customer configured), the gather logic does not fall back to reading it from the state file or install config when `.masters.json` is absent.
Steps to Reproduce:
1. Configure a baremetal IPI cluster with `provisioningNetwork: Disabled` and a static bootstrap IP.
2. Run: `openshift-baremetal-install create cluster --log-level debug --dir ./`
3. Allow the installation to fail for any reason (e.g., API VIP unreachable during bootstrap phase).
4. Observe the gather failure in the installer output:
```
Failed to extract host addresses: open /home/kni/clusterconfigs/.masters.json: no such file or directory
Attempted to gather debug logs after installation failure: must provide bootstrap host address
```
Relevant install-config.yaml (sanitized):
platform: baremetal: provisioningNetwork: "Disabled" externalBridge: "baremetal" bootstrapExternalStaticIP: 192.168.0.10 bootstrapExternalStaticGateway: 192.168.0.1 apiVIPs: 192.168.0.1 ingressVIPs: 192.168.0.2
Expected Behavior:
When the installation fails, the installer should automatically gather bootstrap debug logs, equivalent to running:
openshift-baremetal-install gather bootstrap --bootstrap <bootstrap_ip> --dir ./
The installer should resolve the bootstrap IP from:
1. `.masters.json` (if present at the correct `--dir` path), OR
2. `bootstrapExternalStaticIP` from the install config / state file as a fallback, OR
3. The libvirt domain network interface if the bootstrap VM was created locally.
Actual Behavior:
The automated gather is completely skipped. The user must manually run `gather bootstrap` after the fact, which loses the ability to capture logs at the exact time of failure.
Workaround:
After installation failure, manually run:
openshift-baremetal-install gather bootstrap --bootstrap <bootstrap_static_ip> --dir ./
Additional Context:
- Bootstrap VM is confirmed reachable via SSH at the time of gather failure — so the issue is purely the installer failing to resolve the bootstrap IP, not bootstrap unavailability.
- The `--dir` argument passed is `./` (relative path); the installer looks for `.masters.json` in `/home/kni/clusterconfigs/` — a path mismatch that may be relevant.