Removed guestIp check when upgrading the service offering of a VM. It should not be used anymore since 2.2 network refactoring.

This commit is contained in:
will 2010-12-30 13:20:45 -08:00
parent 1e6c16e294
commit 40f34c4388
2 changed files with 6 additions and 2 deletions

View File

@ -1120,7 +1120,7 @@ public class ManagementServerImpl implements ManagementServer {
sc.addAnd("id", SearchCriteria.Op.NEQ, offering.getId());
// Only return offerings with the same Guest IP type and storage pool preference
sc.addAnd("guestIpType", SearchCriteria.Op.EQ, offering.getGuestIpType());
//sc.addAnd("guestIpType", SearchCriteria.Op.EQ, offering.getGuestIpType());
sc.addAnd("useLocalStorage", SearchCriteria.Op.EQ, offering.getUseLocalStorage());
}

View File

@ -829,13 +829,17 @@ 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() + ")");
}
// Check that the service offering being upgraded to has the same Guest IP type as the VM's current service offering
ServiceOfferingVO currentServiceOffering = _offeringDao.findById(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.
/*
if (!currentServiceOffering.getGuestIpType().equals(newServiceOffering.getGuestIpType())) {
String errorMsg = "The service offering being upgraded to has a guest IP type: " + newServiceOffering.getGuestIpType();
errorMsg += ". Please select a service offering with the same guest IP type as the VM's current service offering (" + currentServiceOffering.getGuestIpType() + ").";
throw new InvalidParameterValueException(errorMsg);
}
*/
// Check that the service offering being upgraded to has the same storage pool preference as the VM's current service offering
if (currentServiceOffering.getUseLocalStorage() != newServiceOffering.getUseLocalStorage()) {