Skip to content

Commit

Permalink
feat(@xen-orchestra/xapi): make nbd use configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeauchamp committed Mar 15, 2023
1 parent f19d155 commit 9d6ec88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions @xen-orchestra/xapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class Xapi extends Base {
constructor({
callRetryWhenTooManyPendingTasks = { delay: 5e3, tries: 10 },
maxUncoalescedVdis,
preferNbd,
syncHookSecret,
syncHookTimeout,
vdiDestroyRetryWhenInUse = { delay: 5e3, tries: 10 },
Expand All @@ -148,6 +149,7 @@ class Xapi extends Base {
this._maxUncoalescedVdis = maxUncoalescedVdis
this._syncHookSecret = syncHookSecret
this._syncHookTimeout = syncHookTimeout
this._preferNbd = preferNbd
this._vdiDestroyRetryWhenInUse = {
...vdiDestroyRetryWhenInUse,
onRetry,
Expand Down
4 changes: 2 additions & 2 deletions @xen-orchestra/xapi/vdi.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Vdi {
})
}

async exportContent(ref, { baseRef, cancelToken = CancelToken.none, format, preferNbd = true }) {
async exportContent(ref, { baseRef, cancelToken = CancelToken.none, format }) {
const query = {
format,
vdi: ref,
Expand All @@ -72,7 +72,7 @@ class Vdi {
}
let nbdClient
try {
if (preferNbd) {
if (this._preferNbd) {
const nbdInfos = await this.call('VDI.get_nbd_info', ref)
if (nbdInfos.length > 0) {
// a little bit of randomization to spread the load
Expand Down
1 change: 1 addition & 0 deletions packages/xo-server/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ vmSnapshotConcurrency = 2
poolMarkingInterval = '6 hours'
poolMarkingMaxAge = '48 hours'
poolMarkingPrefix = 'xo:clientInfo:'
preferNbd = true

[xo-proxy]
callTimeout = '1 min'
Expand Down

0 comments on commit 9d6ec88

Please sign in to comment.