Fix inter pool migration.
This commit is contained in:
parent
a51d6b9a74
commit
18473e6819
@ -196,26 +196,22 @@ migratePool = $coroutine ({
|
|||||||
network
|
network
|
||||||
migrationNetwork
|
migrationNetwork
|
||||||
}) ->
|
}) ->
|
||||||
try
|
# TODO: map multiple VDI and VIF
|
||||||
# TODO: map multiple VDI and VIF
|
|
||||||
|
|
||||||
# Optional parameters
|
# Optional parameters
|
||||||
# if no network given, try to use the management network
|
# if no network given, try to use the management network
|
||||||
unless network
|
unless network
|
||||||
PIF = $findWhere (@getObjects host.$PIFs), management: true
|
PIF = $findWhere (@getObjects host.$PIFs), management: true
|
||||||
network = @getObject PIF.$network, 'network'
|
network = @getObject PIF.$network, 'network'
|
||||||
|
|
||||||
# if no migrationNetwork, use the network
|
# if no migrationNetwork, use the network
|
||||||
migrationNetwork ?= network
|
migrationNetwork ?= network
|
||||||
|
|
||||||
# if no sr is given, try to find the default Pool SR
|
# if no sr is given, try to find the default Pool SR
|
||||||
unless SR
|
unless SR
|
||||||
pool = @getObject host.poolRef, 'pool'
|
pool = @getObject host.poolRef, 'pool'
|
||||||
target_sr_id = pool.default_SR
|
target_sr_id = pool.default_SR
|
||||||
SR = @getObject target_sr_id, 'SR'
|
SR = @getObject target_sr_id, 'SR'
|
||||||
|
|
||||||
catch
|
|
||||||
@throw 'NO_SUCH_OBJECT'
|
|
||||||
|
|
||||||
unless $isVMRunning VM
|
unless $isVMRunning VM
|
||||||
@throw 'INVALID_PARAMS', 'The VM can only be migrated when running'
|
@throw 'INVALID_PARAMS', 'The VM can only be migrated when running'
|
||||||
|
@ -322,7 +322,7 @@ export function pif (obj) {
|
|||||||
device: obj.device,
|
device: obj.device,
|
||||||
IP: obj.IP,
|
IP: obj.IP,
|
||||||
MAC: obj.MAC,
|
MAC: obj.MAC,
|
||||||
management: obj.management, // TODO: find a better name.
|
management: Boolean(obj.management), // TODO: find a better name.
|
||||||
mode: obj.ip_configuration_mode,
|
mode: obj.ip_configuration_mode,
|
||||||
MTU: +obj.MTU,
|
MTU: +obj.MTU,
|
||||||
netmask: obj.netmask,
|
netmask: obj.netmask,
|
||||||
|
Loading…
Reference in New Issue
Block a user