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:21:07 -07:00
parent 21d016b3dd
commit f1f79586da
1 changed files with 2 additions and 2 deletions

View File

@ -417,13 +417,13 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
@Override
public void shutdown(NetworkProfile profile, NetworkOffering offering) {
if (profile.getBroadcastDomainType() == BroadcastDomainType.Vlan && profile.getBroadcastUri() != null && !offering.getSpecifyVlan()) {
if ((profile.getBroadcastDomainType() == BroadcastDomainType.Vlan || profile.getBroadcastDomainType() == BroadcastDomainType.Vxlan) && !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: " + BroadcastDomainType.getValue(profile.getBroadcastUri()) + " for Network: " + profile.getId(), 0);
"Released Zone Vnet: " + BroadcastDomainType.getValue(profile.getBroadcastUri()) + " for Network: " + profile.getId(), 0);
}
profile.setBroadcastUri(null);
}