Versions Compared

Key

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

...

Host 1 is explicitly dedicated to domain D1, Host 2 is shared empty dedicatedhost, and Host 3 is a shared host. 

SID-VM  : VM with Strict Implicit Dedication required  

PID-VM  : VM with Preferred Implicit Dedication  

ED-VM   : VM with Explicit Dedication required 

      VM   : VM with no dedication required


Use Case 1:  User U3 of Account A2 (Red color),  deploys a virtual machine VM1 with SID,

                    Host 2 is chosen from the shared host as it is emplty. "Host 2" is now dedicated to account  A1 A2

Use Case 2:  User U1 of Account A1, deploys a virtual machine VM2 with ED affinity type ,  

                    Host 1 is chosen form the pool of explicitly dedicated resources (In this case, only Host 1 is explicitly dedicated)

Use Case 3: User U1 of Account A1,  deploys a virtual machine VM3 with NO dedication,

                   Host 3  is chosen from the shared pool,  (In this case, only Host 3 is a shared Host)

Use Case 4: User U1 of Account A1 (Green color), deploys a virtual machine VM1 with  SID,

                   Request Failed, No Host available

Use Case 5: User U4 of account A2,  deploys a virtual machine VM2 with  ED affinity type,

                   Host 1 is chosen form the pool of explicitly dedicated resources

Use Case 6:  User U5 of Account A3 (Blue Color),  deploys a virtual machine VM1 with SID,

                    Request Failed, No Host available

Use Case 7:  User U5 of Account A3, deploys a virtual machine VM2 with DVM=ONSID

                    Request Failed, No Host available.

Use Case 8:  User U5 of Account A3, deploys a virtual machine VM3 without with NO Dedication, 

                    Host 3 is selected.

Use Case 9: User U3 of Account A2, deploys a VM with PID.

                   Host 2 is selected, VM with SID is OK if VM come from the same account

Use Case 10:User U3 of Account A2, deploys a VM eith with NO dedication .

                    Host2/Host3 can be chosen.

Use Case 11: User U5 of Account A3 deploys a VM with PID.

                    Search for Host having VMs of same account. If not available can go to shared host.

                     Host 3 is selected. 

Use Case 12: Once All the VMs in Host 2 is deleted, Host will added to the implicit dedicated poolget available for all users.

Use Case 13: Host 1 will remain dedicated to Domain D1 unless root admin changes dedication of this host.

Deletion of Account/domain

  1. Deleting an account will delete all the VMs, snapshots, templates, etc. of that account, and also removes the dedication of host, cluster or pod to that account.
  2. Deleting a domain, will remove the dedication from the hosts, clusters or pods (if dedicated).  

Host Tags with Explicit and Implicit Dedication

  1. If Host Tag is provided and Implicit Dedication is required, Host which is tagged as well as implicitly dedicated, will be allocated. If not found, fail the request. 
  2. If host tag is provided and NO dedication is required, Host which is tagged but not implicitly or explicitly dedicated, will be allocated.  If not found, fail the request. 
  3. If host tag is provided and Explicit dedication is required, Host which is tagged as well as explicitly dedicated, will be allocated.  If not found, fail the request. 

Migration of VMs

  1. If VM to be migrated is non-dedicated: 
    1. if destination host is implicitly or explicitly dedicated, migrate it to that host, but an alert is generated
    2. if destination host is non-dedicated, migrate it to the destination host.
  2. If VM to be migrated is dedicated
    1. if destination host is implicitly or explicitly dedicated to the same account, migrate it to that host.
    2. if destination host is implicitly or explicitly dedicated to different account, migrate it to that host, but an alert is generated
    3. if destination host is non-dedicated, migrate it to that host but an alert is generated.

Architecture and Design description

This feature will come as a separate plugin which will use the PluggableService to add the DedicatedResources feature APIs into CloudStack, the DedicatedResourceManager will be responsible for thread scheduling and the ExplicitDedicationProcessor will implement AffinityGroupProcessor adapter and  ImplicitDedicationPlanner will implement a deployment planner interface.

Panel

Ways to achieve Dedication:

  • To Use Explicit Dedication: Create an Affinity Group of type "explicit dedication". Use that AG to deploy a VM.
  • To Use Implicit Dedication: Create a Service Offering with Implicit dedication planner. Choose a type: 'strict' or 'preferred'. Use that SO to deploy a VM.

Explicit Dedication Design

  1. New Admin APIs to dedicate Zones/Pods/Clusters/Hosts to a domain or account (these APIs will come in a separate plugin)
  2. list affinity types: Add a new type: explicit dedication
  3. User should be able to create affinity groups based on the explicit dedication type
  4. User can associate above affinity group to VM during deployment.
  5. A new ExplicitDedicationProcessor plugin that implements AffinityGroupProcessor adapter, will set deployment plan scope to the correct resource level (For AffinityGroupProcessor adapter see: https://cwiki.apache.org/confluence/display/CLOUDSTACK/FS+-+Affinity-Anti-affinity+groups).
  6. The Deployment Planning Manager will do the following:
    1.  Processors: Call the ExplicitDedicationProcessor to process the dedication request based on the explicitly dedicated resources for the user.
    2.  Planners: Call Deployment Planner to drill down to the right set of clusters to look for placement based on explicitly dedicated clusters/hosts inside them. 
    3.  Allocators: Call Allocators to match the requirement to explicit dedication.

New Addition: ExplicitDedicationProcessor

This will implement the process to set the scope of deployment plan to the correct resource level for planners to look into. This processor will implement AffinityGroupProcessor adapter.

Non-dedicated Resources will be added in Avoid List.

For Example:

              Zone Z has Pods P1,  P2.

              Pod P1 has Clusters C1, C2  and P2 has Cluster C3

              Clusters

              C1 -> h1 (dedicated A), h2 (dedicated B)

              C2 -> h3 (dedicated A)

              C3 -> h4, h5(dedicated B) 

Case 1: Deploy VM  for account A with explicit dedication, processors should set the scope of plan to Pod P1 since both dedicated hosts are in Pod P1 even if in different clusters. Also set the Pod P2 in avoid set

Case 2: Deploy VM for account B with explicit dedication, processors should set the scope of plan to Zone Z  since the dedicated hosts are in Pod P1 and P2 , with parent being the zone itself. Also set the Cluster C2  in avoid set.

Implicit Dedication Design

  1. Admin should be able to choose a planner while creating a Service Offering.
  2. In Service Offering the list of planners will be shown, which include the new planner for Implicit Dedication: ImplicitDedicationPlanner
  3. If ImplicitDedicationPlanner is selected, a new pluggable UI for new API configurePlanner is shown up.
  4. configurePlanner API will take in name-value parameters for implicitDedication mode as input.
  5.  Admin can set the name-value parameter for 
    1. Strict Implicit Dedication as  "implicitDedicationMode = Strict" 
    2. Preferred Implicit Dedication as "implicitDedicationMode = Preferred"
  6. These parameters will get stored in reference to the service_offering_id.
  7. ImplicitDedicationPlanner takes the above parameters as input and  set the scope of the plan of the VM to choose implicitly dedicated resources.

New Planner: ImplicitDedicationPlanner

ImplicitDedicationPlanner will extend firstfitplanner and search only in the dedicated resources.

New API: configurePlanner

configurePlanner API will take in name-value parameters for implicitDedication mode as input.

New Parameter: ImplicitDedicationMode

Admin can set the name-value parameter for 

  1. Strict Implicit Dedication as  "implicitDedicationMode = Strict" 
  2. Preferred Implicit Dedication as "implicitDedicationMode = Preferred"

Change in the Existing Private Zone functionality:

Zones can be dedicated to domains while creation. Users in that domain can deployVm only in that dedicated zone.

Change:

  1. Zones dedicated to a domain at the creation level will be considered as explicit dedication of zones. The functionality will be redirected to explicit dedication affinity group when VM (with explicit dedication) is deployed.
  2. All the Zones will be listed, and if explicit type affinity group is provided, deployment will only happen if any of the resource in that zone will be dedicated to that user's account or domain.

API Changes

Following new APIs will be added:

  • Dedicating Resources (Explicit or Implicit) 
    • dedicateZone
    • dedicatePoe
    • dedicateCluster
    • dedicateHost

      These are new admin APIs to dedicate a zone/pod/cluster/host for an account/domain.

      Parameters include:
       a)    ZoneId/PodId/ClusterId/HostId
       b)    DomainId
       c)    AccountId

       d)    ImplicitDedication     

   Note: Either "DomainId or AccountId" Or "Implicit Dedication" can be provided as a parameter but not both. If neither of them specified, fail the request.

  • Release dedication of resources 
    • releaseDedicatedZone
    • releaseDedicatedPod
    • releaseDedicatedCluster
    • releaseDedicatedHost

      These are new admin APIs to remove the dedication of zone/pod/cluster/host

       Parameters include:
       a)    ZoneId/PodId/ClusterId/HostId

  • Listing Dedicated resources per account/domain
    • listDedicatedZones
    • listDedicatedPods
    • listDedicatedClusters
    • listDedicatedHosts

     These are new admin APIs to list dedicated pods/clusters/hosts for an account/domain.

     Parameters include:
       a)    zoneId/PodId/ClusterId/HostId
       b)    DomainId
       c)    AccountId

       d)    ImplicitDedication flag

DB Changes:

  1. New Table : dedicated_resources (id, uuid, zone_id, pod_id, cluster_id, host_id, domain_id, account_id)
       || Field || Type || Null || Key || Default || Extra ||

    id

    bigint(20) unsigned

    NO

    PRI

    NULL

    auto_increment

    uuid

    varchar(40)

    YES

    UNI

    NULL

     

    data_center_id

    bigint(20) unsigned

    NO

    MUL

    NULL

     

    pod_id

    bigint(20) unsigned

    NO

    MUL

    NULL

     

    cluster_id

    bigint(20) unsigned

    NO

    MUL

    NULL

     

    host_id

    bigint(20) unsigned

    NO

    MUL

    NULL

     

    domain_id

    bigint(20) unsigned

    YES

    MUL

    NULL

     

    account_id

    bigint(20) unsigned

    YES

    MUL

    NULL

     

    implicit_dedication

    tinyint(1) unsigned

    NO

    MUL

    0

     

UI flow

  • TBD
  • Pluggable UI when ImplicitDedicationPlanner is selected in ServiceOffering

DRS? 

  • This is applicable only for placement operations through CloudStack. This implementation is to only support scenarios where the HV does not do HA or DRS.