Details
Description
1. I added new volume.
2. I tried to attach the volume to a VM on UI.
3. It failed and the following log appeared.
2014-05-12 11:29:47,096 DEBUG [cloud.api.ApiServlet] (http-6443-exec-116:null) ===START=== 133.xx.xxx.xxx – GET command=attachVolume&id=ac7099fb-ac66-4c63-bf1e-ed0e1429f412&virtualMachineId=ecdc2c1d-e21e-4c04-962a-4efac1a69a74&response=json&sessionkey=TDcTy%2FQRb5%2F%2Bk28wsjg6BWd6pcA%3D&_=1399861774316
2014-05-12 11:29:47,143 DEBUG [cloud.async.AsyncJobManagerImpl] (http-6443-exec-116:null) submit async job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ], details: AsyncJobVO {id:4916, userId: 3, accountId: 3, sessionKey: null, instanceType: Volume, instanceId: 1543, cmd: org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd, cmdOriginator: null, cmdInfo:
, cmdVersion: 0, callbackType: 0, callbackAddress: null, status: 0, processStatus: 0, resultCode: 0, result: null, initMsid: 90520731085572, completeMsid: null, lastUpdated: null, lastPolled: null, created: null}
2014-05-12 11:29:47,144 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) Executing org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd for job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]
2014-05-12 11:29:47,147 DEBUG [cloud.api.ApiServlet] (http-6443-exec-116:null) ===END=== 133.xx.xxx.xxx – GET command=attachVolume&id=ac7099fb-ac66-4c63-bf1e-ed0e1429f412&virtualMachineId=ecdc2c1d-e21e-4c04-962a-4efac1a69a74&response=json&sessionkey=TDcTy%2FQRb5%2F%2Bk28wsjg6BWd6pcA%3D&_=1399861774316
2014-05-12 11:29:47,192 DEBUG [cloud.user.AccountManagerImpl] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) Access to org.apache.cloudstack.storage.volume.VolumeObject@17178a01 granted to Acct[0bea1cc1-ac60-4fb2-990b-f2dd04a5a329-xxx-x-xxxxx] by DomainChecker_EnhancerByCloudStack_9b413459
2014-05-12 11:29:47,192 DEBUG [cloud.user.AccountManagerImpl] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) Access to VM[User|TEST-A2-VM01] granted to Acct[0bea1cc1-ac60-4fb2-990b-f2dd04a5a329-xxx-x-xxxxx] by DomainChecker_EnhancerByCloudStack_9b413459
2014-05-12 11:29:47,212 DEBUG [storage.allocator.LocalStoragePoolAllocator] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) LocalStoragePoolAllocator trying to find storage pool to fit the vm
2014-05-12 11:29:47,212 DEBUG [storage.allocator.ClusterScopeStoragePoolAllocator] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) ClusterScopeStoragePoolAllocator looking for storage pool
2014-05-12 11:29:47,212 DEBUG [storage.allocator.ClusterScopeStoragePoolAllocator] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) Looking for pools in dc: 1 pod:1 cluster:null having tags:[MPI]
2014-05-12 11:29:47,216 DEBUG [storage.allocator.ClusterScopeStoragePoolAllocator] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) No storage pools available for shared volume allocation, returning
2014-05-12 11:29:47,234 ERROR [cloud.async.AsyncJobManagerImpl] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) Unexpected exception while executing org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd
com.cloud.utils.exception.CloudRuntimeException: Caught: SELECT pool.id, SUM(IF(vol.state='Ready' AND vol.account_id = ?, 1, 0)) FROM `cloud`.`storage_pool` pool LEFT JOIN `cloud`.`volumes` vol ON pool.id = vol.pool_id WHERE pool.data_center_id = ? AND pool.pod_id = ? AND pool.cluster_id = ? GROUP BY pool.id ORDER BY 2 ASC
at com.cloud.storage.dao.VolumeDaoImpl.listPoolIdsByVolumeCount(VolumeDaoImpl.java:480)
at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
at org.apache.cloudstack.storage.allocator.AbstractStoragePoolAllocator.reorderPoolsByNumberOfVolumes(AbstractStoragePoolAllocator.java:122)
at org.apache.cloudstack.storage.allocator.AbstractStoragePoolAllocator.reOrder(AbstractStoragePoolAllocator.java:161)
at org.apache.cloudstack.storage.allocator.AbstractStoragePoolAllocator.allocateToPool(AbstractStoragePoolAllocator.java:110)
at com.cloud.storage.StorageManagerImpl.findStoragePool(StorageManagerImpl.java:433)
at com.cloud.storage.VolumeManagerImpl.createVolume(VolumeManagerImpl.java:673)
at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
at com.cloud.storage.VolumeManagerImpl.createVolumeOnPrimaryStorage(VolumeManagerImpl.java:1548)
at com.cloud.storage.VolumeManagerImpl.attachVolumeToVM(VolumeManagerImpl.java:1882)
at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
at org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd.execute(AttachVolumeCmd.java:122)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:158)
at com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:531)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:701)
Caused by: java.lang.NullPointerException
at com.cloud.storage.dao.VolumeDaoImpl.listPoolIdsByVolumeCount(VolumeDaoImpl.java:470)
... 31 more
2014-05-12 11:29:47,238 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-146:job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ]) Complete async job-4916 = [ dd8fab57-96aa-446f-8ebd-53c32ce4501a ], jobStatus: 2, resultCode: 530, result: Error Code: 530 Error text: Caught: SELECT pool.id, SUM(IF(vol.state='Ready' AND vol.account_id = ?, 1, 0)) FROM `cloud`.`storage_pool` pool LEFT JOIN `cloud`.`volumes` vol ON pool.id = vol.pool_id WHERE pool.data_center_id = ? AND pool.pod_id = ? AND pool.cluster_id = ? GROUP BY pool.id ORDER BY 2 ASC