More logging to plug nic code

This commit is contained in:
Alena Prokharchyk 2012-06-11 15:58:26 -07:00
parent 07be6918d8
commit 287ebd350d
3 changed files with 9 additions and 5 deletions

View File

@ -1271,6 +1271,11 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
for (int i = 0; i < count; i++) {
DomainRouterVO router = deployRouter(owner, dest, plan, params, isRedundant, vrProvider, offeringId,
null, sourceNatIp);
//add router to router network map
if (!_routerDao.isRouterPartOfGuestNetwork(router.getId(), network.getId())) {
DomainRouterVO routerVO = _routerDao.findById(router.getId());
_routerDao.addRouterToGuestNetwork(routerVO, network);
}
routers.add(router);
}
} finally {
@ -3134,8 +3139,6 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
return addRouterToGuestNetwork(router, network, isRedundant, setupDns);
}
protected boolean addRouterToGuestNetwork(VirtualRouter router, Network network, boolean isRedundant, boolean setupDns)
throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
@ -3147,9 +3150,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
//Add router to the Guest network
boolean result = true;
try {
if (_routerDao.isRouterPartOfGuestNetwork(router.getId(), network.getId())) {
if (!_routerDao.isRouterPartOfGuestNetwork(router.getId(), network.getId())) {
DomainRouterVO routerVO = _routerDao.findById(router.getId());
s_logger.debug("Plugging nic for virtual router " + router + " in network " + network);
_routerDao.addRouterToGuestNetwork(routerVO, network);
}

View File

@ -2484,6 +2484,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
//4) plug the nic to the vm
VirtualMachineGuru<VMInstanceVO> vmGuru = getVmGuru(vmVO);
s_logger.debug("Plugging nic for vm " + vm + " in network " + network);
if (vmGuru.plugNic(network, nicTO, vmTO, context, dest)) {
s_logger.debug("Nic is plugged successfully for vm " + vm + " in network " + network + ". Vm is a part of network now");
return nic;
@ -2525,6 +2526,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
NicTO nicTO = toNicTO(nic, vmProfile.getVirtualMachine().getHypervisorType());
s_logger.debug("Un-plugging nic for vm " + vm + " from network " + network);
boolean result = vmGuru.unplugNic(network, nicTO, vmTO, context, dest);
//4) Unplug the nic
if (result) {

View File

@ -5,7 +5,7 @@
# if you change 'em here, you need to change it also in cloud.spec, add a %changelog entry there, and add an entry in debian/changelog
VERSION = '3.0.3.2012-06-11T21:51:13Z'
VERSION = '3.0.3.2012-06-11T22:43:41Z'
APPNAME = 'cloud'
import shutil,os