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 a1cab92ae1
commit 211c7099a6
3 changed files with 12 additions and 0 deletions

View File

@ -1490,6 +1490,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

@ -212,6 +212,10 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
@Override @DB
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) {
Transaction txn = Transaction.currentTxn();

View File

@ -185,6 +185,10 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
@Override @DB
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) {