Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ow2.jasmine.vmm.api
Interface VirtualMachineMXBean

All Superinterfaces:
  ManagedResourceMXBean

    public interface VirtualMachineMXBean

extends ManagedResourceMXBean

Management interface of a virtual machine. The `ObjectName` for identifying a VirtualMachineMXBean follows the following template:

`org.ow2.jasmine.vmm.api:type=VirtualMachine,name=<pathname>,uuid=<uuid>`

The notifications that can be emitted by a HostMXBean are as follows

- NotificationTypes.VM_MIGRATION when the VM has migrated to a new host
- NotificationTypes.VM_STATE_CHANGE when the power state of the VM has changed

Nested Class Summary
`static class` | `VirtualMachineMXBean.PowerState` Different states of a virtual machine.

Method Summary
`boolean` | `canLiveMigrateToHost(HostMXBean targetHost)` Returns true if the VM can be migrated to the given host using live migration
`void` | `destroy()` Destroy the VM
`float` | `getCPULoad()` Returns the CPU load of the VM
`java.lang.String` | `getGuestIpAddress()` Returns the IP addresses of the guest operating system running within the VM.
`HostMXBean` | `getHostMBean()` Returns the host this VM resides on
`float[]` | `getLoadPerVCPU()` Returns the load per virtual CPU of the VM
`java.lang.String` | `getMacAddress()` Returns the MAC addresses of all network interfaces associated with this VM
`long` | `getMemorySizeMB()` Returns the memory size in MBytes of the virtual machine
`long` | `getMemoryUsedMB()` Returns the amount of memory (in MBytes) used by the virtual machine
`java.lang.String` | `getNameLabel()` Returns the name of the virtual machine
`int` | `getNumVCPUs()` Returns the number of virtual CPUs assigned to the virtual machine
`int` | `getSchedulingCap()` Returns the scheduling cap assigned to the VM
`int` | `getSchedulingWeight()` Returns the scheduling weight assigned to the VM
`java.util.Date` | `getStartTime()` Returns the start time of the virtual machine
`VirtualMachineMXBean.PowerState` | `getState()` Returns the power state of the VM
`java.lang.String` | `getUserData(java.lang.String key)` Returns user data associated with the specified key
`java.lang.String` | `getUuid()` Returns the Uuid of the virtual machine
`void` | `makeTemplate(java.lang.String vmImageID, java.lang.String name, java.lang.String description)` Makes a VM image template from this VM
`void` | `migrate(HostMXBean targetHost, boolean live)` Migrate the VM to a target host.
`void` | `reboot()` Reboot the VM
`void` | `resume()` Resume the VM
`void` | `setMemorySizeMB(long size)` Attempts to change the memory sie of the virtual machine
`void` | `setNumVCPUs(int numVCPUs)` Changes the number of virtual CPUs assigned to the virtual machine
`void` | `setSchedulingCap(int schedulingCap)` Sets the scheduling cap assigned to the VM
`void` | `setSchedulingWeight(int schedulingWeight)` Sets the scheduling cap assigned to the VM
`void` | `shutdown()` Shutdown the VM
`void` | `start()` Start the VM
`void` | `suspend()` Suspend the VM

Methods inherited from interface org.ow2.jasmine.vmm.api.ManagedResourceMXBean
`getObjectName, getPath`

Method Detail

### getUuid

    java.lang.String getUuid()
                             throws javax.management.InstanceNotFoundException

  Returns the Uuid of the virtual machine

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getHostMBean

    HostMXBean getHostMBean()
                            throws javax.management.InstanceNotFoundException

  Returns the host this VM resides on

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getNameLabel

    java.lang.String getNameLabel()
                                  throws javax.management.InstanceNotFoundException

  Returns the name of the virtual machine

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getMacAddress

    java.lang.String getMacAddress()
                                   throws javax.management.InstanceNotFoundException

  Returns the MAC addresses of all network interfaces associated with this VM

  Returns:
    MAC addresses in xx:xx:xx:xx:xx:xx format
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getGuestIpAddress

    java.lang.String getGuestIpAddress()
                                       throws javax.management.InstanceNotFoundException

  Returns the IP addresses of the guest operating system running within the VM.

  Returns:
    IP addresses or null if the manager is unable to determine the IP addresses
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getLoadPerVCPU

    float[] getLoadPerVCPU()
                           throws javax.management.InstanceNotFoundException

  Returns the load per virtual CPU of the VM

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getCPULoad

    float getCPULoad()
                     throws javax.management.InstanceNotFoundException

  Returns the CPU load of the VM

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException`

### getStartTime

    java.util.Date getStartTime()
                                throws javax.management.InstanceNotFoundException

  Returns the start time of the virtual machine

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException`

### getMemorySizeMB

    long getMemorySizeMB()
                         throws javax.management.InstanceNotFoundException

  Returns the memory size in MBytes of the virtual machine

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException`

### setMemorySizeMB

    void setMemorySizeMB(long size)
                         throws javax.management.InstanceNotFoundException

  Attempts to change the memory sie of the virtual machine

  Parameters:
    `size` - target size
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getMemoryUsedMB

    long getMemoryUsedMB()
                         throws javax.management.InstanceNotFoundException

  Returns the amount of memory (in MBytes) used by the virtual machine

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getNumVCPUs

    int getNumVCPUs()
                    throws javax.management.InstanceNotFoundException

  Returns the number of virtual CPUs assigned to the virtual machine

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### setNumVCPUs

    void setNumVCPUs(int numVCPUs)
                     throws javax.management.InstanceNotFoundException

  Changes the number of virtual CPUs assigned to the virtual machine

  Parameters:
    `numVCPUs` -
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getSchedulingCap

    int getSchedulingCap()
                         throws javax.management.InstanceNotFoundException

  Returns the scheduling cap assigned to the VM

  Returns:
    current scheduling cap
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### setSchedulingCap

    void setSchedulingCap(int schedulingCap)
                          throws javax.management.InstanceNotFoundException

  Sets the scheduling cap assigned to the VM

  Parameters:
    `schedulingCap` - new cap
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getSchedulingWeight

    int getSchedulingWeight()
                            throws javax.management.InstanceNotFoundException

  Returns the scheduling weight assigned to the VM

  Returns:
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### setSchedulingWeight

    void setSchedulingWeight(int schedulingWeight)
                             throws javax.management.InstanceNotFoundException

  Sets the scheduling cap assigned to the VM

  Parameters:
    `schedulingWeight` - new weight
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### getState

    VirtualMachineMXBean.PowerState getState()
                                             throws javax.management.InstanceNotFoundException

  Returns the power state of the VM

  Returns:
    current power state
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### suspend

    void suspend()
                 throws javax.management.InstanceNotFoundException,
                        BadVMPowerStateException

  Suspend the VM

  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist
    `BadVMPowerStateException` - thrown if the VM is not in the appropriate state

### resume

    void resume()
                throws javax.management.InstanceNotFoundException,
                       BadVMPowerStateException

  Resume the VM

  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist
    `BadVMPowerStateException` - thrown if the VM is not in the appropriate state

### shutdown

    void shutdown()
                  throws javax.management.InstanceNotFoundException,
                         BadVMPowerStateException

  Shutdown the VM

  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist
    `BadVMPowerStateException` - thrown if the VM is not in the appropriate state

### start

    void start()
               throws javax.management.InstanceNotFoundException,
                      BadVMPowerStateException

  Start the VM

  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist
    `BadVMPowerStateException` - thrown if the VM is not in the appropriate state

### reboot

    void reboot()
                throws javax.management.InstanceNotFoundException,
                       BadVMPowerStateException

  Reboot the VM

  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist
    `BadVMPowerStateException` - thrown if the VM is not in the appropriate state

### destroy

    void destroy()
                 throws javax.management.InstanceNotFoundException

  Destroy the VM

  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist

### canLiveMigrateToHost

    boolean canLiveMigrateToHost(HostMXBean targetHost)

  Returns true if the VM can be migrated to the given host using live migration

  Parameters:
    `targetHost` - host on which the VM migration is tested

### migrate

    void migrate(HostMXBean targetHost,
                 boolean live)
                 throws javax.management.InstanceNotFoundException,
                        IllegalOperationException,
                        VMMException

  Migrate the VM to a target host. Note that the target host must belong to the same server pool as the VM's current host.

  Parameters:
    `targetHost` - target host of the migration
    `live` - if true a live migration will be attempted
  Throws:
    `javax.management.InstanceNotFoundException` - thrown if the specified MXBean does not exist
    `IllegalOperationException` - thrown if the migration cannot be performed
    `VMMException`

### getUserData

    java.lang.String getUserData(java.lang.String key)
                                 throws javax.management.InstanceNotFoundException

  Returns user data associated with the specified key

  Parameters:
    `key` - of the user data to return
  Returns:
    user data for the specified key
  Throws:
    `javax.management.InstanceNotFoundException`

### makeTemplate

    void makeTemplate(java.lang.String vmImageID,
                      java.lang.String name,
                      java.lang.String description)
                      throws InsufficientResourcesException,
                             IllegalOperationException,
                             VMMException

  Makes a VM image template from this VM

  Parameters:
    `vmImageID` - name of the VM image to create
  Throws:
    `InsufficientResourcesException` - thrown if not enough resources are available
    `IllegalOperationException`
    `RuntimeVirtException`
    `VMMException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 OW2 Consortium. All Rights Reserved.