Hi Darren, Please find my reply inline. On 22/10/13 12:47 AM, "Darren Shepherd" <darren.s.sheph...@gmail.com> wrote:
>I've noticed that when I bring up my mgmt server theres a period of >time in which the storage capacity numbers are wrong. When the mgmt >server starts I deploy a VM and it fails because the below message >indicates storage is at 124% used > >Checking pool 2 for storage, totalSize: 33808039936, usedBytes: >41965518848, usedPct: 1.24128813523181, disable threshold: 0.85 > >After waiting a minute or so and deploying a VM it will work and print >the following. > >Checking pool 2 for storage, totalSize: 33808039936, usedBytes: >4969705472, usedPct: 0.14699774022415543, disable threshold: 0.85 > >Notice the used bytes drastically decreased. So I debugged this and >got to this strange code in >StorageManagerImpl.checkUsageSpace(StoragePool pool) > > StorageStats stats = sc.getStoragePoolStats(pool.getId()); > if (stats == null) { > stats = sc.getStorageStats(pool.getId()); > } > >So it looks for stats for the storage pool, and if it doesn't find it >it calls getStorageStats(). But I believe getStorageStats() is for >secondary. So what is happening is that my primary and secondary >storage happen to have the same IDs. So when the primary storage >stats haven't been cached its getting the secondary storage stats >which are wrong. So something needs to change here. You are right. This seems to be a bug. It should be calling getStoragePoolStats instead of getStorageStats. That should fix it. > >Darren