Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2017805

Summary: No relevant status in case you create bmh withouut infraenv
Product: OpenShift Container Platform Reporter: Rei <rhalle>
Component: assisted-installerAssignee: Nobody <nobody>
assisted-installer sub component: discovery-agent QA Contact: Yuri Obshansky <yobshans>
Status: CLOSED NOTABUG Docs Contact:
Severity: high    
Priority: unspecified CC: aos-bugs, mfilanov
Version: 4.9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-28 10:53:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rei 2021-10-27 12:57:44 UTC
Description of problem:
You can create BMH with infraenvs reference that isn't exists and node will stay in "ready" till you create the relevant infraenvs   

Version-Release number of selected component (if applicable):


How reproducible:
4.9.0-0.nightly-2021-10-26-021742

Steps to Reproduce:
1. create namespace my namespace "oc  new-project mynamespace"
2.create bmh
cat << EOF | oc apply -f -
 ---
apiVersion: v1
data:
  password: cGFzc3dvcmQ=
  username: YWRtaW4=
kind: Secret
metadata:
  name: spoke-master-3-0-bmc-secret
  namespace: spoke-3
type: Opaque
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
  name: mybmh
  namespace: mynamespace
  annotations:
    inspect.metal3.io: disabled
    bmac.agent-install.openshift.io/hostname: "myhostname"
    bmac.agent-install.openshift.io/role: "master"
  labels:
    infraenvs.agent-install.openshift.io: "somenoneexsitsinfraenv"
spec:
  bmc:
    address: redfish-virtualmedia+https://[machine-ip]:8000/redfish/v1/Systems/<aace9b63-b57f-4376-91f6-f2d765e454ba>
    credentialsName: spoke-master-3-0-bmc-secret
    disableCertificateVerification: true
  bootMACAddress: <machinemac>
  automatedCleaningMode: disabled
  online: true
EOF

3.

Actual results:
root@seal23 ~]# oc get bmh -n spoke-3  spoke-master-3-0-bmh  -o yaml
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
  annotations:
    bmac.agent-install.openshift.io/hostname: spoke-master-3-0
    bmac.agent-install.openshift.io/role: master
    inspect.metal3.io: disabled
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"metal3.io/v1alpha1","kind":"BareMetalHost","metadata":{"annotations":{"bmac.agent-install.openshift.io/hostname":"spoke-master-3-0","bmac.agent-install.openshift.io/role":"master","inspect.metal3.io":"disabled"},"labels":{"infraenvs.agent-install.openshift.io":"spoke-3"},"name":"spoke-master-3-0-bmh","namespace":"spoke-3"},"spec":{"automatedCleaningMode":"disabled","bmc":{"address":"redfish-virtualmedia+https://[fd2e:6f44:5dd8::1]:8000/redfish/v1/Systems/aace9b63-b57f-4376-91f6-f2d765e454ba","credentialsName":"spoke-master-3-0-bmc-secret","disableCertificateVerification":true},"bootMACAddress":"52:54:00:f6:03:9b","online":true}}
  creationTimestamp: "2021-10-27T12:37:42Z"
  finalizers:
  - baremetalhost.metal3.io
  generation: 1
  labels:
    infraenvs.agent-install.openshift.io: spoke-3
  name: spoke-master-3-0-bmh
  namespace: spoke-3
  resourceVersion: "2393957"
  uid: 99d30c32-c5ea-48ba-8351-6147d788ebf1
spec:
  automatedCleaningMode: disabled
  bmc:
    address: redfish-virtualmedia+https://[fd2e:6f44:5dd8::1]:8000/redfish/v1/Systems/aace9b63-b57f-4376-91f6-f2d765e454ba
    credentialsName: spoke-master-3-0-bmc-secret
    disableCertificateVerification: true
  bootMACAddress: 52:54:00:f6:03:9b
  online: true
status:
  errorCount: 0
  errorMessage: ""
  goodCredentials:
    credentials:
      name: spoke-master-3-0-bmc-secret
      namespace: spoke-3
    credentialsVersion: "2393297"
  hardwareProfile: unknown
  lastUpdated: "2021-10-27T12:38:09Z"
  operationHistory:
    deprovision:
      end: null
      start: null
    inspect:
      end: "2021-10-27T12:37:56Z"
      start: "2021-10-27T12:37:55Z"
    provision:
      end: null
      start: null
    register:
      end: "2021-10-27T12:37:55Z"
      start: "2021-10-27T12:37:43Z"
  operationalStatus: OK
  poweredOn: true
  provisioning:
    ID: 1d736f16-f2b2-439d-9292-90deb28a5f95
    bootMode: UEFI
    image:
      url: ""
    raid:
      softwareRAIDVolumes: []
    rootDeviceHints:
      deviceName: /dev/sda
    state: ready
  triedCredentials:
    credentials:
      name: spoke-master-3-0-bmc-secret
      namespace: spoke-3
    credentialsVersion: "2393297"
[root@seal23 ~]# oc get bmh -n spoke-3  spoke-master-3-0-bmh  
NAME                   STATE   CONSUMER   ONLINE   ERROR
spoke-master-3-0-bmh   ready              true  


Expected results:
[root@seal23 ~]# oc get bmh -n spoke-3  spoke-master-3-0-bmh  
NAME                   STATE   CONSUMER   ONLINE   ERROR
spoke-master-3-0-bmh   ready/noimage              true  

Additional info:

Comment 1 Michael Filanov 2021-10-28 10:53:11 UTC
We cannot update status on BMH because we don't own it, so in this case users will need to understand that things are not progressing by looking at the URL.