org.glassfish.virtualization.spi
Class AllocationConstraints

java.lang.Object
  extended by org.glassfish.virtualization.spi.AllocationConstraints

public class AllocationConstraints
extends Object

Virtual machine allocation constraints such as groups to privilege or ignore.

Author:
Jerome Dochez

Constructor Summary
AllocationConstraints(TemplateInstance template, VirtualCluster targetCluster)
           
 
Method Summary
 Collection<ServerPool> affinities()
          Returns the groups this set of virtual machine allocations should be allocated into
 StaticVirtualMachineInfo getCharacteristics()
          Returns the requested characteristics for the virtual machines
 VirtualCluster getTargetCluster()
          Returns the virtual cluster this allocation is targeted to
 TemplateInstance getTemplate()
          Returns the template associated with the virtual machine order.
 Properties getVirtualMachineProperties()
          Returns the properties for a specific virtual machine allocation.
 AllocationConstraints in(ServerPool... groups)
          Specifies the serverPool in which the number of virtual machines should be allocated.
 AllocationConstraints noColocationWith(VirtualMachine... vms)
          Specifies the virtual machines that should not be co-located on the same hardware with the new allocated virtual machines.
 List<VirtualMachine> separateFrom()
          Returns a list of virtual machine we would like the new virtual machines to not be co-located with (meaning not running on the same hardware resource).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllocationConstraints

public AllocationConstraints(TemplateInstance template,
                             VirtualCluster targetCluster)
Method Detail

getTargetCluster

public VirtualCluster getTargetCluster()
Returns the virtual cluster this allocation is targeted to

Returns:
the target virtual cluster

getCharacteristics

public StaticVirtualMachineInfo getCharacteristics()
Returns the requested characteristics for the virtual machines

Returns:
a set of static virtual machine characteristics to use when allocating the new virtual machines or null if the template characteristics should apply.

in

public AllocationConstraints in(ServerPool... groups)
Specifies the serverPool in which the number of virtual machines should be allocated. If no serverPool is specified, it's left to the Infrastructure Management Service to decide in which groups those Virtual Machines will be allocated.

Parameters:
groups - desired serverPool instance
Returns:
itself

noColocationWith

public AllocationConstraints noColocationWith(VirtualMachine... vms)
Specifies the virtual machines that should not be co-located on the same hardware with the new allocated virtual machines. This is particularly useful when willing to allocate replication instances for existing virtual machines so they do not end up being running on the same hardware resource.

Parameters:
vms - list of virtual machines to not co-locate with.
Returns:
itself.

getVirtualMachineProperties

public Properties getVirtualMachineProperties()
Returns the properties for a specific virtual machine allocation. These properties will be passed to the virtual machine through a provider specific mechanism. Such properties can be used by the virtual machine to configure itself.

Returns:
the virtual machine properties

affinities

public Collection<ServerPool> affinities()
Returns the groups this set of virtual machine allocations should be allocated into

Returns:
the groups we should use to allocate the virtual machines if possible.

separateFrom

public List<VirtualMachine> separateFrom()
Returns a list of virtual machine we would like the new virtual machines to not be co-located with (meaning not running on the same hardware resource).

Returns:
a list of virtual machines to no co-locate new ones with.

getTemplate

public TemplateInstance getTemplate()
Returns the template associated with the virtual machine order.

Returns:
the template to use for the virtual machines allocation.


Copyright © 2012. All Rights Reserved.