Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR fixes #7309

We need to always update the size and state of systemvm template during registration

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

@weizhouapache weizhouapache added this to the 4.18.1.0 milestone Aug 16, 2023
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #7874 (31d2f99) into 4.18 (e8b4911) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               4.18    #7874      +/-   ##
============================================
- Coverage     13.02%   13.02%   -0.01%     
+ Complexity     9040     9039       -1     
============================================
  Files          2720     2720              
  Lines        257094   257094              
  Branches      40092    40092              
============================================
- Hits          33491    33489       -2     
- Misses       219398   219401       +3     
+ Partials       4205     4204       -1     
Files Changed Coverage Δ
...om/cloud/upgrade/SystemVmTemplateRegistration.java 0.00% <0.00%> (ø)
...ain/java/com/cloud/storage/StorageManagerImpl.java 1.59% <0.00%> (ø)

... and 1 file with indirect coverage changes

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

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.

clgtm

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SF] 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.

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SF] 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

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6820

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-7470)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 41846 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7874-t7470-kvm-centos7.zip
Smoke tests completed. 108 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@DaanHoogland
Copy link
Contributor

@Pearl1594 , did you test or just reviewed?

@Pearl1594
Copy link
Contributor

I haven't tested it @DaanHoogland

Copy link
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

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

LGTM didn't test, we can merge if @weizhouapache advises what/how he has tested this.

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@rohityadavcloud @DaanHoogland
this fixes two current issues when setup a cloudstack zone
(1) system vm template size is NULL until ssvm is Up
(2) there are duplicated records for systemvm template in template_store_ref

mysql> select * from template_store_ref where template_id=3;
+----+----------+-------------+---------------------+---------------------+--------+--------------+------------+------------+---------------+----------------+-----------+------------+--------------------------------------------------------------+-------------------------------------------------------------------------------------+-------+-----------+---------+--------------+---------+---------+----------------------+--------------+
| id | store_id | template_id | created             | last_updated        | job_id | download_pct | size       | store_role | physical_size | download_state | error_str | local_path | install_path                                                 | url                                                                                 | state | destroyed | is_copy | update_count | ref_cnt | updated | download_url_created | download_url |
+----+----------+-------------+---------------------+---------------------+--------+--------------+------------+------------+---------------+----------------+-----------+------------+--------------------------------------------------------------+-------------------------------------------------------------------------------------+-------+-----------+---------+--------------+---------+---------+----------------------+--------------+
|  5 |        1 |           3 | 2023-08-23 06:51:31 | 2023-08-24 17:11:08 | NULL   |          100 | 5242880000 | Image      |     460193792 | DOWNLOADED     | NULL      | NULL       | template/tmpl/1/3/3509aabf-805e-44de-a80a-27145fc8762a.qcow2 | https://download.cloudstack.org/systemvm/4.18/systemvmtemplate-4.18.1-kvm.qcow2.bz2 | Ready |         0 |       0 |            0 |       0 | NULL    | NULL                 | NULL         |
|  7 |        1 |           3 | 2023-08-23 06:51:31 | 2023-08-25 11:33:46 | NULL   |          100 | 5242880000 | Image      |     460193792 | DOWNLOADED     | NULL      | NULL       | template/tmpl/1/3/3509aabf-805e-44de-a80a-27145fc8762a.qcow2 | https://download.cloudstack.org/systemvm/4.18/systemvmtemplate-4.18.1-kvm.qcow2.bz2 | Ready |         0 |       0 |            0 |       0 | NULL    | NULL                 | NULL         |
+----+----------+-------------+---------------------+---------------------+--------+--------------+------------+------------+---------------+----------------+-----------+------------+--------------------------------------------------------------+-------------------------------------------------------------------------------------+-------+-----------+---------+--------------+---------+---------+----------------------+--------------+
2 rows in set (0.00 sec)

With this PR

(1) systemvm template size and state are updated when systemvm template is registered (from /usr/share/cloudstack-management/templates/systemvm/)
(2) there is only 1 record for systemvm template in template_store_ref

MariaDB [cloud]> select * from template_store_ref where template_id=3;
+----+----------+-------------+---------------------+---------------------+--------+--------------+------------+------------+---------------+----------------+-----------+------------+--------------------------------------------------------------+-------------------------------------------------------------------------------------+-------+-----------+---------+--------------+---------+---------+----------------------+--------------+
| id | store_id | template_id | created             | last_updated        | job_id | download_pct | size       | store_role | physical_size | download_state | error_str | local_path | install_path                                                 | url                                                                                 | state | destroyed | is_copy | update_count | ref_cnt | updated | download_url_created | download_url |
+----+----------+-------------+---------------------+---------------------+--------+--------------+------------+------------+---------------+----------------+-----------+------------+--------------------------------------------------------------+-------------------------------------------------------------------------------------+-------+-----------+---------+--------------+---------+---------+----------------------+--------------+
|  5 |        1 |           3 | 2023-08-25 12:32:25 | 2023-08-25 12:45:18 | NULL   |          100 | 5242880000 | Image      |     461242368 | DOWNLOADED     | NULL      | NULL       | template/tmpl/1/3/5d1a1a0b-ec1f-400e-92d3-0ba2496c164b.qcow2 | https://download.cloudstack.org/systemvm/4.18/systemvmtemplate-4.18.1-kvm.qcow2.bz2 | Ready |         0 |       0 |            0 |       0 | NULL    | NULL                 | NULL         |
+----+----------+-------------+---------------------+---------------------+--------+--------------+------------+------------+---------------+----------------+-----------+------------+--------------------------------------------------------------+-------------------------------------------------------------------------------------+-------+-----------+---------+--------------+---------+---------+----------------------+--------------+
1 row in set (0.00 sec)

@DaanHoogland
Copy link
Contributor

DaanHoogland commented Aug 25, 2023

verified both conditions in a test env.
template size is set during zone creation
only one entry is added per template/store (i didn't know this was a thing)

ready to merge!

@DaanHoogland DaanHoogland merged commit 0dd6bb7 into apache:4.18 Aug 25, 2023
@DaanHoogland DaanHoogland deleted the 4.18-update-systemvm-template-details-during-registration branch August 25, 2023 14:46
@blueorangutan
Copy link

[SF] Trillian test result (tid-7562)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38997 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7874-t7562-kvm-centos7.zip
Smoke tests completed. 108 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

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.

5 participants