diff --git a/@xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.mjs b/@xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.mjs index 8151cd251ce..a7dcc6340a0 100644 --- a/@xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.mjs +++ b/@xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.mjs @@ -290,7 +290,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract { for (const vdiRef of vdiRefs) { try { // data_destroy will fail with a VDI_NO_CBT_METADATA error if CBT is not enabled on this VDI - await this._xapi.call('VDI.data_destroy', vdiRef) + await this._xapi.VDI_dataDestroy(vdiRef) Task.info(`Snapshot data has been deleted`, { vdiRef }) } catch (error) { Task.warning(`Couldn't deleted snapshot data`, { error, vdiRef }) diff --git a/@xen-orchestra/xapi/vdi.mjs b/@xen-orchestra/xapi/vdi.mjs index c32191cda9a..c65b9f39985 100644 --- a/@xen-orchestra/xapi/vdi.mjs +++ b/@xen-orchestra/xapi/vdi.mjs @@ -28,6 +28,10 @@ class Vdi { ) } + async dataDestroy(vdiRef) { + await this.callAsync('VDI.data_destroy', vdiRef) + } + async create( { name_description, @@ -290,5 +294,12 @@ decorateClass(Vdi, { return this._vdiDestroyRetryWhenInUse }, ], + // same condition when destroying data of a VDI + dataDestroy: [ + pRetry.wrap, + function () { + return this._vdiDestroyRetryWhenInUse + }, + ], exportContent: defer, }) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index b05bcc316ba..77f2951d05f 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -25,6 +25,8 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” +- [Incremental Backup & Replication] Remove most of `Couldn't delete snapshot data` errors when using _Purge snapshot data when using CBT_ [#7826](https://github.com/vatesfr/xen-orchestra/pull/7826) (PR [#7960](https://github.com/vatesfr/xen-orchestra/pull/7960)) + ### Packages to release > When modifying a package, add it here with its release type. @@ -41,9 +43,11 @@ +- @xen-orchestra/backups patch - @xen-orchestra/lite minor - @xen-orchestra/web minor - @xen-orchestra/web-core minor +- @xen-orchestra/xapi minor - xo-server minor - xo-server-perf-alert minor - xo-server-sdn-controller patch