Bug 1576658

Summary: oc adm migrate storage fails if pods deleted during the migration
Product: OpenShift Container Platform Reporter: Kenjiro Nakayama <knakayam>
Component: MasterAssignee: Maciej Szulik <maszulik>
Status: CLOSED DEFERRED QA Contact: Wang Haoran <haowang>
Severity: urgent Docs Contact:
Priority: high    
Version: 3.7.0CC: aos-bugs, erich, fcami, jkaur, jokerman, mfojtik, mmccomas, sdodson
Target Milestone: ---   
Target Release: 3.7.z   
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: 2019-03-15 11:30:45 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 Kenjiro Nakayama 2018-05-10 05:10:50 UTC
Description of problem:
- When we run oc adm migrate storage, we got following error:

```
    "stdout": "E0507 17:21:02.645139 error:     -n xxx pods/config-rest-2-thzt8: pods \"config-rest-2-thzt8\" not found\nE0507 17:21:02.708902 error:     -n xxx pods/end-to-end-test-1-668xr: pods \"end-to-end-test-1-668xr\" not found\nE0507 17:21:02.741192 error:     -n xxx pods/kafka-1-zlc9b: pods \"kafka-1-zlc9b\" not found\nsummary: total=38931 errors=3 ignored=0 unchanged=28861 migrated=10067\ninfo: to rerun only failing resources, add --include=pods\nerror: 3 resources failed to migrate",
    "stdout_lines": [
        "E0507 17:21:02.645139 error:     -n xxx pods/config-rest-2-thzt8: pods \"config-rest-2-thzt8\" not found",
        "E0507 17:21:02.708902 error:     -n xxx pods/end-to-end-test-1-668xr: pods \"end-to-end-test-1-668xr\" not found",
        "E0507 17:21:02.741192 error:     -n xxx pods/kafka-1-zlc9b: pods \"kafka-1-zlc9b\" not found",
        "summary: total=38931 errors=3 ignored=0 unchanged=28861 migrated=10067",
        "info: to rerun only failing resources, add --include=pods",
        "error: 3 resources failed to migrate"
    ]
```

- Root cause of this issue is that "# oc adm --config=/etc/origin/master/admin.kubeconfig migrate storage --include=* --confirm" in "TASK [Upgrade all storage]" fails if pods are re-started(re-created).

Version-Release number of the following components:
- OCP 3.7

How reproducible: 10%

Steps to Reproduce:
1. Delete or re-create pods during oc adm migrate storage. (It happens usually by CrashLooping pods)

Actual results:
- Please refer to the error above.

Expected results:
- Success upgrade playbook without error.
- We would like to request to increase success rate of "oc adm migrate storage" (TASK [Upgrade all storage]), since upgrade playbook took long time and re-run the playbook is bothering.

Comment 2 Seth Jennings 2018-05-10 19:12:42 UTC
I think this is just due to a delay between when the pod resources are listed and when the pods are actually migrated.  Pods that are removed between the two times cause errors but are harmless.

Maybe we not returning errors in that case.