Bug 2005815 - Rollback of intra-cluster State migration fails with PVC mapping error
Summary: Rollback of intra-cluster State migration fails with PVC mapping error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: General
Version: 1.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 1.6.1
Assignee: Pranav Gaikwad
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-20 09:06 UTC by Sergio
Modified: 2021-10-28 09:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-28 09:48:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-controller pull 1209 0 None open Bug 2005815: Fix rollback for intra-cluster same namespace migrations 2021-09-23 18:04:44 UTC
Github konveyor mig-controller pull 1216 0 None open Bug 2005815: fix rollback for intra-cluster same namespace migrations (#1209) 2021-10-12 15:42:59 UTC
Red Hat Product Errata RHBA-2021:4023 0 None None None 2021-10-28 09:48:06 UTC

Description Sergio 2021-09-20 09:06:58 UTC
Description of problem:
When we execute an intra-cluster "State" migration and then we execute a rollback, the rollback is always failing.

Version-Release number of selected component (if applicable):
SOURCE CLUSTER: AWS 3.11 (MTC 1.5.1)
TARGET CLUSTER: AWS 4.9 (MTC 1.6.0) (CONTROLLER + UI)

How reproducible:
Always

Steps to Reproduce:
1.In local cluster (host), create a namespace with a pvc and a pod


$ oc new-project ocp-44561-state-intralocal

$ cat <<EOF | oc create -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  namespace: ocp-44561-state-intralocal
  name: test-data-app1
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
EOF

$ cat <<EOF | oc create -f -
apiVersion:  apps/v1
kind: Deployment
metadata:
  labels:
    app: state-only-mig
  name: state-only-mig
  namespace: ocp-44561-state-intralocal
spec:
  replicas:  1
  selector:
    matchLabels:
      app: state-only-mig
  template:
    metadata:
      labels:
        app: state-only-mig
    spec:
      containers:
      - name: podtest
        imagePullPolicy: Always
        image: quay.io/openshifttest/alpine
        command: [ "/bin/sh", "-c", "--" ]
        args:
        - while true; do sleep 30; done;
        restartPolicy: Never
        volumeMounts:
        - name: testvolume
          mountPath: /data/test
      volumes:
      - name: testvolume
        persistentVolumeClaim:
          claimName: test-data-app1
EOF

2. Create an intra-cluster migration plan, from local cluster (host) to local cluster (host). (No mapping)

3. Execute the intra-cluster "State" migration.

4. Execute a "Rollback".

Actual results:
The rollback will fail with this error

"Source PVCs [...] are mapped to destination PVCs which result in conflicts. Please ensure that each source PVC is mapped to a distinct destination PVC and try again."



Expected results:
The rollback should be executed without problems.

Additional info:

The error in the rollback happens because:

1. We have 1 pvc, with name P1:P1
2. We map it to P1:P2 and I run the intra cluster state migration
3. The result is that in the migplan now we have 2 PVCs:
- P1:P2
- P2:P2

We can see that P2 is mapped to P2 and that is triggering the error in the rollback.

Comment 1 Erik Nelson 2021-09-23 18:02:35 UTC
Since the impact of this is a pretty specific edge case (you need to be rolling back a migration that's within the same cluster AND namespace), we're going to push this to a 1.6.1 z stream release.

Comment 8 Prasad Joshi 2021-10-18 05:57:11 UTC
Verified with MTC 1.6.1

Image:
registry.redhat.io/rhmtc/openshift-migration-controller-rhel8@sha256:c65bb630b5fbb44529861051be16fcceb67f19cfa90d36864095ba70a5533ace

Comment 12 errata-xmlrpc 2021-10-28 09:48:01 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 (Migration Toolkit for Containers (MTC) 1.6.1 release advisory), 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/RHBA-2021:4023


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