Uploaded image for project: 'Migration Toolkit for Virtualization'
  1. Migration Toolkit for Virtualization
  2. MTV-678

Canceling and deleting failed migration plan is not cleaning up "populate" pods and pvc

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Major Major
    • 2.6.0
    • 2.4.2
    • Controller
    • None
    • Important

      Description of problem:

       

      If the user cancels and deletes a migration plan when it fails after creating the PVC and spawning the "populate" pods, the populate pods and associated pods are not cleaned up and need manual removal.

       

      The PVC still exists after deleting the plan:

       

       

      dell-per7525-03 ~]# oc get pvc
      NAME                                         STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                           AGE
      e6943ec4-d349-44c4-b6b1-925b644691e5         Pending                                                                        ocs-external-storagecluster-ceph-rbd   16m
      prime-06b87c47-279c-4b74-8245-c92fbfa8a94c   Bound     pvc-0c128025-a058-4a03-9b7f-8e80cae65682   11Gi       RWX            ocs-external-storagecluster-ceph-rbd   16m

       

       

      And the pod:

       

       

      dell-per7525-03 ~]# oc get pod
      NAME                                            READY   STATUS   RESTARTS   AGE
      populate-06b87c47-279c-4b74-8245-c92fbfa8a94c   0/1     Error    0          1s

       

       

      And the plan was deleted:

       

      dell-per7525-03 ~]# oc get plan -A
      No resources found

       

       

      If I create and start a new plan for the same VM, it will fail with the error below:

       

       

      # oc get plan new-plan -n openshift-mtv -o yaml |yq '.status.migration.vms'
      - completed: "2023-08-30T04:20:17Z"
        conditions:
          - category: Advisory
            durable: true
            lastTransitionTime: "2023-08-30T04:20:13Z"
            message: The VM migration has FAILED.
            status: "True"
            type: Failed
        error:
          phase: CreateDataVolumes
          reasons:
            - persistentvolumeclaims "e6943ec4-d349-44c4-b6b1-925b644691e5" already exists
        id: de2caeae-1347-4d4d-aa22-f219f1d61436

       

       

      I have to delete the PVC, remove the finalizers from PVC, and remove the pod to clean the resources.

       

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

       

      Migration Toolkit for Virtualization Operator   2.4.2

      How reproducible:

      100%

      Steps to Reproduce:

      1. To fail the migration, stop the ovirt-imageio service in the RHV hosts.
      2. Start the migration plan. 
      3. The populate pod will try to download the image and fail and will get respawned continuously.

      4. Cancel and delete the plan from UI.

      5. The populate pods and pvc are not cleaned up and need manual removal.

      Actual results:

      Canceling and deleting failed migration plan is not cleaning up "populate"  pods and pvc. This makes troubleshooting harder.

      Expected results:

       

      When the plan is canceled, it should stop/delete the resources it created for migrating the VM.

       

      Additional info:

            lrotenbe Liran Rotenberg
            rhn-support-nashok Nijin Ashok
            Qin Yuan Qin Yuan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: