Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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.

...

  • 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 (in MB) - *Maximum RAM 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 20is 20*20.
  • 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 use 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.

...

    1. Root/Domain-Admin update RAM 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 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 use cross RAM 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 1GB for Project P1 having account A1. Users belonging to Project P1 should not be able to use more RAM than the defined limit.

...

    1. Root/Domain-Admin update primary storage to 5GB for domain D1. Users belonging to Domain D1 should not be able to use more than that.
    2. Root/Domain-Admin update primary storage to 5GB for Account A1 in Domain D1. Users belonging to Account A1 should not be able to use more than that. Also, they should not use cross primary storage 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 primary storage to 5GB for Project P1 having account A1. Users belonging to Project P1 should not be able to use more primary storage than the defined limit.

...

    1. Root/Domain-Admin update secondary storage to 5GB for domain D1. Users belonging to Domain D1 should not be able to use more than that.
    2. Root/Domain-Admin update secondary storage to 5GB for Account A1 in Domain D1. Users belonging to Account A1 should not be able to use more than that. Also, they should not use cross secondary storage 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 secondary storage to 5GB for Project P1 having account A1. Users belonging to Project P1 should not be able to use more secondary storage than the defined limit.

...

    1. Root/Domain-Admin update network bandwidth rate to 1000bps for domain D1. Users belonging to Domain D1 should not be able to use more than that.
    2. Root/Domain-Admin update network bandwidth rate to 1000bps for Account A1 in Domain D1. Users belonging to Account A1 should not be able to use more than that. Also, they should not use secondary storage cross network bandwidth 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 network bandwidth rate to 1000bps for Project P1 having account A1. Users belonging to Project P1 should not be able to use more network bandwidth rate than the defined limit.

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

No

In the above mentioned API, admin can pass the newly added resource types to set the limits.

2. updateResourceCount

ApiName

Request Parameters

Response Parameters

Available to regular user

updateResourceCount

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

No

In the above mentioned API, admin can pass the newly added resource types to get the resource count.

3. listResourceLimits 

  This API is available to regular users and this will list the resource limits including the new resource types.

...

9

...

CPU

...

10

...

RAM

...

11

...

Primary (shared) storage (Volumes)

...

12

...

Secondary storage  (Snapshots, Templates & ISOs)

...

13

...

Example:

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

For a User

  1. listResourceLimit:  

Request parameters resourcetype is optional but it has to be changed.

          Response Tags change: resourcetype, required 

DB Changes:

New values will be added  in resource_limit table 

resource_limit table:

id

domain_id

account_id

type

max

1

2

NULL

user_vm

2

2

2

NULL

public_ip

-1

3

2

NULL

volume

-1

4

2

NULL

snapshot

-1

5

2

NULL

template

-1

6

2

NULL

project

4

7

2

NULL

network

4

8

2

NULL

vpc

5

9

2

NULL

cpu

2

10

2

NULL

ram

4

11

2

NULL

primary_storage

5

12

2

NULL

secondary_storage

5

13

2

NULL

network_bandwidth_rate

600

DB Changes:

No DB Changes.

Changes to Existing Files:

  • Add new resource types in Resource.java .
  • Add new resource type in description field of resource_types in UpdateResourceCountCmd.java and in UpdateResourceLimitCmd.java .
  • Add new resource type in description field of resource_types in* ResourceCountResponse.java and in ResourceLimitResponse.java .*
  • Add new methods in* ResourceLimitManagerImpl.java* to get resourceCount for newly added resource types*.*
  • Add new method in UserVmDaoImpl.java to get a list of serviceOfferingIds by passing a vmId.
  • Add new calls in UserVmManagerImpl.java and BareMetalVmManagerImpl.java to check the limits for an account and to increment or decrement resource count for an account.

Design Decisions: TBD

  • The Limit imposed (per account, per  Domain, per Project) should not conflict  
  • What should be the maximum limit for CPU, RAM, Primary Storage, Secondary StorageTBD: resource type: 11 - Network bandwidth rate (in bps), Network rate

UI flow

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

...