Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
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, RAMMemory, 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.

...

  • Requirements

    • Update Resource Limit: Root /Domain Admin should would be able to limit the following resources for domain/accounts, domain admin would be able to limit the follwoing resources only for sub-domains/accounts under his own domain or all sub-domain.
      • CPUs
      • RAMMemory
      • Primary (shared) storage (Volumes)
      • Secondary storage  (Snapshots, Templates & ISOs)
      • Network bandwidth rate (in mbps)
    • Usage: Limits can be imposed on Accounts, Domains and Projects.
    • List Resource Limit: Any User/RootAdmin/Domain Admin can list Resources
    • Resource Limit Logs: Ensure proper logs are maintained into vmops.log and api.log 

...

  • Configuration

    • global configuration parameters:
      • max.account.cpus - Maximum number of CPU cores that can be used for an account. Default value for this is 40.
      • max.account.ram memory (in MB) - Maximum RAM Memory that can be used for an account. Default value for this is 40960.
      • max.account.primary.storage (in GB) - Maximum primary storage space that can be used for an account. Default value for this is 20*10.
      • max.account.secondary.storage (in GB) - Maximum secondary storage space that can be used for an account. Default value for this is 20*20.
      • max.account.network.rate(in mbps) - Maximum network rate that can be used for an account. Default value for this is 200.
      • max.project.cpus - Maximum number of CPU cores that can be used for an account. Default value for this is 40.
      • max.project.ram memory (in MB) - Maximum RAM Memory that can be used for an account. Default value for this is 40960.
      • max.project.primary.storage (in GB) - Maximum primary storage space that can be used for an account. Default value for this is 20*10.
      • max.project.secondary.storage(in GB) - Maximum secondary storage space that can be used for an account. Default value for this is 20*20.
      • max.project.network.rate(in mbps) - Maximum network rate that can be used for an account. Default value for this is 200.
  • 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

...

    1. Root/Domain-Admin update CPU to 10 for domain D1. Users belonging to Domain D1 should not be able to use more than that.
    2. Root/Domain-Admin update CPU to 10 for Account A1 in Domain D1. Users belonging to Account A1 should not be able to use more than that. Also, they should not cross CPU limit defined for D1 domain.
    3. Limits imposed on Domain D1 should be imposed on sub-domain SD1 as well.
    4. Root/Domain-Admin update CPU to 10 for Project P1 having account A1 . Users belonging to Project P1 should not be able to use more CPUs than the defined limit.

2. Amount of RAM Memory:

    1. Root/Domain-Admin update RAM Memory to 1GB for domain D1. Users belonging to Domain D1 should not be able to use more than that.
    2. Root/Domain-Admin update RAM to Memory to 1GB for Account A1 in Domain D1. Users belonging to Account A1 should not be able to use more than that. Also, they should not cross RAM limit Memory limit defined for D1 domain.
    3. Limits imposed on Domain D1 should be imposed on sub-domain SD1 as well.
    4. Root/Domain-Admin update RAM to Memory to 1GB for Project P1 having account A1. Users belonging to Project P1 should not be able to use more RAM than Memory than the defined limit.

3. Amount of Primary Storage:

...

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, RAM Memory, primary storage, secondary storage and network rate)
  • account
  • domainid
  • max
  • projectid
  • account
  • domain
  • domainid
  • max
  • project
  • projectid
  • resourcetype

No

...

ApiName

Request Parameters

Response Parameters

Available to regular user

updateResourceCount

  • domainid
  • account
  • projectid
  • resourcetype (admin can pass new resource type to update CPU, RAM Memory, primary storage, secondary storage *and network rate*)
  • account
  • domain
  • domainid
  • project
  • projectid
  • resourcecount
  • 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, RAMMemory, Primary Storage, Secondary Storage, Network rate

UI flow

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

...