From b48d955c44be6a23e6cee076f4d1e0be50d66b67 Mon Sep 17 00:00:00 2001 From: Florent Beauchamp Date: Tue, 16 Jan 2024 16:32:03 +0000 Subject: [PATCH 1/2] fix(backups/formatVmBackups): ignore suspend vdi when showing key/differential --- @xen-orchestra/backups/formatVmBackups.mjs | 20 ++++++++++++++++---- CHANGELOG.unreleased.md | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/@xen-orchestra/backups/formatVmBackups.mjs b/@xen-orchestra/backups/formatVmBackups.mjs index 7ebe8d9d5df..c6e88fa8dd8 100644 --- a/@xen-orchestra/backups/formatVmBackups.mjs +++ b/@xen-orchestra/backups/formatVmBackups.mjs @@ -2,8 +2,20 @@ import mapValues from 'lodash/mapValues.js' import { dirname } from 'node:path' function formatVmBackup(backup) { - const { isVhdDifferencing } = backup + const { isVhdDifferencing, vmSnapshot } = backup + let differencingVhds + let dynamicVhds + const withMemory = vmSnapshot.suspend_VDI !== 'OpaqueRef:NULL' + // isVhdDifferencing is either undefined or an object + if (isVhdDifferencing !== undefined) { + differencingVhds = Object.values(isVhdDifferencing).filter(t => t).length + dynamicVhds = Object.values(isVhdDifferencing).filter(t => !t).length + if (withMemory) { + // the suspend VDI (memory) is always a dynamic + dynamicVhds -= 1 + } + } return { disks: backup.vhds === undefined @@ -28,9 +40,9 @@ function formatVmBackup(backup) { name_label: backup.vm.name_label, }, - // isVhdDifferencing is either undefined or an object - differencingVhds: isVhdDifferencing && Object.values(isVhdDifferencing).filter(t => t).length, - dynamicVhds: isVhdDifferencing && Object.values(isVhdDifferencing).filter(t => !t).length, + differencingVhds, + dynamicVhds, + withMemory, } } diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 3473f14c263..6c7ce30a68d 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -32,6 +32,7 @@ - [Backup/Restore] Fix unnecessary pool selector in XO config backup restore modal [Forum#8130](https://xcp-ng.org/forum/topic/8130/xo-configbackup-restore) (PR [#7287](https://github.com/vatesfr/xen-orchestra/pull/7287)) - [File restore] Fix potential race condition in partition mount/unmount (PR [#7312](https://github.com/vatesfr/xen-orchestra/pull/7312)) - [Modal] Fix opened modal not closing when navigating to another route/URL (PR [#7301](https://github.com/vatesfr/xen-orchestra/pull/7301)) +- [Backup/Restore] Don't count memory as a key (i.e. complete) disk [Forum#8212](https://xcp-ng.org/forum/post/69591) (PR [#7315](https://github.com/vatesfr/xen-orchestra/pull/7315)) ### Packages to release From cd9c0f25405e1d4df22a75a6c263354ef01f808a Mon Sep 17 00:00:00 2001 From: Florent Beauchamp Date: Tue, 16 Jan 2024 16:32:36 +0000 Subject: [PATCH 2/2] feat(xo-web/backups): show backup with memory --- CHANGELOG.unreleased.md | 1 + packages/xo-web/src/common/render-xo-item.js | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 6c7ce30a68d..13ac211dbfb 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -15,6 +15,7 @@ - [Plugins] Loading, or unloading, will respectively enable, or disable, _Auto-load at server start_, this should lead to least surprising behaviors (PR [#7317](https://github.com/vatesfr/xen-orchestra/pull/7317)) - [VM/Advanced] Admin can change VM creator [Forum#7313](https://xcp-ng.org/forum/topic/7313/change-created-by-and-date-information) (PR [#7276](https://github.com/vatesfr/xen-orchestra/pull/7276)) - [Host/Reboot] Confirmation modal to reboot an updated slave host if the master is not [#7059](https://github.com/vatesfr/xen-orchestra/issues/7059) (PR [#7293](https://github.com/vatesfr/xen-orchestra/pull/7293)) +- [Backup/Restore] Show whether the memory was backed up (PR [#7315](https://github.com/vatesfr/xen-orchestra/pull/7315)) ### Bug fixes diff --git a/packages/xo-web/src/common/render-xo-item.js b/packages/xo-web/src/common/render-xo-item.js index d31bf362e64..1b2f78c2602 100644 --- a/packages/xo-web/src/common/render-xo-item.js +++ b/packages/xo-web/src/common/render-xo-item.js @@ -657,6 +657,7 @@ const xoItemToRender = { {backup.dynamicVhds} {_('backupisKey')}{' '} )} + {backup.withMemory && {_('withMemory')} } {backup.size !== undefined && {formatSize(backup.size)}}{' '}