Hi,all:
In 4.2,We can limit the secondarystorage usage for a user or a domain.
But when I refer to source code ,I find
public long calculateSecondaryStorageForAccount(long accountId) {
long totalVolumesSize =
_volumeDao.secondaryStorageUsedForAccount(accountId);
long totalSnapshotsSize =
_snapshotDao.secondaryStorageUsedForAccount(accountId);
long totalTemplatesSize = 0;
SearchCriteria<SumCount> sc = templateSizeSearch.create();
sc.setParameters("downloadState", Status.DOWNLOADED);
sc.setParameters("destroyed", false);
sc.setJoinParameters("templates", "accountId", accountId);
List<SumCount> templates = _vmTemplateStoreDao.customSearch(sc,
null);
if (templates != null) {
totalTemplatesSize = templates.get(0).sum;
}
return totalVolumesSize + totalSnapshotsSize + totalTemplatesSize;
}
Templates and snapshots are certainly belong to secondarystorage,
The volumes which sql is :
select sum(size) from volumes where account_id=? and path is null and
removed is null and state not in ("ALLOCATED").
So my question is why volumes is counted as secondarystorage?