Files
Xen-Orchestra-xen-orchestra…/@vates/nbd-client
spacotte-vates a94eba4dd1 fix(nbd-client): fix long datamap read nbddisk (#10157)
Customer imported large VM from VMWare (> 3 To), import switched to Qcow2 automatically but the process was stuck while building the qcow2 L1/L2 address tables, where the NbdDisk's hasBlock is called for each l2 table entry which iterated over the disk dataMap which contained ~113,528 ranges. This froze the process for more than 18 minutes after which it was either killed or died due to OOM error.

This fix improves the NbdDisk by:

    Updating processDatamap to throw on overlapping ranges and merge touching extents.
    Override default getBlockIndexesCount with optimized Nbd one.
    Improve hasBlock with a built in cursor to improve performance.

Test file added to cover the new function and updated code.
2026-08-03 11:24:44 +02:00
..
2026-07-29 15:30:14 +02:00
2023-02-06 11:25:12 +01:00

@vates/nbd-client

Package Version License PackagePhobia Node compatibility

Install

Installation of the npm package:

npm install --save @vates/nbd-client

Usage

new NdbClient({address, exportname, secure = true, port = 10809})

create a new nbd client

import NbdClient from '@vates/nbd-client'
const client = new NbdClient({
  address: 'MY_NBD_HOST',
  exportname: 'MY_SECRET_EXPORT',
  cert: 'Server certificate', // optional, will use encrypted link if provided
})

await client.connect()
const block = await client.readBlock(blockIndex, BlockSize)
await client.disconnect()

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Vates SAS