Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1879115

Summary: [CMT-UI] A failed migration cannot be executed again from UI if it has been canceled before
Product: OpenShift Container Platform Reporter: Sergio <sregidor>
Component: Migration ToolingAssignee: Ian <ibolton>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.5CC: chezhang, mberube, rjohnson, rpattath, whu, xjiang
Target Milestone: ---   
Target Release: 4.5.0   
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: 2020-09-30 18:43:07 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 2020-09-15 13:23:12 UTC
Description of problem:
When a migration is canceled, and later on it is executed again and it fails, the option to run this migration again is disabled in the UI and cannot be executed any more.

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

How reproducible:
Always

Steps to Reproduce:
1. Create a namespace

oc new-project bztest

2. Create a migration plan for this namespace, and use the name "bztest" for the plan

3. Create a fake canceled  execution
cat <<EOF | oc create -f -
apiVersion: migration.openshift.io/v1alpha1
kind: MigMigration
metadata:
  name: cancelled
  namespace: openshift-migration
spec:
  canceled: true
  migPlanRef:
    name: bztest
    namespace: openshift-migration
  quiescePods: true
  stage: false
status:
  conditions:
  - category: Advisory
    durable: true
    lastTransitionTime: "2020-09-14T16:21:58Z"
    message: '[1] Stage pods created.'
    status: "True"
    type: StagePodsCreated
  - category: Advisory
    durable: true
    lastTransitionTime: "2020-09-14T16:26:38Z"
    message: The migration has been canceled.
    reason: Cancel
    status: "True"
    type: Canceled
  - category: Advisory
    durable: true
    lastTransitionTime: "2020-09-14T16:26:38Z"
    message: The migration has completed successfully.
    reason: Completed
    status: "True"
    type: Succeeded
  itinerary: Cancel
  observedDigest: bc5d7bd366b3cd11f09c93146f5a025b7f9a6eacfd223a822eddf6116991fa1e
  phase: Completed
  startTimestamp: "2020-09-14T16:21:19Z"
EOF


4. Create a fake failed  execution

cat <<EOF | oc create -f  -
apiVersion: migration.openshift.io/v1alpha1
kind: MigMigration
metadata:
  name: fakefailedmigration
  namespace: openshift-migration
spec:
  migPlanRef:
    name: bztest
    namespace: openshift-migration
  quiescePods: true
  stage: false
status:
  conditions:
  - category: Advisory
    durable: true
    lastTransitionTime: "2020-09-14T15:20:26Z"
    message: '[1] Stage pods created.'
    status: "True"
    type: StagePodsCreated
  - category: Advisory
    durable: true
    lastTransitionTime: "2020-09-14T15:26:07Z"
    message: 'The migration has failed.  See: Errors.'
    reason: StageRestoreCreated
    status: "True"
    type: Failed
  errors:
  - 'Restore: openshift-migration/b5b35a70-f69d-11ea-89b0-ff4ebcbfbe3b-k9wnk partially
    failed.'
  itinerary: Failed
  observedDigest: e28d926ab03d858fe1ce88e12a04b13e9a2f71e57d9bb6d1bbef35c3256484a2
  phase: Completed
  startTimestamp: "2020-09-14T15:19:40Z"
EOF


Actual results:
In the UI the option to run the migration plan again is disabled.

Expected results:
The user should be able to run the failed migration again.

Additional info:

Comment 1 Ian 2020-09-16 17:31:31 UTC
Fixed in mig-ui
Commit: eb834427c4bcb4babe69adf9884eec85b60dfd60 cherry-picked to release-1.3.0.

Comment 5 Xin jiang 2020-09-21 03:27:02 UTC
verified with MTC 1.3.0

$ oc get pod -n openshift-migration  migration-operator-2584515257-7bw8w -o yaml| grep image
    image: quay-enterprise-quay-enterprise.apps.cam-tgt-8740.qe.devcluster.openshift.com/admin/openshift-migration-rhel7-operator:v1.3
    imagePullPolicy: Always
  imagePullSecrets:
    image: quay-enterprise-quay-enterprise.apps.cam-tgt-8740.qe.devcluster.openshift.com/admin/openshift-migration-rhel7-operator:v1.3
    imageID: docker-pullable://quay-enterprise-quay-enterprise.apps.cam-tgt-8740.qe.devcluster.openshift.com/admin/openshift-migration-rhel7-operator@sha256:b3096fb9eec0fae3546c64367259bf5018bef26bd62f9733aa7ef9bf7fc59c90


$ oc get pod -n openshift-migration  migration-ui-999399751-mwzpn -o yaml| grep image
  - image: quay-enterprise-quay-enterprise.apps.cam-tgt-8740.qe.devcluster.openshift.com/admin/openshift-migration-ui-rhel8@sha256:d5d2a58977d533d2bd773d6e0403eea9f072a2e09d19efa219fccb3df9b96457
    imagePullPolicy: Always
  imagePullSecrets:
    image: quay-enterprise-quay-enterprise.apps.cam-tgt-8740.qe.devcluster.openshift.com/admin/openshift-migration-ui-rhel8@sha256:d5d2a58977d533d2bd773d6e0403eea9f072a2e09d19efa219fccb3df9b96457
    imageID: docker-pullable://quay-enterprise-quay-enterprise.apps.cam-tgt-8740.qe.devcluster.openshift.com/admin/openshift-migration-ui-rhel8@sha256:d5d2a58977d533d2bd773d6e0403eea9f072a2e09d19efa219fccb3df9b96457

Comment 9 errata-xmlrpc 2020-09-30 18:43:07 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) Tool image release advisory 1.3.0), 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-2020:4148