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

[AWS]mapi machine create Failed when there is a same name machine which is Terminated on AWS

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • Yes
    • None
    • None
    • Rejected
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

          mapi machine create Failed when there is a same name machine which is Terminated on AWS, but capi machine create succeed.
      This looks an regression issue because I checked on a 4.16 cluster, no such issue.

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

          4.20.0-0.nightly-2025-08-28-071300
      
      

      How reproducible:

          always

      Steps to Reproduce:

          1.Create a standalone machine, the machine get Running, then delete it, when the machine disappeared in the cluster, I can see the machine still shows on AWS console, and it's Terminated state.
      
      https://drive.google.com/file/d/1Ls-1ANdSsBrtWKrIdmOCfyPLg7kH1VQl/view?usp=sharing
       
          2.Create the machine again with authoritativeAPI: MachineAPI, the machine get Failed
      
      liuhuali@Lius-MacBook-Pro huali-test % cat ms1.yaml 
      apiVersion: machine.openshift.io/v1beta1
      kind: Machine
      metadata:
        name: machine-authoritativeapi-mapi-deletion
        namespace: openshift-machine-api
      spec:
        authoritativeAPI: MachineAPI
        lifecycleHooks: {}
        metadata: {}
        providerSpec:
          value:
            ami:
              id: ami-082a55a580d5538ed
            apiVersion: machine.openshift.io/v1beta1
            blockDevices:
            - ebs:
                encrypted: true
                iops: 0
                kmsKey:
                  arn: ""
                volumeSize: 120
                volumeType: gp3
            capacityReservationId: ""
            credentialsSecret:
              name: aws-cloud-credentials
            deviceIndex: 0
            iamInstanceProfile:
              id: huliu-aws829a-4nts6-worker-profile
            instanceType: m6i.xlarge
            kind: AWSMachineProviderConfig
            metadata:
              creationTimestamp: null
            metadataServiceOptions: {}
            placement:
              availabilityZone: us-east-2c
              region: us-east-2
            securityGroups:
            - filters:
              - name: tag:Name
                values:
                - huliu-aws829a-4nts6-node
            - filters:
              - name: tag:Name
                values:
                - huliu-aws829a-4nts6-lb
            subnet:
              filters:
              - name: tag:Name
                values:
                - huliu-aws829a-4nts6-subnet-private-us-east-2c
            tags:
            - name: kubernetes.io/cluster/huliu-aws829a-4nts6
              value: owned
            userDataSecret:
              name: worker-user-data
       liuhuali@Lius-MacBook-Pro huali-test % oc create -f ms1.yaml 
      machine.machine.openshift.io/machine-authoritativeapi-mapi-deletion created
      liuhuali@Lius-MacBook-Pro huali-test % oc get machine
      NAME                                          PHASE     TYPE         REGION      ZONE         AGE
      huliu-aws829a-4nts6-master-0                  Running   m6i.xlarge   us-east-2   us-east-2a   8h
      huliu-aws829a-4nts6-master-1                  Running   m6i.xlarge   us-east-2   us-east-2b   8h
      huliu-aws829a-4nts6-master-2                  Running   m6i.xlarge   us-east-2   us-east-2c   8h
      huliu-aws829a-4nts6-worker-us-east-2a-8l9bq   Running   m6i.xlarge   us-east-2   us-east-2a   8h
      huliu-aws829a-4nts6-worker-us-east-2b-25g82   Running   m6i.xlarge   us-east-2   us-east-2b   8h
      huliu-aws829a-4nts6-worker-us-east-2c-mslbv   Running   m6i.xlarge   us-east-2   us-east-2c   8h
      machine-authoritativeapi-mapi-deletion        Failed                                          3s
      liuhuali@Lius-MacBook-Pro huali-test % oc get machine machine-authoritativeapi-mapi-deletion -oyaml
      ...
      status:
        authoritativeAPI: MachineAPI
        conditions:
        - lastTransitionTime: "2025-08-29T10:32:55Z"
          status: "True"
          type: Drainable
        - lastTransitionTime: "2025-08-29T10:32:55Z"
          message: Instance has not been created
          reason: InstanceNotCreated
          severity: Warning
          status: "False"
          type: InstanceExists
        - lastTransitionTime: "2025-08-29T10:32:55Z"
          message: The AuthoritativeAPI status is set to 'MachineAPI'
          reason: AuthoritativeAPIMachineAPI
          severity: Info
          status: "False"
          type: Paused
        - lastTransitionTime: "2025-08-29T10:32:55Z"
          message: Successfully synchronized MAPI Machine to CAPI
          reason: ResourceSynchronized
          severity: ""
          status: "True"
          type: Synchronized
        - lastTransitionTime: "2025-08-29T10:32:55Z"
          status: "True"
          type: Terminable
        errorMessage: Instance i-0174576be2b6e6d65 is in a terminated state
        errorReason: InvalidConfiguration
        lastUpdated: "2025-08-29T10:32:55Z"
        phase: Failed
        providerStatus: {}
        synchronizedGeneration: 1
      
      3. Change authoritativeAPI from MachineAPI to ClusterAPI, then create the machine, the machine get Running
      
      liuhuali@Lius-MacBook-Pro huali-test % oc create -f ms1.yaml 
      machine.machine.openshift.io/machine-authoritativeapi-mapi-deletion created
      liuhuali@Lius-MacBook-Pro huali-test % oc get machine.c -n openshift-cluster-api
      NAME                                          CLUSTER               NODENAME                                    PROVIDERID                              PHASE     AGE     VERSION
      huliu-aws829a-4nts6-worker-us-east-2a-8l9bq   huliu-aws829a-4nts6                                               aws:///us-east-2a/i-06c0824941b32602b             8h      
      huliu-aws829a-4nts6-worker-us-east-2b-25g82   huliu-aws829a-4nts6                                               aws:///us-east-2b/i-08533980068d569e3             8h      
      huliu-aws829a-4nts6-worker-us-east-2c-mslbv   huliu-aws829a-4nts6                                               aws:///us-east-2c/i-045593364841450db             8h      
      machine-authoritativeapi-mapi-deletion        huliu-aws829a-4nts6   ip-10-0-82-147.us-east-2.compute.internal   aws:///us-east-2c/i-0faf56c83f59655e3   Running   6m53s   
      
      https://drive.google.com/file/d/1ZGmRxZHcjGDU84MYGGryqVerJYt6v1w5/view?usp=sharing

      Actual results:

          mapi machine create Failed when there is a same name machine which is Terminated on AWS

      Expected results:

          mapi machine should create succeed when there is a same name machine which is Terminated on AWS

      Additional info:

          

              rh-ee-tbarberb Theo Barber-Bany
              huliu@redhat.com Huali Liu
              None
              None
              Huali Liu Huali Liu
              None
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: