bug 9200: Fixed issue when attempting to change the service offering of a VM who's current service offering has been deleted.

This commit is contained in:
will 2011-03-28 18:15:13 -07:00
parent f8a1278a80
commit a959726f38
2 changed files with 2 additions and 2 deletions

View File

@ -1080,7 +1080,7 @@ public class ManagementServerImpl implements ManagementServer {
}
}
ServiceOfferingVO offering = _offeringsDao.findById(vmInstance.getServiceOfferingId());
ServiceOfferingVO offering = _offeringsDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId());
sc.addAnd("id", SearchCriteria.Op.NEQ, offering.getId());
// Only return offerings with the same Guest IP type and storage pool preference

View File

@ -857,7 +857,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
throw new InvalidParameterValueException("Not upgrading vm " + vmInstance.toString() + " since it already has the requested service offering (" + newServiceOffering.getName() + ")");
}
ServiceOfferingVO currentServiceOffering = _offeringDao.findById(vmInstance.getServiceOfferingId());
ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId());
// Check that the service offering being upgraded to has the same Guest IP type as the VM's current service offering
// NOTE: With the new network refactoring in 2.2, we shouldn't need the check for same guest IP type anymore.