|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.iaas.IaaSService
public class IaaSService
This class represents a single IaaS service. It's tasks are the maintenance and management of the physical machines and the scheduling of the VM requests among the PMs.
Nested Class Summary | |
---|---|
static class |
IaaSService.IaaSHandlingException
This class represents a generic error that occurred during the operation of the IaaS service. |
Nested classes/interfaces inherited from interface hu.mta.sztaki.lpds.cloud.simulator.iaas.VMManager |
---|
VMManager.CapacityChangeEvent<F>, VMManager.NoSuchVMException, VMManager.VMManagementException |
Field Summary | |
---|---|
private StateDependentEventHandler<VMManager.CapacityChangeEvent<PhysicalMachine>,List<PhysicalMachine>> |
capacityListenerManager
event handler for capacity changes in terms of added/removed physical machines |
private ArrayList<PhysicalMachine> |
internalMachines
The actual writable list of the machine set maintained behind this IaaSService WARNING: The order of internal machines is not guaranteed |
private ArrayList<Repository> |
internalRepositories
The list of repositories under direct control of this IaaS service - this is for internal purposes the list is writeable The order of internal repositories is not guaranteed |
private ArrayList<PhysicalMachine> |
internalRunningMachines
The actual writable list of the running machine set maintained behind this IaaSService WARNING: The order of internal running machines is not guaranteed |
List<PhysicalMachine> |
machines
publicly available read only version of the internal machines field |
PhysicalMachineController |
pmcontroller
the PM scheduler applied by this IaaSService object |
private ResourceConstraints |
publicRCap
The capacity of the running machines to be reported externally. |
private ResourceConstraints |
publicTCap
the total capacity to be reported for external users. |
List<Repository> |
repositories
the read only list of all repositories in the system |
private AlterableResourceConstraints |
runningCapacity
the capacity of the machines that are actually running in the system - this is for internal use only again |
List<PhysicalMachine> |
runningMachines
publicly available read only version of the internal running machines field |
Scheduler |
sched
the VM scheduler applied by this IaaSservice object |
private AlterableResourceConstraints |
totalCapacity
the total capacity of all machines in this iaas service, for use only internally in the IaaS service class |
Constructor Summary | |
---|---|
IaaSService(Class<? extends Scheduler> s,
Class<? extends PhysicalMachineController> c)
Constructs an IaaS service object directly. |
Method Summary | |
---|---|
void |
bulkHostRegistration(List<PhysicalMachine> newPMs)
This function allows rapid registration of several PMs |
private PhysicalMachine |
checkVMHost(VirtualMachine vm)
Determines if the VM is hosted locally in one of the physical machines of this IaaSServie |
void |
deregisterHost(PhysicalMachine pm)
This function allows the IaaS to reduce in size. |
void |
deregisterRepository(Repository r)
This function allows the IaaS to reduce its storage capacities. |
ResourceConstraints |
getCapacities()
returns with the total capacities of this service (cumulative value for all its PMs) |
ResourceConstraints |
getRunningCapacities()
returns with the total running capacities of this service (cumulative value for all its PMs that are in a running state) |
boolean |
isRegisteredHost(PhysicalMachine pm)
A function to determine if a host is within the premises of this IaaSService. |
Collection<VirtualMachine> |
listVMs()
lists all VMs running or requested (and queued at a VM scheduler) from the IaaSservice |
void |
migrateVM(VirtualMachine vm,
IaaSService target)
Not implemented! Will allow migrating VMs across IaaSServices. |
private void |
realDeregistration(PhysicalMachine pm)
Really deregisters a PM from the list of PMs. |
void |
reallocateResources(VirtualMachine vm,
ResourceConstraints newresources)
NOT IMPLEMENTED! Reallocates the VM's resources according to the newresources on the host of the VM. |
void |
registerHost(PhysicalMachine pm)
This function allows the IaaS to grow in size with a single PM |
void |
registerRepository(Repository r)
This function allows the IaaS to grow its storage capacities |
VirtualMachine[] |
requestVM(VirtualAppliance va,
ResourceConstraints rc,
Repository vaSource,
int count)
Allows the request of multiple VMs without propagating any scheduling constraints. |
VirtualMachine[] |
requestVM(VirtualAppliance va,
ResourceConstraints rc,
Repository vaSource,
int count,
HashMap<String,Object> schedulingConstraints)
Allows the request of multiple VMs. |
void |
stateChanged(PhysicalMachine pm,
PhysicalMachine.State oldState,
PhysicalMachine.State newState)
Implements the PhysicalMachine's state change listener to manage the internalRunningMachines list. |
void |
subscribeToCapacityChanges(VMManager.CapacityChangeEvent<PhysicalMachine> e)
get notified about capacity changes (PM additions/removals) This call is propagated to StateDependentEventHandler. |
void |
terminateVM(VirtualMachine vm,
boolean killTasks)
Requesting the destruction of a VM in a DESTROYED state will dequeue the VM from the scheduler's request queue. |
String |
toString()
Provides a convenient way to debug the IaaS. |
void |
unsubscribeFromCapacityChanges(VMManager.CapacityChangeEvent<PhysicalMachine> e)
cancel the notifications about capacity changes (PM additions/removals) This call is propagated to StateDependentEventHandler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final ArrayList<PhysicalMachine> internalMachines
private final ArrayList<PhysicalMachine> internalRunningMachines
public final List<PhysicalMachine> machines
public final List<PhysicalMachine> runningMachines
private AlterableResourceConstraints totalCapacity
private ResourceConstraints publicTCap
private AlterableResourceConstraints runningCapacity
private ResourceConstraints publicRCap
private final StateDependentEventHandler<VMManager.CapacityChangeEvent<PhysicalMachine>,List<PhysicalMachine>> capacityListenerManager
private final ArrayList<Repository> internalRepositories
public final List<Repository> repositories
public final Scheduler sched
public final PhysicalMachineController pmcontroller
Constructor Detail |
---|
public IaaSService(Class<? extends Scheduler> s, Class<? extends PhysicalMachineController> c) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
s
- class of the VM scheduler to be usedc
- class of the PM scheduler to be used
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
NoSuchMethodException
SecurityException
Method Detail |
---|
public void migrateVM(VirtualMachine vm, IaaSService target)
migrateVM
in interface VMManager<IaaSService,PhysicalMachine>
vm
- the VM to be relocatedtarget
- the target system that should host the VM in the futureprivate PhysicalMachine checkVMHost(VirtualMachine vm) throws VMManager.NoSuchVMException
vm
- the VM to be checked
NoSuchVMException
- if the VM is not hosted by any of the PMs in the system
VMManager.NoSuchVMException
public void reallocateResources(VirtualMachine vm, ResourceConstraints newresources) throws VMManager.NoSuchVMException, VMManager.VMManagementException
reallocateResources
in interface VMManager<IaaSService,PhysicalMachine>
vm
- The VM to be adjustednewresources
- The new amount of resources needed (this could not only raise
the available resources of the VM but also decrease them
VMManager.NoSuchVMException
- if the request was issued for a VM unknown in the system
VMManager.VMManagementException
- if the request cannot be fulfilled for some reasonpublic VirtualMachine[] requestVM(VirtualAppliance va, ResourceConstraints rc, Repository vaSource, int count) throws VMManager.VMManagementException, NetworkNode.NetworkException
va
- the VA to be used as the disk of the VMrc
- the resource requirements of the future VMvaSource
- the repository that currently stores the VAcount
- the number of VMs that this request should be returning with
VMManagementException
- if there are no pms that could run the VMs. or if the request
is too big to be hosted across the complete infrastructure
NetworkNode.NetworkException
- if there are network connectivity problems within the
infrastructure
VMManager.VMManagementException
public VirtualMachine[] requestVM(VirtualAppliance va, ResourceConstraints rc, Repository vaSource, int count, HashMap<String,Object> schedulingConstraints) throws VMManager.VMManagementException, NetworkNode.NetworkException
requestVM
in interface VMManager<IaaSService,PhysicalMachine>
va
- the VA to be used as the disk of the VMrc
- the resource requirements of the future VMvaSource
- the repository that currently stores the VAcount
- the number of VMs that this request should be returning withschedulingConstraints
- The VM scheduler dependent additional requirements for the
newly requested VMs (e.g. please go for a specific host etc.)
For understanding what you can send here please have a look at
the documentation of the particular VM scheduler in question.
VMManagementException
- if there are no pms that could run the VMs. or if the request
is too big to be hosted across the complete infrastructure
NetworkNode.NetworkException
- if there are network connectivity problems within the
infrastructure
VMManager.VMManagementException
public void terminateVM(VirtualMachine vm, boolean killTasks) throws VMManager.NoSuchVMException, VMManager.VMManagementException
terminateVM
in interface VMManager<IaaSService,PhysicalMachine>
vm
- the VM to be terminated
VMManager.NoSuchVMException
- if the request was issued for a VM unknown in the system
VMManager.VMManagementException
- if the request cannot be fulfilled for some reasonpublic Collection<VirtualMachine> listVMs()
listVMs
in interface VMManager<IaaSService,PhysicalMachine>
public void registerHost(PhysicalMachine pm)
pm
- the new physical machine to be utilized within the systempublic void bulkHostRegistration(List<PhysicalMachine> newPMs)
newPMs
- the list of PMs to be registeredprivate void realDeregistration(PhysicalMachine pm)
pm
- the PM to be deregisteredpublic void deregisterHost(PhysicalMachine pm) throws IaaSService.IaaSHandlingException
pm
- the physical machine to be dropped from the control of the
system
IaaSService.IaaSHandlingException
public void registerRepository(Repository r)
r
- the new repository to be utilized within the systempublic void deregisterRepository(Repository r) throws IaaSService.IaaSHandlingException
r
- the repository to be dropped from the control of the system
IaaSService.IaaSHandlingException
public ResourceConstraints getCapacities()
getCapacities
in interface VMManager<IaaSService,PhysicalMachine>
public ResourceConstraints getRunningCapacities()
public void subscribeToCapacityChanges(VMManager.CapacityChangeEvent<PhysicalMachine> e)
subscribeToCapacityChanges
in interface VMManager<IaaSService,PhysicalMachine>
e
- the listener object which expects capacity change eventspublic void unsubscribeFromCapacityChanges(VMManager.CapacityChangeEvent<PhysicalMachine> e)
unsubscribeFromCapacityChanges
in interface VMManager<IaaSService,PhysicalMachine>
e
- the listener object that no longer expects capacity change eventspublic boolean isRegisteredHost(PhysicalMachine pm)
pm
- the host in question
public String toString()
toString
in class Object
public void stateChanged(PhysicalMachine pm, PhysicalMachine.State oldState, PhysicalMachine.State newState)
stateChanged
in interface PhysicalMachine.StateChangeListener
pm
- the physical machine that is involved in the state changeoldState
- the state the PM was in before this state change event was
deliverednewState
- the new state the PM will be in after the event is
complete
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |