Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-69511

Unable to disable deletion protection from VM

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • CNV Infrastructure
    • None
    • Quality / Stability / Reliability
    • 0.42
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • None

      Description of problem:

      A Namespace was deleted, triggering deletion of all resources within the namespace, including a VM that had deletion protection enabled.
      
      The VM was not deleted, as is expected with the feature enabled. However, it wasn't possible to disable deletion protection.
      
      ocrm1 patch vm fedora --type json -p '[{"op": "remove", "path": "/metadata/labels/kubevirt.io~1vm-delete-protection"}]' -n <namespace>
      The request is invalid: spec.instancetype: Failure to find instancetype: controllerrevisions.apps "fedora-u1.large-v1beta1-e6dd3092-e1fe-496b-a1ba-0afd3ffe7e36-1" not found
      
      I guess that the instancetype and preference resources were deleted when the namespace deletion was triggered.

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

      Cluster is ROSA 4.19.7 w/ OpenShift Virtualization 4.19.6.

      How reproducible:

       

      Steps to Reproduce:

      1. Create a VM
      2. Enable deletion protection on the VM configuration
      3. Delete the namespace containing the VM
      

      Actual results:

      Was not able to remove deletion protection and unblock the deletion of the VM and Namespace.

      Expected results:

      Should be able to remove deletion protection.

      Additional info:

      Workaround:
      ocrm1 patch vm fedora --type json -p '[{"op": "remove", "path": "/metadata/labels/kubevirt.io~1vm-delete-protection"}, {"op": "remove", "path": "/spec/instancetype"}, {"op": "remove", "path": "/spec/preference"}]' -n <namespace>

              rh-ee-jcanocan Javier Cano Cano
              rajivnathan Rajiv Senthilnathan
              Geetika Kapoor Geetika Kapoor
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: