Bug 1917810

Summary: DIM is ignoring disable_image_migration value
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: unspecified    
Version: 1.4.0CC: chezhang, ernelson, pgaikwad, rjohnson, rpattath, whu, xjiang
Target Milestone: ---   
Target Release: 1.4.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: 2021-02-11 12:55:27 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-01-19 12:31:14 UTC
Description of problem:
When we configure disable_image_migration=true in the migrationcontroller resource, Direct Image Migrations are migrating the imagestreams anyway.

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

How reproducible:


Steps to Reproduce:
1. In source cluster. Create a new namespace

  oc new-project bz-test

2. In source cluster. Create an internal imagestream in this namespace

  oc new-build -D $'FROM centos:7\nRUN yum install -y httpd' -n bz-test

3. Create a migration plan for the namespace, using Direct Image Migration.

4. In controller cluster. Configure the MigrationController resource to skip the imagestreams in controller cluster

  oc patch migrationcontroller migration-controller -p '{"spec":{"disable_image_migration": "true" } }' --type='merge' -n openshift-migration

5. Wait until migration-controller pod is restarted

6. Execute the migration


Actual results:
The imagestream should not be migrated, since we hace configured disable_image_migration=true

Expected results:
The imagestream is migrated.

Additional info:

Comment 1 Pranav Gaikwad 2021-01-26 20:23:45 UTC
Upon initial investigation, I could confirm that the imagestreams were migrated even if the `disable_image_migration` is set to True. I will continue to investigate this issue further, but it looks like the root cause of the problem could be that the `imagestreamtags` are not excluded from Velero Backup which is causing them to be restored on the target cluster. When `disable_image_migration` is set, `imagestreams` and `imagetags` resources are added to excluded list but `imagestreamtags` are not which might be causing imagestreams to be restored from the tags.

Comment 6 Sergio 2021-02-02 14:52:14 UTC
With this fix the external images are not being migrated when disable_image_migration=true.

disable_image_migration=true should skip the copy of the internal images, but the external images should be migrated to the target cluster.

We move the status to ASSIGNED.

Comment 8 errata-xmlrpc 2021-02-11 12:55:27 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.4.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:5329