feat(xo-server-usage-report): ignore replicated VMs (#5241)
Fixes #4778
This commit is contained in:
parent
6fd45a37e2
commit
c77016ea44
@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
> Users must be able to say: “Nice enhancement, I'm eager to test it”
|
> Users must be able to say: “Nice enhancement, I'm eager to test it”
|
||||||
|
|
||||||
|
- [Usage report] Exclude replicated VMs from the VMs evolution [#4778](https://github.com/vatesfr/xen-orchestra/issues/4778) (PR [#5241](https://github.com/vatesfr/xen-orchestra/pull/5241))
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||||
@ -27,3 +29,5 @@
|
|||||||
> - major: if the change breaks compatibility
|
> - major: if the change breaks compatibility
|
||||||
>
|
>
|
||||||
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
||||||
|
|
||||||
|
- xo-server-usage-report minor
|
||||||
|
@ -405,16 +405,26 @@ async function getSrsStats({ xo, xoObjects }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function computeGlobalVmsStats({ haltedVms, vmsStats, xo }) {
|
function computeGlobalVmsStats({ haltedVms, vmsStats, xo }) {
|
||||||
const allVms = concat(
|
const allVms = vmsStats.map(vm => ({
|
||||||
map(vmsStats, vm => ({
|
uuid: vm.uuid,
|
||||||
uuid: vm.uuid,
|
name: vm.name,
|
||||||
name: vm.name,
|
}))
|
||||||
})),
|
|
||||||
map(haltedVms, vm => ({
|
haltedVms.forEach(vm => {
|
||||||
uuid: vm.uuid,
|
const isReplication =
|
||||||
name: vm.name_label,
|
'start' in vm.blockedOperations &&
|
||||||
}))
|
vm.tags.some(
|
||||||
)
|
tag => tag === 'Disaster Recovery' || tag === 'Continuous Replication'
|
||||||
|
)
|
||||||
|
|
||||||
|
// Exclude replicated VMs because they keep being created/destroyed due to the implementation
|
||||||
|
if (!isReplication) {
|
||||||
|
allVms.push({
|
||||||
|
uuid: vm.uuid,
|
||||||
|
name: vm.name_label,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
return Object.assign(
|
return Object.assign(
|
||||||
computeMeans(vmsStats, [
|
computeMeans(vmsStats, [
|
||||||
@ -426,7 +436,7 @@ function computeGlobalVmsStats({ haltedVms, vmsStats, xo }) {
|
|||||||
'netTransmission',
|
'netTransmission',
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
number: allVms.length,
|
number: vmsStats.length + haltedVms.length,
|
||||||
allVms,
|
allVms,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user