diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md
index 7282fbf610f..3af1b4dc759 100644
--- a/CHANGELOG.unreleased.md
+++ b/CHANGELOG.unreleased.md
@@ -14,6 +14,7 @@
- [Export/Disks] Allow the export of disks in VMDK format (PR [#5982](https://github.com/vatesfr/xen-orchestra/pull/5982))
- [Rolling Pool Update] Automatically pause load balancer plugin during the update [#5711](https://github.com/vatesfr/xen-orchestra/issues/5711)
- [Backup] Speedup merge and cleanup speed for S3 backup by a factor 10 (PR [#6100](https://github.com/vatesfr/xen-orchestra/pull/6100))
+- [Health] Display pools with no default SR (PR [#6083](https://github.com/vatesfr/xen-orchestra/pull/6083))
### Bug fixes
diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js
index fa62054b609..c6064d3e774 100644
--- a/packages/xo-web/src/common/intl/messages.js
+++ b/packages/xo-web/src/common/intl/messages.js
@@ -1401,6 +1401,7 @@ const messages = {
orphanVdisTip: 'VDIs and VDI snapshots that are not attached to a VM',
orphanedVms: 'Orphaned VMs snapshot',
noOrphanedObject: 'No orphans',
+ poolsWithNoDefaultSr: 'Pools with no default SR',
tooManySnapshots: 'Too many snapshots',
tooManySnapshotsTip: 'VMs with more than the recommended amount of snapshots',
noLocalDefaultSrs: 'No local default SRs',
diff --git a/packages/xo-web/src/xo-app/dashboard/health/index.js b/packages/xo-web/src/xo-app/dashboard/health/index.js
index 45ea5a318da..3420bbc7ee8 100644
--- a/packages/xo-web/src/xo-app/dashboard/health/index.js
+++ b/packages/xo-web/src/xo-app/dashboard/health/index.js
@@ -122,6 +122,14 @@ const LOCAL_DEFAULT_SRS_COLUMNS = [
},
]
+const POOLS_WITHOUT_DEFAULT_SR_COLUMNS = [
+ {
+ name: _('pool'),
+ itemRenderer: pool => ,
+ sortCriteria: 'name_label',
+ },
+]
+
const SR_COLUMNS = [
{
name: _('srName'),
@@ -604,15 +612,24 @@ export default class Health extends Component {
)
)
+ _getPoolIds = createCollectionWrapper(createSelector(() => this.state.pools, resolveIds))
+
+ _getSelectedPools = createCollectionWrapper(
+ createSelector(
+ () => this.props.pools,
+ this._getPoolIds,
+ (pools, poolIds) => (isEmpty(poolIds) ? pools : pick(pools, poolIds))
+ )
+ )
+
_getLocalDefaultSrs = createCollectionWrapper(
createSelector(
() => this.props.hosts,
- () => this.props.pools,
() => this.props.userSrs,
- () => this._getPoolIds(),
- (hosts, pools, userSrs, poolIds) => {
+ this._getSelectedPools,
+ (hosts, userSrs, selectedPools) => {
const nbHostsPerPool = countBy(hosts, host => host.$pool)
- return filter(isEmpty(poolIds) ? pools : pick(pools, poolIds), pool => {
+ return filter(selectedPools, pool => {
const { default_SR } = pool
return default_SR !== undefined && !userSrs[default_SR].shared && nbHostsPerPool[pool.id] > 1
})
@@ -620,7 +637,11 @@ export default class Health extends Component {
)
)
- _getPoolIds = createCollectionWrapper(createSelector(() => this.state.pools, resolveIds))
+ _getPoolsWithNoDefaultSr = createCollectionWrapper(
+ createSelector(this._getSelectedPools, selectedPools =>
+ filter(selectedPools, ({ default_SR }) => default_SR === undefined)
+ )
+ )
_getPoolPredicate = createSelector(this._getPoolIds, poolIds =>
isEmpty(poolIds) ? undefined : item => includes(poolIds, item.$pool)
@@ -654,6 +675,7 @@ export default class Health extends Component {
const localDefaultSrs = this._getLocalDefaultSrs()
const userSrs = this._getUserSrs()
const orphanVdis = this._getOrphanVdis()
+ const poolsWithNoDefaultSr = this._getPoolsWithNoDefaultSr()
return (
@@ -721,6 +743,35 @@ export default class Health extends Component {
)}
+ {poolsWithNoDefaultSr.length > 0 && (
+
+
+
+
+ {_('poolsWithNoDefaultSr')}
+
+
+
+ {() => (
+
+
+
+
+
+ )}
+
+
+
+
+
+ )}