You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "DaanHoogland (via GitHub)" <gi...@apache.org> on 2024/02/13 14:30:54 UTC

[PR] volume view in separate file for easier modification [cloudstack]

DaanHoogland opened a new pull request, #8647:
URL: https://github.com/apache/cloudstack/pull/8647

   ### Description
   
   <!-- Fixes: # -->
   we moved to a new way of maintaining views (see #7417)
   not all views were added in that PR so this pr is intended to do so
   
   - [ ] account_netstats_view
   - [ ] account_view
   - [ ] account_vmstats_view
   - [ ] affinity_group_view
   - [ ] domain_view
   - [ ] event_view
   - [ ] free_ip_view
   - [ ] image_store_view
   - [ ] instance_group_view
   - [ ] last_annotation_view
   - [ ] mshost_view
   - [ ] project_account_view
   - [ ] project_invitation_view
   - [ ] project_view
   - [ ] resource_tag_view
   - [ ] security_group_view
   - [x] volume_view
   - [ ] vpc_offering_view
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   $ ls -1 engine/schema/src/main/resources/META-INF/db/views/
   cloud.account_netstats_view.sql
   cloud.account_view.sql
   cloud.account_vmstats_view.sql
   cloud.affinity_group_view.sql
   cloud.async_job_view.sql
   cloud.data_center_view.sql
   cloud.disk_offering_view.sql
   cloud.domain_router_view.sql
   cloud.domain_view.sql
   cloud.event_view.sql
   cloud.free_ip_view.sql
   cloud.host_view.sql
   cloud.image_store_view.sql
   cloud.instance_group_view.sql
   cloud.last_annotation_view.sql
   cloud.mshost_view.sql
   cloud.network_offering_view.sql
   cloud.project_account_view.sql
   cloud.project_invitation_view.sql
   cloud.project_view.sql
   cloud.resource_tag_view.sql
   cloud.security_group_view.sql
   cloud.service_offering_view.sql
   cloud.snapshot_view.sql
   cloud.snapshot_view.sql
   cloud.storage_pool_view.sql
   cloud.storage_pool_view.sql
   cloud.template_view.sql
   cloud.template_view.sql
   cloud.user_view.sql
   cloud.user_view.sql
   cloud.user_vm_view.sql
   cloud.user_vm_view.sql
   cloud.volume_view.sql
   cloud.vpc_offering_view.sql
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   $ ls -1 engine/schema/src/main/resources/META-INF/db/views/
   cloud.async_job_view.sql
   cloud.data_center_view.sql
   cloud.disk_offering_view.sql
   cloud.domain_router_view.sql
   cloud.host_view.sql
   cloud.network_offering_view.sql
   cloud.service_offering_view.sql
   cloud.snapshot_view.sql
   cloud.storage_pool_view.sql
   cloud.template_view.sql
   cloud.user_view.sql
   cloud.user_vm_view.sql
   ~~~
   
   <!--- ******************************************************************************* -->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ******************************************************************************* -->
   
   ### 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)
   - [x] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [x] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [X] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1948145067

   @DaanHoogland a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1941761480

   > > PR #7417's main purpose was to introduce the concept.
   > 
   > I know, or better I remember now ;)
   > 
   > > The idea was to create the new files as we would change the views; however, there is no problem in creating them right away.
   > 
   > In hindsight it might be a bit confusing and lead to review errors . I'll get myself in an agry streak soon and add the rest.
   
   @DaanHoogland @GutoVeronezi 
   
   IMHO, ideally the database upgrade process should be
   - drop procedures if exist, and create procedures
   - perform database upgrade scripts (in .sql files) and data migration (in .java files), which should not depend on views
   - create views
   
   #7417 has introduced the concept to create views as last step, which is good.
   however, we should also consider 
   - recreating all views might take quite long time if the database if huge
   - the upgrade script or data migration might rely on some views (need double-check) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1945632490

   @DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#discussion_r1487967255


##########
engine/schema/src/main/resources/META-INF/db/views/cloud.volume_view.sql:
##########
@@ -0,0 +1,157 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+-- VIEW `cloud`.`volume_view`;
+
+DROP VIEW IF EXISTS `cloud`.`volume_view`;
+
+CREATE OR REPLACE
+ALGORITHM = UNDEFINED VIEW `volume_view` AS
+SELECT
+    `volumes`.`id` AS `id`,
+    `volumes`.`uuid` AS `uuid`,
+    `volumes`.`name` AS `name`,
+    `volumes`.`device_id` AS `device_id`,
+    `volumes`.`volume_type` AS `volume_type`,
+    `volumes`.`provisioning_type` AS `provisioning_type`,
+    `volumes`.`size` AS `size`,
+    `volumes`.`min_iops` AS `min_iops`,
+    `volumes`.`max_iops` AS `max_iops`,
+    `volumes`.`created` AS `created`,
+    `volumes`.`state` AS `state`,
+    `volumes`.`attached` AS `attached`,
+    `volumes`.`removed` AS `removed`,
+    `volumes`.`display_volume` AS `display_volume`,
+    `volumes`.`format` AS `format`,
+    `volumes`.`path` AS `path`,
+    `volumes`.`chain_info` AS `chain_info`,
+    `volumes`.`external_uuid` AS `external_uuid`,
+    `account`.`id` AS `account_id`,
+    `account`.`uuid` AS `account_uuid`,
+    `account`.`account_name` AS `account_name`,
+    `account`.`type` AS `account_type`,
+    `domain`.`id` AS `domain_id`,
+    `domain`.`uuid` AS `domain_uuid`,
+    `domain`.`name` AS `domain_name`,
+    `domain`.`path` AS `domain_path`,
+    `projects`.`id` AS `project_id`,
+    `projects`.`uuid` AS `project_uuid`,
+    `projects`.`name` AS `project_name`,
+    `data_center`.`id` AS `data_center_id`,
+    `data_center`.`uuid` AS `data_center_uuid`,
+    `data_center`.`name` AS `data_center_name`,
+    `data_center`.`networktype` AS `data_center_type`,
+    `vm_instance`.`id` AS `vm_id`,
+    `vm_instance`.`uuid` AS `vm_uuid`,
+    `vm_instance`.`name` AS `vm_name`,
+    `vm_instance`.`state` AS `vm_state`,
+    `vm_instance`.`vm_type` AS `vm_type`,
+    `user_vm`.`display_name` AS `vm_display_name`,
+    `volume_store_ref`.`size` AS `volume_store_size`,
+    `volume_store_ref`.`download_pct` AS `download_pct`,
+    `volume_store_ref`.`download_state` AS `download_state`,
+    `volume_store_ref`.`error_str` AS `error_str`,
+    `volume_store_ref`.`created` AS `created_on_store`,
+    `disk_offering`.`id` AS `disk_offering_id`,
+    `disk_offering`.`uuid` AS `disk_offering_uuid`,
+    `disk_offering`.`name` AS `disk_offering_name`,
+    `disk_offering`.`display_text` AS `disk_offering_display_text`,
+    `disk_offering`.`use_local_storage` AS `use_local_storage`,
+    `service_offering`.`system_use` AS `system_use`,
+    `disk_offering`.`bytes_read_rate` AS `bytes_read_rate`,
+    `disk_offering`.`bytes_write_rate` AS `bytes_write_rate`,
+    `disk_offering`.`iops_read_rate` AS `iops_read_rate`,
+    `disk_offering`.`iops_write_rate` AS `iops_write_rate`,
+    `disk_offering`.`cache_mode` AS `cache_mode`,
+    `storage_pool`.`id` AS `pool_id`,
+    `storage_pool`.`uuid` AS `pool_uuid`,
+    `storage_pool`.`name` AS `pool_name`,
+    `cluster`.`id` AS `cluster_id`,
+    `cluster`.`name` AS `cluster_name`,
+    `cluster`.`uuid` AS `cluster_uuid`,
+    `cluster`.`hypervisor_type` AS `hypervisor_type`,
+    `vm_template`.`id` AS `template_id`,
+    `vm_template`.`uuid` AS `template_uuid`,
+    `vm_template`.`extractable` AS `extractable`,
+    `vm_template`.`type` AS `template_type`,
+    `vm_template`.`name` AS `template_name`,
+    `vm_template`.`display_text` AS `template_display_text`,
+    `iso`.`id` AS `iso_id`,
+    `iso`.`uuid` AS `iso_uuid`,
+    `iso`.`name` AS `iso_name`,
+    `iso`.`display_text` AS `iso_display_text`,
+    `resource_tags`.`id` AS `tag_id`,
+    `resource_tags`.`uuid` AS `tag_uuid`,
+    `resource_tags`.`key` AS `tag_key`,
+    `resource_tags`.`value` AS `tag_value`,
+    `resource_tags`.`domain_id` AS `tag_domain_id`,
+    `resource_tags`.`account_id` AS `tag_account_id`,
+    `resource_tags`.`resource_id` AS `tag_resource_id`,
+    `resource_tags`.`resource_uuid` AS `tag_resource_uuid`,
+    `resource_tags`.`resource_type` AS `tag_resource_type`,
+    `resource_tags`.`customer` AS `tag_customer`,
+    `async_job`.`id` AS `job_id`,
+    `async_job`.`uuid` AS `job_uuid`,
+    `async_job`.`job_status` AS `job_status`,
+    `async_job`.`account_id` AS `job_account_id`,
+    `host_pod_ref`.`id` AS `pod_id`,
+    `host_pod_ref`.`uuid` AS `pod_uuid`,
+    `host_pod_ref`.`name` AS `pod_name`,
+    `resource_tag_account`.`account_name` AS `tag_account_name`,
+    `resource_tag_domain`.`uuid` AS `tag_domain_uuid`,
+    `resource_tag_domain`.`name` AS `tag_domain_name`
+FROM
+    ((((((((((((((((((`volumes`
+JOIN `account`ON
+    ((`volumes`.`account_id` = `account`.`id`)))
+JOIN `domain`ON
+    ((`volumes`.`domain_id` = `domain`.`id`)))
+LEFT JOIN `projects`ON
+    ((`projects`.`project_account_id` = `account`.`id`)))
+LEFT JOIN `data_center`ON
+    ((`volumes`.`data_center_id` = `data_center`.`id`)))
+LEFT JOIN `vm_instance`ON
+    ((`volumes`.`instance_id` = `vm_instance`.`id`)))
+LEFT JOIN `user_vm`ON
+    ((`user_vm`.`id` = `vm_instance`.`id`)))
+LEFT JOIN `volume_store_ref`ON
+    ((`volumes`.`id` = `volume_store_ref`.`volume_id`)))
+LEFT JOIN `service_offering`ON
+    ((`vm_instance`.`service_offering_id` = `service_offering`.`id`)))
+LEFT JOIN `disk_offering`ON
+    ((`volumes`.`disk_offering_id` = `disk_offering`.`id`)))
+LEFT JOIN `storage_pool`ON
+    ((`volumes`.`pool_id` = `storage_pool`.`id`)))
+LEFT JOIN `host_pod_ref`ON
+    ((`storage_pool`.`pod_id` = `host_pod_ref`.`id`)))
+LEFT JOIN `cluster`ON
+    ((`storage_pool`.`cluster_id` = `cluster`.`id`)))
+LEFT JOIN `vm_template`ON
+    ((`volumes`.`template_id` = `vm_template`.`id`)))
+LEFT JOIN `vm_template` `iso`ON
+    ((`iso`.`id` = `volumes`.`iso_id`)))
+LEFT JOIN `resource_tags`ON
+    (((`resource_tags`.`resource_id` = `volumes`.`id`)
+        and (`resource_tags`.`resource_type` = 'Volume'))))
+LEFT JOIN `async_job`ON
+    (((`async_job`.`instance_id` = `volumes`.`id`)
+        and (`async_job`.`instance_type` = 'Volume')
+            and (`async_job`.`job_status` = 0))))
+LEFT JOIN `account` `resource_tag_account`ON
+    ((`resource_tag_account`.`id` = `resource_tags`.`account_id`)))
+LEFT JOIN `domain` `resource_tag_domain`ON
+    ((`resource_tag_domain`.`id` = `resource_tags`.`domain_id`)));

Review Comment:
   ```suggestion
       ((`resource_tag_domain`.`id` = `resource_tags`.`domain_id`)));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1942106370

   > > * recreating all views might take quite long time if the database if huge
   > 
   > View structures should not be affected by the database size. They are structures that represent queries; thus, not relying on the amount of data.
   > 
   good to know it.
   
   > > * the upgrade script or data migration might rely on some views (need double-check)
   > 
   > Regarding this one, you can check my comment on PR https://github.com/apache/cloudstack/pull/7417#issuecomment-1741821866,  which answers the same question you made.
   > 
   > 
   Yes, I remember it.
   I am ok with moving all views to separated files.  We need to test the upgrade of different cloudstack versions.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1944205193

   @DaanHoogland a [SL] 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1941674115

   > @GutoVeronezi , can you advice if this is all that is needed to put views under the new maintenance regime? I really only want volume_view for now, so is there any reason not to do them all right now? thanks
   
   By the design we created, creating the view's file under the `views` directory should be enough.
   
   PR #7417's main purpose was to introduce the concept. The idea was to create the new files as we would change the views; however, there is no problem in creating them right away.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1941954665

   > * recreating all views might take quite long time if the database if huge
   
   View structures should not be affected by the database size. They are structures that represent queries; thus, not relying on the amount of data.
   
   > * the upgrade script or data migration might rely on some views (need double-check)
   
   Regarding this one, you can check my comment on PR https://github.com/apache/cloudstack/pull/7417#issuecomment-1741821866,  which answers the same question you made.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1944203734

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1947506501

   <b>[SF] Trillian test result (tid-9228)</b>
   Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9
   Total time taken: 50771 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8647-t9228-kvm-alma9.zip
   Smoke tests completed. 128 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_trigger_shutdown | `Failure` | 341.27 | test_safe_shutdown.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1945631100

   @blueorangutan test alma9 kvm-alma9


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1949486290

   <b>[SF] Trillian test result (tid-9253)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 44956 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8647-t9253-xenserver-71.zip
   Smoke tests completed. 128 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_trigger_shutdown | `Failure` | 336.79 | test_safe_shutdown.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#discussion_r1487967255


##########
engine/schema/src/main/resources/META-INF/db/views/cloud.volume_view.sql:
##########
@@ -0,0 +1,157 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+-- VIEW `cloud`.`volume_view`;
+
+DROP VIEW IF EXISTS `cloud`.`volume_view`;
+
+CREATE OR REPLACE
+ALGORITHM = UNDEFINED VIEW `volume_view` AS
+SELECT
+    `volumes`.`id` AS `id`,
+    `volumes`.`uuid` AS `uuid`,
+    `volumes`.`name` AS `name`,
+    `volumes`.`device_id` AS `device_id`,
+    `volumes`.`volume_type` AS `volume_type`,
+    `volumes`.`provisioning_type` AS `provisioning_type`,
+    `volumes`.`size` AS `size`,
+    `volumes`.`min_iops` AS `min_iops`,
+    `volumes`.`max_iops` AS `max_iops`,
+    `volumes`.`created` AS `created`,
+    `volumes`.`state` AS `state`,
+    `volumes`.`attached` AS `attached`,
+    `volumes`.`removed` AS `removed`,
+    `volumes`.`display_volume` AS `display_volume`,
+    `volumes`.`format` AS `format`,
+    `volumes`.`path` AS `path`,
+    `volumes`.`chain_info` AS `chain_info`,
+    `volumes`.`external_uuid` AS `external_uuid`,
+    `account`.`id` AS `account_id`,
+    `account`.`uuid` AS `account_uuid`,
+    `account`.`account_name` AS `account_name`,
+    `account`.`type` AS `account_type`,
+    `domain`.`id` AS `domain_id`,
+    `domain`.`uuid` AS `domain_uuid`,
+    `domain`.`name` AS `domain_name`,
+    `domain`.`path` AS `domain_path`,
+    `projects`.`id` AS `project_id`,
+    `projects`.`uuid` AS `project_uuid`,
+    `projects`.`name` AS `project_name`,
+    `data_center`.`id` AS `data_center_id`,
+    `data_center`.`uuid` AS `data_center_uuid`,
+    `data_center`.`name` AS `data_center_name`,
+    `data_center`.`networktype` AS `data_center_type`,
+    `vm_instance`.`id` AS `vm_id`,
+    `vm_instance`.`uuid` AS `vm_uuid`,
+    `vm_instance`.`name` AS `vm_name`,
+    `vm_instance`.`state` AS `vm_state`,
+    `vm_instance`.`vm_type` AS `vm_type`,
+    `user_vm`.`display_name` AS `vm_display_name`,
+    `volume_store_ref`.`size` AS `volume_store_size`,
+    `volume_store_ref`.`download_pct` AS `download_pct`,
+    `volume_store_ref`.`download_state` AS `download_state`,
+    `volume_store_ref`.`error_str` AS `error_str`,
+    `volume_store_ref`.`created` AS `created_on_store`,
+    `disk_offering`.`id` AS `disk_offering_id`,
+    `disk_offering`.`uuid` AS `disk_offering_uuid`,
+    `disk_offering`.`name` AS `disk_offering_name`,
+    `disk_offering`.`display_text` AS `disk_offering_display_text`,
+    `disk_offering`.`use_local_storage` AS `use_local_storage`,
+    `service_offering`.`system_use` AS `system_use`,
+    `disk_offering`.`bytes_read_rate` AS `bytes_read_rate`,
+    `disk_offering`.`bytes_write_rate` AS `bytes_write_rate`,
+    `disk_offering`.`iops_read_rate` AS `iops_read_rate`,
+    `disk_offering`.`iops_write_rate` AS `iops_write_rate`,
+    `disk_offering`.`cache_mode` AS `cache_mode`,
+    `storage_pool`.`id` AS `pool_id`,
+    `storage_pool`.`uuid` AS `pool_uuid`,
+    `storage_pool`.`name` AS `pool_name`,
+    `cluster`.`id` AS `cluster_id`,
+    `cluster`.`name` AS `cluster_name`,
+    `cluster`.`uuid` AS `cluster_uuid`,
+    `cluster`.`hypervisor_type` AS `hypervisor_type`,
+    `vm_template`.`id` AS `template_id`,
+    `vm_template`.`uuid` AS `template_uuid`,
+    `vm_template`.`extractable` AS `extractable`,
+    `vm_template`.`type` AS `template_type`,
+    `vm_template`.`name` AS `template_name`,
+    `vm_template`.`display_text` AS `template_display_text`,
+    `iso`.`id` AS `iso_id`,
+    `iso`.`uuid` AS `iso_uuid`,
+    `iso`.`name` AS `iso_name`,
+    `iso`.`display_text` AS `iso_display_text`,
+    `resource_tags`.`id` AS `tag_id`,
+    `resource_tags`.`uuid` AS `tag_uuid`,
+    `resource_tags`.`key` AS `tag_key`,
+    `resource_tags`.`value` AS `tag_value`,
+    `resource_tags`.`domain_id` AS `tag_domain_id`,
+    `resource_tags`.`account_id` AS `tag_account_id`,
+    `resource_tags`.`resource_id` AS `tag_resource_id`,
+    `resource_tags`.`resource_uuid` AS `tag_resource_uuid`,
+    `resource_tags`.`resource_type` AS `tag_resource_type`,
+    `resource_tags`.`customer` AS `tag_customer`,
+    `async_job`.`id` AS `job_id`,
+    `async_job`.`uuid` AS `job_uuid`,
+    `async_job`.`job_status` AS `job_status`,
+    `async_job`.`account_id` AS `job_account_id`,
+    `host_pod_ref`.`id` AS `pod_id`,
+    `host_pod_ref`.`uuid` AS `pod_uuid`,
+    `host_pod_ref`.`name` AS `pod_name`,
+    `resource_tag_account`.`account_name` AS `tag_account_name`,
+    `resource_tag_domain`.`uuid` AS `tag_domain_uuid`,
+    `resource_tag_domain`.`name` AS `tag_domain_name`
+FROM
+    ((((((((((((((((((`volumes`
+JOIN `account`ON
+    ((`volumes`.`account_id` = `account`.`id`)))
+JOIN `domain`ON
+    ((`volumes`.`domain_id` = `domain`.`id`)))
+LEFT JOIN `projects`ON
+    ((`projects`.`project_account_id` = `account`.`id`)))
+LEFT JOIN `data_center`ON
+    ((`volumes`.`data_center_id` = `data_center`.`id`)))
+LEFT JOIN `vm_instance`ON
+    ((`volumes`.`instance_id` = `vm_instance`.`id`)))
+LEFT JOIN `user_vm`ON
+    ((`user_vm`.`id` = `vm_instance`.`id`)))
+LEFT JOIN `volume_store_ref`ON
+    ((`volumes`.`id` = `volume_store_ref`.`volume_id`)))
+LEFT JOIN `service_offering`ON
+    ((`vm_instance`.`service_offering_id` = `service_offering`.`id`)))
+LEFT JOIN `disk_offering`ON
+    ((`volumes`.`disk_offering_id` = `disk_offering`.`id`)))
+LEFT JOIN `storage_pool`ON
+    ((`volumes`.`pool_id` = `storage_pool`.`id`)))
+LEFT JOIN `host_pod_ref`ON
+    ((`storage_pool`.`pod_id` = `host_pod_ref`.`id`)))
+LEFT JOIN `cluster`ON
+    ((`storage_pool`.`cluster_id` = `cluster`.`id`)))
+LEFT JOIN `vm_template`ON
+    ((`volumes`.`template_id` = `vm_template`.`id`)))
+LEFT JOIN `vm_template` `iso`ON
+    ((`iso`.`id` = `volumes`.`iso_id`)))
+LEFT JOIN `resource_tags`ON
+    (((`resource_tags`.`resource_id` = `volumes`.`id`)
+        and (`resource_tags`.`resource_type` = 'Volume'))))
+LEFT JOIN `async_job`ON
+    (((`async_job`.`instance_id` = `volumes`.`id`)
+        and (`async_job`.`instance_type` = 'Volume')
+            and (`async_job`.`job_status` = 0))))
+LEFT JOIN `account` `resource_tag_account`ON
+    ((`resource_tag_account`.`id` = `resource_tags`.`account_id`)))
+LEFT JOIN `domain` `resource_tag_domain`ON
+    ((`resource_tag_domain`.`id` = `resource_tags`.`domain_id`)));

Review Comment:
   ```suggestion
       ((`resource_tag_domain`.`id` = `resource_tags`.`domain_id`)));
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1948144430

   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1941645749

   @GutoVeronezi , can you advice if this is all that is needed to put views under the new maintenance regime? I really only want volume_view for now, so is there any reason not to do them all right now?
   thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1941689828

   > PR #7417's main purpose was to introduce the concept.
   
   I know, or better I remember now ;)
   > The idea was to create the new files as we would change the views; however, there is no problem in creating them right away.
   
   In hindsight it might be a bit confusing and lead to review errors . I'll get myself in an agry streak soon and add the rest.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1941784015

   > * recreating all views might take quite long time if the database if huge
   
   so we should add intelligence as to which views have changed
   > * the upgrade script or data migration might rely on some views (need double-check)
   
   well, this should not be a problem as all views are still there while other upgrades occur. I think it is the programmers responsibility to have their dependencies straight.
   
   the first one is a valid consideration but out of scope here I think.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1941693883

   > In hindsight it might be a bit confusing and lead to review errors . 
   
   Indeed


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move views into separate files for easier modification [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1944309688

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] volume view in separate file for easier modification [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8647:
URL: https://github.com/apache/cloudstack/pull/8647#issuecomment-1941665011

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/8647?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Comparison is base [(`bda49ab`)](https://app.codecov.io/gh/apache/cloudstack/commit/bda49ab08ffc8cda7dd36f5a553096c23f7ec1a5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 30.90% compared to head [(`03d7030`)](https://app.codecov.io/gh/apache/cloudstack/pull/8647?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 4.39%.
   
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##               4.19   #8647       +/-   ##
   ============================================
   - Coverage     30.90%   4.39%   -26.52%     
   ============================================
     Files          5347     361     -4986     
     Lines        375566   28633   -346933     
     Branches      54625    4995    -49630     
   ============================================
   - Hits         116068    1258   -114810     
   + Misses       244236   27236   -217000     
   + Partials      15262     139    -15123     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/8647/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [simulator-marvin-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8647/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/8647/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.39% <ø> (ø)` | |
   | [unit-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8647/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/8647?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org