Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-63340

No FailureReason/FailureMessage in capi awsmachine/machine status when creating a capi machineset with invalid ami

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      When creating a capi machineset with invalid ami, the machine will be in Pending status, check awsmachine/machine status, no FailureReason/FailureMessage field. 

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

      4.21.0-0.nightly-2025-10-19-181151

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create a capi machineset with invalid ami 
      $ cat capi-aws-create-machineset.yaml    
      apiVersion: cluster.x-k8s.io/v1beta1
      kind: MachineSet
      metadata:
        name: aws-machineset3
        namespace: openshift-cluster-api
      spec:
        clusterName: ci-ln-x7xfwdt-76ef8-lr7x6
        deletePolicy: Random
        replicas: 1
        selector:
          matchLabels:
            cluster.x-k8s.io/cluster-name: ci-ln-x7xfwdt-76ef8-lr7x6
            machine.openshift.io/cluster-api-cluster: ci-ln-x7xfwdt-76ef8-lr7x6
            machine.openshift.io/cluster-api-machineset: aws-machineset3
        template:
          metadata:
            labels:
              cluster.x-k8s.io/cluster-name: ci-ln-x7xfwdt-76ef8-lr7x6
              machine.openshift.io/cluster-api-cluster: ci-ln-x7xfwdt-76ef8-lr7x6
              machine.openshift.io/cluster-api-machineset: aws-machineset3
          spec:
            bootstrap:
              dataSecretName: worker-user-data
            clusterName: ci-ln-x7xfwdt-76ef8-lr7x6
            infrastructureRef:
              apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
              kind: AWSMachineTemplate
              name: aws-machine-template3
              namespace: openshift-cluster-api
      ---
      apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
      kind: AWSMachineTemplate
      metadata:
        name: aws-machine-template3
        namespace: openshift-cluster-api
      spec:
        template:
          metadata: {}
          spec:
            additionalSecurityGroups:
            - filters:
              - name: tag:Name
                values:
                - ci-ln-x7xfwdt-76ef8-lr7x6-node
            - filters:
              - name: tag:Name
                values:
                - ci-ln-x7xfwdt-76ef8-lr7x6-lb
            additionalTags:
              ci-nat-replace: "false"
              clusterName: ci-ln-gcp98x2-76ef8
              expirationDate: 2025-10-20T08:22+00:00
              kubernetes.io/cluster/ci-ln-x7xfwdt-76ef8-lr7x6: owned
            ami:
              id: ami-0368e7083557a9c5d-invalid
            cloudInit: {}
            iamInstanceProfile: ci-ln-x7xfwdt-76ef8-lr7x6-worker-profile
            ignition:
              storageType: UnencryptedUserData
            instanceMetadataOptions:
              httpEndpoint: enabled
              httpPutResponseHopLimit: 1
              httpTokens: optional
              instanceMetadataTags: disabled
            instanceType: m6a.xlarge-invalid
            rootVolume:
              encrypted: true
              size: 120
              type: gp3
            subnet:
              filters:
              - name: tag:Name
                values:
                - ci-ln-x7xfwdt-76ef8-lr7x6-subnet-private-us-east-1a     
      2. Check awsmachine/machine status
      3.
          

      Actual results:

      Machine is stuck in Pending status, no FailureReason/FailureMessage in status.
      
      $ oc get machine.c -n openshift-cluster-api      
      NAME                                                CLUSTER                     NODENAME                       PROVIDERID                              PHASE     AGE    VERSION
      aws-machineset3-8l4zn                               ci-ln-x7xfwdt-76ef8-lr7x6                                                                          Pending   32m
      $ oc get awsmachine -n openshift-cluster-api aws-machineset3-8l4zn -o yaml | grep -A10 status:          
      status:
        conditions:
        - lastTransitionTime: "2025-10-21T02:46:48Z"
          message: 0 of 2 completed
          reason: InstanceProvisionFailed
          severity: Error
          status: "False"
          type: Ready
        - lastTransitionTime: "2025-10-21T03:15:31Z"
          message: 'failed to create AWSMachine instance: failed to get root volume from
            image "ami-0368e7083557a9c5d-invalid": operation error EC2: DescribeImages,
            https response error StatusCode: 400, RequestID: 8fe903c0-3a46-4dcf-917b-60ad60d15089,
            api error InvalidAMIID.Malformed: Invalid id: "ami-0368e7083557a9c5d-invalid"'
          reason: InstanceProvisionFailed
          severity: Error
          status: "False"
          type: InstanceReady
        - lastTransitionTime: "2025-10-21T02:46:48Z"
          reason: NotPaused
          status: "False"
          type: Paused
      zhsun:aws1/ $ oc get machine.c -n openshift-cluster-api aws-machineset3-8l4zn -o yaml | grep -A10 status:    
      status:
        conditions:
        - lastTransitionTime: "2025-10-21T02:46:48Z"
          message: 0 of 2 completed
          reason: InstanceProvisionFailed
          severity: Error
          status: "False"
          type: Ready
        - lastTransitionTime: "2025-10-21T02:46:48Z"
          message: 0 of 2 completed
          reason: InstanceProvisionFailed
          severity: Error
          status: "False"
          type: InfrastructureReady
        - lastTransitionTime: "2025-10-21T02:46:48Z"
          reason: WaitingForNodeRef
          severity: Info
          status: "False"
          type: NodeHealthy
        lastUpdated: "2025-10-21T02:46:48Z"
        observedGeneration: 1
        phase: Pending
        v1beta2:
          conditions:
          - lastTransitionTime: "2025-10-21T02:46:48Z"
            message: ""
            observedGeneration: 1
            reason: NotReady
            status: "False"
            type: Available
          - lastTransitionTime: "2025-10-21T02:46:48Z"
            message: |-
              * InfrastructureReady: 0 of 2 completed
              * NodeHealthy: Waiting for AWSMachine to report spec.providerID
            observedGeneration: 1
            reason: NotReady
            status: "False"
            type: Ready
          - lastTransitionTime: "2025-10-21T02:46:48Z"
            message: ""
            observedGeneration: 1
            reason: DataSecretProvided
            status: "True"
            type: BootstrapConfigReady
          - lastTransitionTime: "2025-10-21T02:46:48Z"
            message: 0 of 2 completed
            observedGeneration: 1
            reason: InstanceProvisionFailed
            status: "False"
            type: InfrastructureReady
          - lastTransitionTime: "2025-10-21T02:46:48Z"
            message: Waiting for AWSMachine to report spec.providerID
            observedGeneration: 1
            reason: InspectionFailed
            status: Unknown
            type: NodeHealthy
          - lastTransitionTime: "2025-10-21T02:46:48Z"
            message: Waiting for AWSMachine to report spec.providerID
            observedGeneration: 1
            reason: InspectionFailed
            status: Unknown
            type: NodeReady
          - lastTransitionTime: "2025-10-21T02:46:48Z"
            message: ""
            observedGeneration: 1
            reason: NotPaused
            status: "False"
            type: Paused
          - lastTransitionTime: "2025-10-21T02:46:48Z"
            message: ""
            observedGeneration: 1
            reason: NotDeleting
            status: "False"
            type: Deleting

      Expected results:

      Machine is in Failed status with invalid config.

      Additional info:

          

              rh-ee-cschlott Christian Schlotter
              rhn-support-zhsun Zhaohua Sun
              None
              None
              Zhaohua Sun Zhaohua Sun
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: