diff --git a/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java b/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java index 69f2204d0e3..d98bb3b45bf 100644 --- a/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java +++ b/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java @@ -24,17 +24,16 @@ import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.Id; import javax.persistence.Table; -import com.cloud.org.Cluster; -import com.cloud.storage.ScopeType; -import com.cloud.storage.StoragePoolStatus; -import com.cloud.storage.Storage.StoragePoolType; -import com.cloud.utils.db.GenericDao; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; - import com.cloud.hypervisor.Hypervisor.HypervisorType; +import com.cloud.org.Cluster; +import com.cloud.storage.ScopeType; +import com.cloud.storage.Storage.StoragePoolType; +import com.cloud.storage.StoragePoolStatus; +import com.cloud.utils.db.GenericDao; /** * Storage Pool DB view. @@ -137,6 +136,9 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity, I @Enumerated(value = EnumType.STRING) private HypervisorType hypervisor; + @Column(name = "storage_provider_name") + private String storageProviderName; + /** * @return the scope */ @@ -378,5 +380,7 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity, I this.jobStatus = jobStatus; } - + public String getStorageProviderName() { + return storageProviderName; + } } diff --git a/setup/db/db/schema-420to430.sql b/setup/db/db/schema-420to430.sql index 653ff77c090..a7651895699 100644 --- a/setup/db/db/schema-420to430.sql +++ b/setup/db/db/schema-420to430.sql @@ -281,6 +281,7 @@ CREATE VIEW `cloud`.`template_view` AS and (resource_tags.resource_type = 'Template' or resource_tags.resource_type='ISO') where vm_template.state='Active'; + DROP VIEW IF EXISTS `cloud`.`volume_view`; CREATE VIEW `cloud`.`volume_view` AS select @@ -392,3 +393,56 @@ CREATE VIEW `cloud`.`volume_view` AS INSERT IGNORE INTO `cloud`.`configuration`(category, instance, component, name, value, description, default_value) VALUES ('Advanced', 'DEFAULT', 'management-server', 's3.multipart.enabled', 'true', 'enable s3 multipart upload', 'true'); +DROP VIEW IF EXISTS `cloud`.`storage_pool_view`; +CREATE VIEW `cloud`.`storage_pool_view` AS + select + storage_pool.id, + storage_pool.uuid, + storage_pool.name, + storage_pool.status, + storage_pool.path, + storage_pool.pool_type, + storage_pool.host_address, + storage_pool.created, + storage_pool.removed, + storage_pool.capacity_bytes, + storage_pool.capacity_iops, + storage_pool.scope, + storage_pool.hypervisor, + storage_pool.storage_provider_name, + cluster.id cluster_id, + cluster.uuid cluster_uuid, + cluster.name cluster_name, + cluster.cluster_type, + data_center.id data_center_id, + data_center.uuid data_center_uuid, + data_center.name data_center_name, + data_center.networktype data_center_type, + host_pod_ref.id pod_id, + host_pod_ref.uuid pod_uuid, + host_pod_ref.name pod_name, + storage_pool_details.name tag, + op_host_capacity.used_capacity disk_used_capacity, + op_host_capacity.reserved_capacity disk_reserved_capacity, + async_job.id job_id, + async_job.uuid job_uuid, + async_job.job_status job_status, + async_job.account_id job_account_id + from + `cloud`.`storage_pool` + left join + `cloud`.`cluster` ON storage_pool.cluster_id = cluster.id + left join + `cloud`.`data_center` ON storage_pool.data_center_id = data_center.id + left join + `cloud`.`host_pod_ref` ON storage_pool.pod_id = host_pod_ref.id + left join + `cloud`.`storage_pool_details` ON storage_pool_details.pool_id = storage_pool.id + and storage_pool_details.value = 'true' + left join + `cloud`.`op_host_capacity` ON storage_pool.id = op_host_capacity.host_id + and op_host_capacity.capacity_type = 3 + left join + `cloud`.`async_job` ON async_job.instance_id = storage_pool.id + and async_job.instance_type = 'StoragePool' + and async_job.job_status = 0;