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

[AWS][CAPI]error shown in capa logs when create CAPI CapacityBlock instance

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • 2
    • Low
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

          error shown in capa log when create CAPI CapacityBlock instance
      
      

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

          4.19.0-0.nightly-2025-04-08-163320

      How reproducible:

          always

      Steps to Reproduce:

          1.create awsmachinetemplate
      
            instanceType: trn1.32xlarge
            marketType: CapacityBlock
            capacityReservationId: cr-0bf8c3cb7a73b9983 
      
          2.create capimachineset, the machine get Running, but I see some error in capa logs
      
      liuhuali@Lius-MacBook-Pro huali-test % oc get machineset.c
      NAME             CLUSTER              REPLICAS   READY   AVAILABLE   AGE   VERSION
      capimachineset   huliu-aws49a-bwrxg   1          1       1           11m   
      liuhuali@Lius-MacBook-Pro huali-test % oc get machine.c
      NAME                   CLUSTER              NODENAME                                    PROVIDERID                              PHASE     AGE   VERSION
      capimachineset-ct2tn   huliu-aws49a-bwrxg   ip-10-0-26-181.us-east-2.compute.internal   aws:///us-east-2a/i-0fbf9639fcd40504a   Running   11m   
      liuhuali@Lius-MacBook-Pro huali-test % oc get awsmachine
      NAME                   CLUSTER              STATE     READY   INSTANCEID                              MACHINE
      capimachineset-ct2tn   huliu-aws49a-bwrxg   running   true    aws:///us-east-2a/i-0fbf9639fcd40504a   capimachineset-ct2tn
      
      I0409 03:42:59.545979       1 awsmachine_controller.go:732] "Creating EC2 instance"
      E0409 03:43:01.676476       1 awsmachine_controller.go:535] "unable to create instance" err=<
      failed to create AWSMachine instance: failed to create tags for resource "eni-05807e398e7f79df3": : failed to create tags for resource "eni-05807e398e7f79df3": map[MachineName:openshift-cluster-api/capimachineset-ct2tn Name:capimachineset-ct2tn aws:ec2:capacity-reservation-type:capacity-block kubernetes.io/cluster/huliu-aws49a-bwrxg:owned sigs.k8s.io/cluster-api-provider-aws/cluster/huliu-aws49a-bwrxg:owned sigs.k8s.io/cluster-api-provider-aws/role:node]: InvalidParameterValue: Value ( aws:ec2:capacity-reservation-type ) for parameter key is invalid. Tag keys starting with 'aws:' are reserved for internal use
      status code: 400, request id: fe84aa27-7975-48c0-946a-e10ab25d7c16
       >
      E0409 03:43:01.713230       1 controller.go:316] "Reconciler error" err=<
      failed to create AWSMachine instance: failed to create tags for resource "eni-05807e398e7f79df3": : failed to create tags for resource "eni-05807e398e7f79df3": map[MachineName:openshift-cluster-api/capimachineset-ct2tn Name:capimachineset-ct2tn aws:ec2:capacity-reservation-type:capacity-block kubernetes.io/cluster/huliu-aws49a-bwrxg:owned sigs.k8s.io/cluster-api-provider-aws/cluster/huliu-aws49a-bwrxg:owned sigs.k8s.io/cluster-api-provider-aws/role:node]: InvalidParameterValue: Value ( aws:ec2:capacity-reservation-type ) for parameter key is invalid. Tag keys starting with 'aws:' are reserved for internal use
      status code: 400, request id: fe84aa27-7975-48c0-946a-e10ab25d7c16
       > controller="awsmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AWSMachine" AWSMachine="openshift-cluster-api/capimachineset-ct2tn" namespace="openshift-cluster-api" name="capimachineset-ct2tn" reconcileID="58d3c312-3754-46d8-88a7-82acac7ce3ee"   
          
      
         3. I checked on AWS console, and found that tag is added to the instance https://drive.google.com/file/d/1DBQKYmiXnwig1P7DTuyaNgF2U6L9HEtL/view?usp=sharing
      
      but not to the network interface https://drive.google.com/file/d/1SlU8JIJZXBo1OmYpxmNewFN1wb4I0000/view?usp=sharing  
      
      I tried to add the tag using aws cli to instance and network interface, both get error as well, I'm not sure how it was added to the instance, but if it cannot be added to the network interface, maybe we should stop doing that?
      
      liuhuali@Lius-MacBook-Pro huali-test % aws ec2 create-tags --resources  eni-0b69b2737ad584407 --tags Key=aws:ec2:capacity-reservation-type,Value=capacity-block
      
      
      An error occurred (InvalidParameterValue) when calling the CreateTags operation: Value ( aws:ec2:capacity-reservation-type ) for parameter key is invalid. Tag keys starting with 'aws:' are reserved for internal use
      
      liuhuali@Lius-MacBook-Pro huali-test % aws ec2 create-tags --resources  i-0cb8cc9212befa658 --tags Key=aws:ec2:capacity-reservation-type,Value=capacity-block
      
      
      An error occurred (InvalidParameterValue) when calling the CreateTags operation: Value ( aws:ec2:capacity-reservation-type ) for parameter key is invalid. Tag keys starting with 'aws:' are reserved for internal use
      liuhuali@Lius-MacBook-Pro huali-test % 
      
      I also checked the MAPI machine, there is no such error in machine-controller log
      
      liuhuali@Lius-MacBook-Pro huali-test % oc logs machine-api-controllers-7f8447c9c5-xbb7r  -c machine-controller |grep "internal use" 
      liuhuali@Lius-MacBook-Pro huali-test % 
      
      mapi instance has that tag
      https://drive.google.com/file/d/1TdfvhJcGohs2FZFJTY8XbS5LAoX1qP-i/view?usp=sharing
      mapi network interface doesn't have that tag
      https://drive.google.com/file/d/1c2dtk2EUYDPiRBD125a31gDVLy9hb1o_/view?usp=sharing

      Actual results:

         error shown in capa log when create CAPI CapacityBlock instance

      Expected results:

      no error shown in capa log when create CAPI CapacityBlock instance 

      Additional info:

          new feature testing for https://issues.redhat.com/browse/OCPCLOUD-2781

              athiruma@redhat.com Thirumalesh Aaraveti (Inactive)
              huliu@redhat.com Huali Liu
              None
              None
              Huali Liu Huali Liu
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: