bug 9667: when delete port forwarding rule as a part of vm expunge, keep in mind that guest ip addresses can be the same for the same account in different zones

status 9667: resolved fixed
This commit is contained in:
alena 2011-05-19 16:35:03 -07:00
parent ae570460c1
commit 1eb2b8514c
1 changed files with 5 additions and 2 deletions

View File

@ -1166,6 +1166,7 @@ public class UserVmManagerImpl implements UserVmManager {
}
@Override
public void releaseGuestIpAddress(UserVmVO userVm) {
ServiceOffering offering = _offeringDao.findById(userVm.getServiceOfferingId());
@ -1974,7 +1975,7 @@ public class UserVmManagerImpl implements UserVmManager {
if(publicIp!=null)
{
if((publicIp.getAccountId().longValue() == vm.getAccountId()))
if((publicIp.getAccountId().longValue() == vm.getAccountId()) && (publicIp.getDataCenterId() == vm.getDataCenterId()))
{
_networkMgr.deleteRule(rule.getId(), Long.valueOf(User.UID_SYSTEM), Long.valueOf(User.UID_SYSTEM));
if(s_logger.isDebugEnabled())
@ -2218,6 +2219,7 @@ public class UserVmManagerImpl implements UserVmManager {
}
}
@Override
public VMTemplateVO createPrivateTemplateRecord(Long userId, long volumeId, String name, String description, long guestOSId, Boolean requiresHvm, Integer bits, Boolean passwordEnabled, boolean isPublic, boolean featured)
throws InvalidParameterValueException {
@ -2940,7 +2942,8 @@ public class UserVmManagerImpl implements UserVmManager {
_vmMgr = vmMgr;
}
public void run() {
@Override
public void run() {
GlobalLock scanLock = GlobalLock.getInternLock("UserVMExpunge");
try {
if(scanLock.lock(ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION)) {