server: fix for inactive service offering for VM - #3320
Conversation
Fixes apache#3315 Currently code was allowing to change service offering for VM to a deleted or inactive service offering. Added check for it to throw an exception. Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
| Map<String, String> customParameters = cmd.getDetails(); | ||
| ServiceOfferingVO newServiceOffering = _offeringDao.findById(svcOffId); | ||
| if (newServiceOffering.getState() == DiskOffering.State.Inactive) { | ||
| throw new InvalidParameterValueException(String.format("Unable to upgrade virtual machine %s with an inactive service offering %s", vmInstance.toString(), newServiceOffering.getUuid())); |
There was a problem hiding this comment.
@anuragaw instead vmInstance.getUuid()? As we show UUIDs mostly.
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
LGTM |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-2750 |
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2753 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
| Map<String, String> customParameters = cmd.getDetails(); | ||
| ServiceOfferingVO newServiceOffering = _offeringDao.findById(svcOffId); | ||
| if (newServiceOffering.getState() == DiskOffering.State.Inactive) { | ||
| throw new InvalidParameterValueException(String.format("Unable to upgrade virtual machine %s with an inactive service offering %s", vmInstance.getUuid(), newServiceOffering.getUuid())); |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2769 |
|
Trillian test result (tid-3571)
|
Description
Fixes #3315
Currently, the code was allowed to change service offering for VM to a deleted or inactive service offering. Added check for it to throw an exception.
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?
Using cmk