...
Code Block |
---|
public interface AffinityGroupProcessor extends Adapter { /** * process() is called to apply the affinity/anti-affinity rules to the deployment plan and avoid set for th given VM placement. * @param vm * virtual machine. * @param plan * deployment plan that tells you where it's being deployed to. * @param avoid * avoid these data centers, pods, clusters, or hosts. * @return DeployDestination for that virtual machine. */ void process(VirtualMachineProfile<? extends VirtualMachine> vm, DeploymentPlan plan, ExcludeList avoid); /** * getType() should return the affinity/anti-affinity group being implemented * @return String Affinity/Anti-affinity type */ String getType(); } |
We will provide default implementation of the host affinity rule. This processor will implement the AffinityGroupProcessor adapter.
...
Code Block |
---|
public interface DeploymentPlanner extends Adapter { /** * plan is called to determine where a virtual machine should be running. * * @param vm * virtual machine. * @param plan * deployment plan that tells you where it's being deployed to. * @param avoid * avoid these data centers, pods, clusters, or hosts. * @return DeployDestination for that virtual machine. */ DeployDestination plan(VirtualMachineProfile<? extends VirtualMachine> vm, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException; …} |
Following are the API additions and changes.
CreateAffinityGroup API
This is a new user API to create affinity groups for the account. Parameters include:
a) AccountName
b) DomainId
c) Name
d) Type (affinity/anti-affinity)
e) Description
ListAffinityGroups API
This is a new user API to list affinity groups.Parameters include:
a) Affinity group Id
b) Affinity group Name
c) VM Id
d) AccountName and DomainId
DeleteAffinityGroup API
This is a new user API to delete affinity groups. Parameters include:
a) Affinity group Id
b) Affinity group Name
c) VM Id
d) AccountName and DomainId
UpdateVMAffinityGroup API
This is a new user API to update the affinity groups assocaited with the VM. Parameters include:
a) List of Affinity group Ids OR
b) List of Affinity group Name
c) VM Id
DeployVirtualMachine API
User can set a list of affinity group Ids OR names during a VM deployment. Additional parameters:
a) affinitygroupids
b) affinitygroupnames
ListAffinityGroupTypes API
Lists the affinity/ anti-affinity types available in the zone.
...