From 01c71414ae4fab230e6d7b5533fa3c2aa159d362 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Fri, 6 Sep 2024 15:49:37 +0200 Subject: [PATCH 01/25] fix(xo-server/xen-servers): don't try to mark read-only pool This led to many warnings in the log. --- packages/xo-server/src/xo-mixins/xen-servers.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/xo-server/src/xo-mixins/xen-servers.mjs b/packages/xo-server/src/xo-mixins/xen-servers.mjs index f0c5001e1df..f15048f38b2 100644 --- a/packages/xo-server/src/xo-mixins/xen-servers.mjs +++ b/packages/xo-server/src/xo-mixins/xen-servers.mjs @@ -388,6 +388,12 @@ export default class XenServers { const markPool = async () => { const now = Date.now() + + // cannot mark the pool if it is read-only + if (xapi.readOnly) { + return + } + const { pool } = xapi try { From 2f7e0d09636429863538e5e0b4038148afa5aae0 Mon Sep 17 00:00:00 2001 From: Florent BEAUCHAMP Date: Mon, 9 Sep 2024 09:26:53 +0200 Subject: [PATCH 02/25] fix(v2v): computation of memory_static_max (#7971) Introduced by ad1bf3b348e9d715355c8b30ec44b949c8557f03 The max memory that can be assigned to a VM is not correctly passed by the v2v import --- CHANGELOG.unreleased.md | 1 + packages/xo-server/src/xo-mixins/vmware/index.mjs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 8dfc8447e11..703a40979d0 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -16,6 +16,7 @@ - [REST API] Add `pifs` and `vm-controllers` collections - [REST API/Dashboard] Add name and type of the backup in the backup job issues (PR [#7958](https://github.com/vatesfr/xen-orchestra/pull/7958)) - [Perf-alert] Display warning if no guest tools are detected while monitoring VM memory (PR [#7886](https://github.com/vatesfr/xen-orchestra/pull/7886)) +- [V2V] Fix computation of `memory_static_max` ### Bug fixes diff --git a/packages/xo-server/src/xo-mixins/vmware/index.mjs b/packages/xo-server/src/xo-mixins/vmware/index.mjs index 62682432787..b65df52cd6c 100644 --- a/packages/xo-server/src/xo-mixins/vmware/index.mjs +++ b/packages/xo-server/src/xo-mixins/vmware/index.mjs @@ -38,6 +38,7 @@ export default class MigrateVm { ...OTHER_CONFIG_TEMPLATE, memory_dynamic_max: memory, memory_dynamic_min: memory, + memory_static_max: memory, // allow the user to reduce the memory of this VM to the limit set by the template memory_static_min: template.memory_static_min, name_description: `from esxi -- source guest id :${guestId} -- template used:${template.name_label}`, From af17f4a28aa8bb344e37d4df75a1fbb420000aba Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Mon, 9 Sep 2024 09:06:12 +0200 Subject: [PATCH 03/25] fix(xo-server-sdn-controller): don't try to install certs on ro pools --- CHANGELOG.unreleased.md | 1 + packages/xo-server-sdn-controller/src/index.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 703a40979d0..8a068cfd09e 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -40,6 +40,7 @@ - xo-server minor - xo-server-perf-alert minor +- xo-server-sdn-controller patch - xo-web minor diff --git a/packages/xo-server-sdn-controller/src/index.js b/packages/xo-server-sdn-controller/src/index.js index 358cc09223a..323489ab3e2 100644 --- a/packages/xo-server-sdn-controller/src/index.js +++ b/packages/xo-server-sdn-controller/src/index.js @@ -343,7 +343,7 @@ class SDNController extends EventEmitter { await Promise.all( map(this._xo.getAllXapis(), async xapi => { - if (xapi.status === 'connected') { + if (xapi.status === 'connected' && !xapi.readOnly) { await this._installCaCertificateIfNeeded(xapi) } }) From 576a3aa0074e0f5aca4871c916b806dc2c52167a Mon Sep 17 00:00:00 2001 From: Thierry Goettelmann Date: Mon, 9 Sep 2024 14:48:15 +0200 Subject: [PATCH 04/25] fix(web6): record can be undefined in single record context (#7976) --- .../web/src/components/site/dashboard/Backups.vue | 10 +++++----- .../web/src/components/site/dashboard/Patches.vue | 12 ++++++------ .../web/src/stores/xo-rest-api/dashboard.store.ts | 12 ++++++------ @xen-orchestra/web/src/types/xo/index.ts | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/@xen-orchestra/web/src/components/site/dashboard/Backups.vue b/@xen-orchestra/web/src/components/site/dashboard/Backups.vue index 7f14a2a4ddd..be1add3ebef 100644 --- a/@xen-orchestra/web/src/components/site/dashboard/Backups.vue +++ b/@xen-orchestra/web/src/components/site/dashboard/Backups.vue @@ -3,7 +3,7 @@ {{ $t('backups') }} - + @@ -34,22 +34,22 @@ const title = computed(() => ({ const segments = computed(() => [ { label: t('backups.jobs.running-good'), - value: record.value.backups?.jobs.successful ?? 0, + value: record.value?.backups?.jobs.successful ?? 0, color: 'success', }, { label: t('backups.jobs.at-least-one-skipped'), - value: record.value.backups?.jobs.skipped ?? 0, + value: record.value?.backups?.jobs.skipped ?? 0, color: 'primary', }, { label: t('backups.jobs.looks-like-issue'), - value: record.value.backups?.jobs.failed ?? 0, + value: record.value?.backups?.jobs.failed ?? 0, color: 'danger', }, { label: t('backups.jobs.disabled'), - value: record.value.backups?.jobs.disabled ?? 0, + value: record.value?.backups?.jobs.disabled ?? 0, color: 'disabled', }, ]) diff --git a/@xen-orchestra/web/src/components/site/dashboard/Patches.vue b/@xen-orchestra/web/src/components/site/dashboard/Patches.vue index 95e9e7cc53c..51d830d89ef 100644 --- a/@xen-orchestra/web/src/components/site/dashboard/Patches.vue +++ b/@xen-orchestra/web/src/components/site/dashboard/Patches.vue @@ -30,8 +30,8 @@ const poolsTitle: ComputedRef = computed(() })) const poolsSegments: ComputedRef = computed(() => { - const nPoolsWithMissingPatches = record.value.missingPatches?.nPoolsWithMissingPatches ?? 0 - const nPools = record.value.nPools + const nPoolsWithMissingPatches = record.value?.missingPatches?.nPoolsWithMissingPatches ?? 0 + const nPools = record.value?.nPools ?? 0 const nUpToDatePools = nPools - nPoolsWithMissingPatches @@ -46,11 +46,11 @@ const hostsTitle: ComputedRef = computed(() })) const hostsSegments = computed(() => { - const nHostsWithMissingPatches = record.value.missingPatches?.nHostsWithMissingPatches ?? 0 - const nHostsEol = record.value.nHostsEol - const nHosts = record.value.nHosts + const nHostsWithMissingPatches = record.value?.missingPatches?.nHostsWithMissingPatches ?? 0 + const nHostsEol = record.value?.nHostsEol + const nHosts = record.value?.nHosts - const nUpToDateHosts = nHosts - (nHostsWithMissingPatches + (nHostsEol ?? 0)) + const nUpToDateHosts = (nHosts ?? 0) - (nHostsWithMissingPatches + (nHostsEol ?? 0)) const segments: DonutChartWithLegendProps['segments'] = [ { value: nUpToDateHosts, color: 'success', label: t('up-to-date') }, diff --git a/@xen-orchestra/web/src/stores/xo-rest-api/dashboard.store.ts b/@xen-orchestra/web/src/stores/xo-rest-api/dashboard.store.ts index 8f229552e3e..7b7a3cd8bc1 100644 --- a/@xen-orchestra/web/src/stores/xo-rest-api/dashboard.store.ts +++ b/@xen-orchestra/web/src/stores/xo-rest-api/dashboard.store.ts @@ -9,17 +9,17 @@ export const useDashboardStore = defineStore('dashboard', () => { const backupRepositories = computed(() => { return { - total: formatSizeRaw(baseContext.record.value.backupRepositories?.size.total, 1), - used: formatSizeRaw(baseContext.record.value.backupRepositories?.size.used, 1), - available: formatSizeRaw(baseContext.record.value.backupRepositories?.size.available, 1), + total: formatSizeRaw(baseContext.record.value?.backupRepositories?.size.total, 1), + used: formatSizeRaw(baseContext.record.value?.backupRepositories?.size.used, 1), + available: formatSizeRaw(baseContext.record.value?.backupRepositories?.size.available, 1), } }) const storageRepositories = computed(() => { return { - total: formatSizeRaw(baseContext.record.value.storageRepositories.size.total, 1), - used: formatSizeRaw(baseContext.record.value.storageRepositories.size.used, 1), - available: formatSizeRaw(baseContext.record.value.storageRepositories.size.available, 1), + total: formatSizeRaw(baseContext.record.value?.storageRepositories.size.total, 1), + used: formatSizeRaw(baseContext.record.value?.storageRepositories.size.used, 1), + available: formatSizeRaw(baseContext.record.value?.storageRepositories.size.available, 1), } }) diff --git a/@xen-orchestra/web/src/types/xo/index.ts b/@xen-orchestra/web/src/types/xo/index.ts index b2fbcc2d403..065cb1c78b6 100644 --- a/@xen-orchestra/web/src/types/xo/index.ts +++ b/@xen-orchestra/web/src/types/xo/index.ts @@ -33,7 +33,7 @@ export type XoSingleRecordType = keyof XoSingleRecordMapping export type XoSingleRecord = XoSingleRecordMapping[XoSingleRecordType] export type XoSingleRecordContext = { - record: ComputedRef + record: ComputedRef isFetching: Readonly> isReady: Readonly> lastError: Readonly> From 6c8d41db00b9052990d122e0113b61b3971cb638 Mon Sep 17 00:00:00 2001 From: OlivierFL <66562640+OlivierFL@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:44:15 +0200 Subject: [PATCH 05/25] feat(xo-6/dashboard): add backup issues data (#7974) --- .../state-hero/no-data-hero.story.vue | 14 ++++ .../web-core/lib/assets/no-data.svg | 67 +++++++++++++++++++ .../lib/components/backup-item/BackupItem.vue | 5 +- .../lib/components/state-hero/NoDataHero.vue | 11 +++ .../lib/components/state-hero/StateHero.vue | 5 +- @xen-orchestra/web-core/lib/locales/en.json | 1 + @xen-orchestra/web-core/lib/locales/fr.json | 1 + .../web-core/lib/types/backup.type.ts | 2 +- .../site/dashboard/BackupIssues.vue | 42 ++++++++++++ @xen-orchestra/web/src/locales/en.json | 2 + @xen-orchestra/web/src/locales/fr.json | 2 + @xen-orchestra/web/src/pages/index.vue | 6 ++ .../src/stores/xo-rest-api/dashboard.store.ts | 3 + .../web/src/types/xo/dashboard.type.ts | 8 +++ .../convert-backup-issue-to-core.util.ts | 7 ++ CHANGELOG.unreleased.md | 5 ++ 16 files changed, 178 insertions(+), 3 deletions(-) create mode 100644 @xen-orchestra/lite/src/stories/web-core/state-hero/no-data-hero.story.vue create mode 100644 @xen-orchestra/web-core/lib/assets/no-data.svg create mode 100644 @xen-orchestra/web-core/lib/components/state-hero/NoDataHero.vue create mode 100644 @xen-orchestra/web/src/components/site/dashboard/BackupIssues.vue create mode 100644 @xen-orchestra/web/src/utils/convert-backup-issue-to-core.util.ts diff --git a/@xen-orchestra/lite/src/stories/web-core/state-hero/no-data-hero.story.vue b/@xen-orchestra/lite/src/stories/web-core/state-hero/no-data-hero.story.vue new file mode 100644 index 00000000000..fff487c0574 --- /dev/null +++ b/@xen-orchestra/lite/src/stories/web-core/state-hero/no-data-hero.story.vue @@ -0,0 +1,14 @@ + + + diff --git a/@xen-orchestra/web-core/lib/assets/no-data.svg b/@xen-orchestra/web-core/lib/assets/no-data.svg new file mode 100644 index 00000000000..51810b35390 --- /dev/null +++ b/@xen-orchestra/web-core/lib/assets/no-data.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/@xen-orchestra/web-core/lib/components/backup-item/BackupItem.vue b/@xen-orchestra/web-core/lib/components/backup-item/BackupItem.vue index 88d093285e2..ceb40694912 100644 --- a/@xen-orchestra/web-core/lib/components/backup-item/BackupItem.vue +++ b/@xen-orchestra/web-core/lib/components/backup-item/BackupItem.vue @@ -1,9 +1,12 @@ + + diff --git a/@xen-orchestra/web/typed-router.d.ts b/@xen-orchestra/web/typed-router.d.ts index 3b20a0a61b0..ea3a94c65d5 100644 --- a/@xen-orchestra/web/typed-router.d.ts +++ b/@xen-orchestra/web/typed-router.d.ts @@ -20,6 +20,7 @@ declare module 'vue-router/auto-routes' { export interface RouteNamedMap { '/': RouteRecordInfo<'/', '/', Record, Record>, '/dev/': RouteRecordInfo<'/dev/', '/dev', Record, Record>, + '/dev/colors': RouteRecordInfo<'/dev/colors', '/dev/colors', Record, Record>, '/dev/token': RouteRecordInfo<'/dev/token', '/dev/token', Record, Record>, '/host/[id]': RouteRecordInfo<'/host/[id]', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/:id': RouteRecordInfo<'/host/:id', '/host/:id', { id: ParamValue }, { id: ParamValue }>, From e830bf0f0c9c370fadfb17c6136203fc21109b03 Mon Sep 17 00:00:00 2001 From: Thierry Goettelmann Date: Tue, 10 Sep 2024 09:06:24 +0200 Subject: [PATCH 07/25] fix(web-core): tooltip position does not update when content changes (#7979) --- .../lib/components/tooltip/TooltipItem.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/@xen-orchestra/web-core/lib/components/tooltip/TooltipItem.vue b/@xen-orchestra/web-core/lib/components/tooltip/TooltipItem.vue index ddf7ef7150b..ae446622b34 100644 --- a/@xen-orchestra/web-core/lib/components/tooltip/TooltipItem.vue +++ b/@xen-orchestra/web-core/lib/components/tooltip/TooltipItem.vue @@ -10,7 +10,7 @@ import type { TooltipOptions } from '@core/stores/tooltip.store' import { hasEllipsis } from '@core/utils/has-ellipsis.util' import { isString } from 'lodash-es' import place from 'placement.js' -import { computed, ref, watchEffect } from 'vue' +import { computed, ref, watch, watchEffect } from 'vue' const props = defineProps<{ target: HTMLElement @@ -41,13 +41,19 @@ const isDisabled = computed(() => content.value === false) const placement = computed(() => props.options.placement ?? 'top') -watchEffect(() => { - if (tooltipElement.value) { - place(props.target, tooltipElement.value, { - placement: placement.value, - }) +function updatePlacement() { + if (!tooltipElement.value) { + return } -}) + + place(props.target, tooltipElement.value, { + placement: placement.value, + }) +} + +watchEffect(() => updatePlacement(), { flush: 'post' }) + +watch(content, () => updatePlacement(), { flush: 'post' })