Skip to content

Fix NPE on migrateVirtualMachineWithVolume#5758

Merged
sureshanaparti merged 1 commit into
apache:4.16from
scclouds:insert-correct-template-size-when-live-migrating-vm-with-volumes
Dec 16, 2021
Merged

Fix NPE on migrateVirtualMachineWithVolume#5758
sureshanaparti merged 1 commit into
apache:4.16from
scclouds:insert-correct-template-size-when-live-migrating-vm-with-volumes

Conversation

@GutoVeronezi

Copy link
Copy Markdown
Contributor

Description

When a volume is copied to another storage pool, if the template does not exist in the destination storage pool yet, it should be copied. The API migrateVirtualMachineWithVolume already does it; however, when migrating the volume with migrateVolume (VM stopped), the template is not copied, which causes inconsistencies in the database and primary storage systems. The not existence of the template in the storage pool causes an NPE when using the API migrateVirtualMachineWithVolume.

This PR intends to avoid this NPE.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

I tested it in a test lab.

  1. I created a VM;
  2. I stopped the VM;
  3. I created a new primary storage;
  4. With API migrateVolume I migrated the volume to the new primary storage;
  5. Before this changes, when I tried to migrate the volume to another primary storage that does not have the template yet, it threw a NPE.
  6. After this changes, when I tried to migrate the volume to another primary storage that does not have the template yet, the migration could be done.

@GutoVeronezi GutoVeronezi changed the title Insert correct template size when live migrating VM with volumes Fix NPE on migrateVirtualMachineWithVolume Dec 8, 2021

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

clgtm, simplification of the code while preventing an NPE

@GabrielBrascher GabrielBrascher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code LGTM

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1878

@sureshanaparti

Copy link
Copy Markdown
Contributor

@GutoVeronezi Is this PR good to go in 4.16.1? If so, rebase it with '4.16' branch.

@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

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2646)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32062 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5758-t2646-kvm-centos7.zip
Smoke tests completed. 91 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@sureshanaparti

Copy link
Copy Markdown
Contributor

@GutoVeronezi Is this PR good to go in 4.16.1? If so, rebase it with '4.16' branch.

Hi @GutoVeronezi Can you confirm if this is good for 4.16.1.

@GutoVeronezi
GutoVeronezi force-pushed the insert-correct-template-size-when-live-migrating-vm-with-volumes branch from bde1cd8 to 39c0b94 Compare December 14, 2021 13:01
@GutoVeronezi
GutoVeronezi changed the base branch from main to 4.16 December 14, 2021 13:02
@GutoVeronezi

GutoVeronezi commented Dec 14, 2021

Copy link
Copy Markdown
Contributor Author

@sureshanaparti done. As soon as it get merged, I'll create another PR to main branch.

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@sureshanaparti

Copy link
Copy Markdown
Contributor

@sureshanaparti done. As soon as it get merged, I'll create another PR to main branch.

thanks @GutoVeronezi, no need of another PR to main branch, we can forward merge this changes to main.

@sureshanaparti sureshanaparti added this to the 4.16.1.0 milestone Dec 14, 2021
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1902

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2659)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33266 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5758-t2659-kvm-centos7.zip
Smoke tests completed. 90 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_disable_oobm_ha_state_ineligible Error 1543.50 test_hostha_kvm.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@sureshanaparti done. As soon as it get merged, I'll create another PR to main branch.

this is not needed @GutoVeronezi . part of the release managers task on dot releases is to forward merge any commits to newer release branches.

@sureshanaparti

Copy link
Copy Markdown
Contributor

Merging based on approvals and test results (test failure above is unrelated to this PR).

@sureshanaparti
sureshanaparti merged commit 79d924f into apache:4.16 Dec 16, 2021
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Dec 20, 2021
GabrielBrascher pushed a commit to CLDIN/cloudstack that referenced this pull request Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants