Skip to content

Commit

Permalink
fix(vmware-explorer): better handling of VM import without any storage (
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeauchamp committed Nov 14, 2023
1 parent b234847 commit 46ec2df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions @xen-orchestra/vmware-explorer/esxi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ export default class Esxi extends EventEmitter {

return Object.keys(datas).map(id => {
const { config, storage, runtime } = datas[id]
if (storage === undefined) {
throw new Error(`source VM ${id} don't have any storage`)
}
const perDatastoreUsage = Array.isArray(storage.perDatastoreUsage)
? storage.perDatastoreUsage
: [storage.perDatastoreUsage]
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Backup/Restore] In case of snapshot with memory, create the suspend VDI on the correct SR instead of the default one
- [Import/ESXi] Handle `Cannot read properties of undefined (reading 'perDatastoreUsage')` error when importing VM without storage (PR [#7168](https://github.com/vatesfr/xen-orchestra/pull/7168))

### Packages to release

Expand All @@ -30,6 +31,7 @@
<!--packages-start-->

- @xen-orchestra/backups patch
- @xen-orchestra/vmware-explorer patch
- xo-web patch

<!--packages-end-->

0 comments on commit 46ec2df

Please sign in to comment.