[
https://issues.apache.org/jira/browse/CLOUDSTACK-5406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13864011#comment-13864011
]
Sanjay Tripathi commented on CLOUDSTACK-5406:
---------------------------------------------
Hi Sangeetha,
WorkFlow of createSnapshot and Resource Limits (snapshots):
1) User triggers createSnapshot command.
2) CS checks the resourceLimits with virtualSize of snapshot.
3) CS updates the secondary_storage resourceType in resouce_count table with
virtual size.
4) Hypervisor takes the snapshots and CS copies it to secondary storage and
update the snapshot_store_ref table with actual size of snapshot.
5) Once snapshot is in place (in secondary storage), CS corrects the resource
count for secondary storage with actual size of snapshot.
If user triggers multiple snapshots and previous snapshots are still not done
then for that time CS treats the snapshot size as virtual size of snapshot and
not the actual size; And if limits are not permitting, then user will receive
resourceLimit error.
Can you check the secondary storage count in resource_count table once snapshot
is done; it should be updated with actual size of snapshot.
> Not able to take snapshot becasue of secondary_storage limit of 400 gb
> exceeded even though we have not really consumed this limit in secondary
> store.
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-5406
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-5406
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Management Server
> Affects Versions: 4.3.0
> Environment: Build from 4.3
> Reporter: Sangeetha Hariharan
> Assignee: Sanjay Tripathi
> Priority: Critical
> Fix For: 4.3.0
>
> Attachments: management-server.rar, storage.rar
>
>
> Set up:
> Xenserver setup with 2 NFS secondary stores.
> 1 account having 21 Vms.
> I am using the the default "secondary_storage" limit which is 400 gb.
>
> Started hourly snapshot policy for all the ROOT volumes of the Vms which was
> created from a template of size 20 gb. The actual used up size is 12 GB.
> When snapshot gets created , the full snapshot size is ~6.7 GB.
> After only 2 snapshots of ROOT volume , I hit the following excepton:
>
> “2013-12-06 00:00:48,298 WARN [c.c.s.s.SnapshotSchedulerImpl]
> (SnapshotPollTask:ctx-a7ccb50a) Scheduling snapshot failed due to
> com.cloud.exception.ResourceAllocationException: Maximum number of resources
> of type 'secondary_storage' for account
> name=test-TestParallelVolumeSnasohots-273V8U in domain id=1 has been
> exceeded.”
>
> How are we calculating this limit ? Do we query the actual secondary store /
> do we calculate based on the ROOT volume size and # of Snapshots.
>
> In case of Xenserve , we have Delta snapshots.We should not be
>
> mysql> select count(*) from snapshots where account_id=8 group by volume_id;
> +----------+
> | count(*) |
> +----------+
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 2 |
> | 3 |
> | 3 |
> +----------+
> 21 rows in set (0.00 sec)
>
>
> [root@Rack3Host5 secondary]# du -h --max-depth=1
> 28G ./snapshots
> 13G ./template
> 4.0K ./volumes
> 41G .
>
>
> [root@Rack3Host8 secondary]# du -h --max-depth=1
> 12G ./template
> 29G ./snapshots
> 4.0K ./volumes
> 41G .
> [root@Rack3Host8 secondary]#
> mysql> select * from resource_limit;
> +----+-----------+------------+-------------------+---------------+
> | id | domain_id | account_id | type | max |
> +----+-----------+------------+-------------------+---------------+
> | 31 | NULL | 8 | user_vm | 200 |
> | 32 | NULL | 8 | public_ip | 200 |
> | 33 | NULL | 8 | volume | 200 |
> | 34 | NULL | 8 | snapshot | 200 |
> | 35 | NULL | 8 | template | 200 |
> | 36 | NULL | 8 | vpc | 200 |
> | 37 | NULL | 8 | cpu | 40 |
> | 38 | NULL | 8 | memory | 40960 |
> | 39 | NULL | 8 | network | 20 |
> | 40 | NULL | 8 | primary_storage | 214748364800 |
> | 41 | NULL | 8 | secondary_storage | 4294967296000 |
> +----+-----------+------------+-------------------+---------------+
> 11 rows in set (0.00 sec)
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)