You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Sanjay Tripathi <sa...@citrix.com> on 2013/02/21 14:20:45 UTC

Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

Review request for cloudstack, Devdeep Singh and Min Chen.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java a94e935 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 4440b7a 
  server/src/com/cloud/baremetal/BareMetalVmManagerImpl.java 5de5ccd 
  server/src/com/cloud/configuration/Config.java c0c23b6 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
  server/src/com/cloud/storage/StorageManagerImpl.java 05e0cfe 
  server/src/com/cloud/storage/dao/SnapshotDao.java 3b961f6 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java a8a07dc 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java a189d00 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 6d3cf2a 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java e06da75 
  server/src/com/cloud/template/HyervisorTemplateAdapter.java fe6bc2a 
  server/src/com/cloud/template/TemplateAdapterBase.java fa677ac 
  server/src/com/cloud/template/TemplateManagerImpl.java f9cf277 
  server/src/com/cloud/vm/UserVmManagerImpl.java df97609 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 9a59318 
  setup/db/db/schema-410to420.sql 65add75 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.

> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 979
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line979>
> >
> >     consider to make it transactional? just like persistVolume

incrementResourceCount is internally calling the updateResourceCountForAccount method, which is transactional.


> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 1013
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line1013>
> >
> >     consider to make it transactional?

decrementResourceCount is calling updateResourceCountForAccount, which is transactional.


> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 1334
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line1334>
> >
> >     consider to make it transactional?

this method is internally calling transactional method.


> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 1383
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line1383>
> >
> >     consider to make it transactional?

this method is internally calling transactional method.


> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 1456
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line1456>
> >
> >     check vol != null ?

Missed between volume and vol names,thanks for pointing it out.


> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 1466
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line1466>
> >
> >     should also add check in resizeVolume method (which is also a new feature)

Missed this because this API is not present in the API doc i.e. http://incubator.apache.org/cloudstack/docs/api/apidocs-4.0.0/TOC_Root_Admin.html

Will update the patch with these changes.


On Feb. 26, 2013, 2:58 a.m., Sanjay Tripathi wrote:
> > only took a look at VolumeManagerImpl.java and added some suggestions.
> > The limit for primary storage refers to allocated_storage , can we make it a bit clear (either in code comments or resource.type, maybe one day used_storage become another limit)
> > 
> >

Yes, it is allocated_storage. Added couple of comments in ResourceType, where these resources are defined.


- Sanjay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17071
-----------------------------------------------------------


On Feb. 25, 2013, 12:47 p.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2013, 12:47 p.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java 8c77715 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 1fd1996 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java cf9eb27 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 74f0dba 
>   setup/db/db/schema-410to420.sql 4637b6d 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by mice xia <mi...@tcloudcomputing.com>.

> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 979
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line979>
> >
> >     consider to make it transactional? just like persistVolume
> 
> Sanjay Tripathi wrote:
>     incrementResourceCount is internally calling the updateResourceCountForAccount method, which is transactional.

there are two incrementResourceCount() method call here, both of which update DB, is it necessary to surround them with txn.start() and txn.commit() ?


- mice


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17071
-----------------------------------------------------------


On Feb. 25, 2013, 12:47 p.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2013, 12:47 p.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java 8c77715 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 1fd1996 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java cf9eb27 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 74f0dba 
>   setup/db/db/schema-410to420.sql 4637b6d 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by mice xia <mi...@tcloudcomputing.com>.

> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 1466
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line1466>
> >
> >     should also add check in resizeVolume method (which is also a new feature)
> 
> Sanjay Tripathi wrote:
>     Missed this because this API is not present in the API doc i.e. http://incubator.apache.org/cloudstack/docs/api/apidocs-4.0.0/TOC_Root_Admin.html
>     
>     Will update the patch with these changes.

there is another API 'assignVMCmd' which needs to be handled.


- mice


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17071
-----------------------------------------------------------


On Feb. 25, 2013, 12:47 p.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2013, 12:47 p.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java 8c77715 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 1fd1996 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java cf9eb27 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 74f0dba 
>   setup/db/db/schema-410to420.sql 4637b6d 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.

> On Feb. 26, 2013, 2:58 a.m., mice xia wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 979
> > <https://reviews.apache.org/r/9541/diff/3/?file=261677#file261677line979>
> >
> >     consider to make it transactional? just like persistVolume
> 
> Sanjay Tripathi wrote:
>     incrementResourceCount is internally calling the updateResourceCountForAccount method, which is transactional.
> 
> mice xia wrote:
>     there are two incrementResourceCount() method call here, both of which update DB, is it necessary to surround them with txn.start() and txn.commit() ?

We are using txn.start() and txn.commit() to make this method generic. I agree that in some places like above, it doesn't make sense to open txn.start() twice but this happens only if there is a need to increment/decrement more than one resource type.


- Sanjay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17071
-----------------------------------------------------------


On Feb. 26, 2013, 7:47 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 26, 2013, 7:47 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java eb6fb24 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java c2bba63 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 59b2a7d 
>   setup/db/db/schema-410to420.sql 6c831f0 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by mice xia <mi...@tcloudcomputing.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17071
-----------------------------------------------------------



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment36151>

    consider to make it transactional? just like persistVolume



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment36152>

    consider to make it transactional?



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment36153>

    consider to make it transactional?



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment36154>

    consider to make it transactional?



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment36155>

    check vol != null ?



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment36156>

    should also add check in resizeVolume method (which is also a new feature)


only took a look at VolumeManagerImpl.java and added some suggestions.
The limit for primary storage refers to allocated_storage , can we make it a bit clear (either in code comments or resource.type, maybe one day used_storage become another limit)



- mice xia


On Feb. 25, 2013, 12:47 p.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2013, 12:47 p.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java 8c77715 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 1fd1996 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java cf9eb27 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 74f0dba 
>   setup/db/db/schema-410to420.sql 4637b6d 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.

> On Feb. 26, 2013, 8:14 a.m., David Nalley wrote:
> > setup/db/db/schema-40to410.sql, line 316
> > <https://reviews.apache.org/r/9541/diff/1/?file=260618#file260618line316>
> >
> >     Why are you making changes to 40to410.sql?

limit CPU and Memory resources feature got shifted to 4.2 because it missed the code-freeze deadline but the patch was up in the review board and Min committed it into the master branch. So moving "Limit CPU and Memory resources" feature related changes from schema-40to410.sql to schema-410-420.sql


- Sanjay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17080
-----------------------------------------------------------


On Feb. 26, 2013, 7:47 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 26, 2013, 7:47 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java eb6fb24 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java c2bba63 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 59b2a7d 
>   setup/db/db/schema-410to420.sql 6c831f0 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by David Nalley <da...@gnsa.us>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17080
-----------------------------------------------------------



setup/db/db/schema-40to410.sql
<https://reviews.apache.org/r/9541/#comment36166>

    Why are you making changes to 40to410.sql? 


- David Nalley


On Feb. 26, 2013, 7:47 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 26, 2013, 7:47 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java eb6fb24 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java c2bba63 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 59b2a7d 
>   setup/db/db/schema-410to420.sql 6c831f0 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.

> On March 12, 2013, 11:33 a.m., Devdeep Singh wrote:
> > server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java, line 43
> > <https://reviews.apache.org/r/9541/diff/7/?file=269109#file269109line43>
> >
> >     I see another file ./plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java present by the same name. Should the changes be made to this file instead? Can you confirm?

As this is the file which is getting complied, so made corresponding changes in this file under plugin package.


> On March 12, 2013, 11:33 a.m., Devdeep Singh wrote:
> > server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java, line 887
> > <https://reviews.apache.org/r/9541/diff/7/?file=269111#file269111line887>
> >
> >     Instead of adding routines for calculating secondary storage used by an account in volumeDao and snapshotDao, would it make sense to keep them in ResourceManagerImpl itself? Same comment for primaryStorageUsedForAccount in volumeDao

To get the resource count of all the existing resources, the method was written in the DAOs files, i have followed similar approach and in this way the methods to get primary and secondary storage space count are more generic and can be used in other parts also if required.


> On March 12, 2013, 11:33 a.m., Devdeep Singh wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 471
> > <https://reviews.apache.org/r/9541/diff/7/?file=269113#file269113line471>
> >
> >     Should the check be made outside the validateVolume function, that is in uploadVolume?

As ResourceLimitCheck to check template is in validateVolume, in the similar manner I am also checking the resource limit for secondary storage in the same method. If you feel that both the checks and accountAccess check (which is also called from the same method) should not be in validateVolume, then I will move these calls in the uploadVolume method.


> On March 12, 2013, 11:33 a.m., Devdeep Singh wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 1274
> > <https://reviews.apache.org/r/9541/diff/7/?file=269113#file269113line1274>
> >
> >     Can you put a comment here explaining why you are decrementing the count from secondary storage. I understand it to to handle the scenario when the volume has been uploaded. Please put that in a comments here.

Thanks for suggestion, I'll add appropriate comment in the code. 


- Sanjay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17720
-----------------------------------------------------------


On March 11, 2013, 8:15 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 11, 2013, 8:15 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java d902dc4 
>   server/src/com/cloud/configuration/Config.java 64465a2 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java f0e6028 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 6b2f762 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql b9bfe1a 
>   setup/db/db/schema-410to420.sql ca15bda 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Devdeep Singh <de...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17720
-----------------------------------------------------------



server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java
<https://reviews.apache.org/r/9541/#comment37642>

    I see another file ./plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java present by the same name. Should the changes be made to this file instead? Can you confirm?



server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
<https://reviews.apache.org/r/9541/#comment37643>

    Instead of adding routines for calculating secondary storage used by an account in volumeDao and snapshotDao, would it make sense to keep them in ResourceManagerImpl itself? Same comment for primaryStorageUsedForAccount in volumeDao



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment37644>

    Should the check be made outside the validateVolume function, that is in uploadVolume?



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment37645>

    Can you put a comment here explaining why you are decrementing the count from secondary storage. I understand it to to handle the scenario when the volume has been uploaded. Please put that in a comments here.



server/src/com/cloud/storage/dao/VolumeDaoImpl.java
<https://reviews.apache.org/r/9541/#comment37646>

    Why is the instanceid not null check needed?



server/src/com/cloud/storage/dao/VolumeDaoImpl.java
<https://reviews.apache.org/r/9541/#comment37647>

    Similarly why is the instanceid is null check needed here?


- Devdeep Singh


On March 11, 2013, 8:15 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 11, 2013, 8:15 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java d902dc4 
>   server/src/com/cloud/configuration/Config.java 64465a2 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java f0e6028 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 6b2f762 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql b9bfe1a 
>   setup/db/db/schema-410to420.sql ca15bda 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.

> On March 17, 2013, 5:38 p.m., Nitin Mehta wrote:
> > server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java, line 316
> > <https://reviews.apache.org/r/9541/diff/8/?file=269913#file269913line316>
> >
> >     increment needs to check for exceeding once again correct because the check happenned before snapshot creation

Changed to increment the resource count just after persist the values in DB and incase of failure, decrementing the count accordingly.


- Sanjay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review18043
-----------------------------------------------------------


On March 13, 2013, 5:44 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 13, 2013, 5:44 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 64465a2 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 4951975 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 88086ce 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql b9bfe1a 
>   setup/db/db/schema-410to420.sql ca15bda 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Nitin Mehta <ni...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review18043
-----------------------------------------------------------



server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
<https://reviews.apache.org/r/9541/#comment38121>

    increment needs to check for exceeding once again correct because the check happenned before snapshot creation 


- Nitin Mehta


On March 13, 2013, 5:44 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 13, 2013, 5:44 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 64465a2 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 4951975 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 88086ce 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql b9bfe1a 
>   setup/db/db/schema-410to420.sql ca15bda 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.

> On March 17, 2013, 5:27 p.m., Nitin Mehta wrote:
> > server/src/com/cloud/storage/VolumeManagerImpl.java, line 744
> > <https://reviews.apache.org/r/9541/diff/8/?file=269907#file269907line744>
> >
> >     It can be a compressed image as well so this might not work in that case. You would need to increment the exact size.

Added checks in downloadMonitor and downloadListener files, as after uncompressing the file, CS will check the resource limit with the diff size (difference between the actual size and compressed size) and generate an alert if it exceeds the limit. After this it will also update the count accordingly in resource_count table.

The initial increment is still there in place (UriUtils.getRemoteSize(url)), this is to increment the count just after persisting the template/volume in DB. This will take care of check if user fire registerTemplate/uploadVolume API cmd immediately after the first command. 


- Sanjay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review18042
-----------------------------------------------------------


On March 13, 2013, 5:44 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 13, 2013, 5:44 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 64465a2 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 4951975 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 88086ce 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql b9bfe1a 
>   setup/db/db/schema-410to420.sql ca15bda 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Nitin Mehta <ni...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review18042
-----------------------------------------------------------



server/src/com/cloud/storage/VolumeManagerImpl.java
<https://reviews.apache.org/r/9541/#comment38119>

    It can be a compressed image as well so this might not work in that case. You would need to increment the exact size.



server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
<https://reviews.apache.org/r/9541/#comment38120>

    you need to check primary storage depending on the global config right ?


- Nitin Mehta


On March 13, 2013, 5:44 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 13, 2013, 5:44 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 64465a2 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 4951975 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 88086ce 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql b9bfe1a 
>   setup/db/db/schema-410to420.sql ca15bda 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by ASF Subversion and Git Services <as...@urd.zones.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review18509
-----------------------------------------------------------


Commit 95fce112157526b0727821e145ec53d0e8f3e824 in branch refs/heads/bvt from Hugo Trippaers <ht...@schubergphilis.com>
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=95fce11 ]

CLOUDSTACK-1156 Fix small typo

- ASF Subversion and Git Services


On March 28, 2013, 8:36 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 28, 2013, 8:36 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
>   server/src/com/cloud/api/ApiResponseHelper.java f33601f 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 1a57a64 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 60ad025 
>   setup/db/db/schema-410to420.sql 9eed0a6 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by ASF Subversion and Git Services <as...@urd.zones.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review18496
-----------------------------------------------------------


Commit 18695276f79a4cf90279f6ff25ebc7c66b6a9c49 in branch refs/heads/master from Nitin Mehta <ni...@citrix.com>
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1869527 ]

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types

    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11

    Also added jUnit Tests for the same.
Reviewed by : nitin mehta<ni...@citrix.com>


- ASF Subversion and Git Services


On March 28, 2013, 8:36 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 28, 2013, 8:36 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
>   server/src/com/cloud/api/ApiResponseHelper.java f33601f 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 1a57a64 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 60ad025 
>   setup/db/db/schema-410to420.sql 9eed0a6 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by ASF Subversion and Git Services <as...@urd.zones.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review18504
-----------------------------------------------------------


Commit 95fce112157526b0727821e145ec53d0e8f3e824 in branch refs/heads/master from Hugo Trippaers <ht...@schubergphilis.com>
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=95fce11 ]

CLOUDSTACK-1156 Fix small typo

- ASF Subversion and Git Services


On March 28, 2013, 8:36 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 28, 2013, 8:36 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
>   server/src/com/cloud/api/ApiResponseHelper.java f33601f 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 1a57a64 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 60ad025 
>   setup/db/db/schema-410to420.sql 9eed0a6 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 28, 2013, 8:36 a.m.)


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.


Changes
-------

Resolved conflicts with the latest code.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
  server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
  server/src/com/cloud/api/ApiResponseHelper.java f33601f 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/configuration/Config.java 1a57a64 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
  server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 60ad025 
  setup/db/db/schema-410to420.sql 9eed0a6 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 27, 2013, 11:43 a.m.)


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.


Changes
-------

Changed the getRemoteSize method in UriUtils to support java version 6.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
  server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
  server/src/com/cloud/api/ApiResponseHelper.java 663139d 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/configuration/Config.java 9db7dbd 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
  server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 60ad025 
  setup/db/db/schema-410to420.sql eb650cc 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


RE: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
You are right Nitin, I am working on it and will use methods which are supported in java 6.

From: Nitin Mehta
Sent: Wednesday, March 27, 2013 3:39 PM
To: Sanjay Tripathi; Sateesh Chodapuneedi; mice xia; Min Chen; Devdeep Singh
Cc: David Nalley; cloudstack
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

I don't think you should be using a method introduced in 7.0 since its not gonna work with someone using version 6.0

From: Sanjay Tripathi <sa...@citrix.com>>
Date: Wednesday 27 March 2013 3:21 PM
To: Nitin Mehta <ni...@citrix.com>>, Sateesh Chodapuneedi <sa...@citrix.com>>, "mice_xia@tcloudcomputing.com<ma...@tcloudcomputing.com>" <mi...@tcloudcomputing.com>>, Min Chen <mi...@citrix.com>>, Devdeep Singh <de...@citrix.com>>
Cc: David Nalley <da...@gnsa.us>>, "cloudstack-dev@incubator.apache.org<ma...@incubator.apache.org>" <cl...@incubator.apache.org>>
Subject: RE: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Nitin,

In my setup I am not facing any compilation issues, Can you check the java version in you system. In my setup I am using jdk 1.7.

And the method "getContentLengthLong()" is supported since 7.0 under the class URLConnection.

This is the description of the method that I have used:

getContentLengthLong

public long getContentLengthLong()
Returns the value of the content-length header field as a long.
Returns:
the content length of the resource that this connection's URL references, or -1 if the content length is not known.
Since:
7.0
--Sanjay

From: Nitin Mehta
Sent: Wednesday, March 27, 2013 2:22 PM
To: Sanjay Tripathi; Sateesh Chodapuneedi; mice xia; Min Chen; Devdeep Singh
Cc: David Nalley; cloudstack
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

I get the following error on running mvn clean install


[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.373s
[INFO] Finished at: Wed Mar 27 14:20:41 GMT+05:30 2013
[INFO] Final Memory: 18M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project cloud-utils: Compilation failure: Compilation failure:
[ERROR] /Users/nitinmehta/apache/incubator-cloudstack/utils/src/com/cloud/utils/UriUtils.java:[95,37] cannot find symbol
[ERROR] symbol  : method getContentLengthLong()
[ERROR] location: class java.net.HttpURLConnection
[ERROR] /Users/nitinmehta/apache/incubator-cloudstack/utils/src/com/cloud/utils/UriUtils.java:[99,38] cannot find symbol
[ERROR] symbol  : method getContentLengthLong()
[ERROR] location: class javax.net.ssl.HttpsURLConnection
[ERROR] -> [Help 1]






From: Sanjay Tripathi <sa...@citrix.com>>
Reply-To: Sanjay Tripathi <sa...@citrix.com>>
Date: Wednesday 27 March 2013 11:30 AM
To: Sateesh Chodapuneedi <sa...@citrix.com>>, "mice_xia@tcloudcomputing.com<ma...@tcloudcomputing.com>" <mi...@tcloudcomputing.com>>, Min Chen <mi...@citrix.com>>, Nitin Mehta <ni...@citrix.com>>, Devdeep Singh <de...@citrix.com>>
Cc: David Nalley <da...@gnsa.us>>, "cloudstack-dev@incubator.apache.org<ma...@incubator.apache.org>" <cl...@incubator.apache.org>>, Sanjay Tripathi <sa...@citrix.com>>
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/9541/


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
By Sanjay Tripathi.

Updated March 27, 2013, 6 a.m.

Changes

updated patch, in sync with the latest code.


Description

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts



    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of

    resource types.

    Added methods to set the limits on these resources using updateResourceLimit

    API command and to get a count using updateResourceCount. Also added calls in the

    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new

    resource types



    Resource Name          :: Resource type number

        Primary Storage               10

        Secondary Storage             11



    Also added jUnit Tests for the same.


Testing

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.

Bugs: CLOUDSTACK-1156
Diffs (updated)

  *   api/src/com/cloud/configuration/Resource.java (7614c8a)
  *   api/src/com/cloud/storage/VolumeApiService.java (8517988)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java (f6d3a98)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java (0039f62)
  *   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java (955727a)
  *   api/src/org/apache/cloudstack/api/response/AccountResponse.java (9a98a35)
  *   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java (a7fbbf2)
  *   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java (b444e7a)
  *   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java (33725f6)
  *   server/src/com/cloud/alert/AlertManagerImpl.java (a45482f)
  *   server/src/com/cloud/api/ApiResponseHelper.java (663139d)
  *   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java (898bafc)
  *   server/src/com/cloud/api/query/vo/AccountJoinVO.java (cd7231c)
  *   server/src/com/cloud/configuration/Config.java (9db7dbd)
  *   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java (23c0796)
  *   server/src/com/cloud/storage/VolumeManager.java (af3cbbf)
  *   server/src/com/cloud/storage/VolumeManagerImpl.java (737ed0a)
  *   server/src/com/cloud/storage/dao/SnapshotDao.java (0e378a7)
  *   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java (825b6d5)
  *   server/src/com/cloud/storage/dao/VolumeDao.java (d7a2667)
  *   server/src/com/cloud/storage/dao/VolumeDaoImpl.java (40ed875)
  *   server/src/com/cloud/storage/download/DownloadListener.java (d4c20cf)
  *   server/src/com/cloud/storage/download/DownloadMonitorImpl.java (0bc89e3)
  *   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java (bacca01)
  *   server/src/com/cloud/template/HypervisorTemplateAdapter.java (1426421)
  *   server/src/com/cloud/template/TemplateManagerImpl.java (d843dbc)
  *   server/src/com/cloud/vm/UserVmManagerImpl.java (82a69bd)
  *   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java (d311ad3)
  *   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java (b9fc861)
  *   setup/db/db/schema-40to410.sql (60ad025)
  *   setup/db/db/schema-410to420.sql (eb650cc)
  *   utils/src/com/cloud/utils/UriUtils.java (a8b5ccb)

View Diff<https://reviews.apache.org/r/9541/diff/>



Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Nitin Mehta <Ni...@citrix.com>.
I don’t think you should be using a method introduced in 7.0 since its not gonna work with someone using version 6.0

From: Sanjay Tripathi <sa...@citrix.com>>
Date: Wednesday 27 March 2013 3:21 PM
To: Nitin Mehta <ni...@citrix.com>>, Sateesh Chodapuneedi <sa...@citrix.com>>, "mice_xia@tcloudcomputing.com<ma...@tcloudcomputing.com>" <mi...@tcloudcomputing.com>>, Min Chen <mi...@citrix.com>>, Devdeep Singh <de...@citrix.com>>
Cc: David Nalley <da...@gnsa.us>>, "cloudstack-dev@incubator.apache.org<ma...@incubator.apache.org>" <cl...@incubator.apache.org>>
Subject: RE: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Nitin,

In my setup I am not facing any compilation issues, Can you check the java version in you system. In my setup I am using jdk 1.7.

And the method “getContentLengthLong()” is supported since 7.0 under the class URLConnection.

This is the description of the method that I have used:

getContentLengthLong

public long getContentLengthLong()
Returns the value of the content-length header field as a long.
Returns:
the content length of the resource that this connection's URL references, or -1 if the content length is not known.
Since:
7.0
--Sanjay

From: Nitin Mehta
Sent: Wednesday, March 27, 2013 2:22 PM
To: Sanjay Tripathi; Sateesh Chodapuneedi; mice xia; Min Chen; Devdeep Singh
Cc: David Nalley; cloudstack
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

I get the following error on running mvn clean install


[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.373s
[INFO] Finished at: Wed Mar 27 14:20:41 GMT+05:30 2013
[INFO] Final Memory: 18M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project cloud-utils: Compilation failure: Compilation failure:
[ERROR] /Users/nitinmehta/apache/incubator-cloudstack/utils/src/com/cloud/utils/UriUtils.java:[95,37] cannot find symbol
[ERROR] symbol  : method getContentLengthLong()
[ERROR] location: class java.net.HttpURLConnection
[ERROR] /Users/nitinmehta/apache/incubator-cloudstack/utils/src/com/cloud/utils/UriUtils.java:[99,38] cannot find symbol
[ERROR] symbol  : method getContentLengthLong()
[ERROR] location: class javax.net.ssl.HttpsURLConnection
[ERROR] -> [Help 1]






From: Sanjay Tripathi <sa...@citrix.com>>
Reply-To: Sanjay Tripathi <sa...@citrix.com>>
Date: Wednesday 27 March 2013 11:30 AM
To: Sateesh Chodapuneedi <sa...@citrix.com>>, "mice_xia@tcloudcomputing.com<ma...@tcloudcomputing.com>" <mi...@tcloudcomputing.com>>, Min Chen <mi...@citrix.com>>, Nitin Mehta <ni...@citrix.com>>, Devdeep Singh <de...@citrix.com>>
Cc: David Nalley <da...@gnsa.us>>, "cloudstack-dev@incubator.apache.org<ma...@incubator.apache.org>" <cl...@incubator.apache.org>>, Sanjay Tripathi <sa...@citrix.com>>
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/9541/


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
By Sanjay Tripathi.

Updated March 27, 2013, 6 a.m.

Changes

updated patch, in sync with the latest code.


Description

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts



    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of

    resource types.

    Added methods to set the limits on these resources using updateResourceLimit

    API command and to get a count using updateResourceCount. Also added calls in the

    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new

    resource types



    Resource Name          :: Resource type number

        Primary Storage               10

        Secondary Storage             11



    Also added jUnit Tests for the same.


Testing

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.

Bugs: CLOUDSTACK-1156
Diffs (updated)

  *   api/src/com/cloud/configuration/Resource.java (7614c8a)
  *   api/src/com/cloud/storage/VolumeApiService.java (8517988)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java (f6d3a98)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java (0039f62)
  *   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java (955727a)
  *   api/src/org/apache/cloudstack/api/response/AccountResponse.java (9a98a35)
  *   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java (a7fbbf2)
  *   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java (b444e7a)
  *   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java (33725f6)
  *   server/src/com/cloud/alert/AlertManagerImpl.java (a45482f)
  *   server/src/com/cloud/api/ApiResponseHelper.java (663139d)
  *   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java (898bafc)
  *   server/src/com/cloud/api/query/vo/AccountJoinVO.java (cd7231c)
  *   server/src/com/cloud/configuration/Config.java (9db7dbd)
  *   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java (23c0796)
  *   server/src/com/cloud/storage/VolumeManager.java (af3cbbf)
  *   server/src/com/cloud/storage/VolumeManagerImpl.java (737ed0a)
  *   server/src/com/cloud/storage/dao/SnapshotDao.java (0e378a7)
  *   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java (825b6d5)
  *   server/src/com/cloud/storage/dao/VolumeDao.java (d7a2667)
  *   server/src/com/cloud/storage/dao/VolumeDaoImpl.java (40ed875)
  *   server/src/com/cloud/storage/download/DownloadListener.java (d4c20cf)
  *   server/src/com/cloud/storage/download/DownloadMonitorImpl.java (0bc89e3)
  *   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java (bacca01)
  *   server/src/com/cloud/template/HypervisorTemplateAdapter.java (1426421)
  *   server/src/com/cloud/template/TemplateManagerImpl.java (d843dbc)
  *   server/src/com/cloud/vm/UserVmManagerImpl.java (82a69bd)
  *   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java (d311ad3)
  *   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java (b9fc861)
  *   setup/db/db/schema-40to410.sql (60ad025)
  *   setup/db/db/schema-410to420.sql (eb650cc)
  *   utils/src/com/cloud/utils/UriUtils.java (a8b5ccb)

View Diff<https://reviews.apache.org/r/9541/diff/>



RE: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
Nitin,

In my setup I am not facing any compilation issues, Can you check the java version in you system. In my setup I am using jdk 1.7.

And the method "getContentLengthLong()" is supported since 7.0 under the class URLConnection.

This is the description of the method that I have used:

getContentLengthLong

public long getContentLengthLong()
Returns the value of the content-length header field as a long.
Returns:
the content length of the resource that this connection's URL references, or -1 if the content length is not known.
Since:
7.0
--Sanjay

From: Nitin Mehta
Sent: Wednesday, March 27, 2013 2:22 PM
To: Sanjay Tripathi; Sateesh Chodapuneedi; mice xia; Min Chen; Devdeep Singh
Cc: David Nalley; cloudstack
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

I get the following error on running mvn clean install


[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.373s
[INFO] Finished at: Wed Mar 27 14:20:41 GMT+05:30 2013
[INFO] Final Memory: 18M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project cloud-utils: Compilation failure: Compilation failure:
[ERROR] /Users/nitinmehta/apache/incubator-cloudstack/utils/src/com/cloud/utils/UriUtils.java:[95,37] cannot find symbol
[ERROR] symbol  : method getContentLengthLong()
[ERROR] location: class java.net.HttpURLConnection
[ERROR] /Users/nitinmehta/apache/incubator-cloudstack/utils/src/com/cloud/utils/UriUtils.java:[99,38] cannot find symbol
[ERROR] symbol  : method getContentLengthLong()
[ERROR] location: class javax.net.ssl.HttpsURLConnection
[ERROR] -> [Help 1]






From: Sanjay Tripathi <sa...@citrix.com>>
Reply-To: Sanjay Tripathi <sa...@citrix.com>>
Date: Wednesday 27 March 2013 11:30 AM
To: Sateesh Chodapuneedi <sa...@citrix.com>>, "mice_xia@tcloudcomputing.com<ma...@tcloudcomputing.com>" <mi...@tcloudcomputing.com>>, Min Chen <mi...@citrix.com>>, Nitin Mehta <ni...@citrix.com>>, Devdeep Singh <de...@citrix.com>>
Cc: David Nalley <da...@gnsa.us>>, "cloudstack-dev@incubator.apache.org<ma...@incubator.apache.org>" <cl...@incubator.apache.org>>, Sanjay Tripathi <sa...@citrix.com>>
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/9541/


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
By Sanjay Tripathi.

Updated March 27, 2013, 6 a.m.

Changes

updated patch, in sync with the latest code.


Description

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts



    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of

    resource types.

    Added methods to set the limits on these resources using updateResourceLimit

    API command and to get a count using updateResourceCount. Also added calls in the

    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new

    resource types



    Resource Name          :: Resource type number

        Primary Storage               10

        Secondary Storage             11



    Also added jUnit Tests for the same.


Testing

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.

Bugs: CLOUDSTACK-1156
Diffs (updated)

  *   api/src/com/cloud/configuration/Resource.java (7614c8a)
  *   api/src/com/cloud/storage/VolumeApiService.java (8517988)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java (f6d3a98)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java (0039f62)
  *   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java (955727a)
  *   api/src/org/apache/cloudstack/api/response/AccountResponse.java (9a98a35)
  *   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java (a7fbbf2)
  *   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java (b444e7a)
  *   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java (33725f6)
  *   server/src/com/cloud/alert/AlertManagerImpl.java (a45482f)
  *   server/src/com/cloud/api/ApiResponseHelper.java (663139d)
  *   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java (898bafc)
  *   server/src/com/cloud/api/query/vo/AccountJoinVO.java (cd7231c)
  *   server/src/com/cloud/configuration/Config.java (9db7dbd)
  *   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java (23c0796)
  *   server/src/com/cloud/storage/VolumeManager.java (af3cbbf)
  *   server/src/com/cloud/storage/VolumeManagerImpl.java (737ed0a)
  *   server/src/com/cloud/storage/dao/SnapshotDao.java (0e378a7)
  *   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java (825b6d5)
  *   server/src/com/cloud/storage/dao/VolumeDao.java (d7a2667)
  *   server/src/com/cloud/storage/dao/VolumeDaoImpl.java (40ed875)
  *   server/src/com/cloud/storage/download/DownloadListener.java (d4c20cf)
  *   server/src/com/cloud/storage/download/DownloadMonitorImpl.java (0bc89e3)
  *   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java (bacca01)
  *   server/src/com/cloud/template/HypervisorTemplateAdapter.java (1426421)
  *   server/src/com/cloud/template/TemplateManagerImpl.java (d843dbc)
  *   server/src/com/cloud/vm/UserVmManagerImpl.java (82a69bd)
  *   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java (d311ad3)
  *   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java (b9fc861)
  *   setup/db/db/schema-40to410.sql (60ad025)
  *   setup/db/db/schema-410to420.sql (eb650cc)
  *   utils/src/com/cloud/utils/UriUtils.java (a8b5ccb)

View Diff<https://reviews.apache.org/r/9541/diff/>



Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Nitin Mehta <Ni...@citrix.com>.
I get the following error on running mvn clean install


[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.373s
[INFO] Finished at: Wed Mar 27 14:20:41 GMT+05:30 2013
[INFO] Final Memory: 18M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project cloud-utils: Compilation failure: Compilation failure:
[ERROR] /Users/nitinmehta/apache/incubator-cloudstack/utils/src/com/cloud/utils/UriUtils.java:[95,37] cannot find symbol
[ERROR] symbol  : method getContentLengthLong()
[ERROR] location: class java.net.HttpURLConnection
[ERROR] /Users/nitinmehta/apache/incubator-cloudstack/utils/src/com/cloud/utils/UriUtils.java:[99,38] cannot find symbol
[ERROR] symbol  : method getContentLengthLong()
[ERROR] location: class javax.net.ssl.HttpsURLConnection
[ERROR] -> [Help 1]






From: Sanjay Tripathi <sa...@citrix.com>>
Reply-To: Sanjay Tripathi <sa...@citrix.com>>
Date: Wednesday 27 March 2013 11:30 AM
To: Sateesh Chodapuneedi <sa...@citrix.com>>, "mice_xia@tcloudcomputing.com<ma...@tcloudcomputing.com>" <mi...@tcloudcomputing.com>>, Min Chen <mi...@citrix.com>>, Nitin Mehta <ni...@citrix.com>>, Devdeep Singh <de...@citrix.com>>
Cc: David Nalley <da...@gnsa.us>>, "cloudstack-dev@incubator.apache.org<ma...@incubator.apache.org>" <cl...@incubator.apache.org>>, Sanjay Tripathi <sa...@citrix.com>>
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/9541/

Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
By Sanjay Tripathi.

Updated March 27, 2013, 6 a.m.

Changes

updated patch, in sync with the latest code.


Description

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types

    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11

    Also added jUnit Tests for the same.


Testing

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Bugs: CLOUDSTACK-1156
Diffs (updated)

  *   api/src/com/cloud/configuration/Resource.java (7614c8a)
  *   api/src/com/cloud/storage/VolumeApiService.java (8517988)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java (f6d3a98)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java (0039f62)
  *   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java (955727a)
  *   api/src/org/apache/cloudstack/api/response/AccountResponse.java (9a98a35)
  *   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java (a7fbbf2)
  *   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java (b444e7a)
  *   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java (33725f6)
  *   server/src/com/cloud/alert/AlertManagerImpl.java (a45482f)
  *   server/src/com/cloud/api/ApiResponseHelper.java (663139d)
  *   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java (898bafc)
  *   server/src/com/cloud/api/query/vo/AccountJoinVO.java (cd7231c)
  *   server/src/com/cloud/configuration/Config.java (9db7dbd)
  *   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java (23c0796)
  *   server/src/com/cloud/storage/VolumeManager.java (af3cbbf)
  *   server/src/com/cloud/storage/VolumeManagerImpl.java (737ed0a)
  *   server/src/com/cloud/storage/dao/SnapshotDao.java (0e378a7)
  *   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java (825b6d5)
  *   server/src/com/cloud/storage/dao/VolumeDao.java (d7a2667)
  *   server/src/com/cloud/storage/dao/VolumeDaoImpl.java (40ed875)
  *   server/src/com/cloud/storage/download/DownloadListener.java (d4c20cf)
  *   server/src/com/cloud/storage/download/DownloadMonitorImpl.java (0bc89e3)
  *   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java (bacca01)
  *   server/src/com/cloud/template/HypervisorTemplateAdapter.java (1426421)
  *   server/src/com/cloud/template/TemplateManagerImpl.java (d843dbc)
  *   server/src/com/cloud/vm/UserVmManagerImpl.java (82a69bd)
  *   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java (d311ad3)
  *   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java (b9fc861)
  *   setup/db/db/schema-40to410.sql (60ad025)
  *   setup/db/db/schema-410to420.sql (eb650cc)
  *   utils/src/com/cloud/utils/UriUtils.java (a8b5ccb)

View Diff<https://reviews.apache.org/r/9541/diff/>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 27, 2013, 6 a.m.)


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.


Changes
-------

updated patch, in sync with the latest code.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
  server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
  server/src/com/cloud/api/ApiResponseHelper.java 663139d 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/configuration/Config.java 9db7dbd 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
  server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 60ad025 
  setup/db/db/schema-410to420.sql eb650cc 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Nitin Mehta <ni...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review18380
-----------------------------------------------------------

Ship it!


Ship It!

- Nitin Mehta


On March 21, 2013, 7:17 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 21, 2013, 7:17 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
>   server/src/com/cloud/api/ApiResponseHelper.java 663139d 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 9db7dbd 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 9d51030 
>   setup/db/db/schema-410to420.sql eb650cc 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


RE: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Ram Ganesh <Ra...@citrix.com>.
Nitin,

Can you please review the patch and apply it if the changes are ok?

Thanks,
RamG

-----Original Message-----
From: Sanjay Tripathi [mailto:noreply@reviews.apache.org] On Behalf Of Sanjay Tripathi
Sent: 21 March 2013 12:47
To: Sateesh Chodapuneedi; mice xia; Min Chen; Nitin Mehta; Devdeep Singh
Cc: David Nalley; cloudstack; Sanjay Tripathi
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 21, 2013, 7:17 a.m.)


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.


Changes
-------

Updated patch with changes as per Nitin's review comments.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
  server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
  server/src/com/cloud/api/ApiResponseHelper.java 663139d 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/configuration/Config.java 9db7dbd 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
  server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 9d51030 
  setup/db/db/schema-410to420.sql eb650cc 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Nitin Mehta <Ni...@citrix.com>.
This looks good to me, and I will merge the code soon. If anyone has any objections do let me know.

From: Sanjay Tripathi <sa...@citrix.com>>
Reply-To: Sanjay Tripathi <sa...@citrix.com>>
Date: Thursday 21 March 2013 12:47 PM
To: Sateesh Chodapuneedi <sa...@citrix.com>>, "mice_xia@tcloudcomputing.com<ma...@tcloudcomputing.com>" <mi...@tcloudcomputing.com>>, Min Chen <mi...@citrix.com>>, Nitin Mehta <ni...@citrix.com>>, Devdeep Singh <de...@citrix.com>>
Cc: David Nalley <da...@gnsa.us>>, "cloudstack-dev@incubator.apache.org<ma...@incubator.apache.org>" <cl...@incubator.apache.org>>, Sanjay Tripathi <sa...@citrix.com>>
Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/9541/

Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
By Sanjay Tripathi.

Updated March 21, 2013, 7:17 a.m.

Changes

Updated patch with changes as per Nitin's review comments.


Description

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types

    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11

    Also added jUnit Tests for the same.


Testing

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Bugs: CLOUDSTACK-1156
Diffs (updated)

  *   api/src/com/cloud/configuration/Resource.java (7614c8a)
  *   api/src/com/cloud/storage/VolumeApiService.java (8517988)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java (f6d3a98)
  *   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java (0039f62)
  *   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java (955727a)
  *   api/src/org/apache/cloudstack/api/response/AccountResponse.java (9a98a35)
  *   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java (a7fbbf2)
  *   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java (b444e7a)
  *   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java (33725f6)
  *   server/src/com/cloud/alert/AlertManagerImpl.java (a45482f)
  *   server/src/com/cloud/api/ApiResponseHelper.java (663139d)
  *   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java (898bafc)
  *   server/src/com/cloud/api/query/vo/AccountJoinVO.java (cd7231c)
  *   server/src/com/cloud/configuration/Config.java (9db7dbd)
  *   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java (23c0796)
  *   server/src/com/cloud/storage/VolumeManager.java (af3cbbf)
  *   server/src/com/cloud/storage/VolumeManagerImpl.java (737ed0a)
  *   server/src/com/cloud/storage/dao/SnapshotDao.java (0e378a7)
  *   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java (825b6d5)
  *   server/src/com/cloud/storage/dao/VolumeDao.java (d7a2667)
  *   server/src/com/cloud/storage/dao/VolumeDaoImpl.java (40ed875)
  *   server/src/com/cloud/storage/download/DownloadListener.java (d4c20cf)
  *   server/src/com/cloud/storage/download/DownloadMonitorImpl.java (0bc89e3)
  *   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java (bacca01)
  *   server/src/com/cloud/template/HypervisorTemplateAdapter.java (1426421)
  *   server/src/com/cloud/template/TemplateManagerImpl.java (d843dbc)
  *   server/src/com/cloud/vm/UserVmManagerImpl.java (82a69bd)
  *   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java (d311ad3)
  *   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java (b9fc861)
  *   setup/db/db/schema-40to410.sql (9d51030)
  *   setup/db/db/schema-410to420.sql (eb650cc)
  *   utils/src/com/cloud/utils/UriUtils.java (a8b5ccb)

View Diff<https://reviews.apache.org/r/9541/diff/>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 21, 2013, 7:17 a.m.)


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.


Changes
-------

Updated patch with changes as per Nitin's review comments.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
  server/src/com/cloud/alert/AlertManagerImpl.java a45482f 
  server/src/com/cloud/api/ApiResponseHelper.java 663139d 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/configuration/Config.java 9db7dbd 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java 737ed0a 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadListener.java d4c20cf 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
  server/src/com/cloud/vm/UserVmManagerImpl.java 82a69bd 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 9d51030 
  setup/db/db/schema-410to420.sql eb650cc 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


RE: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Animesh Chaturvedi <an...@citrix.com>.
Nitin please review and commit the patch if satisfied

Animesh

> -----Original Message-----
> From: Devdeep Singh [mailto:noreply@reviews.apache.org] On Behalf Of
> Devdeep Singh
> Sent: Wednesday, March 13, 2013 12:46 AM
> To: Sateesh Chodapuneedi; mice xia; Min Chen; Nitin Mehta; Devdeep Singh
> Cc: cloudstack; Sanjay Tripathi
> Subject: Re: Review Request: CLOUDSTACK-1156: Limit Primary and
> Secondary storage for domain/accounts
> 
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/#review17799
> -----------------------------------------------------------
> 
> Ship it!
> 
> 
> Changes look fine. A committer could also take a look at it and commit it if the
> changes look ok.
> 
> - Devdeep Singh
> 
> 
> On March 13, 2013, 5:44 a.m., Sanjay Tripathi wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > https://reviews.apache.org/r/9541/
> > -----------------------------------------------------------
> >
> > (Updated March 13, 2013, 5:44 a.m.)
> >
> >
> > Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh
> Chodapuneedi, mice xia, and Min Chen.
> >
> >
> > Description
> > -------
> >
> > CLOUDSTACK-1156: Limit Primary and Secondary storage for
> domain/accounts
> >
> >     Addition of two new resource types i.e. Primary and Secondary storage
> space in the existing pool of
> >     resource types.
> >     Added methods to set the limits on these resources using
> updateResourceLimit
> >     API command and to get a count using updateResourceCount. Also
> added calls in the
> >     Templates, Volumes, Snapshots life cycle to check these limits and to
> increment/decrement the new
> >     resource types
> >
> >     Resource Name          :: Resource type number
> >         Primary Storage               10
> >         Secondary Storage             11
> >
> >     Also added jUnit Tests for the same.
> >
> >
> > This addresses bug CLOUDSTACK-1156.
> >
> >
> > Diffs
> > -----
> >
> >   api/src/com/cloud/configuration/Resource.java 7614c8a
> >   api/src/com/cloud/storage/VolumeApiService.java 8517988
> >
> api/src/org/apache/cloudstack/api/command/user/resource/UpdateResour
> ceCountCmd.java f6d3a98
> >
> api/src/org/apache/cloudstack/api/command/user/resource/UpdateResour
> ceLimitCmd.java 0039f62
> >
> api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeC
> md.java 955727a
> >   api/src/org/apache/cloudstack/api/response/AccountResponse.java
> 9a98a35
> >
> api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
> a7fbbf2
> >
> api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
> b444e7a
> >
> plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMe
> talTemplateAdapter.java 33725f6
> >   server/src/com/cloud/api/ApiResponseHelper.java fbfc955
> >   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc
> >   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c
> >   server/src/com/cloud/configuration/Config.java 64465a2
> >   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
> 23c0796
> >   server/src/com/cloud/storage/VolumeManager.java af3cbbf
> >   server/src/com/cloud/storage/VolumeManagerImpl.java 4951975
> >   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7
> >   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5
> >   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667
> >   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875
> >   server/src/com/cloud/storage/download/DownloadMonitorImpl.java
> 0bc89e3
> >   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
> bacca01
> >   server/src/com/cloud/template/HypervisorTemplateAdapter.java
> 1426421
> >   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc
> >   server/src/com/cloud/vm/UserVmManagerImpl.java 88086ce
> >
> server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java
> d311ad3
> >   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java
> b9fc861
> >   setup/db/db/schema-40to410.sql b9bfe1a
> >   setup/db/db/schema-410to420.sql ca15bda
> >   utils/src/com/cloud/utils/UriUtils.java a8b5ccb
> >
> > Diff: https://reviews.apache.org/r/9541/diff/
> >
> >
> > Testing
> > -------
> >
> > Tested life cycle of templates, volumes, snapshots, vm on my local
> CloudStack setup.
> >
> >
> > Thanks,
> >
> > Sanjay Tripathi
> >
> >


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Devdeep Singh <de...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17799
-----------------------------------------------------------

Ship it!


Changes look fine. A committer could also take a look at it and commit it if the changes look ok.

- Devdeep Singh


On March 13, 2013, 5:44 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated March 13, 2013, 5:44 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
>   server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/configuration/Config.java 64465a2 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java 4951975 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
>   server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
>   server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
>   server/src/com/cloud/vm/UserVmManagerImpl.java 88086ce 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql b9bfe1a 
>   setup/db/db/schema-410to420.sql ca15bda 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 13, 2013, 5:44 a.m.)


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.


Changes
-------

Updated patch as per Devdeep's review comments.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java 33725f6 
  server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/configuration/Config.java 64465a2 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java 4951975 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
  server/src/com/cloud/vm/UserVmManagerImpl.java 88086ce 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql b9bfe1a 
  setup/db/db/schema-410to420.sql ca15bda 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 11, 2013, 8:15 a.m.)


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.


Changes
-------

Resolved conflicts with the latest code.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java d902dc4 
  server/src/com/cloud/configuration/Config.java 64465a2 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java f0e6028 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java bacca01 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java d843dbc 
  server/src/com/cloud/vm/UserVmManagerImpl.java 6b2f762 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql b9bfe1a 
  setup/db/db/schema-410to420.sql ca15bda 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 8, 2013, 10:10 a.m.)


Review request for cloudstack, Devdeep Singh, Nitin Mehta, Sateesh Chodapuneedi, mice xia, and Min Chen.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java d902dc4 
  server/src/com/cloud/configuration/Config.java 418f97d 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java 336dbcb 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
  server/src/com/cloud/vm/UserVmManagerImpl.java ca9c13f 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 706a197 
  setup/db/db/schema-410to420.sql f3112a1 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated March 7, 2013, 5:47 p.m.)


Review request for cloudstack, Devdeep Singh, Sateesh Chodapuneedi, mice xia, and Min Chen.


Changes
-------

Resolved conflicts with the latest code.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java fbfc955 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java d902dc4 
  server/src/com/cloud/configuration/Config.java 418f97d 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 23c0796 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java 336dbcb 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 825b6d5 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java 40ed875 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
  server/src/com/cloud/template/HypervisorTemplateAdapter.java 1426421 
  server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
  server/src/com/cloud/vm/UserVmManagerImpl.java ca9c13f 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 706a197 
  setup/db/db/schema-410to420.sql f3112a1 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.

> On Feb. 27, 2013, 5:38 a.m., Nitin Mehta wrote:
> > server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java, line 311
> > <https://reviews.apache.org/r/9541/diff/5/?file=262210#file262210line311>
> >
> >     What will happen if u get an exception that the size limit exceeds ?
> >     Do you cleanup the snapshot then ?
> >     
> >     Same question for templates, volumes. Did you consider the volumes which are created on secondary storage ?
> >     
> >     Can we not make all the increment business state transition based - like when volume goes from allocated to ready we increment the volume count and the size etc. ?

In case of size limit exceeds during the check, CS will through resourceAllocation exception right after the check and in case of failure of creating any snapshot or volume, CS decrements the count accordingly.

I considered the volume which is created on secondary storage and this happens only if user uploads a volume. If user attach this volume to any VM, it moves from secondary to primary, so CS decrements secondary storage count and increment primary storage count.

We cannot wait for volume to get into READY state to increment the count because all these calls are async and this will give user some time to create more volume/templates etc. which may have out of his storage limits.

Sailaja has already shared the test case for this feature which covers all these scenarios.


- Sanjay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17137
-----------------------------------------------------------


On Feb. 27, 2013, 5:21 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2013, 5:21 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java eb6fb24 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java c2bba63 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 59b2a7d 
>   setup/db/db/schema-410to420.sql 4349bd0 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Nitin Mehta <ni...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review17137
-----------------------------------------------------------



server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
<https://reviews.apache.org/r/9541/#comment36309>

    What will happen if u get an exception that the size limit exceeds ?
    Do you cleanup the snapshot then ?
    
    Same question for templates, volumes. Did you consider the volumes which are created on secondary storage ?
    
    Can we not make all the increment business state transition based - like when volume goes from allocated to ready we increment the volume count and the size etc. ? 


- Nitin Mehta


On Feb. 27, 2013, 5:21 a.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2013, 5:21 a.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh, Sateesh Chodapuneedi, mice xia, and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/com/cloud/storage/VolumeApiService.java 8517988 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
>   server/src/com/cloud/configuration/Config.java eb6fb24 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/VolumeManager.java af3cbbf 
>   server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
>   server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
>   server/src/com/cloud/vm/UserVmManagerImpl.java c2bba63 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 59b2a7d 
>   setup/db/db/schema-410to420.sql 4349bd0 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated Feb. 27, 2013, 5:21 a.m.)


Review request for cloudstack, Devdeep Singh, Sateesh Chodapuneedi, mice xia, and Min Chen.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
  server/src/com/cloud/configuration/Config.java eb6fb24 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
  server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
  server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
  server/src/com/cloud/vm/UserVmManagerImpl.java c2bba63 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 59b2a7d 
  setup/db/db/schema-410to420.sql 4349bd0 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated Feb. 26, 2013, 9:04 a.m.)


Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
  server/src/com/cloud/configuration/Config.java eb6fb24 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
  server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
  server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
  server/src/com/cloud/vm/UserVmManagerImpl.java c2bba63 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 59b2a7d 
  setup/db/db/schema-410to420.sql 4349bd0 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated Feb. 26, 2013, 7:47 a.m.)


Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.


Changes
-------

Updated diff as per review comments.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/com/cloud/storage/VolumeApiService.java 8517988 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java 955727a 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
  server/src/com/cloud/configuration/Config.java eb6fb24 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
  server/src/com/cloud/storage/VolumeManager.java af3cbbf 
  server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 0bc89e3 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
  server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
  server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
  server/src/com/cloud/vm/UserVmManagerImpl.java c2bba63 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 59b2a7d 
  setup/db/db/schema-410to420.sql 6c831f0 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated Feb. 25, 2013, 12:47 p.m.)


Review request for cloudstack, Devdeep Singh, mice xia, and Min Chen.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
  server/src/com/cloud/configuration/Config.java 8c77715 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
  server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 1fd1996 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
  server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
  server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
  server/src/com/cloud/vm/UserVmManagerImpl.java cf9eb27 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 74f0dba 
  setup/db/db/schema-410to420.sql 4637b6d 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated Feb. 25, 2013, 12:46 p.m.)


Review request for cloudstack, Devdeep Singh and Min Chen.


Changes
-------

Resolved conflicts cause by storage related checkins.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java eafee8a 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 0cf19fb 
  server/src/com/cloud/configuration/Config.java 8c77715 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
  server/src/com/cloud/storage/VolumeManagerImpl.java a69607f 
  server/src/com/cloud/storage/dao/SnapshotDao.java 0e378a7 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java 5b3f273 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java ca3b82a 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 1fd1996 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ed48bd1 
  server/src/com/cloud/template/HyervisorTemplateAdapter.java ad41af5 
  server/src/com/cloud/template/TemplateManagerImpl.java 29659d3 
  server/src/com/cloud/vm/UserVmManagerImpl.java cf9eb27 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 74f0dba 
  setup/db/db/schema-410to420.sql 4637b6d 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/
-----------------------------------------------------------

(Updated Feb. 21, 2013, 4:51 p.m.)


Review request for cloudstack, Devdeep Singh and Min Chen.


Changes
-------

updated diff after Sateesh's review comments.


Description
-------

CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
    
    Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
    resource types.
    Added methods to set the limits on these resources using updateResourceLimit
    API command and to get a count using updateResourceCount. Also added calls in the
    Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
    resource types
    
    Resource Name          :: Resource type number
        Primary Storage               10
        Secondary Storage             11
    
    Also added jUnit Tests for the same.


This addresses bug CLOUDSTACK-1156.


Diffs (updated)
-----

  api/src/com/cloud/configuration/Resource.java 7614c8a 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
  api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
  api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
  api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
  api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
  server/src/com/cloud/api/ApiResponseHelper.java a94e935 
  server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
  server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
  server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 4440b7a 
  server/src/com/cloud/baremetal/BareMetalVmManagerImpl.java 5de5ccd 
  server/src/com/cloud/configuration/Config.java c0c23b6 
  server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
  server/src/com/cloud/storage/StorageManagerImpl.java 05e0cfe 
  server/src/com/cloud/storage/dao/SnapshotDao.java 3b961f6 
  server/src/com/cloud/storage/dao/SnapshotDaoImpl.java a8a07dc 
  server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
  server/src/com/cloud/storage/dao/VolumeDaoImpl.java a189d00 
  server/src/com/cloud/storage/download/DownloadMonitorImpl.java 6d3cf2a 
  server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java e06da75 
  server/src/com/cloud/template/HyervisorTemplateAdapter.java fe6bc2a 
  server/src/com/cloud/template/TemplateAdapterBase.java fa677ac 
  server/src/com/cloud/template/TemplateManagerImpl.java f9cf277 
  server/src/com/cloud/vm/UserVmManagerImpl.java ed8cd36 
  server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
  server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
  setup/db/db/schema-40to410.sql 47b7cbe 
  setup/db/db/schema-410to420.sql 0335f2a 
  utils/src/com/cloud/utils/UriUtils.java a8b5ccb 

Diff: https://reviews.apache.org/r/9541/diff/


Testing
-------

Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.


Thanks,

Sanjay Tripathi


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sanjay Tripathi <sa...@citrix.com>.

> On Feb. 21, 2013, 2:15 p.m., Sateesh Chodapuneedi wrote:
> > server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java, line 180
> > <https://reviews.apache.org/r/9541/diff/1/?file=260599#file260599line180>
> >
> >     Need to see if the division result might cause skew in calculations involving these variables.

This conversion (bytes to GiB) is just for display the limits in response and not for any calculation. 


> On Feb. 21, 2013, 2:15 p.m., Sateesh Chodapuneedi wrote:
> > server/src/com/cloud/vm/UserVmManagerImpl.java, line 2416
> > <https://reviews.apache.org/r/9541/diff/1/?file=260615#file260615line2416>
> >
> >     how about snapshot value null here?

This method is called by createTemplate API and in this API, one of the parameter is required i.e volume or snapshot. Both cannot be null at same time.


On Feb. 21, 2013, 2:15 p.m., Sanjay Tripathi wrote:
> > Would like to know if there are upgrade scenarios considered.

Upgrade scenarios are already considered.
you can look in to the FS to know about upgrade scenarios. 
FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domains+and+accounts


- Sanjay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review16846
-----------------------------------------------------------


On Feb. 21, 2013, 4:51 p.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2013, 4:51 p.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java a94e935 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 4440b7a 
>   server/src/com/cloud/baremetal/BareMetalVmManagerImpl.java 5de5ccd 
>   server/src/com/cloud/configuration/Config.java c0c23b6 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/StorageManagerImpl.java 05e0cfe 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 3b961f6 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java a8a07dc 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java a189d00 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 6d3cf2a 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java e06da75 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java fe6bc2a 
>   server/src/com/cloud/template/TemplateAdapterBase.java fa677ac 
>   server/src/com/cloud/template/TemplateManagerImpl.java f9cf277 
>   server/src/com/cloud/vm/UserVmManagerImpl.java ed8cd36 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 47b7cbe 
>   setup/db/db/schema-410to420.sql 0335f2a 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>


Re: Review Request: CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts

Posted by Sateesh Chodapuneedi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9541/#review16846
-----------------------------------------------------------



server/src/com/cloud/api/ApiResponseHelper.java
<https://reviews.apache.org/r/9541/#comment35773>

    Good to take ceiling value to roundoff this division operation. Or do +1 to result. 



server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
<https://reviews.apache.org/r/9541/#comment35774>

    Need to see if the division result might cause skew in calculations involving these variables.



server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
<https://reviews.apache.org/r/9541/#comment35775>

    Why is the dao object protected?



server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
<https://reviews.apache.org/r/9541/#comment35776>

    change variable name to start with small case letter.



server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
<https://reviews.apache.org/r/9541/#comment35777>

    Good amount of comman code exists between public long findCorrectResourceLimitForAccount(Account account, ResourceType type) and public long findCorrectResourceLimitForAccount(short accountType, Long limit, ResourceType type). Is this something we can optimize?



server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
<https://reviews.apache.org/r/9541/#comment35778>

    This statement is not required as default value would suffice.



server/src/com/cloud/storage/dao/VolumeDao.java
<https://reviews.apache.org/r/9541/#comment35779>

    What is the unit of storage space here? bytes of Gib. Please update the comment to bring more clarity.



server/src/com/cloud/storage/dao/VolumeDao.java
<https://reviews.apache.org/r/9541/#comment35780>

    Specify storage units here.



server/src/com/cloud/vm/UserVmManagerImpl.java
<https://reviews.apache.org/r/9541/#comment35781>

    how about snapshot value null here?



utils/src/com/cloud/utils/UriUtils.java
<https://reviews.apache.org/r/9541/#comment35782>

    Better to add finally block with connection cleanup code.


Would like to know if there are upgrade scenarios considered.

- Sateesh Chodapuneedi


On Feb. 21, 2013, 1:20 p.m., Sanjay Tripathi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9541/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2013, 1:20 p.m.)
> 
> 
> Review request for cloudstack, Devdeep Singh and Min Chen.
> 
> 
> Description
> -------
> 
> CLOUDSTACK-1156: Limit Primary and Secondary storage for domain/accounts
>     
>     Addition of two new resource types i.e. Primary and Secondary storage space in the existing pool of
>     resource types.
>     Added methods to set the limits on these resources using updateResourceLimit
>     API command and to get a count using updateResourceCount. Also added calls in the
>     Templates, Volumes, Snapshots life cycle to check these limits and to increment/decrement the new
>     resource types
>     
>     Resource Name          :: Resource type number
>         Primary Storage               10
>         Secondary Storage             11
>     
>     Also added jUnit Tests for the same.
> 
> 
> This addresses bug CLOUDSTACK-1156.
> 
> 
> Diffs
> -----
> 
>   api/src/com/cloud/configuration/Resource.java 7614c8a 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java f6d3a98 
>   api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java 0039f62 
>   api/src/org/apache/cloudstack/api/response/AccountResponse.java 9a98a35 
>   api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java a7fbbf2 
>   api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b444e7a 
>   server/src/com/cloud/api/ApiResponseHelper.java a94e935 
>   server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java 898bafc 
>   server/src/com/cloud/api/query/vo/AccountJoinVO.java cd7231c 
>   server/src/com/cloud/baremetal/BareMetalTemplateAdapter.java 4440b7a 
>   server/src/com/cloud/baremetal/BareMetalVmManagerImpl.java 5de5ccd 
>   server/src/com/cloud/configuration/Config.java c0c23b6 
>   server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java 7ff06af 
>   server/src/com/cloud/storage/StorageManagerImpl.java 05e0cfe 
>   server/src/com/cloud/storage/dao/SnapshotDao.java 3b961f6 
>   server/src/com/cloud/storage/dao/SnapshotDaoImpl.java a8a07dc 
>   server/src/com/cloud/storage/dao/VolumeDao.java d7a2667 
>   server/src/com/cloud/storage/dao/VolumeDaoImpl.java a189d00 
>   server/src/com/cloud/storage/download/DownloadMonitorImpl.java 6d3cf2a 
>   server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java e06da75 
>   server/src/com/cloud/template/HyervisorTemplateAdapter.java fe6bc2a 
>   server/src/com/cloud/template/TemplateAdapterBase.java fa677ac 
>   server/src/com/cloud/template/TemplateManagerImpl.java f9cf277 
>   server/src/com/cloud/vm/UserVmManagerImpl.java df97609 
>   server/test/com/cloud/resourcelimit/ResourceLimitManagerImplTest.java d311ad3 
>   server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b9fc861 
>   setup/db/db/schema-40to410.sql 9a59318 
>   setup/db/db/schema-410to420.sql 65add75 
>   utils/src/com/cloud/utils/UriUtils.java a8b5ccb 
> 
> Diff: https://reviews.apache.org/r/9541/diff/
> 
> 
> Testing
> -------
> 
> Tested life cycle of templates, volumes, snapshots, vm on my local CloudStack setup.
> 
> 
> Thanks,
> 
> Sanjay Tripathi
> 
>