CLOUDSTACK-6072: Release VNIs when guest networks are destroyed

submitted-by: mail@ynojima.net
This commit is contained in:
Marcus Sorensen 2014-02-20 23:22:57 -07:00
parent 3787579d29
commit c04fb68fc7
1 changed files with 2 additions and 2 deletions

View File

@ -414,13 +414,13 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
@Override
public void shutdown(NetworkProfile profile, NetworkOffering offering) {
if (profile.getBroadcastDomainType() == BroadcastDomainType.Vlan &&
if ((profile.getBroadcastDomainType() == BroadcastDomainType.Vlan || profile.getBroadcastDomainType() == BroadcastDomainType.Vxlan) &&
profile.getBroadcastUri() != null && !offering.getSpecifyVlan()) {
s_logger.debug("Releasing vnet for the network id=" + profile.getId());
_dcDao.releaseVnet(BroadcastDomainType.getValue(profile.getBroadcastUri()), profile.getDataCenterId(),
profile.getPhysicalNetworkId(), profile.getAccountId(), profile.getReservationId());
ActionEventUtils.onCompletedActionEvent(CallContext.current().getCallingUserId(), profile.getAccountId(),
EventVO.LEVEL_INFO, EventTypes.EVENT_ZONE_VLAN_RELEASE, "Released Zone Vlan: "
EventVO.LEVEL_INFO, EventTypes.EVENT_ZONE_VLAN_RELEASE, "Released Zone vnet: "
+ BroadcastDomainType.getValue(profile.getBroadcastUri()) + " for Network: " + profile.getId(), 0);
}
profile.setBroadcastUri(null);