Increment VIF # when creating a VM (fix #229).

This commit is contained in:
Julien Fontanet
2015-04-13 16:27:53 +02:00
parent 7d00d47cb6
commit d32a18d965

View File

@@ -39,14 +39,16 @@ create = $coroutine ({
# TODO: remove existing VIFs.
# Creates associated virtual interfaces.
#
# FIXME: device n may already exists, we have to find the first
# free device number.
deviceId = 0
$forEach VIFs, (VIF) =>
network = @getObject VIF.network, 'network'
$wait xapi.call 'VIF.create', {
# FIXME: device n may already exists, we have to find the first
# free device number.
device: '0'
device: String(deviceId++)
MAC: VIF.MAC ? ''
MTU: '1500'
network: network.ref