Skip to content

Conversation

@nvazquez
Copy link
Contributor

@nvazquez nvazquez commented Jan 22, 2020

Description

This FR proposes the extension of the direct download support to primary storage pools using the most commonly used protocols/storage types:

  • NFS – already supported
  • Local storage
  • SharedMountpoint

Other storage providers support can be extended in future by interface implementation on the KVM storage provider depending on the storage adaptor.

The KVM storage processor is extended to achieve the direct template downloads in a storage agnostic way, including the supported storage providers implementations and allowing future implementations for different storage providers:

  • A new check of the available free space on the downloading host local storage is added before attempting to download a template. As on registration, a CheckUrlCommand is sent to a random KVM host, this host performs a HEAD command to the template URL. In case the server provides the remote file size of the template, this size is passed as part of the DirectDownloadCommand and used to check against the available free space.
  • The template file is downloaded to a scratch space in the local storage system within the host. This location can be explicitly set by the administrator via agent.properties file on the property: direct.download.temporary.download.location, and in case it is not set the default location var/lib/libvirt/images is used.
  • After the template file is downloaded to the scratch space location, it is extracted (or copied) to the primary storage pool selected by the CloudStack planner.
  • The implementation of the extract/copy method is extended to invoke the different StorageAdaptors implementations for different storage providers. These implementations include local storage, shared mount point and NFS in the scope of this PR.
  • After the template is extracted/copied to the destination storage pool, the downloaded file is removed from the scratch space location in the host.

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)

Screenshots (if appropriate):

How Has This Been Tested?

Ubuntu based management server
Test zone with local storage for user VMs enabled
2 x CentOS7 based KVM hosts
1 NFS storage pool
1 Shared mount point across the 2 hosts

@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-646

Copy link
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.

please do not use a [WIP] tag in the title or [DO NOT MERGE]. you can create the PR as draft PR if you want to guard against merging.

Copy link
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 generally good, I have some doubts about the log messages. please review those @nvazquez .

@nvazquez nvazquez changed the title [WIP DO NOT MERGE] [KVM] Direct download agnostic of the storage provider [KVM] Direct download agnostic of the storage provider Jan 22, 2020
@nvazquez
Copy link
Contributor Author

Thanks @DaanHoogland, comments are sorted out using your suggestions
@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-648

@nvazquez
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-805)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37512 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3828-t805-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_direct_download.py
Intermittent failure detected: /marvin/tests/smoke/test_templates.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 76 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_deploy_vm_from_direct_download_template_nfs_storage Error 3.34 test_direct_download.py
ContextSuite context=TestDirectDownloadTemplates>:teardown Error 2.23 test_direct_download.py
test_02_upload_direct_download_certificates Failure 0.04 test_direct_download.py
test_02_deploy_vm_from_direct_download_template Error 38.35 test_templates.py
test_03_deploy_vm_wrong_checksum Error 10.61 test_templates.py

@DaanHoogland
Copy link
Contributor

travis choked

@DaanHoogland DaanHoogland reopened this Jan 23, 2020
@nvazquez nvazquez force-pushed the direct-download-agnostic branch from e7d9b1d to d485183 Compare January 29, 2020 04:30
@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-680

@nvazquez
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@yadvr yadvr closed this Jan 29, 2020
@yadvr yadvr reopened this Jan 29, 2020
@nvazquez nvazquez force-pushed the direct-download-agnostic branch from 62d99cf to 9034a8a Compare March 4, 2020 15:04
@nvazquez
Copy link
Contributor Author

nvazquez commented Mar 4, 2020

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-999

@blueorangutan
Copy link

Trillian test result (tid-1183)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 30769 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3828-t1183-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermittent failure detected: /marvin/tests/smoke/test_loadbalance.py
Smoke tests completed. 81 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@yadvr
Copy link
Member

yadvr commented Mar 5, 2020

@nvazquez there is one issue specific to simulator, address implement the mocked/override method:

[ERROR] /home/travis/build/apache/cloudstack/plugins/hypervisors/simulator/src/main/java/com/cloud/resource/SimulatorStorageProcessor.java:[56,7] error: SimulatorStorageProcessor is not abstract and does not override abstract method copyVolumeFromPrimaryToPrimary(CopyCommand) in StorageProcessor
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project cloud-plugin-hypervisor-simulator: Compilation failure
[ERROR] /home/travis/build/apache/cloudstack/plugins/hypervisors/simulator/src/main/java/com/cloud/resource/SimulatorStorageProcessor.java:[56,7] error: SimulatorStorageProcessor is not abstract and does not override abstract method copyVolumeFromPrimaryToPrimary(CopyCommand) in StorageProcessor
[ERROR] -> [Help 1]

@DaanHoogland @andrijapanicsb cc @borisstoyanov @PaulAngus this is ready to merge, please advice if any manual testing is complete?

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM

@nvazquez
Copy link
Contributor Author

nvazquez commented Mar 5, 2020

Fix for the simulator build added

@nvazquez
Copy link
Contributor Author

nvazquez commented Mar 5, 2020

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-1006

@nvazquez
Copy link
Contributor Author

nvazquez commented Mar 5, 2020

@blueorangutan test

@blueorangutan
Copy link

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

@andrijapanicsb
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-1206)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 27787 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3828-t1206-kvm-centos7.zip
Smoke tests completed. 81 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@andrijapanicsb
Copy link
Contributor

3 x approvals, extensive manual testing, another review of the same and all regression testing passes.

Merging.

@andrijapanicsb andrijapanicsb merged commit 73122fd into apache:master Mar 6, 2020
@nvazquez nvazquez deleted the direct-download-agnostic branch April 6, 2020 14:33
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.

7 participants