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

Machine can't be associated with the created capacity reservation group

XMLWordPrintable

    • Moderate
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      When creating capacity reservation group, then create a machine with capacityReservationGroupID, but machine will be created in availability set, even location eastus with 3 zones.    

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

      4.18.0-0.nightly-2024-09-10-184137    

      How reproducible:

      Always    

      Steps to Reproduce:

      1.Create a Capacity Reservation and 3 capacity reservation group for each zone 1,2,3
      2. Create azuremachinetemplate and machineset
      $ oc get azuremachinetemplate capi-azure-machine-template1 -o yaml  
      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
      kind: AzureMachineTemplate
      metadata:
        name: capi-azure-machine-template1
        namespace: openshift-cluster-api
      spec:
        template:
          metadata: {}
          spec:
            capacityReservationGroupID: /subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/ZHSUN-AZ11-LKCH7-RG/providers/Microsoft.Compute/capacityReservationGroups/zhsun-capacity
            identity: None
            image:
              id: /subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/zhsun-az11-lkch7-rg/providers/Microsoft.Compute/galleries/gallery_zhsun_az11_lkch7/images/zhsun-az11-lkch7-gen2/versions/latest
            networkInterfaces:
            - acceleratedNetworking: true
              privateIPConfigs: 1
              subnetName: zhsun-az11-lkch7-worker-subnet
            osDisk:
              cachingType: None
              diskSizeGB: 128
              managedDisk:
                storageAccountType: Standard_LRS
              osType: Linux
            sshPublicKey: c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDZllLNHR0Uk9jcVEweDQ4VXhhUWpPbnE0WUNJNjVGWnRxT3NnK0swV2RjWGQxRVl6dkdkcFRNQTdzMERHbVRZSlAwWUg2YUxncVBCWHozVVJQekIvbTlUWXBIQklHT0FwTWE0MHJHdW9sSkJyNUtmdG5uVzZVcitxQmdmWDFmYURWYyt4OTVDVU9zdzRVakhTaTk2bTlJVEZIN21yakcxMzZEdS9Odm9adzVLVlAzak5qdncyc0dsamt2TTFUblllbk03U0VNZXNFVlN6WjN2d3VmSkg2c3FBTklQT3JFWHR0c3gxVWlGVHFKcDE4OFNHMGVWY3dVZlRFcm5xUDFLR3hFUUVMWGRyRXZmYnNMdnJnVHZSem1lRXNWVkFnS05RaEN2MGFlVVlWTUY0L3VROUkrUkJBZGNFTW4xVHkzSjY1cFpWZ3dVN1hhWVZCcDJHR24xWTMK
            vmSize: Standard_D4s_v3 
      3.
          

      Actual results:

      Machine failed to create.
      $ oc get machine capi-ms1-gmzcs -o yaml   
      apiVersion: cluster.x-k8s.io/v1beta1
      kind: Machine
      metadata:
        creationTimestamp: "2024-09-11T07:26:11Z"
        finalizers:
        - machine.cluster.x-k8s.io
        generation: 1
        labels:
          cluster.x-k8s.io/cluster-name: zhsun-az11-lkch7
          cluster.x-k8s.io/set-name: capi-ms1
          disk: ultrassd
          machine.openshift.io/cluster-api-cluster: zhsun-az11-lkch7
        name: capi-ms1-gmzcs
        namespace: openshift-cluster-api
        ownerReferences:
        - apiVersion: cluster.x-k8s.io/v1beta1
          blockOwnerDeletion: true
          controller: true
          kind: MachineSet
          name: capi-ms1
          uid: 0573f04f-e663-41a6-aa94-b9f140f13ed8
        resourceVersion: "177984"
        uid: 2d9586a2-7e93-4622-8951-34fce7a882fc
      spec:
        bootstrap:
          dataSecretName: worker-user-data
        clusterName: zhsun-az11-lkch7
        infrastructureRef:
          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
          kind: AzureMachine
          name: capi-ms1-gmzcs
          namespace: openshift-cluster-api
          uid: 9f361480-0952-4daa-86d1-a5a3e45490a2
        nodeDeletionTimeout: 10s
      status:
        conditions:
        - lastTransitionTime: "2024-09-11T07:26:35Z"
          message: 0 of 2 completed
          reason: Failed
          severity: Error
          status: "False"
          type: Ready
        - lastTransitionTime: "2024-09-11T07:26:47Z"
          message: |
            virtualmachine failed to create or update. err: failed to create or update resource zhsun-az11-lkch7-rg/capi-ms1-gmzcs (service: virtualmachine): PUT https://management.azure.com/subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/zhsun-az11-lkch7-rg/providers/Microsoft.Compute/virtualMachines/capi-ms1-gmzcs
            --------------------------------------------------------------------------------
            RESPONSE 409: 409 Conflict
            ERROR CODE: OperationNotAllowed
            --------------------------------------------------------------------------------
            {
              "error": {
                "code": "OperationNotAllowed",
                "message": " Associating with Capacity Reservation Group '/subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/ZHSUN-AZ11-LKCH7-RG/providers/Microsoft.Compute/capacityReservationGroups/zhsun-capacity' is not supported for VM 'capi-ms1-gmzcs' in an availability set."
              }
            }
            --------------------------------------------------------------------------------
          reason: Failed
          severity: Error
          status: "False"
          type: InfrastructureReady
        - lastTransitionTime: "2024-09-11T07:26:11Z"
          reason: WaitingForNodeRef
          severity: Info
          status: "False"
          type: NodeHealthy
        lastUpdated: "2024-09-11T07:26:11Z"
        observedGeneration: 1
        phase: Pending
      
      E0911 07:26:43.133292       1 controller.go:329] "Reconciler error" err=<
          failed to reconcile AzureMachine: failed to reconcile AzureMachine service virtualmachine: failed to create or update resource zhsun-az11-lkch7-rg/capi-ms1-gmzcs (service: virtualmachine): PUT https://management.azure.com/subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/zhsun-az11-lkch7-rg/providers/Microsoft.Compute/virtualMachines/capi-ms1-gmzcs
          --------------------------------------------------------------------------------
          RESPONSE 409: 409 Conflict
          ERROR CODE: OperationNotAllowed
          --------------------------------------------------------------------------------
          {
            "error": {
              "code": "OperationNotAllowed",
              "message": " Associating with Capacity Reservation Group '/subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/ZHSUN-AZ11-LKCH7-RG/providers/Microsoft.Compute/capacityReservationGroups/zhsun-capacity' is not supported for VM 'capi-ms1-gmzcs' in an availability set."
            }
          }
          --------------------------------------------------------------------------------
      
      $ oc get machines.machine.openshift.io -n openshift-machine-api    
      NAME                                    PHASE     TYPE              REGION   ZONE   AGE
      zhsun-az11-lkch7-master-0               Running   Standard_D8s_v3   eastus   2      5h56m
      zhsun-az11-lkch7-master-1               Running   Standard_D8s_v3   eastus   3      5h56m
      zhsun-az11-lkch7-master-2               Running   Standard_D8s_v3   eastus   1      5h56m
      zhsun-az11-lkch7-worker-eastus1-qzgfk   Running   Standard_D4s_v3   eastus   1      5h48m
      zhsun-az11-lkch7-worker-eastus2-ntbx2   Running   Standard_D4s_v3   eastus   2      5h48m
      zhsun-az11-lkch7-worker-eastus3-j7r5f   Running   Standard_D4s_v3   eastus   3      5h48m    

      Expected results:

      Machine can be created successful and associated with the capacity reservation group.

      Additional info:

          

            rmanak@redhat.com Radek Manak
            rhn-support-zhsun Zhaohua Sun
            Zhaohua Sun Zhaohua Sun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: