[
https://issues.apache.org/jira/browse/CLOUDSTACK-9668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15766493#comment-15766493
]
ASF GitHub Bot commented on CLOUDSTACK-9668:
--------------------------------------------
GitHub user sudhansu7 opened a pull request:
https://github.com/apache/cloudstack/pull/1844
CLOUDSTACK-9668 : disksizeallocated of PrimaryStorage is different fr…
…om the total size of a volume
update capacity if current allocated is different from used bytes in DB.
Disksizeallocated of PrimaryStorage is different from the total size of a
volume.
steps to reproduce:
1. create another primary storage( apart from default) with storage tag
(say tag1)
2. create a disk offering with storage tag as that step1.
3. create a data disk with above disk offering.
4. attach the disk to vm.
5. when capacity checker thread runs it will update the used_capacity. Note
down the op_host_capacity details for pool created in step1.
6. detach the disk and destroy the volume.
7. when capacity checker thread runs it will not update the used_capacity
to 0.
Root Cause: If all volumes have been removed from storage_pool then
capacity checker does not update the op_host_capacity.
Resolution: Update capacity if current allocated is different from used
bytes in DB.
```
public void createCapacityEntry(StoragePoolVO storagePool, short
capacityType, long allocated) {
..
..
..
} else {
CapacityVO capacity = capacities.get(0);
if (capacity.getTotalCapacity() != totalOverProvCapacity ||
**allocated != 0L** || capacity.getCapacityState() != capacityState) {
....
......
}
}
..
.
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sudhansu7/cloudstack CLOUDSTACK-9668
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cloudstack/pull/1844.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1844
----
commit a8ba7c47787afa660327edca5604b1a82ab70aa8
Author: Sudhansu <[email protected]>
Date: 2016-12-21T08:37:47Z
CLOUDSTACK-9668 : disksizeallocated of PrimaryStorage is different from the
total size of a volume
update capacity if current allocated is different from used bytes in DB.
----
> disksizeallocated of PrimaryStorage is different from the total size of a
> volume
> --------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-9668
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9668
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Management Server
> Affects Versions: 4.9.0
> Reporter: Sudhansu Sahu
> Assignee: Sudhansu Sahu
>
> Disksizeallocated of PrimaryStorage is different from the total size of a
> volume.
> steps to reproduce:
> 1. create another primary storage( apart from default) with storage tag (say
> tag1)
> 2. create a disk offering with storage tag as that step1.
> 3. create a data disk with above disk offering.
> 4. attach the disk to vm.
> 5. when capacity checker thread runs it will update the used_capacity. Note
> down the op_host_capacity details for pool created in step1.
> 6. detach the disk and destroy the volume.
> 7. when capacity checker thread runs it will not update the used_capacity to
> 0.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)