diff --git a/pkg/controller/plan/kubevirt.go b/pkg/controller/plan/kubevirt.go index 4afa58a5d..af44af2a1 100644 --- a/pkg/controller/plan/kubevirt.go +++ b/pkg/controller/plan/kubevirt.go @@ -661,7 +661,7 @@ func (r *KubeVirt) getDVs(vm *plan.VMStatus) (edvs []ExtendedDataVolume, err err context.TODO(), dvsList, &client.ListOptions{ - LabelSelector: k8slabels.SelectorFromSet(r.vmLabels(vm.Ref)), + LabelSelector: k8slabels.SelectorFromSet(r.vmAllButMigrationLabels(vm.Ref)), Namespace: r.Plan.Spec.TargetNamespace, }) diff --git a/pkg/controller/plan/migration.go b/pkg/controller/plan/migration.go index 122ebffb2..f3c9e0530 100644 --- a/pkg/controller/plan/migration.go +++ b/pkg/controller/plan/migration.go @@ -458,6 +458,9 @@ func (r *Migration) cleanup(vm *plan.VMStatus, failOnErr func(error) bool) error if err := r.deletePopulatorPVCs(vm); failOnErr(err) { return err } + if err := r.kubevirt.DeleteDataVolumes(vm); failOnErr(err) { + return err + } } if err := r.deleteImporterPods(vm); failOnErr(err) { return err