Skip to content

Allow download of system vm templates#6750

Merged
yadvr merged 2 commits intoapache:mainfrom
scclouds:allow_download_of_system_vm_templates
Oct 8, 2022
Merged

Allow download of system vm templates#6750
yadvr merged 2 commits intoapache:mainfrom
scclouds:allow_download_of_system_vm_templates

Conversation

@GaOrtiga
Copy link
Copy Markdown
Contributor

Description

Currently, ACS does not allow the user to download System VM Templates, even though it may be usefull as it can speed up the registration process of the template for production once the homologation is done beforehand. This PR changes this, allowing the user to download said VM Templates

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

How Has This Been Tested?

I built the code with the respective changes in a local lab. After that, I copied the Uuid from one of the System VM templates. Then, using CloudMonkey, I utilized the command 'extract template' with the copied Uuid. CloudMonkey then generated a link for the download of the template, confirming that the alteration was successful.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 20, 2022

Thanks for the PR - can you explain the use case as the systemvmtemplate aren't for public/general consumption for users? The systemvmtemplates are also publicly available so if anybody wants they can register using such links.

@GaOrtiga
Copy link
Copy Markdown
Contributor Author

@rohityadavcloud
Access to the official repositories may be slow at time; therefore, being able to perform a direct download can speed up this process in some use cases. Also since access to these templates is already public, there should be no problem in allowing the downloads to be performed from within the platform itself.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 20, 2022

Codecov Report

Merging #6750 (0aa0dc4) into main (bbc1260) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff            @@
##               main    #6750   +/-   ##
=========================================
  Coverage     10.42%   10.42%           
- Complexity     6701     6705    +4     
=========================================
  Files          2458     2458           
  Lines        243246   243244    -2     
  Branches      38067    38066    -1     
=========================================
+ Hits          25358    25366    +8     
+ Misses       214714   214703   -11     
- Partials       3174     3175    +1     
Impacted Files Coverage Δ
...n/java/com/cloud/template/TemplateManagerImpl.java 11.04% <0.00%> (+0.02%) ⬆️
...apache/cloudstack/syslog/AlertsSyslogAppender.java 58.75% <0.00%> (+2.25%) ⬆️
...dstack/network/contrail/model/ModelObjectBase.java 28.84% <0.00%> (+7.69%) ⬆️

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

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

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

@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-4939)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 40082 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6750-t4939-kvm-centos7.zip
Smoke tests completed. 102 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

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

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

code looks good and I'm fine with it functionaly

@DaanHoogland
Copy link
Copy Markdown
Contributor

Thanks for the PR - can you explain the use case as the systemvmtemplate aren't for public/general consumption for users? The systemvmtemplates are also publicly available so if anybody wants they can register using such links.

is this a 👎 , @rohityadavcloud ?

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 21, 2022

@DaanHoogland no just a question, really trying to understand why we're making this public? (historically this has been private/hidden to users, or at least the download button isn't it?)

@DaanHoogland
Copy link
Copy Markdown
Contributor

@rohityadavcloud it is a valid question but I think @GaOrtiga 's argument makes sense. Do we merge?

Copy link
Copy Markdown
Contributor

@SadiJr SadiJr left a comment

Choose a reason for hiding this comment

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

CLGTM, and I agree with @DaanHoogland and @GaOrtiga arguments

@DaanHoogland
Copy link
Copy Markdown
Contributor

@rohityadavcloud I need to test but i think that the system vm template will not be visible to the normal user so no download button either. Only root admins should be able to download it this way. (not sure about the API)
We can verify. Is there any other blocking concern you have?

@GaOrtiga
Copy link
Copy Markdown
Contributor Author

GaOrtiga commented Oct 4, 2022

@DaanHoogland you are correct, the download button will not be visible in the UI as shown below:
image (1)

Furthermore, even through CloudMonkey download will only be available to Root Admins, as shown below:
Running the command with a Root Admin account:
downloadRootAdmin

Running the command with a user-level account:
downloaduser

With this being said, I still do not understand why allowing operators to download said templates is a concern. These images are publicly available, and operators are the ones registering them in ACS. Therefore, it makes sense to allow them to download directly from ACS if they wish so.

@yadvr yadvr added this to the 4.18.0.0 milestone Oct 8, 2022
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Oct 8, 2022

Makes sense, LGTM, let's merge this.

@yadvr yadvr merged commit eb26ca1 into apache:main Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants