-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Enable Direct Download for systemVM templates #3731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Direct Download for systemVM templates #3731
Conversation
02b3802 to
9d7f71d
Compare
| public HttpDirectDownloadCommand(String url, Long templateId, PrimaryDataStoreTO destPool, String checksum, Map<String, String> headers) { | ||
| public HttpDirectDownloadCommand(String url, Long templateId, PrimaryDataStoreTO destPool, String checksum, Map<String, String> headers, int connectTimeout, int soTimeout) { | ||
| super(url, templateId, destPool, checksum, headers); | ||
| setConnectTimeout(connectTimeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be set on the DrectDownloadCommand constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| DownloadProtocol.HTTPS.equals(protocol) || | ||
| DownloadProtocol.METALINK.equals(protocol)) { | ||
| try { | ||
| connectTimeout = Integer.parseInt(configDao.getValue(DirectDownloadConnectTimeout.key())); |
There was a problem hiding this 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 this and use the config key value() method, same below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| private void updateDirectDownloadTemplate(long templateId, long zoneId) { | ||
| TemplateDataStoreVO templateStore = _tmplStoreDao.findByTemplateZone(templateId, zoneId, DataStoreRole.Image); | ||
| TemplateDataStoreVO templateStore = _tmplStoreDao.findByTemplate(templateId, DataStoreRole.Image); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we are updating every reference in every zone for the template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nvazquez as we do not store store_id in cloud.template_store_ref table for direct download template, we cannot find the entry in the table for a zone while update. Continued with same behaviour from user direct download templates. Do we need to change this for system direct download templates? updateDirectDownloadTemplate is new method added in this PR only
|
Thanks @shwstppr, left some comments after reviewing |
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-503 |
|
Is it ready @shwstppr @Spaceman1984 ? |
|
No @rhtyd. This is based on another PR so waiting for it to get merge, then rebase. |
|
76fe17e to
c66a81c
Compare
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-751 |
|
Packaging result: ✖centos6 ✖centos7 ✖debian. JID-752 |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-753 |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-772 |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-812 |
1afa879 to
c66a81c
Compare
|
Packaging result: ✖centos6 ✖centos7 ✔debian. JID-829 |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-912 |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@shwstppr is this still WIP? if no, please remove tag from the title. |
|
@blueorangutan package |
|
@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
@DaanHoogland yes it still needs some fixing related to the listing of direct download system template after removing adding new zones. Working on it |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-929 |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
Packaging result: ✖centos6 ✖centos7 ✖debian. JID-932 |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-933 |
| } | ||
|
|
||
| // delete template refs for this zone | ||
| templateZoneDao.deleteByZoneId(zoneId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaanHoogland please review if this is the correct place to cleanup template_zone_ref entries for a zone to be removed? Or should this call be made after the successful removal of DataCenterVO in success block below? Functionality-wise it is working fine.
cc @rhtyd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shwstppr absolutely only on success. I don't think the zone is still usable if deletion of the zoneVO, but it is not right to do an automatic clean-up of items (templates) in a container (zone) if the container is not disposed of.
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-937 |
|
@blueorangutan test |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1091)
|
|
@blueorangutan test |
|
@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1108)
|
borisstoyanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, test failures does not seem related
|
LGTM after internal review. |
|
Merging based on 4 x approvals and regression test results (and of course manual testing) |
Description
As of now provisioning of System VMs with direct download enabled template was not supported. Even after setting such templates as SYSTEM template, while provisioning SSVM and CPVM the server would return an error message like,
This behaviour has been changed and it allows the server to provision SSVM and CPVM even with direct download system templates.
Additionally, changes have been made to make different timeouts for direct download functionality configurable using global settings. Following global configurations have been added for this,
direct.download.connect.timeout- Connection establishment timeout in milliseconds for direct downloaddirect.download.socket.timeout- Socket timeout (SO_TIMEOUT) in milliseconds for direct downloaddirect.download.connection.request.timeout- Requesting a connection from connection manager timeout in milliseconds for direct downloadTypes of changes
Screenshots (if appropriate):
New global settings,

How Has This Been Tested?
Admin registers a direct download private USER or ROUTING type template,
For testing databse is updated manually to make newly added template to the SYSTEM type template. This can be done using upgrade script during upgrade,
Existing SSVM and CPVM are destroyed for testing new template and server can provision new VMs with newly added template.

New VMs get created,
Database values for template_id verified in vm_instance,
MariaDB [cloud]> select id,name,vm_template_id from vm_instance where removed IS NULL\G;
To check direct download template for VR
router.template.*global config is updated and VR is recreated or new network is created.Verified in DB,