Versions Compared

Key

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

...

  • Admin decides what are the affinity/anti-affinity types available to the users.
  • This depends on which AffinityGroupProcessor plugins are included in the deployment. Each AffinityGroupProcessor plugin implements a certain affinity/anti-affinity and exposes the type it implements.

User

  • User can list the affinity /anti-affinity types available using listAffinityTypes API
  • User creates affinity /anti-affinity group using a type available
  • During VM deployment, user can specify affinity/anti-affinity group Ids or names to be associated with the VM. Looking at the affinity group, the corresponding plugin that can handle this type will then process to set the deployment scope.
  • User can list the affinity /anti-affinity groups of a VM
  • User can delete/update the affinity /anti-affinity groups a VM is associated to.
  • User can delete the affinity /anti-affinity group only if there are no VM's associated with it.

...

The high level functional breakdown of the feature is as follows:

  • New API to list affinity types available.
  • New user APIs to create and list Affinity groups based on affinity types available.
  • Ability to associate affinity groups to VMs during deployment.
  • AffinityGroupProcessor adapter that defines the interface needed to implement an affinity type. This can be implemented by a plugin to add affinity/anti-affinity types to CloudStack.
  • A default HostAffinityProcessor plugin that implements this adapter and processes the host affinity rule.
  • A default HostAntiAffinityProcessor plugin that implements this adapter and processes the host anti-affinity rule.
  • DeploymentPlanningManager - a manager which contains planning for volume, vm, and network.
    • For VM deployment, this manager will be invoked by VirtualMachineManager to handle the following:
      • Process Affinity
    Planner – a planner that takes into account the affinity groups of the VM during placement
      • /Anti-affinity - Call the chain of AffinityGroupProcessor adapters to set deploymentplan scope and exclude list
      • Call DeploymentPlanner - to use heuristics to find the best spot to place the vm/volume. Planner will drill down to the write set of clusters to look for placement based on various heuristics.
      • Call Allocators - Given a cluster, allocators matches the requirements to capabilities of the physical resource (host, storage pool).

AffinityGroupProcessor Adapter

...