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

[4.19] PVs are not removed when deleting cloned VMs created from MTV migrated VMs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • CNV v4.19.z
    • CNV v4.19.z
    • Storage Platform
    • None
    • Quality / Stability / Reliability
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • CNV v4.19.11.rhel9-2
    • Critical
    • Customer Reported
    • None
    • Migration Toolkit for Virtualization, Red Hat OpenShift Virtualization

      Description of problem:

      The virtual machines migrated using MTV will use PVCs directly:

      # oc get vm nijin-rhel-9-5 -o yaml |yq '.spec.template.spec.volumes'
      - name: vol-0
        persistentVolumeClaim:
          claimName: nijin-rhel-9-5-vm-76972-m5bq6

       

      The owner of these PVCs will be the VM:

      oc get pvc nijin-rhel-9-5-vm-76972-m5bq6  -o yaml |yq '.metadata.ownerReferences'
      - apiVersion: kubevirt.io/v1
        blockOwnerDeletion: true
        controller: false
        kind: VirtualMachine
        name: nijin-rhel-9-5
        uid: c584e538-490b-453e-9ad1-e9d10225fb3e

       

      However, when this VM is cloned, the new PVC doesn't have the  ownerReferences.

      # oc get vm nijin-rhel-9-5-clone-1ze6tx  -o yaml |yq '.spec.template.spec.volumes'
      - name: vol-0
        persistentVolumeClaim:
          claimName: restore-32cb1f00-286b-4d72-828f-2f5cc7c3dbb8-vol-0
      
      
      # oc get pvc restore-32cb1f00-286b-4d72-828f-2f5cc7c3dbb8-vol-0 -o yaml |yq '.metadata.ownerReferences'
      null
      

      Because of this, when the cloned VM is deleted, the PVC remains in the cluster. 

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

      OpenShift Virtualization  4.18.11

      How reproducible:

      100%

      Steps to Reproduce:

      1. Migrate a VM from VMware to OpenShift Virtualization.
      2. Clone the VM.
      3. Delete the cloned VM. Although UI shows the checkbox to delete the PVC, from the backend PVC is not deleted. 
      

      Actual results:

      PVs are not removed when deleting cloned VMs created from MTV migrated VMs

      Expected results:

      Because the source VM's PVC has an owner reference, cloning the VM should result in the cloned PVC being associated with the cloned VM, and it should be removed automatically when that VM is deleted

      Additional info:

       

              rhn-support-awels Alexander Wels
              rhn-support-nashok Nijin Ashok
              Jenia Peimer Jenia Peimer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: