Skip to content

api, server, ui: allow host auto-select for migrateVirtualMachineWith…#6785

Closed
shwstppr wants to merge 8 commits intoapache:mainfrom
shapeblue:add-automigrate-localstorage
Closed

api, server, ui: allow host auto-select for migrateVirtualMachineWith…#6785
shwstppr wants to merge 8 commits intoapache:mainfrom
shapeblue:add-automigrate-localstorage

Conversation

@shwstppr
Copy link
Contributor

Description

Fixes #6773

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

Screenshots (if appropriate):

How Has This Been Tested?

…Volume

Fixes apache#6773

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr shwstppr changed the title server, api, ui: allow host auto-select for migrateVirtualMachineWith… api, server, ui: allow host auto-select for migrateVirtualMachineWith… Sep 29, 2022
@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6785 (SL-JID-2442)

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6785 (SL-JID-2443)

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Merging #6785 (919c4e6) into main (c9b103c) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main    #6785      +/-   ##
============================================
- Coverage     12.95%   12.95%   -0.01%     
  Complexity     8986     8986              
============================================
  Files          2728     2728              
  Lines        256647   256656       +9     
  Branches      40024    40026       +2     
============================================
  Hits          33257    33257              
- Misses       219210   219220      +10     
+ Partials       4180     4179       -1     
Impacted Files Coverage Δ
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 7.33% <0.00%> (-0.02%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@shwstppr
Copy link
Contributor Author

@DaanHoogland please note I've not done any sort of testing for this yet

@DaanHoogland
Copy link
Contributor

@DaanHoogland please note I've not done any sort of testing for this yet

I'll do some when I get around. Do you have any test advice on this? I couldn´t reproduce the issue on 4.17.

@shwstppr
Copy link
Contributor Author

@DaanHoogland To reproduce, I think one needs to just select Automatically assign in the migrate instance form for a vm that has volumes on local storage,
Screenshot from 2022-09-30 15-52-43
For tests,

  • we will need to test this case which I feel would fail :-D
  • test for any regression - user vm migration, systemvm migration, vm storage migration using migrateVirtualMachineWithVolume API and maybe cross-cluster migration

@blueorangutan
Copy link

Trillian test result (tid-5059)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 48674 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6785-t5059-kvm-centos7.zip
Smoke tests completed. 100 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_unsecure_vm_migration Error 225.92 test_vm_life_cycle.py
test_03_secured_to_nonsecured_vm_migration Error 145.08 test_vm_life_cycle.py
test_04_nonsecured_to_secured_vm_migration Error 153.13 test_vm_life_cycle.py
test_08_upgrade_kubernetes_ha_cluster Failure 605.48 test_kubernetes_clusters.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 650.62 test_vpc_redundant.py

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

Nice enhancement

@DaanHoogland
Copy link
Contributor

Nice enhancement

Did you test @weizhouapache ? I didn´t get to it yet.

@weizhouapache
Copy link
Member

Nice enhancement

Did you test @weizhouapache ? I didn´t get to it yet.

I have not tested it yet

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@yadvr yadvr requested a review from DaanHoogland April 13, 2023 09:45
@yadvr yadvr added this to the 4.19.0.0 milestone Apr 13, 2023

private boolean isVmVolumesOnZoneWideStore(VMInstanceVO vm) {
final List<VolumeVO> volumes = _volsDao.findCreatedByInstance(vm.getId());
private boolean isVmVolumesUsingLocalStorage(final List<VolumeVO> volumes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The code in this method looks exactly like the bit in isVmVolumesOnZoneWideStore

Comment on lines +6961 to +6971
if (destinationHost == null) {
Long poolId = null;
if (MapUtils.isNotEmpty(volToPoolObjectMap)) {
poolId = new ArrayList<>(volToPoolObjectMap.values()).get(0);
}
DeployDestination deployDestination = chooseVmMigrationDestination(vm, srcHost, poolId);
if (deployDestination == null) {
throw new CloudRuntimeException("Unable to find suitable destination to migrate VM " + vm.getInstanceName());
}
destinationHost = deployDestination.getHost();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be extracted?

shwstppr added 3 commits May 23, 2023 17:49
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@apache apache deleted a comment from blueorangutan May 23, 2023
@apache apache deleted a comment from blueorangutan May 23, 2023
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el7 ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 6130

@blueorangutan
Copy link

Packaging result [LL]: ✖️ el7 ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 6054

@blueorangutan
Copy link

Packaging result [LL]: ✖️ el7 ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 6055

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el7 ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 6136

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@shwstppr shwstppr closed this May 24, 2023
@blueorangutan
Copy link

@shwstppr a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@shwstppr
Copy link
Contributor Author

Recreated here #7554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AutoSelect live migration fails with local storage

6 participants