Skip to content

Conversation

@DK101010
Copy link
Contributor

Description

During the datastore cluster creation, cloudstack could not
recognize the existing primary storage and create a new one because
uuid format not equal.

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?

Tested in my own Vmware env.

during the datastore cluster creation, cloudstack could not
recognize the existing primary storage and create a new one because
uuid format not equal
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.

thought the code is not very bad, I don't think this is how the problem should be solved @DK101010 . Where the input does not adhere to the standard, it should be converted. not during the search. Don't you think?

@DK101010
Copy link
Contributor Author

thought the code is not very bad, I don't think this is how the problem should be solved @DK101010 . Where the input does not adhere to the standard, it should be converted. not during the search. Don't you think?

For sure, but I'm not sure why are uuids in custom attributes without and in db with separators. Also for this way we must update custom attributes of all storages and for this I can not estimate the impact of already existing implementation. Therefore this solution.

@DaanHoogland
Copy link
Contributor

thought the code is not very bad, I don't think this is how the problem should be solved @DK101010 . Where the input does not adhere to the standard, it should be converted. not during the search. Don't you think?

For sure, but I'm not sure why are uuids in custom attributes without and in db with separators. Also for this way we must update custom attributes of all storages and for this I can not estimate the impact of already existing implementation. Therefore this solution.

Ok, so how about removing the dashes unconditionally but just for the comparison and otherwise keep using the originals?

@nvazquez nvazquez added this to the 4.16.1.0 milestone Sep 23, 2021
@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

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.

minor nit, this is executed only during upgrade/install so not making a fuzz

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@rohityadavcloud rohityadavcloud modified the milestones: 4.16.1.0, 4.17.0.0 Nov 25, 2021
@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@sureshanaparti
Copy link
Contributor

@blueorangutan test

1 similar comment
@nvazquez
Copy link
Contributor

nvazquez commented Feb 7, 2022

@blueorangutan test

@nvazquez
Copy link
Contributor

@blueorangutan test matrix

@blueorangutan
Copy link

@nvazquez a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-3626)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33353 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5382-t3626-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

Trillian test result (tid-3625)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 35470 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5382-t3625-xenserver-71.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

Trillian test result (tid-3627)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 36646 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5382-t3627-vmware-65u2.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

updateStmt.setString(1, poolUuid.toString());
updateStmt.addBatch();
}
updateStmt.executeBatch();
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry if not correct, but in case the result set is empty wouldn't this fail since the parameters are not set? Or does this method check the parameters before executing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @nvazquez, good point, no Idea how it works, I will check this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have checked it, executeBatch have no problems if no values are added.

@nvazquez
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@nvazquez 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

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

@nvazquez
Copy link
Contributor

@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-3725)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39461 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5382-t3725-kvm-centos7.zip
Smoke tests completed. 90 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez
Copy link
Contributor

PIng for review @weizhouapache @Pearl1594 @DaanHoogland

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 good

@nvazquez
Copy link
Contributor

@blueorangutan package

1 similar comment
@nvazquez
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@nvazquez 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

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

@nvazquez
Copy link
Contributor

@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-3935)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43183 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5382-t3935-kvm-centos7.zip
Smoke tests completed. 95 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_02_create_iso_with_checksum_sha256 Error 66.56 test_iso.py

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

LGTM - manually tested upgrade from 4.16.1 on Vmware env:

Before the upgrade:

MariaDB [cloud]> select id, uuid from storage_pool;
+----+--------------------------------------+
| id | uuid                                 |
+----+--------------------------------------+
|  2 | 0c4d8fb8-72b4-3c92-b06f-48310371df62 |
|  1 | ccd02aec-5e0a-323f-a358-d739fd5dd50c |
+----+--------------------------------------+
2 rows in set (0.00 sec)

MariaDB [cloud]> select * from version order by id desc limit 1;
+----+----------+---------------------+----------+
| id | version  | updated             | step     |
+----+----------+---------------------+----------+
| 37 | 4.16.1.0 | 2022-04-21 01:58:07 | Complete |
+----+----------+---------------------+----------+
1 row in set (0.00 sec)

Upgraded successfully:

...
2022-04-21 02:45:04,415 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- PR#5984 Create table to persist VM stats.
2022-04-21 02:45:04,415 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) DROP TABLE IF EXISTS `cloud`.`vm_stats` 
2022-04-21 02:45:04,418 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) CREATE TABLE `cloud`.`vm_stats` (   `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',   `vm_id` bigint unsigned NOT NULL,   `mgmt_server_id` bigint unsigned NOT NULL,   `timestamp` datetime NOT NULL,   `vm_stats_data` text NOT NULL,   PRIMARY KEY (`id`)   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 
2022-04-21 02:45:04,428 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- PR#5984 Update name for global configuration vm.stats.increment.metrics
2022-04-21 02:45:04,428 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) Update configuration set name='vm.stats.increment.metrics' where name='vm.stats.increment.metrics.in.memory' 
2022-04-21 02:45:04,431 DEBUG [c.c.u.d.Upgrade41610to41700] (main:null) (logid:) Replacement of faulty pool uuids
2022-04-21 02:45:04,448 INFO  [c.c.u.DatabaseUpgradeChecker] (main:null) (logid:) Cleanup upgrade Upgrade41610to41700 to upgrade from 4.16.1.0-4.17.0.0 to 4.17.0.0
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- Licensed to the Apache Software Foundation (ASF) under one
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- or more contributor license agreements.  See the NOTICE file
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- distributed with this work for additional information
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- regarding copyright ownership.  The ASF licenses this file
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- to you under the Apache License, Version 2.0 (the
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- "License"); you may not use this file except in compliance
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- with the License.  You may obtain a copy of the License at
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --   http://www.apache.org/licenses/LICENSE-2.0
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- Unless required by applicable law or agreed to in writing,
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- software distributed under the License is distributed on an
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- KIND, either express or implied.  See the License for the
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- specific language governing permissions and limitations
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- under the License.
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --;
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- Schema upgrade cleanup from 4.16.1.0 to 4.17.0.0
2022-04-21 02:45:04,451 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --;
2022-04-21 02:45:04,452 DEBUG [c.c.u.DatabaseUpgradeChecker] (main:null) (logid:) Cleanup script Upgrade41610to41700 is executed successfully
2022-04-21 02:45:04,477 DEBUG [c.c.u.DatabaseUpgradeChecker] (main:null) (logid:) Upgrade completed for version 4.17.0.0
....
MariaDB [cloud]> select id, uuid from storage_pool;
+----+--------------------------------------+
| id | uuid                                 |
+----+--------------------------------------+
|  2 | 0c4d8fb8-72b4-3c92-b06f-48310371df62 |
|  1 | ccd02aec-5e0a-323f-a358-d739fd5dd50c |
+----+--------------------------------------+
2 rows in set (0.00 sec)

MariaDB [cloud]> select * from version order by id desc limit 1;
+----+----------+---------------------+----------+
| id | version  | updated             | step     |
+----+----------+---------------------+----------+
| 38 | 4.17.0.0 | 2022-04-21 02:45:04 | Complete |
+----+----------+---------------------+----------+
1 row in set (0.00 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants