Refuse to change service offering if encryption value would change (#203)

This commit is contained in:
Marcus Sorensen 2022-09-28 12:00:32 -06:00 committed by GitHub
parent 82879af238
commit 015ee74e2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1260,6 +1260,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
int currentCpu = currentServiceOffering.getCpu();
int currentMemory = currentServiceOffering.getRamSize();
if (currentServiceOffering.getEncrypt() != newServiceOffering.getEncrypt()) {
throw new UnsupportedOperationException(("Cannot change volume encryption type via offering change"));
}
Account owner = _accountMgr.getActiveAccountById(vmInstance.getAccountId());
if (! VirtualMachineManager.ResourceCountRunningVMsonly.value()) {
if (newCpu > currentCpu) {