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

Machine with annotation machine.openshift.io/delete-machine=true should be prioritized for deletion

XMLWordPrintable

    • Moderate
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

       Machine with annotation machine.openshift.io/delete-machine=true will not be prioritized for deletion 

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

       4.18.0-0.nightly-2024-09-18-000823   

      How reproducible:

       Always   

      Steps to Reproduce:

      1. Create a cluster with TechPreviewNoUpgrade
      2. Create a machineset with capi with deletePolicy: Oldest
      3. Scale up machineset
      4. Annotate the new create machine with machine.openshift.io/delete-machine=true     

      Actual results:

      The old machine will be deleted
      $ oc get machine     
      NAME             CLUSTER            NODENAME         PROVIDERID                                                                                                                                                  PHASE     AGE   VERSION
      capi-ms1-h8pnp   zhsun-az19-hrv7x   capi-ms1-h8pnp   azure:///subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/zhsun-az19-hrv7x-rg/providers/Microsoft.Compute/virtualMachines/capi-ms1-h8pnp   Running   41m
      capi-ms1-n8p9k   zhsun-az19-hrv7x   capi-ms1-n8p9k   azure:///subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/zhsun-az19-hrv7x-rg/providers/Microsoft.Compute/virtualMachines/capi-ms1-n8p9k   Running   95m
      $ oc get machineset capi-ms1 -o yaml | grep dele     
        deletePolicy: Oldest
      $ oc get machine capi-ms1-h8pnp -o yaml 
      apiVersion: cluster.x-k8s.io/v1beta1
      kind: Machine
      metadata:
        annotations:
          machine.openshift.io/delete-machine: "true"
      
      $ oc scale machineset capi-ms1 --replicas 1   
      machineset.cluster.x-k8s.io/capi-ms1 scaled
      $ oc get machine         
      NAME             CLUSTER            NODENAME         PROVIDERID                                                                                                                                                  PHASE      AGE   VERSION
      capi-ms1-h8pnp   zhsun-az19-hrv7x   capi-ms1-h8pnp   azure:///subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/zhsun-az19-hrv7x-rg/providers/Microsoft.Compute/virtualMachines/capi-ms1-h8pnp   Running    42m
      capi-ms1-n8p9k   zhsun-az19-hrv7x   capi-ms1-n8p9k   azure:///subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/zhsun-az19-hrv7x-rg/providers/Microsoft.Compute/virtualMachines/capi-ms1-n8p9k   Deleting   96m 

      Expected results:

      Machine with annotation machine.openshift.io/delete-machine=true should be prioritized for deletion 
      https://docs.openshift.com/container-platform/4.16/machine_management/manually-scaling-machineset.html#machineset-delete-policy_manually-scaling-machineset
      
      

      Additional info:

          

            rh-ee-nbrubake Nolan Brubaker
            rhn-support-zhsun Zhaohua Sun
            Zhaohua Sun Zhaohua Sun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: