mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-5641: Local disk usage on host don't show up in the admin's webui. Correcting the view to include capacity type 9 which is local storage. Also changing the response to just pick the used bytes coming in through the view which now stands corrected.
Verified that the dashboard and storage pool view works fine.
This commit is contained in:
parent
2f832fddff
commit
2ed22b3ba7
@ -29,9 +29,7 @@ import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
|
||||
import com.cloud.api.ApiDBUtils;
|
||||
import com.cloud.api.query.vo.StoragePoolJoinVO;
|
||||
import com.cloud.capacity.Capacity;
|
||||
import com.cloud.capacity.CapacityManager;
|
||||
import com.cloud.storage.ScopeType;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.StorageStats;
|
||||
import com.cloud.utils.StringUtils;
|
||||
@ -152,8 +150,7 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
|
||||
poolResponse.setHypervisor(pool.getHypervisor().toString());
|
||||
}
|
||||
|
||||
short capacityType = pool.getScope() == ScopeType.HOST ? Capacity.CAPACITY_TYPE_LOCAL_STORAGE : Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED;
|
||||
long allocatedSize = ApiDBUtils.getStorageCapacitybyPool(pool.getId(), capacityType);
|
||||
long allocatedSize = pool.getUsedCapacity();
|
||||
poolResponse.setDiskSizeTotal(pool.getCapacityBytes());
|
||||
poolResponse.setDiskSizeAllocated(allocatedSize);
|
||||
poolResponse.setCapacityIops(pool.getCapacityIops());
|
||||
|
||||
@ -274,3 +274,58 @@ UPDATE `cloud`.`user` SET `cloud`.`user`.domain_id=(SELECT `cloud`.`account`.dom
|
||||
ALTER TABLE `cloud`.`user` ADD UNIQUE KEY `username_domain_id` (`username`,`domain_id`);
|
||||
|
||||
ALTER TABLE `cloud`.`volumes` CHANGE COLUMN `iso_id` `iso_id` bigint(20) unsigned COMMENT 'The id of the iso from which the volume was created';
|
||||
|
||||
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 in (3,9)
|
||||
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;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user