Compare commits

...

6 Commits

Author SHA1 Message Date
Julien Fontanet
fd12fbceb8 Merge branch 'master' into fix_vmware_ide 2024-02-22 14:56:34 +01:00
Florent Beauchamp
779ac1a0c7 fix: add else 2024-02-22 13:41:44 +00:00
Florent BEAUCHAMP
5405467e30 Update @xen-orchestra/vmware-explorer/esxi.mjs
Co-authored-by: Julien Fontanet <julien.fontanet@isonoe.net>
2024-02-21 10:11:27 +01:00
Florent BEAUCHAMP
46e4314135 Update CHANGELOG.unreleased.md
Co-authored-by: Julien Fontanet <julien.fontanet@isonoe.net>
2024-02-21 10:11:15 +01:00
Florent BEAUCHAMP
75776afb1d Update @xen-orchestra/vmware-explorer/esxi.mjs
Co-authored-by: Julien Fontanet <julien.fontanet@isonoe.net>
2024-02-21 10:11:09 +01:00
Florent Beauchamp
175626c0f5 fix(vmware-explorer): correctly handle IDE disks 2024-02-20 13:23:34 +00:00
2 changed files with 23 additions and 8 deletions

View File

@@ -282,20 +282,33 @@ export default class Esxi extends EventEmitter {
const networks = []
for (const key of Object.keys(vmx)) {
if (key.match('^scsi([0-9]+)$') !== null) {
const scsiChannel = vmx[key]
for (const diskIndex in Object.values(scsiChannel)) {
const disk = scsiChannel[diskIndex]
if (typeof disk !== 'object' || disk.deviceType !== 'scsi-hardDisk') {
const matches = key.match(/^(scsi|ide|ethernet)[0-9]+$/)
if (matches === null) {
continue
}
const channelType = matches[1]
if (channelType === 'ide' || channelType === 'scsi') {
const diskChannel = vmx[key]
for (const diskIndex in Object.values(diskChannel)) {
const disk = diskChannel[diskIndex]
if (typeof disk !== 'object') {
continue
}
// can be something other than a disk, like a controller card
if (channelType === 'scsi' && disk.deviceType !== 'scsi-hardDisk') {
continue
}
// ide hard disk don't have deviceType, but cdroms have one
if (channelType === 'ide' && disk.deviceType === 'atapi-cdrom') {
continue
}
disks.push({
...(await this.#inspectVmdk(dataStores, dataStore, dirname(vmxPath), disk.fileName)),
node: `${key}:${diskIndex}`,
})
}
}
if (key.match('^ethernet([0-9]+)$') !== null) {
} else if (channelType === 'ethernet') {
const ethernet = vmx[key]
networks.push({
@@ -315,7 +328,7 @@ export default class Esxi extends EventEmitter {
for (const diskIndex in snapshot.disks) {
const fileName = snapshot.disks[diskIndex].fileName
snapshot.disks[diskIndex] = {
node: snapshot.disks[diskIndex]?.node, // 'scsi0:0',
node: snapshot.disks[diskIndex]?.node, // 'scsi0:0' , 'ide0:0', ...,
...(await this.#inspectVmdk(dataStores, dataStore, dirname(vmxPath), fileName)),
}
}

View File

@@ -23,6 +23,7 @@
- [Remotes] Correctly clear error when the remote is tested with success
- [Import/VMWare] Fix importing last snapshot (PR [#7370](https://github.com/vatesfr/xen-orchestra/pull/7370))
- [Host/Reboot] Fix false positive warning when restarting an host after updates (PR [#7366](https://github.com/vatesfr/xen-orchestra/pull/7366))
- [Import/VMWare] Handle VMs with IDE disks
### Packages to release
@@ -42,6 +43,7 @@
- @xen-orchestra/backups patch
- @xen-orchestra/fs patch
- @xen-orchestra/vmware-explorer patch
- @xen-orchestra/xapi patch
- vhd-lib patch
- xo-server minor