cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Return vm userdata

Open JoaoJandre opened this issue 3 years ago • 20 comments

Description

This PR extends PR #6051 by making the listVirtualMachines API return the VMs' userdata, so that when the editVM form is opened in the UI, the existing userdata will be shown. A new optional boolean parameter called userdata was added to the listVirtualMachines API, that controls whether the API should return userdata or not. The default value is false. The sanitizeReverse function was also moved to util.js to prevent duplicated code.

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)
  • [X] 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
  • [X] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [ ] Minor
  • [ ] Trivial

Screenshots (if appropriate):

userdata

How Has This Been Tested?

This was tested in a local lab by creating a new VM and editing it's userdata through the UI. After the form was closed it was reopened to check if the userdata that was added before would be shown.

JoaoJandre avatar Aug 29 '22 18:08 JoaoJandre

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

acs-robot avatar Aug 29 '22 18:08 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 Aug 29 '22 18:08 blueorangutan

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

blueorangutan avatar Aug 29 '22 18:08 blueorangutan

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

acs-robot avatar Aug 30 '22 16:08 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 Aug 30 '22 16:08 blueorangutan

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

blueorangutan avatar Aug 30 '22 16:08 blueorangutan

Codecov Report

Merging #6683 (f25394a) into main (9f7e0cc) will increase coverage by 0.01%. The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main    #6683      +/-   ##
============================================
+ Coverage      5.87%    5.88%   +0.01%     
- Complexity     3936     3944       +8     
============================================
  Files          2454     2454              
  Lines        242683   242727      +44     
  Branches      37978    37989      +11     
============================================
+ Hits          14265    14293      +28     
- Misses       226839   226851      +12     
- Partials       1579     1583       +4     
Impacted Files Coverage Δ
server/src/main/java/com/cloud/api/ApiDBUtils.java 0.00% <0.00%> (ø)
...ain/java/com/cloud/api/query/QueryManagerImpl.java 0.00% <0.00%> (ø)
...n/java/com/cloud/api/query/ViewResponseHelper.java 0.00% <0.00%> (ø)
...ava/com/cloud/api/query/dao/UserVmJoinDaoImpl.java 0.00% <0.00%> (ø)
...dstack/storage/datastore/PrimaryDataStoreImpl.java 2.25% <0.00%> (-0.09%) :arrow_down:
...visor/vmware/manager/VmwareStorageManagerImpl.java 1.06% <0.00%> (-0.03%) :arrow_down:
...ne/schema/src/main/java/com/cloud/host/HostVO.java 15.04% <0.00%> (ø)
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 0.00% <0.00%> (ø)
...chema/src/main/java/com/cloud/vm/VMInstanceVO.java 24.40% <0.00%> (ø)
...n/java/com/cloud/resource/ResourceManagerImpl.java 0.00% <0.00%> (ø)
... and 7 more

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

codecov[bot] avatar Aug 30 '22 17:08 codecov[bot]

@blueorangutan package

DaanHoogland avatar Aug 31 '22 07:08 DaanHoogland

@DaanHoogland 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 Aug 31 '22 07:08 blueorangutan

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

blueorangutan avatar Aug 31 '22 08:08 blueorangutan

@blueorangutan test

DaanHoogland avatar Aug 31 '22 13:08 DaanHoogland

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

acs-robot avatar Aug 31 '22 13:08 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 Aug 31 '22 13:08 blueorangutan

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

blueorangutan avatar Aug 31 '22 14:08 blueorangutan

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

acs-robot avatar Sep 02 '22 16:09 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 Sep 02 '22 16:09 blueorangutan

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

blueorangutan avatar Sep 02 '22 16:09 blueorangutan

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

blueorangutan avatar Sep 06 '22 09:09 blueorangutan

@JoaoJandre , when testing this in the simulator user data won´t be saved. I suppose this is because of the backend changes needed. so probably not an issue, but your test description is not repeatable in http://qa.cloudstack.cloud:8080/client/pr/6683. just FYI (@everybody)

DaanHoogland avatar Sep 06 '22 12:09 DaanHoogland

@DaanHoogland, can we run the tests for this one?

GutoVeronezi avatar Sep 23 '22 18:09 GutoVeronezi

@blueorangutan test

DaanHoogland avatar Sep 24 '22 18:09 DaanHoogland

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

blueorangutan avatar Sep 24 '22 18:09 blueorangutan

Trillian Build Failed (tid-5003)

blueorangutan avatar Sep 24 '22 18:09 blueorangutan

@blueorangutan package

DaanHoogland avatar Sep 24 '22 18:09 DaanHoogland

@DaanHoogland 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 24 '22 18:09 blueorangutan

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

blueorangutan avatar Sep 24 '22 19:09 blueorangutan

@blueorangutan test

DaanHoogland avatar Sep 24 '22 19:09 DaanHoogland

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

blueorangutan avatar Sep 24 '22 19:09 blueorangutan

Trillian Build Failed (tid-5005)

blueorangutan avatar Sep 24 '22 19:09 blueorangutan