[
https://issues.apache.org/jira/browse/CLOUDSTACK-9080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15037500#comment-15037500
]
ASF subversion and git services commented on CLOUDSTACK-9080:
-------------------------------------------------------------
Commit 4ffad548a52311db63918b7ea791261fb6c0bb4c in cloudstack's branch
refs/heads/master from [~remibergsma]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=4ffad54 ]
Merge pull request #1107 from karuturi/CLOUDSTACK-9080
CLOUDSTACK-9080: Resource limits for Primary arent respected during
attachprimary store resource limit check is not performed while attaching a
volume to a vm. Added them same.
Also added a marvin test case to verify the same.
Testing:
BEFORE
No error is shown in UI when trying to attach a volume even after reaching the
resource limits.
```
mysql> select * from resource_limit where type="primary_storage";
+----+-----------+------------+-----------------+-------------+
| id | domain_id | account_id | type | max |
+----+-----------+------------+-----------------+-------------+
| 10 | NULL | 4 | primary_storage | 21474836480 |
+----+-----------+------------+-----------------+-------------+
1 row in set (0.00 sec)
mysql> select * from resource_count where account_id=4 and
type='primary_storage';
+----+------------+-----------+-----------------+-------------+
| id | account_id | domain_id | type | count |
+----+------------+-----------+-----------------+-------------+
| 63 | 4 | NULL | primary_storage | 48318382080 |
+----+------------+-----------+-----------------+-------------+
1 row in set (0.00 sec)
```
AFTER
Following error message is shown in UI and the volume is not attached

The resource limits stays the same
```
mysql> select * from resource_limit where type="primary_storage";
+----+-----------+------------+-----------------+-------------+
| id | domain_id | account_id | type | max |
+----+-----------+------------+-----------------+-------------+
| 10 | NULL | 4 | primary_storage | 21474836480 |
+----+-----------+------------+-----------------+-------------+
1 row in set (0.01 sec)
mysql> select * from resource_count where account_id=4 and
type='primary_storage';
+----+------------+-----------+-----------------+-------------+
| id | account_id | domain_id | type | count |
+----+------------+-----------+-----------------+-------------+
| 63 | 4 | NULL | primary_storage | 48318382080 |
+----+------------+-----------+-----------------+-------------+
1 row in set (0.00 sec)
```
Marvin test: nosetests --with-marvin --marvin-config=setup/dev/advanced.cfg
--zone=xen-zone0 --hypervisor=xenserver
test/integration/component/test_ps_resource_limits_volume.py
before the change
```
# do ... === TestName: test_attach_volume_exceeding_primary_limits | Status :
FAILED ===
AssertionError: Resource count 23 should match with the expected resource count
22\n
```
After the change
```
# do ... === TestName: test_attach_volume_exceeding_primary_limits | Status :
SUCCESS ===
ok
----------------------------------------------------------------------
Ran 1 test in 1178.354s
OK
```
* pr/1107:
CLOUDSTACK-9080: Resource limits for Primary arent respected during attach.
Signed-off-by: Remi Bergsma <[email protected]>
> Able to upload Volume greater than the Resource limit defined for Primary
> Storage.
> ----------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-9080
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9080
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Reporter: Rajani Karuturi
>
> Steps :
> 1. Create a child domain and create a User Account for the Respective child
> domain.
> 2. Edit the Primary Storage Resource limits for the account added above .
> Limit being 200 GB , edit the value as 1Gb.
> 3. Try to upload volume greater than 1Gb. (Volume is successfully uploaded. )
> 4. try attaching the volume to a vm.
> Result:
> attach volume is successful even though the resource limits reached.
> Expected:
> attach volume should fail with resource limit reached on primary exception.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)