Bug 2004347 - State migration fails at StageBackup step if Direct Image Migration is not enabled in the MigPlan CR
Summary: State migration fails at StageBackup step if Direct Image Migration is not en...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Controller
Version: 1.6.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 1.6.1
Assignee: Pranav Gaikwad
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
: 2004566 (view as bug list)
Depends On:
Blocks: 2004675
TreeView+ depends on / blocked
 
Reported: 2021-09-15 04:56 UTC by Xin jiang
Modified: 2021-10-28 09:48 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2004675 (view as bug list)
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 1213 0 None open Bug 2004347: Skip image migration for State Migration 2021-10-06 19:11:38 UTC
Github konveyor mig-controller pull 1214 0 None open Bug 2004347: Skip images during state migration 2021-10-06 19:12:22 UTC
Red Hat Product Errata RHBA-2021:4023 0 None None None 2021-10-28 09:48:06 UTC

Description Xin jiang 2021-09-15 04:56:24 UTC
Description of problem:
If the migplan is not enabled DIM as true, the State migration failed at StageBackup and reported error
"
This migration has following error conditions:
migration registry service not found
"

Version-Release number of selected component (if applicable):
MTC 1.6.0

source:  OCP 3.11 on AWS + MTC 1.5.1
target:  OCP 4.6 on AWS + MTC 1.6.0 (controller)


How reproducible:
always

Steps to Reproduce:
1. Deploy an application
ansible-playbook deploy-app.yml -e use_role=ocp-django -e namespace=newocp-django$ oc -n newocp-django get pod
NAME                             READY     STATUS      RESTARTS   AGE
django-psql-persistent-1-42zs5   1/1       Running     0          43s
django-psql-persistent-1-build   0/1       Completed   0          2m
postgresql-1-jzpxd               1/1       Running     0          2m

2. Create a migplan with   indirectImageMigration: true and   indirectVolumeMigration: true

3. Execute State

Actual results:
The State migration failed at StageBackup

Expected results:
The State migration should completed successfully


Additional info:

1. Migplan
$ oc get migplan newocp-django -o yaml
.....
spec:
  destMigClusterRef:
    name: host
    namespace: openshift-migration
  indirectImageMigration: true
  indirectVolumeMigration: true
  migStorageRef:
    name: camautomation
    namespace: openshift-migration
  namespaces:
  - newocp-django
  persistentVolumes:
  - capacity: 1Gi
    name: pvc-42c3a07b-15da-11ec-aa3f-0eeadc05e8eb
    proposedCapacity: 1Gi
    pvc:
      accessModes:
      - ReadWriteOnce
      hasReference: true
      name: postgresql:postgresql
      namespace: newocp-django
    selection:
      action: copy
      copyMethod: filesystem
      storageClass: gp2
    storageClass: gp2
    supported:
      actions:
      - skip
      - copy
      - move
      copyMethods:
      - filesystem
      - snapshot
  srcMigClusterRef:
    name: source-cluster
    namespace: openshift-migration

2. migmigration
$ oc get migmigration state-migration-cac05 -o yaml
.....
status:
  conditions:
  - category: Advisory
    durable: true
    lastTransitionTime: "2021-09-15T04:10:08Z"
    message: '[1] Stage pods created.'
    status: "True"
    type: StagePodsCreated
  - category: Advisory
    durable: true
    lastTransitionTime: "2021-09-15T04:10:11Z"
    message: 'The migration has failed.  See: Errors.'
    reason: EnsureStageBackup
    status: "True"
    type: Failed
  errors:
  - migration registry service not found
  itinerary: Failed
  observedDigest: c8d71234644888ce1d8861fdea5016b76e0f62241e01e0f00224ddd0a5606116


Controller logs:

{"level":"info","ts":1631681185.4735537,"logger":"migration","msg":"Building Stage Velero Backup resource definition","migMigration":"state-migration-dc055","phase":"EnsureStageBackup"}
{"level":"info","ts":1631681185.5071464,"logger":"migration","msg":"Phase execution failed.","migMigration":"state-migration-dc055","phase":"EnsureStageBackup","phaseDescription":"Creating a stage backup.","error":"migration registry service not found"}
{"level":"info","ts":1631681185.507176,"logger":"migration","msg":"","migMigration":"state-migration-dc055","error":"migration registry service not found","stacktrace":"\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*Task).getAnnotations()\n\t/remote-source/app/pkg/controller/migmigration/registry.go:38\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*Task).buildBackup()\n\t/remote-source/app/pkg/controller/migmigration/backup.go:470\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*Task).ensureStageBackup()\n\t/remote-source/app/pkg/controller/migmigration/backup.go:131\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*Task).Run()\n\t/remote-source/app/pkg/controller/migmigration/task.go:750\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*ReconcileMigMigration).migrate()\n\t/remote-source/app/pkg/controller/migmigration/migrate.go:70\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*ReconcileMigMigration).Reconcile()\n\t/remote-source/app/pkg/controller/migmigration/migmigration_controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler()\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:263\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem()\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:235\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1()\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:198\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1()\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil()\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil()\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext()\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext()\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:99\nruntime.goexit()\n\t/opt/rh/go-toolset-1.16/root/usr/lib/go-toolset-1.16-golang/src/runtime/asm_amd64.s:1371"}
{"level":"info","ts":1631681185.5072126,"logger":"migration","msg":"Marking migration as FAILED. See Status.Errors","migMigration":"state-migration-dc055","phase":"EnsureStageBackup","migrationErrors":["migration registry service not found"]}
{"level":"info","ts":1631681185.5560036,"logger":"migration","msg":"[RUN] (Step 1/4) Migration failed.","migMigration":"state-migration-dc055","phase":"EnsureStageBackup"}

Comment 4 Pranav Gaikwad 2021-10-12 18:05:47 UTC
*** Bug 2004566 has been marked as a duplicate of this bug. ***

Comment 8 ssingla 2021-10-18 10:07:46 UTC
Verified with 

source:  OCP 3.11 on AWS + MTC 1.5.1
target:  OCP 4.6 on AWS + MTC 1.6.1 (controller)

State migration works fine. Moving to Verified status.

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.