diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md
index d631a135b..583fec844 100644
--- a/CHANGELOG.unreleased.md
+++ b/CHANGELOG.unreleased.md
@@ -11,6 +11,7 @@
- [Health] Display default SRs that aren't shared [#5871](https://github.com/vatesfr/xen-orchestra/issues/5871) (PR [#6033](https://github.com/vatesfr/xen-orchestra/pull/6033))
- [Pool,VM/advanced] Ability to change the suspend SR [#4163](https://github.com/vatesfr/xen-orchestra/issues/4163) (PR [#6044](https://github.com/vatesfr/xen-orchestra/pull/6044))
- [Home/VMs/Backup filter] Filter out VMs in disabled backup jobs (PR [#6037](https://github.com/vatesfr/xen-orchestra/pull/6037))
+- [Rolling Pool Update] Automatically disable High Availability during the update [#5711](https://github.com/vatesfr/xen-orchestra/issues/5711) (PR [#6057](https://github.com/vatesfr/xen-orchestra/pull/6057))
### Bug fixes
diff --git a/packages/xo-server/src/xapi/mixins/patching.mjs b/packages/xo-server/src/xapi/mixins/patching.mjs
index 96f240067..82daf821d 100644
--- a/packages/xo-server/src/xapi/mixins/patching.mjs
+++ b/packages/xo-server/src/xapi/mixins/patching.mjs
@@ -478,7 +478,15 @@ export default {
throw new Error('non pool-wide install not implemented')
},
- async rollingPoolUpdate() {
+ @decorateWith(deferrable)
+ async rollingPoolUpdate($defer) {
+ if (this.pool.ha_enabled) {
+ const haSrs = this.pool.$ha_statefiles.map(vdi => vdi.SR)
+ const haConfig = this.pool.ha_configuration
+ await this.call('pool.disable_ha')
+ $defer(() => this.call('pool.enable_ha', haSrs, haConfig))
+ }
+
const hosts = filter(this.objects.all, { $type: 'host' })
await Promise.all(hosts.map(host => host.$call('assert_can_evacuate')))
diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js
index 16ed43753..9234b1bd8 100644
--- a/packages/xo-web/src/common/intl/messages.js
+++ b/packages/xo-web/src/common/intl/messages.js
@@ -1003,6 +1003,7 @@ const messages = {
rollingPoolUpdate: 'Rolling pool update',
rollingPoolUpdateMessage:
'Are you sure you want to start a rolling pool update? Running VMs will be migrated back and forth and this can take a while.',
+ rollingPoolUpdateHaWarning: 'High Availability is enabled. This will automatically disable it during the update.',
poolNeedsDefaultSr: 'The pool needs a default SR to install the patches.',
vmsHaveCds: '{nVms, number} VM{nVms, plural, one {} other {s}} {nVms, plural, one {has} other {have}} CDs',
ejectCds: 'Eject CDs',
diff --git a/packages/xo-web/src/common/xo/index.js b/packages/xo-web/src/common/xo/index.js
index adbe5e560..b1b5d6c89 100644
--- a/packages/xo-web/src/common/xo/index.js
+++ b/packages/xo-web/src/common/xo/index.js
@@ -936,9 +936,10 @@ export const installAllPatchesOnPool = ({ pool }) => {
)
}
+import RollingPoolUpdateModal from './rolling-pool-updates-modal' // eslint-disable-line import/first
export const rollingPoolUpdate = poolId =>
confirm({
- body: _('rollingPoolUpdateMessage'),
+ body:
{_('rollingPoolUpdateMessage')}
+ {pool.HA_enabled && ( +
+
+