Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 1 | /** |
| 2 | * |
| 3 | * Upgrade Ceph mon/mgr/osd/rgw/client |
| 4 | * |
| 5 | * Requred parameters: |
| 6 | * SALT_MASTER_URL URL of Salt master |
| 7 | * SALT_MASTER_CREDENTIALS Credentials to the Salt API |
| 8 | * |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 9 | * CLUSTER_FLAGS Comma separated list of tags to apply to cluster |
| 10 | * WAIT_FOR_HEALTHY Wait for cluster rebalance before stoping daemons |
Denis Egorenko | a5594de | 2021-01-11 15:24:45 +0400 | [diff] [blame] | 11 | * ASK_CONFIRMATION Ask for manual confirmation |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 12 | * ORIGIN_RELEASE Ceph release version before upgrade |
| 13 | * TARGET_RELEASE Ceph release version after upgrade |
| 14 | * STAGE_UPGRADE_MON Set to True if Ceph mon nodes upgrade is desired |
| 15 | * STAGE_UPGRADE_MGR Set to True if Ceph mgr nodes upgrade or new deploy is desired |
| 16 | * STAGE_UPGRADE_OSD Set to True if Ceph osd nodes upgrade is desired |
| 17 | * STAGE_UPGRADE_RGW Set to True if Ceph rgw nodes upgrade is desired |
| 18 | * STAGE_UPGRADE_CLIENT Set to True if Ceph client nodes upgrade is desired (includes for example ctl/cmp nodes) |
Michael Vollman | bcec46f | 2019-05-07 08:10:00 -0400 | [diff] [blame] | 19 | * STAGE_FINALIZE Set to True if configs recommended for TARGET_RELEASE should be set after upgrade is done |
| 20 | * BACKUP_ENABLED Select to copy the disks of Ceph VMs before upgrade and backup Ceph directories on OSD nodes |
| 21 | * BACKUP_DIR Select the target dir to backup to when BACKUP_ENABLED |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 22 | * |
| 23 | */ |
| 24 | |
| 25 | common = new com.mirantis.mk.Common() |
| 26 | salt = new com.mirantis.mk.Salt() |
| 27 | def python = new com.mirantis.mk.Python() |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 28 | ceph = new com.mirantis.mk.Ceph() |
Denis Egorenko | a5594de | 2021-01-11 15:24:45 +0400 | [diff] [blame] | 29 | askConfirmation = (env.getProperty('ASK_CONFIRMATION') ?: true).toBoolean() |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 30 | |
Tomek Jaroszyk | bddec29 | 2020-08-18 10:21:54 +0200 | [diff] [blame] | 31 | pepperEnv = "pepperEnv" |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 32 | flags = CLUSTER_FLAGS.tokenize(',') |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 33 | // sortbitwise is set by default on version >jewel. |
| 34 | // For jewel upgrade we will set and keep it while for other cases shouldn't be there |
| 35 | flags.removeElement('sortbitwise') |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 36 | |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 37 | def backup(master, target) { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 38 | stage("backup $target") { |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 39 | |
Jiri Broulik | fd2dcaf | 2017-12-08 15:19:51 +0100 | [diff] [blame] | 40 | if (target == 'osd') { |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 41 | try { |
Jiri Broulik | fd2dcaf | 2017-12-08 15:19:51 +0100 | [diff] [blame] | 42 | salt.enforceState(master, "I@ceph:${target}", "ceph.backup", true) |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 43 | ceph.cmdRunOnTarget(master, "I@ceph:${target}", "su root -c '/usr/local/bin/ceph-backup-runner-call.sh'") |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 44 | } catch (Exception e) { |
Jiri Broulik | fd2dcaf | 2017-12-08 15:19:51 +0100 | [diff] [blame] | 45 | common.errorMsg(e) |
| 46 | common.errorMsg("Make sure Ceph backup on OSD nodes is enabled") |
| 47 | throw new InterruptedException() |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 48 | } |
Jiri Broulik | fd2dcaf | 2017-12-08 15:19:51 +0100 | [diff] [blame] | 49 | } else { |
| 50 | def _pillar = salt.getGrain(master, 'I@salt:master', 'domain') |
| 51 | def domain = _pillar['return'][0].values()[0].values()[0] |
| 52 | |
| 53 | def kvm_pillar = salt.getGrain(master, 'I@salt:control', 'id') |
| 54 | def kvm01 = kvm_pillar['return'][0].values()[0].values()[0] |
| 55 | |
| 56 | def target_pillar = salt.getGrain(master, "I@ceph:${target}", 'host') |
| 57 | def minions = target_pillar['return'][0].values() |
| 58 | for (minion in minions) { |
| 59 | def minion_name = minion.values()[0] |
| 60 | def provider_pillar = salt.getPillar(master, "${kvm01}", "salt:control:cluster:internal:node:${minion_name}:provider") |
| 61 | def minionProvider = provider_pillar['return'][0].values()[0] |
| 62 | |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 63 | ceph.waitForHealthy(master, flags) |
Jiri Broulik | fd2dcaf | 2017-12-08 15:19:51 +0100 | [diff] [blame] | 64 | try { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 65 | ceph.cmdRunOnTarget(master, minionProvider, "[ ! -f ${BACKUP_DIR}/${minion_name}.${domain}.qcow2.bak ] && virsh destroy ${minion_name}.${domain}") |
Jiri Broulik | fd2dcaf | 2017-12-08 15:19:51 +0100 | [diff] [blame] | 66 | } catch (Exception e) { |
| 67 | common.warningMsg('Backup already exists') |
| 68 | } |
| 69 | try { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 70 | ceph.cmdRunOnTarget(master, minionProvider, "[ ! -f ${BACKUP_DIR}/${minion_name}.${domain}.qcow2.bak ] && cp /var/lib/libvirt/images/${minion_name}.${domain}/system.qcow2 ${BACKUP_DIR}/${minion_name}.${domain}.qcow2.bak") |
Jiri Broulik | fd2dcaf | 2017-12-08 15:19:51 +0100 | [diff] [blame] | 71 | } catch (Exception e) { |
| 72 | common.warningMsg('Backup already exists') |
| 73 | } |
| 74 | try { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 75 | ceph.cmdRunOnTarget(master, minionProvider, "virsh start ${minion_name}.${domain}") |
Jiri Broulik | fd2dcaf | 2017-12-08 15:19:51 +0100 | [diff] [blame] | 76 | } catch (Exception e) { |
| 77 | common.warningMsg(e) |
| 78 | } |
| 79 | salt.minionsReachable(master, 'I@salt:master', "${minion_name}*") |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 80 | ceph.waitForHealthy(master, flags) |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 81 | } |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 82 | } |
| 83 | } |
| 84 | return |
| 85 | } |
| 86 | |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 87 | def upgrade(master, target) { |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 88 | |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 89 | stage("Change $target repos") { |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 90 | salt.runSaltProcessStep(master, "I@ceph:${target}", 'saltutil.refresh_pillar', [], null, true, 5) |
| 91 | salt.enforceState(master, "I@ceph:${target}", 'linux.system.repo', true) |
| 92 | } |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 93 | if (target == 'mgr') { |
| 94 | stage('Run ceph mgr state') { |
Tomek Jaroszyk | 0cb8392 | 2020-04-07 11:20:31 +0200 | [diff] [blame] | 95 | salt.enforceState(master, "I@ceph:mgr", "ceph.mgr", true, failOnError=false, retries=3, retries_wait=10) |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 96 | } |
| 97 | } |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 98 | if (target == 'common') { |
| 99 | stage('Upgrade ceph-common pkgs') { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 100 | salt.runSaltProcessStep(master, "I@ceph:common", 'pkg.install', ["ceph-common"], 'only_upgrade=True') |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 101 | } |
| 102 | } else { |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 103 | minions = salt.getMinions(master, "I@ceph:${target}") |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 104 | |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 105 | def ignoreDifferentSubversions = false |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 106 | for (minion in minions) { |
| 107 | // upgrade pkgs |
| 108 | if (target == 'radosgw') { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 109 | stage("Upgrade radosgw pkgs on $minion") { |
| 110 | salt.runSaltProcessStep(master, minion, 'pkg.install', [target], 'only_upgrade=True') |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 111 | } |
| 112 | } else { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 113 | stage("Upgrade $target pkgs on $minion") { |
| 114 | salt.runSaltProcessStep(master, minion, 'pkg.install', ["ceph-${target}"], 'only_upgrade=True') |
| 115 | } |
| 116 | } |
| 117 | // check for subversion difference before restart |
| 118 | if (ignoreDifferentSubversions) { |
| 119 | targetVersion = ceph.cmdRun(master, "ceph versions | grep $TARGET_RELEASE | awk '{print \$3}' | sort -V | tail -1") |
| 120 | updatedVersion = ceph.cmdRunOnTarget(master, minion, "ceph version | awk '{print \$3}'") |
| 121 | if (targetVersion != updatedVersion) { |
| 122 | stage('Version differnce warning') { |
| 123 | common.warningMsg("A potential problem has been spotted.") |
| 124 | common.warningMsg("Some components already have $targetVersion version while ceph-$target has just been updated to $updatedVersion") |
| 125 | input message: "Do you want to proceed with restarts and silence this warning?" |
| 126 | ignoreDifferentSubversions = true |
| 127 | } |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 128 | } |
| 129 | } |
| 130 | // restart services |
| 131 | stage("Restart ${target} services on ${minion}") { |
Mateusz Los | abf4ef5 | 2020-05-11 10:37:23 +0200 | [diff] [blame] | 132 | if(target == 'osd') { |
Tomek Jaroszyk | 0cb8392 | 2020-04-07 11:20:31 +0200 | [diff] [blame] | 133 | def ceph_disks = salt.getGrain(master, minion, 'ceph')['return'][0].values()[0].values()[0]['ceph_disk'] |
Mateusz Los | b8575e6 | 2020-02-06 13:33:42 +0100 | [diff] [blame] | 134 | ceph_disks.each { osd, param -> |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 135 | ceph.cmdRunOnTarget(master, minion, "systemctl restart ceph-${target}@${osd}") |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 136 | } |
Mateusz Los | abf4ef5 | 2020-05-11 10:37:23 +0200 | [diff] [blame] | 137 | } |
| 138 | else { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 139 | ceph.cmdRunOnTarget(master, minion, "systemctl restart ceph-${target}.target") |
Mateusz Los | abf4ef5 | 2020-05-11 10:37:23 +0200 | [diff] [blame] | 140 | } |
| 141 | |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 142 | ceph.waitForHealthy(master, flags) |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 143 | } |
| 144 | |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 145 | stage("Verify services for $minion") { |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 146 | sleep(10) |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 147 | ceph.cmdRunOnTarget(master, minion, "systemctl status ceph-${target}.target") |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 148 | } |
| 149 | |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 150 | stage('Verify Ceph status') { |
| 151 | ceph.cmdRun(master, "ceph -s", true, true) |
| 152 | if (askConfirmation) { |
| 153 | input message: "From the verification command above, please check Ceph $target joined the cluster correctly. If so, Do you want to continue to upgrade next node?" |
Denis Egorenko | a5594de | 2021-01-11 15:24:45 +0400 | [diff] [blame] | 154 | } |
Jiri Broulik | 96c867a | 2017-11-07 16:14:10 +0100 | [diff] [blame] | 155 | } |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 156 | } |
| 157 | } |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 158 | ceph.cmdRun(master, "ceph versions") |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 159 | sleep(5) |
| 160 | return |
| 161 | } |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 162 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 163 | timeout(time: 12, unit: 'HOURS') { |
| 164 | node("python") { |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 165 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 166 | // create connection to salt master |
| 167 | python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS) |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 168 | |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 169 | stage('Check user choices') { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 170 | if (STAGE_UPGRADE_RGW.toBoolean()) { |
Alena Kiseleva | 639b001 | 2019-01-22 17:09:33 +0300 | [diff] [blame] | 171 | // if rgw, check if other stuff has required version |
| 172 | def mon_ok = true |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 173 | if (!STAGE_UPGRADE_MON.toBoolean()) { |
| 174 | def mon_v = ceph.cmdRun(pepperEnv, "ceph mon versions") |
Alena Kiseleva | 639b001 | 2019-01-22 17:09:33 +0300 | [diff] [blame] | 175 | mon_ok = mon_v.contains("${TARGET_RELEASE}") && !mon_v.contains("${ORIGIN_RELEASE}") |
| 176 | } |
| 177 | def mgr_ok = true |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 178 | if (!STAGE_UPGRADE_MGR.toBoolean()) { |
| 179 | def mgr_v = ceph.cmdRun(pepperEnv, "ceph mgr versions") |
Alena Kiseleva | 639b001 | 2019-01-22 17:09:33 +0300 | [diff] [blame] | 180 | mgr_ok = mgr_v.contains("${TARGET_RELEASE}") && !mgr_v.contains("${ORIGIN_RELEASE}") |
| 181 | } |
| 182 | def osd_ok = true |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 183 | if (!STAGE_UPGRADE_OSD.toBoolean()) { |
| 184 | def osd_v = ceph.cmdRun(pepperEnv, "ceph osd versions") |
Alena Kiseleva | 639b001 | 2019-01-22 17:09:33 +0300 | [diff] [blame] | 185 | osd_ok = osd_v.contains("${TARGET_RELEASE}") && !osd_v.contains("${ORIGIN_RELEASE}") |
| 186 | } |
| 187 | if (!mon_ok || !osd_ok || !mgr_ok) { |
| 188 | common.errorMsg('You may choose stages in any order, but RGW should be upgraded last') |
| 189 | throw new InterruptedException() |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 194 | if (BACKUP_ENABLED.toBoolean() == true) { |
| 195 | if (STAGE_UPGRADE_MON.toBoolean() == true) { |
| 196 | backup(pepperEnv, 'mon') |
| 197 | } |
| 198 | if (STAGE_UPGRADE_RGW.toBoolean() == true) { |
| 199 | backup(pepperEnv, 'radosgw') |
| 200 | } |
| 201 | if (STAGE_UPGRADE_OSD.toBoolean() == true) { |
| 202 | backup(pepperEnv, 'osd') |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 203 | } |
| 204 | } |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 205 | |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 206 | stage('Set cluster flags') { |
| 207 | ceph.setFlags(pepperEnv, flags) |
| 208 | if (ORIGIN_RELEASE == 'jewel') { |
| 209 | ceph.setFlags('sortbitwise') |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 210 | } |
| 211 | } |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 212 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 213 | if (STAGE_UPGRADE_MON.toBoolean() == true) { |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 214 | upgrade(pepperEnv, 'mon') |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | if (STAGE_UPGRADE_MGR.toBoolean() == true) { |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 218 | upgrade(pepperEnv, 'mgr') |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | if (STAGE_UPGRADE_OSD.toBoolean() == true) { |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 222 | upgrade(pepperEnv, 'osd') |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | if (STAGE_UPGRADE_RGW.toBoolean() == true) { |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 226 | upgrade(pepperEnv, 'radosgw') |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | if (STAGE_UPGRADE_CLIENT.toBoolean() == true) { |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 230 | upgrade(pepperEnv, 'common') |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | // remove cluster flags |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 234 | stage('Unset cluster flags') { |
| 235 | ceph.unsetFlags(flags) |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 236 | } |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 237 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 238 | if (STAGE_FINALIZE.toBoolean() == true) { |
| 239 | stage("Finalize ceph version upgrade") { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 240 | ceph.cmdRun(pepperEnv, "ceph osd require-osd-release ${TARGET_RELEASE}") |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 241 | try { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 242 | ceph.cmdRun(pepperEnv, "ceph osd set-require-min-compat-client ${ORIGIN_RELEASE}") |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 243 | } catch (Exception e) { |
| 244 | common.warningMsg(e) |
| 245 | } |
| 246 | try { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 247 | ceph.cmdRun(pepperEnv, "ceph osd crush tunables optimal") |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 248 | } catch (Exception e) { |
| 249 | common.warningMsg(e) |
| 250 | } |
Tomek Jaroszyk | 0cb8392 | 2020-04-07 11:20:31 +0200 | [diff] [blame] | 251 | if (TARGET_RELEASE == 'nautilus' ) { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 252 | ceph.cmdRun(pepperEnv, "ceph mon enable-msgr2") |
Tomek Jaroszyk | 0cb8392 | 2020-04-07 11:20:31 +0200 | [diff] [blame] | 253 | } |
Tomek Jaroszyk | f354656 | 2020-09-17 15:34:05 +0200 | [diff] [blame] | 254 | salt.enforceState(pepperEnv, "I@ceph:common", "ceph.common") |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 255 | } |
| 256 | } |
| 257 | |
| 258 | // wait for healthy cluster |
Ivan Berezovskiy | 2325dcb | 2019-11-05 17:42:57 +0400 | [diff] [blame] | 259 | if (WAIT_FOR_HEALTHY.toBoolean()) { |
Tomek Jaroszyk | 8b8cd14 | 2022-02-18 14:46:34 +0100 | [diff] [blame^] | 260 | ceph.waitForHealthy(pepperEnv, flags) |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 261 | } |
Jiri Broulik | dc87d72 | 2017-11-03 15:43:22 +0100 | [diff] [blame] | 262 | } |
| 263 | } |