feat(xo-server/createVdi): allow setting sm_config (#4841)
This commit is contained in:
parent
b244126d60
commit
6d5a5a46e4
@ -1718,25 +1718,31 @@ export default class Xapi extends XapiBase {
|
|||||||
return this.callAsync('VDI.clone', vdi.$ref).then(extractOpaqueRef)
|
return this.callAsync('VDI.clone', vdi.$ref).then(extractOpaqueRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
async createVdi({
|
async createVdi(
|
||||||
// blindly copying `sm_config` from another VDI can create problems,
|
{
|
||||||
// therefore it is ignored by this method
|
name_description,
|
||||||
//
|
name_label,
|
||||||
// see https://github.com/vatesfr/xen-orchestra/issues/4482
|
other_config = {},
|
||||||
name_description,
|
read_only = false,
|
||||||
name_label,
|
sharable = false,
|
||||||
other_config = {},
|
sm_config,
|
||||||
read_only = false,
|
SR,
|
||||||
sharable = false,
|
tags,
|
||||||
SR,
|
type = 'user',
|
||||||
tags,
|
virtual_size,
|
||||||
type = 'user',
|
xenstore_data,
|
||||||
virtual_size,
|
|
||||||
xenstore_data,
|
|
||||||
|
|
||||||
size,
|
size,
|
||||||
sr = SR !== undefined && SR !== NULL_REF ? SR : this.pool.default_SR,
|
sr = SR !== undefined && SR !== NULL_REF ? SR : this.pool.default_SR,
|
||||||
}) {
|
},
|
||||||
|
{
|
||||||
|
// blindly copying `sm_config` from another VDI can create problems,
|
||||||
|
// therefore it is ignored by default by this method
|
||||||
|
//
|
||||||
|
// see https://github.com/vatesfr/xen-orchestra/issues/4482
|
||||||
|
setSmConfig = false,
|
||||||
|
} = {}
|
||||||
|
) {
|
||||||
sr = this.getObject(sr)
|
sr = this.getObject(sr)
|
||||||
log.debug(`Creating VDI ${name_label} on ${sr.name_label}`)
|
log.debug(`Creating VDI ${name_label} on ${sr.name_label}`)
|
||||||
|
|
||||||
@ -1750,6 +1756,7 @@ export default class Xapi extends XapiBase {
|
|||||||
SR: sr.$ref,
|
SR: sr.$ref,
|
||||||
tags,
|
tags,
|
||||||
type,
|
type,
|
||||||
|
sm_config: setSmConfig ? sm_config : undefined,
|
||||||
virtual_size: size !== undefined ? parseSize(size) : virtual_size,
|
virtual_size: size !== undefined ? parseSize(size) : virtual_size,
|
||||||
xenstore_data,
|
xenstore_data,
|
||||||
}).then(extractOpaqueRef)
|
}).then(extractOpaqueRef)
|
||||||
|
Loading…
Reference in New Issue
Block a user