|
||||||||||
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.resourcemodel.ResourceSpreader
hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.MaxMinFairSpreader
hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.MaxMinProvider
hu.mta.sztaki.lpds.cloud.simulator.iaas.PhysicalMachine
public class PhysicalMachine
Nested Class Summary | |
---|---|
class |
PhysicalMachine.PowerStateDelayer
|
static class |
PhysicalMachine.PowerStateKind
|
class |
PhysicalMachine.ResourceAllocation
|
static class |
PhysicalMachine.State
Represents the possible states of the physical machines modeled in the system |
static interface |
PhysicalMachine.StateChangeListener
|
Nested classes/interfaces inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader |
---|
ResourceSpreader.FreqSyncer |
Nested classes/interfaces inherited from interface hu.mta.sztaki.lpds.cloud.simulator.iaas.VMManager |
---|
VMManager.CapacityChangeEvent<F>, VMManager.NoSuchVMException, VMManager.VMManagementException |
Fields inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader |
---|
lastNotifTime, negligableProcessing, perTickProcessingPower, toBeAdded, toBeRemoved, underProcessing |
Constructor Summary | |
---|---|
PhysicalMachine(double cores,
double perCorePocessing,
long memory,
Repository disk,
double[] turnonOperations,
double[] switchoffOperations,
EnumMap<PhysicalMachine.PowerStateKind,EnumMap<PhysicalMachine.State,PowerState>> powerTransitions)
|
|
PhysicalMachine(double cores,
double perCorePocessing,
long memory,
Repository disk,
int onD,
int offD,
EnumMap<PhysicalMachine.PowerStateKind,EnumMap<PhysicalMachine.State,PowerState>> powerTransitions)
Defines a new physical machine, ensures that there are no VMs running so far |
Method Summary | |
---|---|
private void |
actualSwitchOff()
|
PhysicalMachine.ResourceAllocation |
allocateResources(ResourceConstraints requested,
boolean strict,
int allocationValidityLength)
Ensures the requested amount of resources are going to be available in the foreseeable future on this physical machine. |
boolean |
cancelAllocation(PhysicalMachine.ResourceAllocation allocation)
|
private boolean |
checkAllocationsPresence(PhysicalMachine.ResourceAllocation allocation)
|
void |
deployVM(VirtualMachine vm,
PhysicalMachine.ResourceAllocation ra,
Repository vaSource)
|
ResourceConstraints |
getCapacities()
|
long |
getCompletedVMs()
|
long |
getCurrentOnOffDelay()
|
PhysicalMachine.State |
getState()
|
protected boolean |
isAcceptableConsumption(ResourceConsumption con)
|
boolean |
isDirectConsumerUsageMoratory()
|
boolean |
isHostableRequest(ResourceConstraints requested)
|
boolean |
isHostingVMs()
|
boolean |
isRunning()
Determines if the machine can be used for VM instantiation. |
Collection<VirtualMachine> |
listVMs()
Provides an overview on the VMs currently in the system |
void |
migrateVM(VirtualMachine vm,
PhysicalMachine target)
Migrates a VM from the current system to another. |
int |
numofCurrentVMs()
|
private long |
prepareTransitionalTasks(boolean on,
double[] array)
|
void |
reallocateResources(VirtualMachine vm,
ResourceConstraints newresources)
Allows fine-grained resource utilization setup of the particular VM after it was allocated on the system. |
VirtualMachine[] |
requestVM(VirtualAppliance va,
ResourceConstraints rc,
Repository vaSource,
int count)
Initiates a VM on this physical machine. |
VirtualMachine[] |
requestVM(VirtualAppliance va,
ResourceConstraints rc,
Repository vaSource,
int count,
HashMap<String,Object> schedulingConstraints)
Scheduling constraints are ignored currently! As this is too low level to handle them in the current state of the simulator. |
private void |
setState(PhysicalMachine.State newState)
|
void |
subscribeStateChangeEvents(PhysicalMachine.StateChangeListener sl)
|
void |
subscribeToCapacityChanges(VMManager.CapacityChangeEvent<ResourceConstraints> e)
|
void |
subscribeToIncreasingFreeapacityChanges(VMManager.CapacityChangeEvent<ResourceConstraints> e)
|
boolean |
switchoff(PhysicalMachine migrateHere)
Starts the turn off procedure for the physical machine so it no longer accepts VM requests but it does not consume anymore |
void |
terminateVM(VirtualMachine vm,
boolean killTasks)
Terminates a VM in the system. |
String |
toString()
|
void |
turnon()
Turns on the physical machine so it allows energy and resource consumption and opens the possibility to receive VM requests. |
void |
unsubscribeFromCapacityChanges(VMManager.CapacityChangeEvent<ResourceConstraints> e)
|
void |
unsubscribeFromIncreasingFreeCapacityChanges(VMManager.CapacityChangeEvent<ResourceConstraints> e)
|
void |
unsubscribeStateChangeEvents(PhysicalMachine.StateChangeListener sl)
|
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.MaxMinProvider |
---|
getCounterPart, getSamePart, isConsumer, processSingleConsumption, updateConsumptionLimit |
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.MaxMinFairSpreader |
---|
singleGroupwiseFreqUpdater |
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader |
---|
getCurrentPowerBehavior, getPerTickProcessingPower, getSyncer, getTotalProcessed, hashCode, removeTheseConsumptions, setCurrentPowerBehavior, setPerTickProcessingPower, subscribePowerBehaviorChangeEvents, unsubscribePowerBehaviorChangeEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int defaultAllocLen
public static final int migrationAllocLen
public static final double smallUtilization
public static final EnumSet<PhysicalMachine.State> ToOnorRunning
public static final EnumSet<PhysicalMachine.State> ToOfforOff
public static final EnumSet<PhysicalMachine.State> StatesOfHighEnergyConsumption
private final ConstantConstraints totalCapacities
private final AlterableResourceConstraints internalAvailableCaps
public final UnalterableConstraintsPropagator availableCapacities
private AlterableResourceConstraints promisedCapacities
private final AlterableResourceConstraints internalReallyFreeCaps
public final UnalterableConstraintsPropagator freeCapacities
public final Repository localDisk
private PhysicalMachine.ResourceAllocation[] promisedResources
private int promisedAllocationsCount
private PhysicalMachine.State currentState
private final double[] onTransition
private final double[] offTransition
private final long onDelayEstimate
private final long offDelayEstimate
private final EnumMap<PhysicalMachine.State,PowerState> hostPowerBehavior
private final EnumMap<PhysicalMachine.State,PowerState> storagePowerBehavior
private final EnumMap<PhysicalMachine.State,PowerState> networkPowerBehavior
private final StateDependentEventHandler<PhysicalMachine.StateChangeListener,org.apache.commons.lang3.tuple.Pair<PhysicalMachine.State,PhysicalMachine.State>> stateListenerManager
private final HashSet<VirtualMachine> vms
public final Set<VirtualMachine> publicVms
private long completedVMs
private PhysicalMachine.PowerStateDelayer onOffEvent
private final StateDependentEventHandler<VMManager.CapacityChangeEvent<ResourceConstraints>,List<ResourceConstraints>> increasingFreeCapacityListenerManager
public final MaxMinConsumer directConsumer
private boolean directConsumerUsageMoratory
Constructor Detail |
---|
public PhysicalMachine(double cores, double perCorePocessing, long memory, Repository disk, int onD, int offD, EnumMap<PhysicalMachine.PowerStateKind,EnumMap<PhysicalMachine.State,PowerState>> powerTransitions)
cores
- defines the number of CPU cores this machine has under controlperCorePocessing
- defines the processing capabilities of a single CPU core in
this machine (in instructions/tick)memory
- defines the total physical memory this machine has under
control (in bytes)disk
- defines the local physical disk & networking this machine has
under controlonD
- defines the time delay between the machine's switch on and the
first time it can serve VM requestsoffD
- defines the time delay the machine needs to shut down all of
its operations while it does not serve any more VMspowerTransitions
- determines the applied power state transitions while the
physical machine state changes. This is the principal way to
alter a PM's energy consumption behavior.public PhysicalMachine(double cores, double perCorePocessing, long memory, Repository disk, double[] turnonOperations, double[] switchoffOperations, EnumMap<PhysicalMachine.PowerStateKind,EnumMap<PhysicalMachine.State,PowerState>> powerTransitions)
Method Detail |
---|
private long prepareTransitionalTasks(boolean on, double[] array)
on
- which taskset needs to be preparedarray
- the task array
public boolean switchoff(PhysicalMachine migrateHere) throws VMManager.VMManagementException, NetworkNode.NetworkException
migrateHere
- the physical machine where the currently hosted VMs of this VM
should go before the actual switch off operation will happen
NetworkNode.NetworkException
VMManager.VMManagementException
private void actualSwitchOff()
public boolean isRunning()
public PhysicalMachine.State getState()
public void turnon()
public void migrateVM(VirtualMachine vm, PhysicalMachine target) throws VMManager.VMManagementException, NetworkNode.NetworkException
VMManager
migrateVM
in interface VMManager<PhysicalMachine,ResourceConstraints>
vm
- the VM to be relocatedtarget
- the target system that should host the VM in the future
VMManager.NoSuchVMException
- if the request was issued for a VM unknown in the system
VMManager.VMManagementException
- if the request cannot be fulfilled for some reason
NetworkNode.NetworkException
public void reallocateResources(VirtualMachine vm, ResourceConstraints newresources)
VMManager
reallocateResources
in interface VMManager<PhysicalMachine,ResourceConstraints>
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 thempublic PhysicalMachine.ResourceAllocation allocateResources(ResourceConstraints requested, boolean strict, int allocationValidityLength) throws VMManager.VMManagementException
requested
- The amount of resources needed by the caller
VMManager.VMManagementException
private boolean checkAllocationsPresence(PhysicalMachine.ResourceAllocation allocation)
public boolean cancelAllocation(PhysicalMachine.ResourceAllocation allocation)
public boolean isHostableRequest(ResourceConstraints requested)
public void deployVM(VirtualMachine vm, PhysicalMachine.ResourceAllocation ra, Repository vaSource) throws VMManager.VMManagementException, NetworkNode.NetworkException
VMManager.VMManagementException
NetworkNode.NetworkException
public VirtualMachine[] requestVM(VirtualAppliance va, ResourceConstraints rc, Repository vaSource, int count) throws VMManager.VMManagementException, NetworkNode.NetworkException
va
- The appliance for the VM to be created.rc
- The resource requirements of the VMvaSource
- The storage where the VA resides.count
- The number of VMs to be created with the above specification
VMManagementException
- If the machine is not accepting requests currently.VMManager.VMManagementException
NetworkNode.NetworkException
public VirtualMachine[] requestVM(VirtualAppliance va, ResourceConstraints rc, Repository vaSource, int count, HashMap<String,Object> schedulingConstraints) throws VMManager.VMManagementException, NetworkNode.NetworkException
requestVM
in interface VMManager<PhysicalMachine,ResourceConstraints>
va
- the kind of VM to be created
VMManager.VMManagementException
- if the request cannot be fulfilled for some reason
NetworkNode.NetworkException
public void terminateVM(VirtualMachine vm, boolean killTasks) throws VMManager.NoSuchVMException, VMManager.VMManagementException
VMManager
terminateVM
in interface VMManager<PhysicalMachine,ResourceConstraints>
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()
VMManager
listVMs
in interface VMManager<PhysicalMachine,ResourceConstraints>
public int numofCurrentVMs()
protected boolean isAcceptableConsumption(ResourceConsumption con)
isAcceptableConsumption
in class ResourceSpreader
public boolean isHostingVMs()
public long getCompletedVMs()
public long getCurrentOnOffDelay()
public String toString()
toString
in class MaxMinProvider
public void subscribeStateChangeEvents(PhysicalMachine.StateChangeListener sl)
public void unsubscribeStateChangeEvents(PhysicalMachine.StateChangeListener sl)
private void setState(PhysicalMachine.State newState)
public ResourceConstraints getCapacities()
getCapacities
in interface VMManager<PhysicalMachine,ResourceConstraints>
public void subscribeToCapacityChanges(VMManager.CapacityChangeEvent<ResourceConstraints> e)
subscribeToCapacityChanges
in interface VMManager<PhysicalMachine,ResourceConstraints>
public void unsubscribeFromCapacityChanges(VMManager.CapacityChangeEvent<ResourceConstraints> e)
unsubscribeFromCapacityChanges
in interface VMManager<PhysicalMachine,ResourceConstraints>
public void subscribeToIncreasingFreeapacityChanges(VMManager.CapacityChangeEvent<ResourceConstraints> e)
public void unsubscribeFromIncreasingFreeCapacityChanges(VMManager.CapacityChangeEvent<ResourceConstraints> e)
public boolean isDirectConsumerUsageMoratory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |