Skip to content

server: fix NPE for the case where volume is not attached to a VM#3566

Merged
yadvr merged 1 commit intoapache:masterfrom
shapeblue:npe-fix-suitable-migration-volume
Aug 22, 2019
Merged

server: fix NPE for the case where volume is not attached to a VM#3566
yadvr merged 1 commit intoapache:masterfrom
shapeblue:npe-fix-suitable-migration-volume

Conversation

@yadvr
Copy link
Copy Markdown
Member

@yadvr yadvr commented Aug 21, 2019

Fixes NPE when trying to find suitable storage pools for a volume
when the volume is not attached to a VM, when trying to call the findStoragePoolsForMigration API.

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)

Fixes NPE when trying to find suitable storage pools for a volume
when the volume is not attached to a VM.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Aug 21, 2019

@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.

Copy link
Copy Markdown
Contributor

@anuragaw anuragaw left a comment

Choose a reason for hiding this comment

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

LGTM from code

@blueorangutan
Copy link
Copy Markdown

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

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan test centos7 vmware65

@blueorangutan
Copy link
Copy Markdown

@borisstoyanov unsupported parameters provided. Supported mgmt server os are: centos6, centos7, ubuntu. Supported hypervisors are: kvm-centos6, kvm-centos7, kvm-ubuntu, xenserver-71, xenserver-65sp1, xenserver-62sp1, vmware-65u2, vmware-60u2, vmware-55u3, vmware-51u1, vmware-50u1

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan test centos7 vmware-65u2

@blueorangutan
Copy link
Copy Markdown

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests

Copy link
Copy Markdown
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, run the failed test and it's passing now, also manually verified RC1 and this PR that it's not really a blocker, but def good to have
=== TestName: test_03_migrate_detached_volume | Status : SUCCESS ===

Copy link
Copy Markdown
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

Code LGTM. Just left a comment for code improvement but not mandatory

allPools = getAllStoragePoolCompatileWithVolumeSourceStoragePool(srcVolumePool);
allPools.remove(srcVolumePool);
suitablePools = findAllSuitableStoragePoolsForVm(volume, vm, srcVolumePool);
if (vm != null) {
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.

One liner improvement if you have some time: suitablePools = vm == null ? allPools : findAllSuitableStoragePools(....)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can consider it in the future, I generally like to avoid ternary operator which reduces code readability.

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-340)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34688 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3566-t340-vmware-65u2.zip
Smoke tests completed. 77 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@yadvr yadvr modified the milestones: 4.13.0.0, 4.13.1.0 Aug 22, 2019
@yadvr yadvr merged commit b7470bc into apache:master Aug 22, 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.

6 participants