|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.cod.control.XenControl
public class XenControl
XenControl handles virtual machine reservations (e.g., Xen) for an authority-side mapper (CodMapper). VMs are hosted on inventory nodes running VMMs. Each VM occupies a "sliver" of the hosting node. The key issues are (1) how to bin-pack VMs onto VMMs, and (2) how to assign resources to each sliver. These problems are particularly difficult if reservations "flex" in a way that changes the size of the slivers. The job here is basically to create and release virtual Node objects to represent the virtual machines. Configuration properties (e.g., names and addresses) are assigned on transferIn() of the node to an AuthoritySlice, and the VM is instantiated in the subsequent RAL call from NodeGroup. Currently the allocation policy has the following limitations: - Any flex in a reservation results in a change in the number of VMs, rather than a sliver flex. To flex VM slivers, we need better tracking of slivers, and a way to short-circuit priming of any resources added to the VMs, i.e., AuthorityReservation must distinguish growing VMs from growing the number of VMs in a reservation. - The resources assigned to a VM/sliver are in units of "computons". Computons are simple because they define a fixed "resource ratio" of hardware resources (e.g., CPU:memory:disk following Amdahl's rule). We have no way to allocate slivers with different resource ratios from the same host. The idea of supporting a discrete set of computon types with different ratios has been called "molecules" or "compounds". The current scheme can handle multiple compounds, but it (in essence) statically partitions compound types across the VMM inventory. - VMMs are divided into "pools" indexed by type. Thus each pool must have a different type. All hosting servers (VMMs) in a pool are viewed as equivalent and interchangeable. - Each pool/type has a configured computonsPerNode. Different pools/types may have different computonsPerNode, even if the physical servers in the pools are equivalent. - If type T is a VMM type, then a request for one unit of type T is filled with one VM bound to one computon on a VMM node of type T. For example, a given class of server might be split into multiple pools for small, medium, and large VMs: pools with fewer computonsPerNode host larger VMs. Note also that the resource ratio of each VM is the same as its hosting server, thus we can divide different server classes with different resource ratios (e.g., big memory vs. small memory) into different pools; VMs allocated from the big-memory pool have more memory than those allocated from the small-memory pool.
| Field Summary | |
|---|---|
protected IActor |
actor
|
protected ID |
guid
|
protected LoggingTool |
logger
|
protected java.util.HashMap<ResourceType,ResourceSet> |
nodePools
|
protected java.util.HashMap<ResourceType,BinPool> |
pools
Hosting candidates (VMMs) for each VM type are indexed by their free capacity in BinPools, one pool for each type. |
static java.lang.String |
PropertyGuid
|
static java.lang.String |
PropertyResourceTypePrefix
|
static java.lang.String |
PropertyResourceTypesCount
|
static java.lang.String |
ResourceComputonsPrefix
|
| Constructor Summary | |
|---|---|
XenControl()
|
|
| Method Summary | |
|---|---|
ResourceSet |
assign(AuthorityReservation r)
Allocates virtual machines to fill a request that has been approved by the mapper. |
protected ResourceSet |
assign(AuthorityReservation r,
ResourceType type,
int needed)
|
void |
available(ResourceSet rset)
|
void |
configSlivers(ResourceType type,
int computonsPerNode)
Indicate that VMM nodes of a particular type are to be broken into a specified number of computons per node. |
void |
configure(java.util.Properties p)
|
ResourceSet |
correctDeficit(AuthorityReservation r)
|
ResourceSet |
correctFailed(ResourceSet rset)
|
void |
donate(ResourceSet rset)
Registers server-side VMM inventory. |
void |
eject(ResourceSet rset)
|
void |
freed(ResourceSet rset)
|
ID |
getGuid()
|
ResourceType[] |
getTypes()
|
protected NodeGroup |
groupFromSet(ResourceSet rset)
Returns the NodeGroup underlying a given resource set. |
void |
initialize()
Initializes the object. |
protected void |
instantiateVMs(NodeGroup group,
BinPool pool,
int needed,
int computons,
ResourceType type)
Fills a NodeGroup with virtual Node objects to fill a virtual reservation request, allocated from selected host nodes in the specified VMM pool. |
protected void |
internalError(java.lang.String string)
|
protected void |
logError(java.lang.String string)
|
void |
logException(java.lang.String err,
java.lang.Exception e)
|
protected BinPool |
poolForRequest(ResourceType type)
Returns the BinPool with allocation state for VMM inventory of the type matching the passed resource set. |
void |
release(ResourceSet rset)
Releases VM resources back to their inventory pool. |
protected void |
releaseToVMMs(NodeGroup group,
BinPool pool)
Releases the computons held by virtual nodes in a NodeGroup back to their hosting VMMs, and detaches the nodes from the NodeGroup. |
void |
reset(java.util.Properties p)
De-serializes the object from the given properties list. |
protected void |
resetSlivers(java.util.Properties p)
|
protected void |
revisit(BinPool pool,
NodeGroup inventory,
NodeGroup incoming)
Reallocates the computons held by virtual nodes in a NodeGroup from their hosting VMMs. |
void |
revisit(IActor actor,
java.util.Properties p)
Recovers state of the component using a previously saved properties list and a references to the actor this component belongs to. |
void |
revisit(ResourceReservation r)
Reallocate VM resources from their inventory pool. |
java.util.Properties |
save()
Serializes the object into a properties list. |
void |
save(java.util.Properties p)
Serializes the object into the given properties list. |
protected void |
saveSlivers(java.util.Properties p)
|
protected Node |
selectAndGetFromVMM(BinPool pool,
int computons)
Selects a VMM to host a new virtual machine, and allocates the requested number of computons from it. |
void |
setActor(IActor actor)
|
protected IConcreteSet |
shrink(AuthorityReservation r,
int toRemove)
|
int |
unavailable(ResourceSet rset)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PropertyResourceTypesCount
public static final java.lang.String PropertyResourceTypePrefix
public static final java.lang.String ResourceComputonsPrefix
public static final java.lang.String PropertyGuid
protected ID guid
protected LoggingTool logger
protected java.util.HashMap<ResourceType,BinPool> pools
protected java.util.HashMap<ResourceType,ResourceSet> nodePools
protected IActor actor
| Constructor Detail |
|---|
public XenControl()
| Method Detail |
|---|
public void setActor(IActor actor)
setActor in interface IResourceControl
public void initialize()
throws java.lang.Exception
IInitialize
initialize in interface IInitializejava.lang.Exception
public void configSlivers(ResourceType type,
int computonsPerNode)
type - node typecomputonsPerNode - how many computons per node
public void eject(ResourceSet rset)
throws java.lang.Exception
eject in interface IResourceControljava.lang.Exception
public void available(ResourceSet rset)
throws java.lang.Exception
available in interface IResourceControljava.lang.Exception
public int unavailable(ResourceSet rset)
throws java.lang.Exception
unavailable in interface IResourceControljava.lang.Exception
public void donate(ResourceSet rset)
throws java.lang.Exception
donate in interface IResourceControlrset - the resources being donated
java.lang.Exception
public ResourceSet correctDeficit(AuthorityReservation r)
throws java.lang.Exception
correctDeficit in interface IResourceControljava.lang.Exception
public ResourceSet assign(AuthorityReservation r)
throws java.lang.Exception
assign in interface IResourceControliset - inventory set to fill request fromneeded - number of units needed to fill request
java.lang.Exception - with no side effects if error
protected ResourceSet assign(AuthorityReservation r,
ResourceType type,
int needed)
throws java.lang.Exception
java.lang.Exception
protected IConcreteSet shrink(AuthorityReservation r,
int toRemove)
throws java.lang.Exception
java.lang.Exception
public void freed(ResourceSet rset)
throws java.lang.Exception
freed in interface IResourceControljava.lang.Exception
public void release(ResourceSet rset)
throws java.lang.Exception
release in interface IResourceControlrset - the resource set being released
java.lang.Exception
public void revisit(ResourceReservation r)
throws java.lang.Exception
revisit in interface IResourceControlrset - the resource set being reallocated
java.lang.Exception
protected void instantiateVMs(NodeGroup group,
BinPool pool,
int needed,
int computons,
ResourceType type)
throws java.lang.Exception
group - empty NodeGroup to fill with virtual nodespool - inventory pool of VMM candidates to allocate fromneeded - number of VMs neededcomputons - the number of computons per VM
java.lang.Exception - if allocation is incomplete
protected void releaseToVMMs(NodeGroup group,
BinPool pool)
protected void revisit(BinPool pool,
NodeGroup inventory,
NodeGroup incoming)
protected Node selectAndGetFromVMM(BinPool pool,
int computons)
throws java.lang.Exception
pool - inventory pool of candidate VMMscomputons - number of computons to allocate
java.lang.Exception - if no eligible candidates
protected NodeGroup groupFromSet(ResourceSet rset)
throws java.lang.Exception
rset - resource set of some type
java.lang.Exception - if no concrete set, or if not a NodeGroup
protected BinPool poolForRequest(ResourceType type)
throws java.lang.Exception
rset - resource set of some type
java.lang.Exception - if no inventory pool
protected void internalError(java.lang.String string)
throws java.lang.Exception
java.lang.Exceptionprotected void logError(java.lang.String string)
public void logException(java.lang.String err,
java.lang.Exception e)
protected void saveSlivers(java.util.Properties p)
throws java.lang.Exception
java.lang.Exception
protected void resetSlivers(java.util.Properties p)
throws java.lang.Exception
java.lang.Exception
public java.util.Properties save()
throws java.lang.Exception
ISerialize
save in interface ISerializejava.lang.Exception
public void save(java.util.Properties p)
throws java.lang.Exception
ISerialize
save in interface ISerializep - properties list to serialize the object into
java.lang.Exception
public void reset(java.util.Properties p)
throws java.lang.Exception
ISerialize
reset in interface ISerializep - properties list containing the serialized version of
the object
java.lang.Exception
public void revisit(IActor actor,
java.util.Properties p)
throws java.lang.Exception
IRecover
revisit in interface IRecoveractor - actor object the component belongs top - properties list containing configuration data about the
component
java.lang.Exceptionpublic ResourceType[] getTypes()
getTypes in interface IResourceControl
public void configure(java.util.Properties p)
throws java.lang.Exception
java.lang.Exception
public ResourceSet correctFailed(ResourceSet rset)
throws java.lang.Exception
correctFailed in interface IResourceControljava.lang.Exceptionpublic ID getGuid()
getGuid in interface IResourceControl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||