Ted Smith created CLOUDSTACK-1761:
-------------------------------------

             Summary: Available local storage disk capacity incorrectly 
reported in KVM to manager.
                 Key: CLOUDSTACK-1761
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-1761
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: KVM
    Affects Versions: 4.0.0, 4.0.1, 4.1.0, 4.2.0
         Environment: Ubuntu 12.04, 4.0.0/4.0.1 agent, 4.0.0 manager.
            Reporter: Ted Smith
            Priority: Critical


Currently the client is reporting the amount of disk space that has been used 
when first connecting to the manager instead of the amount of bytes available.

Output of availableBytes from management-server.log:
"capacityBytes":4956273893376,"availableBytes":318101676032

Output of df from physical host with local storage enabled:
/dev/mapper/somehostname003-root 4840111224 310646138 4285003000   7% / 

I'm fairly certain it is related to the two code snippets below. One of them is 
passing getUsed and the other is expecting availableBytes.

>From 
>plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
       try {

            KVMStoragePool localStoragePool = _storagePoolMgr
                    .createStoragePool(_localStorageUUID, "localhost", -1,
                            _localStoragePath, "", StoragePoolType.Filesystem);
            com.cloud.agent.api.StoragePoolInfo pi = new 
com.cloud.agent.api.StoragePoolInfo(
                    localStoragePool.getUuid(), cmd.getPrivateIpAddress(),
                    _localStoragePath, _localStoragePath,
                    StoragePoolType.Filesystem, localStoragePool.getCapacity(),
                    localStoragePool.getUsed());

            sscmd = new StartupStorageCommand();
            sscmd.setPoolInfo(pi);
            sscmd.setGuid(pi.getUuid());
            sscmd.setDataCenter(_dcId);
            sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL);
        }

---------------------------------------------------------------------------------------------------------------------------------
>From api/src/com/cloud/agent/api/StoragePoolInfo.java
        public StoragePoolInfo(String uuid, String host, String hostPath,
                        String localPath, StoragePoolType poolType, long 
capacityBytes,
                        long availableBytes) {
                super();
                this.uuid = uuid;
                this.host = host;
                this.localPath = localPath;
                this.hostPath = hostPath;
                this.poolType = poolType;
                this.capacityBytes = capacityBytes;
                this.availableBytes = availableBytes;
        }

    public StoragePoolInfo(String uuid, String host, String hostPath,
            String localPath, StoragePoolType poolType, long capacityBytes,
            long availableBytes, Map<String, String> details) {
        this(uuid, host, hostPath, localPath, poolType, capacityBytes, 
availableBytes);
        this.details = details;
    }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to