Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 1 | <!-- |
| 2 | ~ Copyright 2017-present Open Networking Foundation |
| 3 | ~ |
| 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | ~ you may not use this file except in compliance with the License. |
| 6 | ~ You may obtain a copy of the License at |
| 7 | ~ |
| 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | ~ |
| 10 | ~ Unless required by applicable law or agreed to in writing, software |
| 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | ~ See the License for the specific language governing permissions and |
| 14 | ~ limitations under the License. |
| 15 | --> |
| 16 | <scenario name="upgrade" description="ONOS cluster upgrade"> |
| 17 | <group name="Upgrade"> |
| 18 | <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/> |
| 19 | |
| 20 | <step name="Initialize-Upgrade" |
| 21 | exec="onos ${OC1} issu init"/> |
| 22 | |
| 23 | <group name="Phase-1"> |
| 24 | <sequential var="${OCMI#}" |
| 25 | starts="Phase-One-Stop-Service-${#}" |
| 26 | ends="Phase-One-Wait-for-Start-${#-1}"> |
| 27 | <step name="Phase-One-Stop-Service-${#}" |
| 28 | exec="onos-service ${OCMI#} stop" |
| 29 | requires="Initialize-Upgrade"/> |
| 30 | |
| 31 | <step name="Phase-One-Wait-for-Stop-${#}" |
| 32 | exec="onos-wait-for-stop ${OCMI#}" |
| 33 | requires="~Phase-One-Stop-Service-${#}"/> |
| 34 | |
| 35 | <step name="Phase-One-Uninstall-${#}" |
| 36 | exec="onos-uninstall ${OCMI#}" |
| 37 | requires="~Phase-One-Wait-for-Stop-${#}"/> |
| 38 | |
| 39 | <step name="Phase-One-Push-Bits-${#}" |
| 40 | exec="onos-push-bits ${OCMI#}" |
| 41 | unless="${OCT}" |
| 42 | requires="~Phase-One-Stop-Service-${#}"/> |
| 43 | |
| 44 | <step name="Phase-One-Install-Upgrade-${#}" |
| 45 | exec="onos-install -v ${OCMI#}" |
| 46 | requires="Phase-One-Push-Bits-${#},Push-Bits,Phase-One-Uninstall-${#}"/> |
| 47 | |
| 48 | <step name="Phase-One-Secure-SSH-${#}" |
| 49 | exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}" |
| 50 | requires="~Phase-One-Install-Upgrade-${#}"/> |
| 51 | |
| 52 | <step name="Phase-One-Wait-for-Start-${#}" |
| 53 | exec="onos-wait-for-start ${OCMI#}" |
| 54 | requires="Phase-One-Secure-SSH-${#}"/> |
| 55 | </sequential> |
| 56 | </group> |
| 57 | |
| 58 | <step name="Run-Upgrade" |
| 59 | exec="onos ${OC1} issu upgrade" |
| 60 | requires="Phase-1"/> |
| 61 | |
| 62 | <group name="Phase-2" requires="Run-Upgrade"> |
| 63 | <sequential var="${OCMA#}" |
| 64 | starts="Phase-Two-Stop-Service-${#}" |
| 65 | ends="Phase-Two-Wait-for-Start-${#-1}"> |
| 66 | <step name="Phase-Two-Stop-Service-${#}" |
| 67 | exec="onos-service ${OCMA#} stop" |
| 68 | requires="Run-Upgrade"/> |
| 69 | |
| 70 | <step name="Phase-Two-Wait-for-Stop-${#}" |
| 71 | exec="onos-wait-for-stop ${OCMA#}" |
| 72 | requires="~Phase-Two-Stop-Service-${#}"/> |
| 73 | |
| 74 | <step name="Phase-Two-Uninstall-${#}" |
| 75 | exec="onos-uninstall ${OCMA#}" |
| 76 | requires="~Phase-Two-Wait-for-Stop-${#}"/> |
| 77 | |
| 78 | <step name="Phase-Two-Push-Bits-${#}" |
| 79 | exec="onos-push-bits ${OCMA#}" |
| 80 | unless="${OCT}" |
| 81 | requires="~Phase-Two-Stop-Service-${#}"/> |
| 82 | |
| 83 | <step name="Phase-Two-Install-Upgrade-${#}" |
| 84 | exec="onos-install -v ${OCMA#}" |
| 85 | requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/> |
| 86 | |
| 87 | <step name="Phase-Two-Secure-SSH-${#}" |
| 88 | exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMA#}" |
| 89 | requires="~Phase-Two-Install-Upgrade-${#}"/> |
| 90 | |
| 91 | <step name="Phase-Two-Wait-for-Start-${#}" |
| 92 | exec="onos-wait-for-start ${OCMA#}" |
| 93 | requires="Phase-Two-Secure-SSH-${#}"/> |
| 94 | </sequential> |
| 95 | </group> |
| 96 | |
| 97 | <step name="Commit-Upgrade" |
| 98 | exec="onos ${OC1} issu commit" |
| 99 | requires="Phase-2"/> |
| 100 | |
| 101 | <group name="Verify-Upgrade" requires="Commit-Upgrade"> |
| 102 | <parallel var="${OC#}"> |
| 103 | <step name="Check-Nodes-${#}" |
| 104 | exec="onos-check-nodes ${OC#}" |
| 105 | delay="3" |
| 106 | requires="Commit-Upgrade"/> |
| 107 | <step name="Check-Components-${#}" |
| 108 | exec="onos-check-components ${OC#}" |
| 109 | delay="5" |
| 110 | requires="~Check-Nodes-${#}"/> |
| 111 | |
| 112 | <step name="Check-Logs-${#}" |
| 113 | exec="onos-check-logs ${OC#}" |
| 114 | requires="~Check-Components-${#}"/> |
| 115 | <step name="Check-Apps-${#}" |
| 116 | exec="onos-check-apps ${OC#} ${ONOS_APPS} includes" |
| 117 | requires="~Check-Components-${#}"/> |
| 118 | </parallel> |
| 119 | </group> |
| 120 | </group> |
| 121 | </scenario> |