fix(xo-server,xo-web/orphan VDIs): ignore irrelevant VDI types (#5249)

Fixes #5248
This commit is contained in:
badrAZ 2020-09-10 16:00:20 +02:00 committed by GitHub
parent 38248d8c35
commit 8d7f8d156f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -14,6 +14,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [New SR] Fix `Cannot read property 'trim' of undefined` error (PR [#5212](https://github.com/vatesfr/xen-orchestra/pull/5212))
- [Dashboard/Health] Fix suspended VDIs considered as orphans [#5248](https://github.com/vatesfr/xen-orchestra/issues/5248) (PR [#5249](https://github.com/vatesfr/xen-orchestra/pull/5249))
### Packages to release

View File

@ -608,6 +608,7 @@ const TRANSFORMS = {
snapshots: link(obj, 'snapshots'),
tags: obj.tags,
usage: +obj.physical_utilisation,
VDI_type: obj.type,
$SR: link(obj, 'SR'),
$VBDs: link(obj, 'VBDs'),

View File

@ -407,6 +407,8 @@ const ALARM_ACTIONS = [
},
]
const HANDLED_VDI_TYPES = new Set(['system', 'user', 'ephemeral'])
@connectStore(() => {
const getSrs = createGetObjectsOfType('SR')
const getOrphanVdis = createSort(
@ -417,7 +419,7 @@ const ALARM_ACTIONS = [
(vdis, snapshotVdis) => Object.assign({}, vdis, snapshotVdis)
),
createSelector(getSrs, srs => vdi => {
if (vdi.$VBDs.length !== 0) {
if (vdi.$VBDs.length !== 0 || !HANDLED_VDI_TYPES.has(vdi.VDI_type)) {
return false
}