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-rollback" description="ONOS cluster upgrade and rollback"> |
| 17 | <group name="Upgrade-Rollback"> |
| 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 | <step name="Run-Rollback" |
| 63 | exec="onos ${OC1} issu rollback" |
| 64 | requires="Run-Upgrade"/> |
| 65 | |
| 66 | <group name="Phase-2" requires="Run-Rollback"> |
| 67 | <sequential var="${OCMI#}" |
| 68 | starts="Phase-Two-Stop-Service-${#}" |
| 69 | ends="Phase-Two-Wait-for-Start-${#-1}"> |
| 70 | <step name="Phase-Two-Stop-Service-${#}" |
| 71 | exec="onos-service ${OCMI#} stop" |
| 72 | requires="Run-Rollback"/> |
| 73 | |
| 74 | <step name="Phase-Two-Wait-for-Stop-${#}" |
| 75 | exec="onos-wait-for-stop ${OCMI#}" |
| 76 | requires="~Phase-Two-Stop-Service-${#}"/> |
| 77 | |
| 78 | <step name="Phase-Two-Uninstall-${#}" |
| 79 | exec="onos-uninstall ${OCMI#}" |
| 80 | requires="~Phase-Two-Wait-for-Stop-${#}"/> |
| 81 | |
| 82 | <step name="Phase-Two-Push-Bits-${#}" |
| 83 | exec="onos-push-bits ${OCMI#}" |
| 84 | unless="${OCT}" |
| 85 | requires="~Phase-Two-Stop-Service-${#}"/> |
| 86 | |
| 87 | <step name="Phase-Two-Install-Upgrade-${#}" |
| 88 | exec="onos-install ${OCMI#}" |
| 89 | requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/> |
| 90 | |
| 91 | <step name="Phase-Two-Secure-SSH-${#}" |
| 92 | exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}" |
| 93 | requires="~Phase-Two-Install-Upgrade-${#}"/> |
| 94 | |
| 95 | <step name="Phase-Two-Wait-for-Start-${#}" |
| 96 | exec="onos-wait-for-start ${OCMI#}" |
| 97 | requires="Phase-Two-Secure-SSH-${#}"/> |
| 98 | </sequential> |
| 99 | </group> |
| 100 | |
| 101 | <step name="Reset-Upgrade" |
| 102 | exec="onos ${OC1} issu reset" |
| 103 | requires="Phase-2"/> |
| 104 | |
| 105 | <group name="Verify-Rollback" requires="Reset-Upgrade"> |
| 106 | <parallel var="${OC#}"> |
| 107 | <step name="Check-Nodes-${#}" |
| 108 | exec="onos-check-nodes ${OC#}" |
| 109 | delay="3" |
| 110 | requires="Reset-Upgrade"/> |
| 111 | <step name="Check-Components-${#}" |
| 112 | exec="onos-check-components ${OC#}" |
| 113 | delay="5" |
| 114 | requires="~Check-Nodes-${#}"/> |
| 115 | |
| 116 | <step name="Check-Logs-${#}" |
| 117 | exec="onos-check-logs ${OC#}" |
| 118 | requires="~Check-Components-${#}"/> |
| 119 | <step name="Check-Apps-${#}" |
| 120 | exec="onos-check-apps ${OC#} ${ONOS_APPS} includes" |
| 121 | requires="~Check-Components-${#}"/> |
| 122 | </parallel> |
| 123 | </group> |
| 124 | </group> |
| 125 | </scenario> |