Bug 2001829 - Migration does not complete when the namespace contains a cron job with a PVC
Summary: Migration does not complete when the namespace contains a cron job with a PVC
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: General
Version: 1.6.0
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ---
: 1.6.0
Assignee: Jaydip Gabani
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-07 09:47 UTC by Sergio
Modified: 2021-09-29 14:36 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-29 14:35:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:3694 0 None None None 2021-09-29 14:36:09 UTC

Description Sergio 2021-09-07 09:47:04 UTC
Description of problem:
When we migrate (IDIM+IDVM) a cronjob with an attached pvc, the migration is stuck forever in StageBackup

Version-Release number of selected component (if applicable):
TARGET CLUSTER: AWS OCP 4.9 (MTC 1.6.0) NFS
SOURCE CLUSTER: AWS OCP 3.11 (MTC 1.5.1) OCS4
REPLICATION REPOSITORY: AWS S3

How reproducible:
Always

Steps to Reproduce:
1.Create a cronjob using a pvc

oc new project bz-test


Create these resources in the new namespace

---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            args:
            - /bin/sh
            - -c
            - date; echo Hello from a CronJob
          restartPolicy: OnFailure
          volumeMounts:
            - mountPath: /downlods
              name: downloads
          dnsPolicy: ClusterFirst
          schedulerName: default-scheduler
          securityContext: {}
          terminationGracePeriodSeconds: 30
          volumes:
          - name: downloads
            persistentVolumeClaim:
              claimName: portal-downloads

---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: portal-downloads
  labels:
    app: cronjob
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 500Mi

2. Migrate the bz-test namespace using IDVM+IDIM


Actual results:
The migration is stuck forever

status:
  conditions:
  - category: Advisory
    lastTransitionTime: "2021-09-07T08:53:52Z"
    message: 'Step: 24/48'
    reason: StagePodsCreated
    status: "True"
    type: Running
  - category: Required
    lastTransitionTime: "2021-09-07T08:53:39Z"
    message: The migration is ready.
    status: "True"
    type: Ready
  - category: Advisory
    durable: true
    lastTransitionTime: "2021-09-07T08:53:51Z"
    message: '[1] Stage pods created.'
    status: "True"
    type: StagePodsCreated
  itinerary: Final
  observedDigest: 8e1386a3cd4d0265dcc864f3392526af375ef52fe89e5a98ed8d441228ce375c
  phase: StagePodsCreated
  pipeline:
  - completed: "2021-09-07T08:53:44Z"
    message: Completed
    name: Prepare
    started: "2021-09-07T08:53:39Z"
  - completed: "2021-09-07T08:53:51Z"
    message: Completed
    name: Backup
    progress:
    - 'Backup openshift-migration/ocp-32189-cronjob-with-pvc-mig-1631004796-initial-vmzlm: 24 out of estimated total of 24 objects backed up (4s)'
    started: "2021-09-07T08:53:44Z"
  - message: Waiting for all Stage Pods to start.
    name: StageBackup
    phase: StagePodsCreated
    started: "2021-09-07T08:53:51Z"
  - message: Not started
    name: StageRestore
  - message: Not started
    name: Restore
  - message: Not started
    name: Cleanup
  startTimestamp: "2021-09-07T08:53:39Z"




Expected results:
The migration should end without problems

Additional info:

Comment 1 Jaydip Gabani 2021-09-09 17:33:16 UTC
Similar to https://bugzilla.redhat.com/show_bug.cgi?id=2002420, and should be resolved with the respective changes made to solve the aforementioned BZ.

This bug should not exists anymore with the merging of the PR - https://github.com/konveyor/mig-controller/pull/1198

Changing status to POST since the PR is merged

Comment 2 Jaydip Gabani 2021-09-09 18:09:50 UTC
This PR cherry-pick the changes in the release branch - https://github.com/konveyor/mig-controller/pull/1199

Changing the status to MODIFIED

Comment 6 Xin jiang 2021-09-15 05:51:37 UTC
verified with mtc1.6.0

registry.redhat.io/rhmtc/openshift-migration-controller-rhel8@sha256:3b5efa9c8197fe0313a2ab7eb184d135ba9749c9a4f0d15a6abb11c0d18b9194

Comment 8 errata-xmlrpc 2021-09-29 14:35:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Migration Toolkit for Containers (MTC) 1.6.0 security & bugfix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3694


Note You need to log in before you can comment on or make changes to this bug.