Bug 2005815

Summary: Rollback of intra-cluster State migration fails with PVC mapping error
Product: Migration Toolkit for Containers Reporter: Sergio <sregidor>
Component: GeneralAssignee: Pranav Gaikwad <pgaikwad>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: medium    
Version: 1.6.0CC: ernelson, prajoshi, rjohnson
Target Milestone: ---   
Target Release: 1.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-28 09:48:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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