Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Table of Contents
indent20px
styledisc

 

Introduction

Purpose

Currently in CloudStack, the admin can limit the resources managed by CloudStack by setting limits for accounts and domains. But these existing limits are based on resource count, that limits the user on the basis of no. of VMs, no. of Volumes, no. of snapshots etc. and not of the basis of storage space, CPU, memory etc.

This feature will add new (CPU, Memory, Primary storage, Secondary storage, network rate etc.) resource types to the existing pool of resources. CS admin would be able to set the limits i.e. CPU, memory, storage etc. for accounts/domains through API or through CloudStack UI. This is functional specifications of feature CLOUDSTACK-713.

Current Scenario

  • updateResourceLimit API has the following resource types:** Instance - Number of instances a user can create.
    • Public IPs - Number of public IP addresses a user can own.
    • Volume - Number of disk volumes a user can create.
    • Snapshot - Number of snapshots a user can create.
    • Template - Number of templates that a user can register/create. 
    • Network - Number of guest networks that a user can create.
    • VPC - Number of VPCs that a user can create.

...

  • User permission

    • Normal users would have privilege to list resource limits (listResourceLimits).
    • Root-Admin would have privilege to list and update resource limits.
    • Domain-Admin would have privilege to list resources and update resource limits that are assigned to the domain.

Use cases

Domain D1 , Account A1 and  Project P1

...

8. If any operation needs to pass through two of more resource limit check, then the lower of 2 limits will be enforced, For e.g. if an account has VM limit of 10 and CPU limit of 20 and user under that account requests 5 VMs of 4 CPUs each, after this user can deploy 5 more VMs(because VM limit is 10) but user has exausted his CPU limit and cannot deploy any more instance.

Architecture and Design description

Existing API Changes:

1. updateResourceLimit

ApiName

Request Parameters

Response Parameters

Available to regular user

updateResourceLimit

  • resourcetype (admin can pass new resource type to update CPU, Memory, primary storage, secondary storage and network rate)
  • account
  • domainid
  • max
  • projectid
  • account
  • domain
  • domainid
  • max
  • project
  • projectid
  • resourcetype

No

...

http://localhost:8080/client/api?command=updateResourceLimit&resourcetype=9&max=1024&domainid=2&apikey=pFZ6ZdlN-TmlBQWJRhncYUAUFCOGk3aCbbLGRAqtSG3KnbYnTEHXvh1MP-Y5801JAn-aFPODB-7vl1P8DiPQ1A&signature=6he37Flw1zRwNDe0yejyHk6oXcE%3d

DB Changes:

No DB Changes.

Changes to Existing Files:

...

  • The Limit imposed (per account, per  Domain, per Project) should not conflict  
  • What should be the maximum limit for CPU, Memory, Primary Storage, Secondary Storage, Network rate

UI flow

  • _On Project Dashboard: Resource page - add resource options as following:

...