mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-09 17:06:13 -06:00
- Migrate VM to NFS on VMWare side
- mount NFS in XO , named [VMWARE]{datastoreName}
- launch import and it will read through the direct NFS instead of using the soap access layer
23 lines
698 B
JavaScript
23 lines
698 B
JavaScript
import assert from 'node:assert'
|
|
import { Datastore } from './_Datastore.mjs'
|
|
|
|
export const DatastoreXoRemote = class DatastoreXoRemote extends Datastore {
|
|
#handler
|
|
constructor(datastoreName, { handler, ...otherOptions }) {
|
|
super(datastoreName, otherOptions)
|
|
this.#handler = handler
|
|
}
|
|
async getStream(path, start, end) {
|
|
return this.#handler.createReadStream(path, { start, end })
|
|
}
|
|
async getBuffer(path, start, end) {
|
|
const buffer = Buffer.alloc(end - start)
|
|
const { bytesRead } = await this.#handler.read(path, buffer, start)
|
|
assert.strictEqual(bytesRead, end - start)
|
|
return buffer
|
|
}
|
|
async getSize(path) {
|
|
return this.#handler.getSize(path)
|
|
}
|
|
}
|