Package org.btrplace.plan.event
Class MigrateVM
java.lang.Object
org.btrplace.plan.event.Action
org.btrplace.plan.event.MigrateVM
- All Implemented Interfaces:
Event
,RunningVMPlacement
,VMEvent
public class MigrateVM extends Action implements RunningVMPlacement
Migrate a running VM from one online node to another one.
It is possible to parametrise the action with the amount of bandwidth
to reserve to perform the operation.
- Author:
- Fabien Hermenier
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description boolean
applyAction(Model i)
Make the VM running on the destination node in the given model.boolean
equals(Object o)
int
getBandwidth()
Get the bandwidth reserved for the migrationNode
getDestinationNode()
Get the destination node for the VM.Node
getSourceNode()
Get the source node that is currently hosting the VM.VM
getVM()
Get the VM to involved in the action.int
hashCode()
String
pretty()
Pretty print of the action.boolean
setBandwidth(int bandwidth)
Set the bandwidth to reserve for the operation.Object
visit(ActionVisitor v)
Notify a visitor to visit the action.Methods inherited from class org.btrplace.plan.event.Action
addEvent, apply, applyEvents, getEnd, getEvents, getStart, toString
-
Constructor Details
-
MigrateVM
Make a new action.- Parameters:
v
- the VM to migratefrom
- the node the VM is currently running onto
- the node where to place the VMstart
- the moment the action will consumeend
- the moment the action will stopbandwidth
- the reserved bandwidth in MB.Integer.MAX_VALUE
for an unlimited bandwidth
-
MigrateVM
Make a new action with an unlimited bandwidth.- Parameters:
v
- the VM to migratefrom
- the node the VM is currently running onto
- the node where to place the VMstart
- the moment the action will consumeend
- the moment the action will stop
-
-
Method Details
-
getSourceNode
Get the source node that is currently hosting the VM.- Returns:
- the node identifier
-
getBandwidth
public int getBandwidth()Get the bandwidth reserved for the migration- Returns:
- an amount in megabytes.
Integer.MAX_VALUE
for an unlimited bandwidth
-
getDestinationNode
Description copied from interface:RunningVMPlacement
Get the destination node for the VM.- Specified by:
getDestinationNode
in interfaceRunningVMPlacement
- Returns:
- the node identifier
-
getVM
Description copied from interface:VMEvent
Get the VM to involved in the action. -
applyAction
Make the VM running on the destination node in the given model.- Specified by:
applyAction
in classAction
- Parameters:
i
- the model to alter with the action- Returns:
true
iff the VM is running on the destination node
-
equals
-
hashCode
public int hashCode() -
pretty
Description copied from class:Action
Pretty print of the action. -
visit
Description copied from interface:Event
Notify a visitor to visit the action. -
setBandwidth
public boolean setBandwidth(int bandwidth)Set the bandwidth to reserve for the operation. The value is in MB- Parameters:
bandwidth
- a positive value.Integer.MAX_VALUE
for an unlimited bandwidth- Returns:
true
if the value was positive
-