bug 11513: add more log in the cleanup network

Reviewed-by:alena@citrix.com
This commit is contained in:
Edison Su 2011-09-21 17:37:39 -07:00
parent de707e9fe7
commit 8abb85f9e8
3 changed files with 12 additions and 0 deletions

View File

@ -1478,6 +1478,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
@Override
public void cleanupNics(VirtualMachineProfile<? extends VMInstanceVO> vm) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Cleaning network for vm: " + vm.getId());
}
List<NicVO> nics = _nicDao.listByVmId(vm.getId());
for (NicVO nic : nics) {
nic.setState(Nic.State.Deallocating);

View File

@ -210,6 +210,10 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
@Override
public void deallocate(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("direct network deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address());
}
IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIp4Address());
if (ip != null) {
_networkMgr.markIpAsUnavailable(ip.getId());

View File

@ -181,6 +181,10 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
@Override
public void deallocate(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("public network deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address());
}
IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIp4Address());
if (ip != null && nic.getReservationStrategy() != ReservationStrategy.Managed) {
_networkMgr.markIpAsUnavailable(ip.getId());