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
8 changed files with 28 additions and 79 deletions

View File

@@ -437,8 +437,7 @@ export async function cleanVm(
}
}
// no warning because a VHD can be unused for perfectly good reasons,
// e.g. the corresponding backup (metadata file) has been deleted
logWarn('unused VHD', { path: vhd })
if (remove) {
logInfo('deleting unused VHD', { path: vhd })
unusedVhdsDeletion.push(VhdAbstract.unlink(handler, vhd))

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

@@ -13,6 +13,7 @@
- [Home & REST API] `$container` field of an halted VM now points to a host if a VDI is on a local storage [Forum#71769](https://xcp-ng.org/forum/post/71769)
- [Size Input] Ability to select two new units in the dropdown (`TiB`, `PiB`) (PR [#7382](https://github.com/vatesfr/xen-orchestra/pull/7382))
### Bug fixes
> Users must be able to say: “I had this issue, happy to know it's fixed”
@@ -22,8 +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))
- [New/VM] Respect _Fast clone_ setting broken since 5.91.0 (PR [#7388](https://github.com/vatesfr/xen-orchestra/issues/7388))
- [Backup] Remove incorrect _unused VHD_ warning because the situation is normal (PR [#7406](https://github.com/vatesfr/xen-orchestra/issues/7406))
- [Import/VMWare] Handle VMs with IDE disks
### Packages to release
@@ -43,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

View File

@@ -425,32 +425,6 @@ It works even if the VM is running, because we'll automatically export a snapsho
In the VM "Snapshots" tab, you can also export a snapshot like you export a VM.
## VM migration
### Simple VM Migration (VM.pool_migrate)
In simple migration, the VM's active state is transferred from host A to host B while its disks remains in its original location. This feature is only possible when the VM's disks are on a shared SR by both hosts and if the VM is running.
#### Use Case
- Migrate a VM within the same pool from host A to host B without moving the VM's VDIs.
### VM Migration with Storage Motion (VM.migrate_send)
VM migration with storage motion allows you to migrate a VM from one host to another when the VM's disks are not on a shared SR between the two hosts or if a specific network is chosen for the migration. VDIs will be migrated to the destination SR if one is provided.
#### Use Cases
- Migrate a VM to another pool.
- Migrate a VM within the same pool from host A to host B by selecting a network for the migration.
- Migrate a VM within the same pool from host A to host B by moving the VM's VDIs to another storage.
### Expected Behavior
- Migrating a VM that has VDIs on a shared SR from host A to host B must trigger a "Simple VM Migration".
- Migrating a VM that has VDIs on a shared SR from host A to host B using a particular network must trigger a "VM Migration with Storage Motion" without moving its VDIs.
- Migrating a VM from host A to host B with a destination SR must trigger a "VM Migration with Storage Motion" and move VDIs to the destination SR, regardless of where the VDIs were stored.
## Hosts management
Outside updates (see next section), you can also do host management via Xen Orchestra. Basic operations are supported, like reboot, shutdown and so on.

View File

@@ -1,27 +0,0 @@
export async function scan({ host }) {
await this.getXapi(host).call('PUSB.scan', host._xapiRef)
}
scan.params = {
host: { type: 'string' },
}
scan.resolve = {
host: ['host', 'host', 'operate'],
}
export async function set({ pusb, enabled }) {
const xapi = this.getXapi(pusb)
if (enabled !== undefined && enabled !== pusb.passthroughEnabled) {
await xapi.call('PUSB.set_passthrough_enabled', pusb._xapiRef, enabled)
}
}
set.params = {
id: { type: 'string' },
enabled: { type: 'boolean', optional: true },
}
set.resolve = {
pusb: ['id', 'PUSB', 'administrate'],
}

View File

@@ -889,17 +889,6 @@ const TRANSFORMS = {
vm: link(obj, 'VM'),
}
},
pusb(obj) {
return {
type: 'PUSB',
description: obj.description,
host: link(obj, 'host'),
passthroughEnabled: obj.passthrough_enabled,
usbGroup: link(obj, 'USB_group'),
}
},
}
// ===================================================================

View File

@@ -460,7 +460,7 @@ export const SelectHostVm = makeStoreSelect(
export const SelectVmTemplate = makeStoreSelect(
() => {
const getVmTemplatesByPool = createGetObjectsOfType('VM-template').filter(getPredicate).sort().groupBy('$pool')
const getVmTemplatesByPool = createGetObjectsOfType('VM-template').filter(getPredicate).sort().groupBy('$container')
const getPools = createGetObjectsOfType('pool')
.pick(createSelector(getVmTemplatesByPool, vmTemplatesByPool => keys(vmTemplatesByPool)))
.sort()

View File

@@ -300,7 +300,7 @@ export default class NewVm extends BaseComponent {
get _isDiskTemplate() {
const { template } = this.props
return template && template.$VBDs.length !== 0 && template.name_label !== 'Other install media'
return template && template.template_info.disks.length === 0 && template.name_label !== 'Other install media'
}
_setState = (newValues, callback) => {
this.setState(
@@ -470,7 +470,7 @@ export default class NewVm extends BaseComponent {
const data = {
affinityHost: state.affinityHost && state.affinityHost.id,
clone: this._isDiskTemplate && state.fastClone,
clone: !this._isDiskTemplate && state.fastClone,
existingDisks: state.existingDisks,
installation,
name_label: state.name_label,