cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

server: fix volume migration on user vm scale

Open shwstppr opened this issue 2 years ago • 9 comments

Description

Fixes #6701

When volume migration is initiated by system, account check is not needed.

Types of changes

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] New feature (non-breaking change which adds functionality)
  • [x] 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
  • [x] Critical
  • [ ] Major
  • [ ] Minor
  • [ ] Trivial

Screenshots (if appropriate):

How Has This Been Tested?

shwstppr avatar Sep 05 '22 18:09 shwstppr

@blueorangutan package

shwstppr avatar Sep 05 '22 18:09 shwstppr

@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 avatar Sep 05 '22 18:09 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 4129

blueorangutan avatar Sep 05 '22 19:09 blueorangutan

@blueorangutan test

shwstppr avatar Sep 05 '22 19:09 shwstppr

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

blueorangutan avatar Sep 05 '22 19:09 blueorangutan

Codecov Report

Merging #6704 (94db086) into 4.17 (296035d) will decrease coverage by 0.00%. The diff coverage is 4.16%.

:exclamation: Current head 94db086 differs from pull request most recent head 2c7f27f. Consider uploading reports for the commit 2c7f27f to get more accurate results

@@             Coverage Diff              @@
##               4.17    #6704      +/-   ##
============================================
- Coverage     10.34%   10.34%   -0.01%     
- Complexity     6610     6611       +1     
============================================
  Files          2451     2451              
  Lines        242340   242352      +12     
  Branches      37924    37926       +2     
============================================
- Hits          25070    25066       -4     
- Misses       214182   214198      +16     
  Partials       3088     3088              
Impacted Files Coverage Δ
...in/java/com/cloud/server/ManagementServerImpl.java 2.50% <0.00%> (-0.01%) :arrow_down:
...n/java/com/cloud/storage/VolumeApiServiceImpl.java 10.79% <0.00%> (-0.03%) :arrow_down:
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 5.63% <0.00%> (-0.01%) :arrow_down:
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java 31.62% <0.00%> (ø)
...rver/src/main/java/com/cloud/vm/UserVmManager.java 100.00% <100.00%> (ø)
...rg/apache/cloudstack/quota/QuotaStatementImpl.java 36.28% <0.00%> (-3.99%) :arrow_down:
...dstack/network/contrail/model/ModelObjectBase.java 28.84% <0.00%> (+7.69%) :arrow_up:

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

codecov[bot] avatar Sep 05 '22 20:09 codecov[bot]

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

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 604.34 test_kubernetes_clusters.py

blueorangutan avatar Sep 06 '22 06:09 blueorangutan

Moving this to draft, need to revisit this later. Ideally, the normal user should not be allowed to scale VM or change volume offering with volume migration.

shwstppr avatar Sep 06 '22 12:09 shwstppr

Moving this to draft, need to revisit this later. Ideally, the normal user should not be allowed to scale VM or change volume offering with volume migration.

is ther some technical reason not to allow that @shwstppr ? because from a business point of view I would want them to be able to scale VMs and volumes.

DaanHoogland avatar Oct 11 '22 10:10 DaanHoogland

@DaanHoogland didn't understand you. I was saying scale VM operation shouldn't be allowed with migration of volume and without migration it should be fine. This was based on the fact that by default user role is not allowed to use migrateVolume API.

shwstppr avatar Oct 11 '22 10:10 shwstppr

@DaanHoogland didn't understand you. I was saying scale VM operation shouldn't be allowed with migration of volume and without migration it should be fine. This was based on the fact that by default user role is not allowed to use migrateVolume API.

ok, makes sense, migration not being allowed. sorry I misunderstood.

DaanHoogland avatar Oct 12 '22 06:10 DaanHoogland

Trillian Build Failed (tid-5131)

blueorangutan avatar Oct 14 '22 13:10 blueorangutan

Trillian Build Failed (tid-5137)

blueorangutan avatar Oct 15 '22 03:10 blueorangutan

@blueorangutan package

harikrishna-patnala avatar Oct 17 '22 03:10 harikrishna-patnala

@harikrishna-patnala 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 avatar Oct 17 '22 03:10 blueorangutan

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

acs-robot avatar Oct 17 '22 03:10 acs-robot

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

blueorangutan avatar Oct 17 '22 03:10 blueorangutan

Added a new global setting for scale VM operation "allow.diskOffering.change.during.scale.vm" which determines whether to allow or disallow disk offering change for root volume during scaling of a stopped or running VM. By default it is false, which means disk offering change will not happen during scale VM. This is to keep the old behavior as is.

harikrishna-patnala avatar Oct 17 '22 03:10 harikrishna-patnala

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6704 (SL-JID-2517)

blueorangutan avatar Oct 17 '22 03:10 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 4479

blueorangutan avatar Oct 17 '22 04:10 blueorangutan

@blueorangutan test matrix

harikrishna-patnala avatar Oct 17 '22 05:10 harikrishna-patnala

@harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

blueorangutan avatar Oct 17 '22 05:10 blueorangutan

Trillian Build Failed (tid-5141)

blueorangutan avatar Oct 17 '22 05:10 blueorangutan

Trillian Build Failed (tid-5142)

blueorangutan avatar Oct 17 '22 05:10 blueorangutan

Trillian test result (tid-5143) Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7 Total time taken: 40761 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6704-t5143-vmware-65u2.zip Smoke tests completed. 100 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_05_scale_vm_dont_allow_disk_offering_change Error 0.11 test_scale_vm.py

blueorangutan avatar Oct 17 '22 17:10 blueorangutan

@blueorangutan package

harikrishna-patnala avatar Oct 18 '22 08:10 harikrishna-patnala

@harikrishna-patnala 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 avatar Oct 18 '22 09:10 blueorangutan

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

acs-robot avatar Oct 18 '22 09:10 acs-robot

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

blueorangutan avatar Oct 18 '22 09:10 blueorangutan