|
OpenNebula Cloud API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opennebula.client.PoolElement org.opennebula.client.vm.VirtualMachine
public class VirtualMachine
This class represents an OpenNebula VM. It also offers static XML-RPC call wrappers.
Field Summary |
---|
Fields inherited from class org.opennebula.client.PoolElement |
---|
client, id, xml, xpath |
Constructor Summary | |
---|---|
|
VirtualMachine(int id,
Client client)
Creates a new VM representation. |
protected |
VirtualMachine(org.w3c.dom.Node xmlElement,
Client client)
|
Method Summary | |
---|---|
protected OneResponse |
action(java.lang.String action)
Submits an action to be performed on the virtual machine. |
static OneResponse |
allocate(Client client,
java.lang.String description)
Allocates a new VM in OpenNebula. |
OneResponse |
cancel()
Cancels the running VM. |
OneResponse |
deploy(int hostId)
Initiates the instance of the VM on the target host. |
OneResponse |
finalizeVM()
Deletes the VM from the pool and database. |
OneResponse |
hold()
Sets the VM to hold state. |
OneResponse |
info()
Loads the xml representation of the virtual machine. |
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given VM. |
int |
lcmState()
Returns the LCM state of the VirtualMachine (numeric value). |
java.lang.String |
lcmStateStr()
Returns the LCM state of the VirtualMachine (string value). |
OneResponse |
liveMigrate(int hostId)
Performs a live migration of the virtual machine to the target host (hid). |
OneResponse |
migrate(int hostId)
Migrates the virtual machine to the target host (hid). |
OneResponse |
migrate(int hostId,
boolean live)
Migrates the virtual machine to the target host (hid). |
OneResponse |
release()
Releases a virtual machine from hold state. |
OneResponse |
restart()
Resubmits the virtual machine after failure. |
OneResponse |
resume()
Resumes the execution of a saved VM. |
OneResponse |
shutdown()
Shuts down the already deployed VM. |
int |
state()
Performs an xpath evaluation for the "state" expression. |
java.lang.String |
stateStr()
Returns the VM state of the VirtualMachine (string value). |
java.lang.String |
status()
Returns the short status string for the VirtualMachine. |
OneResponse |
stop()
Stops the virtual machine. |
OneResponse |
suspend()
Suspends the virtual machine. |
Methods inherited from class org.opennebula.client.PoolElement |
---|
getId, getName, processInfo, xpath |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VirtualMachine(int id, Client client)
id
- The virtual machine Id (vid).client
- XML-RPC Client.protected VirtualMachine(org.w3c.dom.Node xmlElement, Client client)
PoolElement
Method Detail |
---|
public static OneResponse allocate(Client client, java.lang.String description)
client
- XML-RPC Client.description
- A string containing the template of the vm.
public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.
public OneResponse info()
info(Client, int)
public OneResponse deploy(int hostId)
hostId
- The host id (hid) of the target host where
the VM will be instantiated.
protected OneResponse action(java.lang.String action)
action
- The action name to be performed, can be:public OneResponse migrate(int hostId, boolean live)
hostId
- The target host id (hid) where we want to migrate
the vm.live
- If true we are indicating that we want livemigration,
otherwise false.
public OneResponse shutdown()
public OneResponse cancel()
public OneResponse hold()
public OneResponse release()
public OneResponse stop()
public OneResponse suspend()
public OneResponse resume()
public OneResponse finalizeVM()
public OneResponse restart()
public OneResponse migrate(int hostId)
migrate(int, boolean)
with live set to false.
hostId
- The target host id (hid) where we want to migrate
the vm.
public OneResponse liveMigrate(int hostId)
migrate(int, boolean)
with live set to true.
hostId
- The target host id (hid) where we want to migrate
the vm.
public int state()
PoolElement
state
in class PoolElement
public java.lang.String stateStr()
public int lcmState()
public java.lang.String lcmStateStr()
public java.lang.String status()
|
OpenNebula Cloud API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |