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

Bug 1845361

Summary: "host_cluster_restart_restic: true" did not work as expected
Product: OpenShift Container Platform Reporter: whu
Component: Migration ToolingAssignee: Derek Whatley <dwhatley>
Status: CLOSED NOTABUG QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4CC: chezhang, dwhatley, mberube, rjohnson, sregidor, sseago
Target Milestone: ---   
Target Release: ---   
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-06-11 13:48:34 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 whu 2020-06-09 02:28:52 UTC
Description of problem:
After setting "host_cluster_restart_restic: true" on the MigrationController CR, the restic pod on the host cluster did not restart during migration process.

Version-Release number of selected component (if applicable):
CAM 1.2.2 stage
SOURCE: OCP 4.3 azure
TARGET: OCP 4.4 azure
azure S3 BUCKET

How reproducible:
Always

Steps to Reproduce:
1. add "host_cluster_restart_restic: true" on the MigrationController CR

$ oc get MigrationController -o yaml|grep -i restic

$ oc edit MigrationController 

$ oc get MigrationController -o yaml|grep -i restic
    host_cluster_restart_restic: true

2 record the restic pod name in host cluster
$ oc get  pod  |grep restic
restic-kd6jw                                                   1/1     Running     0          6h18m
restic-mpsrm                                                   1/1     Running     0          6h18m
restic-xpbw9                                                   1/1     Running     0          6h18m


3 run a migration as normal.

4 check the restic pod name in host cluster again, the pod did not restart. 
$ oc get  pod  |grep restic
restic-kd6jw                                                   1/1     Running     0          6h18m
restic-mpsrm                                                   1/1     Running     0          6h18m
restic-xpbw9                                                   1/1     Running     0          6h18m

Actual results:
Afiter setting  "host_cluster_restart_restic: true" on the MigrationController CR,  the  restic pod in host cluster did NOT restart during migraton process.

Expected results:
Afiter setting "host_cluster_restart_restic: true" on the MigrationController CR,  the restic pod in host cluster will restart during migraton process.



Additional info:

Comment 1 Derek Whatley 2020-06-09 16:43:31 UTC
This is a bug, good catch!

When I examine the mig-operator logs, I see this:

---
fatal: [localhost]: FAILED! => {"changed": false, "error": 422, "msg": "Failed to create object: b'{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"MigCluster.migration.openshift.io \\\\\"host\\\\\" is invalid: spec.restartRestic: Invalid value: \\\\\"string\\\\\": spec.restartRestic in body must be of type boolean: \\\\\"string\\\\\"\",\"reason\":\"Invalid\",\"details\":{\"name\":\"host\",\"group\":\"migration.openshift.io\",\"kind\":\"MigCluster\",\"causes\":[{\"reason\":\"FieldValueInvalid\",\"message\":\"Invalid value: \\\\\"string\\\\\": spec.restartRestic in body must be of type boolean: \\\\\"string\\\\\"\",\"field\":\"spec.restartRestic\"}]},\"code\":422}\\n'", "reason": "Unprocessable Entity", "status": 422}

TASK [migrationcontroller : operator_sdk.util.k8s_status] **********************
task path: /opt/ansible/roles/migrationcontroller/tasks/main.yml:561
---


I'll need to submit a patch to mig-operator to get this fixed. Will post when it's ready.

Comment 2 Derek Whatley 2020-06-09 17:54:43 UTC
Fix: https://github.com/konveyor/mig-operator/pull/373

Comment 6 whu 2020-06-11 10:50:37 UTC
verified in new cam stage image, this issue has NOT been fixed. 

Image information:
    - openshift-migration-rhel7-operator@sha256:ab124c3917a2ea22e03618f287c629e727bbcdf7ec76db5e7d0f8654064b7a52
    - openshift-migration-controller-rhel8@sha256:ca9ab7ecf0d939afa1aae2540bb3daf5d7ce651ad58b94c6987484d12af1d211
    - openshift-migration-velero-restic-restore-helper-rhel8@sha256:e9459138ec3531eefbefa181dae3fd93fe5cf210b2a0bd3bca7ba38fbec97f60

In target cluster

Before migration:

$ oc get pod |grep -i restic
restic-w56ts                                                   1/1     Running     0          4h53m
restic-wvqxb                                                   1/1     Running     0          4h53m
restic-zftdc                                                   1/1     Running     0          4h53m

// Modify the MigrationController CR
$  oc get MigrationController -o yaml |grep -i restic
    host_cluster_restart_restic: true


After migration 

$ oc get pod |grep -i restic
restic-w56ts                                                   1/1     Running     0          5h36m
restic-wvqxb                                                   1/1     Running     0          5h36m
restic-zftdc                                                   1/1     Running     0          5h36m

Comment 7 Scott Seago 2020-06-11 13:19:31 UTC
Restic only restarts on src cluster, not target cluster.

Comment 8 Xin jiang 2020-06-11 13:48:34 UTC
This is not a bug per the above explanation.