CLOUDSTACK-2984: createNetwork call - when vlan is specified, check that its
not coming from the physical network vnet range as this range is used for
dynamic vlan allocation during the network implementation stage
Conflicts:
server/src/com/cloud/configuration/ConfigurationManagerImpl.java
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/12e984f8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/12e984f8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/12e984f8
Branch: refs/heads/master-6-17-stable
Commit: 12e984f869a487a1370be652b0cfc3bbe687d9b7
Parents: d001e43
Author: Alena Prokharchyk <[email protected]>
Authored: Mon Jul 1 16:08:37 2013 -0700
Committer: Alena Prokharchyk <[email protected]>
Committed: Tue Jul 2 10:08:50 2013 -0700
----------------------------------------------------------------------
.../com/cloud/configuration/ConfigurationManagerImpl.java | 5 +++--
server/src/com/cloud/network/NetworkManagerImpl.java | 8 +++++++-
2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12e984f8/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index eba246f..27c1a51 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2892,9 +2892,10 @@ public class ConfigurationManagerImpl extends
ManagerBase implements Configurati
}
}
- // Check if a guest VLAN is using the same tag
+ // Check if the vlan is being used
if (_zoneDao.findVnet(zoneId, physicalNetworkId, vlanId).size() > 0) {
- throw new InvalidParameterValueException("The VLAN tag " + vlanId
+ " is already being used for the guest network in zone " + zone.getName());
+ throw new InvalidParameterValueException("The VLAN tag " + vlanId
+ + " is already being used for dynamic vlan allocation for
the guest network in zone " + zone.getName());
}
String ipRange = null;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12e984f8/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java
b/server/src/com/cloud/network/NetworkManagerImpl.java
index eef5d76..63e9708 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -2449,7 +2449,13 @@ public class NetworkManagerImpl extends ManagerBase
implements NetworkManager, L
}
}
- if (vlanId != null) {
+ if (vlanSpecified) {
+ //don't allow to specify vlan tag used by physical network for
dynamic vlan allocation
+ if (_dcDao.findVnet(zoneId, pNtwk.getId(), vlanId).size() > 0) {
+ throw new InvalidParameterValueException("The VLAN tag " +
vlanId
+ + " is already being used for dynamic vlan allocation
for the guest network in zone " + zone.getName());
+ }
+
String uri = "vlan://" + vlanId;
// For Isolated networks, don't allow to create network with vlan
that already exists in the zone
if (ntwkOff.getGuestType() == GuestType.Isolated) {