Skip to content

server: fix for inactive service offering for VM - #3320

Merged
yadvr merged 2 commits into
apache:masterfrom
shapeblue:fix-change-service-offering-vm-3315
May 27, 2019
Merged

server: fix for inactive service offering for VM#3320
yadvr merged 2 commits into
apache:masterfrom
shapeblue:fix-change-service-offering-vm-3315

Conversation

@shwstppr

@shwstppr shwstppr commented May 9, 2019

Copy link
Copy Markdown
Contributor

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

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

Using cmk

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()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - vmInstance.name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anuragaw instead vmInstance.getUuid()? As we show UUIDs mostly.

anuragaw
anuragaw approved these changes May 10, 2019
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@anuragaw

Copy link
Copy Markdown
Contributor

LGTM

@yadvr

yadvr commented May 23, 2019

Copy link
Copy Markdown
Member

@blueorangutan package

@yadvr yadvr added this to the 4.13.0.0 milestone May 23, 2019
@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@yadvr yadvr added the type:bug label May 23, 2019
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-2750

@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2753

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test suite running

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()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@yadvr

yadvr commented May 23, 2019

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2769

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3571)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32146 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3320-t3571-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
Smoke tests completed. 69 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_02_cancel_host_maintenace_with_migration_jobs Error 3.52 test_host_maintenance.py

@yadvr
yadvr requested a review from PaulAngus May 24, 2019 11:22
@yadvr
yadvr merged commit d1090c0 into apache:master May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set an inactive service offering over API

6 participants