feat(Xapi#moveVdi): do nothing if already on the correct SR

Fxies vatesfr/xo-web#2158
This commit is contained in:
Julien Fontanet 2017-05-19 11:20:46 +02:00
parent a39e6846fe
commit dbbf6d8c1f

View File

@ -1635,6 +1635,10 @@ export default class Xapi extends XapiBase {
const vdi = this.getObject(vdiId)
const sr = this.getObject(srId)
if (vdi.SR === sr.$ref) {
return // nothing to do
}
debug(`Moving VDI ${vdi.name_label} from ${vdi.$SR.name_label} to ${sr.name_label}`)
try {
await this.call('VDI.pool_migrate', vdi.$ref, sr.$ref, {})