org.ow2.jasmine.vmm.agent.driver.libvirt
Class LibvirtVirtualMachine

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jasmine.vmm.agent.domain.ManagedResource
          extended by org.ow2.jasmine.vmm.agent.driver.libvirt.LibvirtVirtualMachine
All Implemented Interfaces:
javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.ow2.jasmine.vmm.api.ManagedResourceMXBean, org.ow2.jasmine.vmm.api.VirtualMachineMXBean

public class LibvirtVirtualMachine
extends ManagedResource
implements org.ow2.jasmine.vmm.api.VirtualMachineMXBean

Libvirt driver Virtual Machine MXBean implementation


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
org.ow2.jasmine.vmm.api.VirtualMachineMXBean.PowerState
 
Field Summary
 
Fields inherited from class org.ow2.jasmine.vmm.agent.domain.ManagedResource
objectName, path
 
Constructor Summary
LibvirtVirtualMachine(javax.management.ObjectName objectName, LibvirtHost host, org.libvirt.Domain domain, java.util.Map<java.lang.String,java.lang.String> userData)
           
 
Method Summary
 void addUserData(java.lang.String key, java.lang.String value)
           
 boolean canLiveMigrateToHost(org.ow2.jasmine.vmm.api.HostMXBean targetHost)
           
 org.ow2.jasmine.vmm.api.VirtualMachineMXBean cloneVM(java.lang.String clonedVmName, org.ow2.jasmine.vmm.api.VMCustomizationSpec custSpec, boolean sync)
           
 void destroy()
           
 java.lang.String getConsole()
           
 boolean[][] getCPUAffinity()
           
 float getCPULoad()
           
 java.util.List<java.lang.String> getDiskFiles()
           
 long getDomID()
           
 java.lang.String getGuestIpAddress()
           
 org.ow2.jasmine.vmm.api.HostMXBean getHostMBean()
           
 float[] getLoadPerVCPU()
           
 java.lang.String getMacAddress()
           
 long getMemorySizeMB()
           
 long getMemoryUsedMB()
           
 java.lang.String getNameLabel()
           
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
           
 int getNumVCPUs()
           
 org.ow2.jasmine.vmm.api.ResourceUsage getResourceUsage()
           
 int getSchedulingCap()
           
 int getSchedulingWeight()
           
 java.util.Date getStartTime()
           
 org.ow2.jasmine.vmm.api.VirtualMachineMXBean.PowerState getState()
           
 long getUpTimeSeconds()
           
 java.lang.String getUserData(java.lang.String key)
           
 java.lang.String getUuid()
           
 boolean isMigrating()
           
 boolean isSynchronized()
           
 org.ow2.jasmine.vmm.api.VirtualMachineImageMXBean makeTemplate(java.lang.String name, java.lang.String description, java.util.Map<java.lang.String,java.lang.String> metadata)
           
 void migrate(org.ow2.jasmine.vmm.api.HostMXBean targetHost, boolean live)
           
 void pause()
           
 void reboot()
           
 void resume()
           
 void setCPUAffinity(boolean[][] affinity)
           
 void setMemorySizeMB(long size)
           
 void setMigrating(boolean isMigrating)
           
 void setNumVCPUs(int numVCPUs)
           
 void setSchedulingCap(int schedulingCap)
           
 void setSchedulingWeight(int schedulingWeight)
           
 void setSynchronized(boolean isSynchronized)
           
 void shutdown()
           
 void start()
           
 void suspend()
           
 void unpause()
           
 
Methods inherited from class org.ow2.jasmine.vmm.agent.domain.ManagedResource
emitNotification, emitNotification, getObjectName, getPath
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.jasmine.vmm.api.ManagedResourceMXBean
getObjectName, getPath
 

Constructor Detail

LibvirtVirtualMachine

public LibvirtVirtualMachine(javax.management.ObjectName objectName,
                             LibvirtHost host,
                             org.libvirt.Domain domain,
                             java.util.Map<java.lang.String,java.lang.String> userData)
                      throws org.ow2.jasmine.vmm.api.VMMException
Throws:
org.ow2.jasmine.vmm.api.VMMException
Method Detail

canLiveMigrateToHost

public boolean canLiveMigrateToHost(org.ow2.jasmine.vmm.api.HostMXBean targetHost)
                             throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
canLiveMigrateToHost in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

isSynchronized

public boolean isSynchronized()

setSynchronized

public void setSynchronized(boolean isSynchronized)

isMigrating

public boolean isMigrating()

setMigrating

public void setMigrating(boolean isMigrating)

cloneVM

public org.ow2.jasmine.vmm.api.VirtualMachineMXBean cloneVM(java.lang.String clonedVmName,
                                                            org.ow2.jasmine.vmm.api.VMCustomizationSpec custSpec,
                                                            boolean sync)
                                                     throws org.ow2.jasmine.vmm.api.InsufficientResourcesException,
                                                            org.ow2.jasmine.vmm.api.VMMException
Specified by:
cloneVM in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.InsufficientResourcesException
org.ow2.jasmine.vmm.api.VMMException

getUuid

public java.lang.String getUuid()
Specified by:
getUuid in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean

getHostMBean

public org.ow2.jasmine.vmm.api.HostMXBean getHostMBean()
Specified by:
getHostMBean in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean

getDomID

public long getDomID()

getDiskFiles

public java.util.List<java.lang.String> getDiskFiles()
                                              throws org.ow2.jasmine.vmm.api.VMMException
Throws:
org.ow2.jasmine.vmm.api.VMMException

getStartTime

public java.util.Date getStartTime()
Specified by:
getStartTime in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean

getUpTimeSeconds

public long getUpTimeSeconds()

getResourceUsage

public org.ow2.jasmine.vmm.api.ResourceUsage getResourceUsage()
Specified by:
getResourceUsage in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean

getCPULoad

public float getCPULoad()
Specified by:
getCPULoad in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean

getLoadPerVCPU

public float[] getLoadPerVCPU()
                       throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getLoadPerVCPU in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getMemorySizeMB

public long getMemorySizeMB()
                     throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getMemorySizeMB in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

setMemorySizeMB

public void setMemorySizeMB(long size)
                     throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
setMemorySizeMB in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getMemoryUsedMB

public long getMemoryUsedMB()
                     throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getMemoryUsedMB in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getNameLabel

public java.lang.String getNameLabel()
Specified by:
getNameLabel in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean

addUserData

public void addUserData(java.lang.String key,
                        java.lang.String value)
                 throws org.ow2.jasmine.vmm.api.VMMException
Throws:
org.ow2.jasmine.vmm.api.VMMException

getUserData

public java.lang.String getUserData(java.lang.String key)
                             throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getUserData in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getConsole

public java.lang.String getConsole()
                            throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getConsole in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getNumVCPUs

public int getNumVCPUs()
                throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getNumVCPUs in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getCPUAffinity

public boolean[][] getCPUAffinity()
                           throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getCPUAffinity in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

setCPUAffinity

public void setCPUAffinity(boolean[][] affinity)
                    throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
setCPUAffinity in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getSchedulingCap

public int getSchedulingCap()
                     throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getSchedulingCap in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getSchedulingWeight

public int getSchedulingWeight()
                        throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getSchedulingWeight in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getState

public org.ow2.jasmine.vmm.api.VirtualMachineMXBean.PowerState getState()
                                                                 throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getState in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getGuestIpAddress

public java.lang.String getGuestIpAddress()
                                   throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getGuestIpAddress in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getMacAddress

public java.lang.String getMacAddress()
                               throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
getMacAddress in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

setNumVCPUs

public void setNumVCPUs(int numVCPUs)
                 throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
setNumVCPUs in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

setSchedulingCap

public void setSchedulingCap(int schedulingCap)
                      throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
setSchedulingCap in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

setSchedulingWeight

public void setSchedulingWeight(int schedulingWeight)
                         throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
setSchedulingWeight in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

migrate

public void migrate(org.ow2.jasmine.vmm.api.HostMXBean targetHost,
                    boolean live)
             throws org.ow2.jasmine.vmm.api.IllegalOperationException,
                    org.ow2.jasmine.vmm.api.VMMException
Specified by:
migrate in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.IllegalOperationException
org.ow2.jasmine.vmm.api.VMMException

shutdown

public void shutdown()
              throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
shutdown in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

start

public void start()
           throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
start in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

reboot

public void reboot()
            throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
reboot in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

suspend

public void suspend()
             throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
suspend in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

resume

public void resume()
            throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
resume in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

pause

public void pause()
           throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
pause in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

unpause

public void unpause()
             throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
unpause in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

destroy

public void destroy()
             throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
destroy in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster
Overrides:
getNotificationInfo in class javax.management.NotificationBroadcasterSupport

makeTemplate

public org.ow2.jasmine.vmm.api.VirtualMachineImageMXBean makeTemplate(java.lang.String name,
                                                                      java.lang.String description,
                                                                      java.util.Map<java.lang.String,java.lang.String> metadata)
                                                               throws org.ow2.jasmine.vmm.api.InsufficientResourcesException,
                                                                      org.ow2.jasmine.vmm.api.IllegalOperationException,
                                                                      org.ow2.jasmine.vmm.api.BadVMPowerStateException,
                                                                      org.ow2.jasmine.vmm.api.VMMException
Specified by:
makeTemplate in interface org.ow2.jasmine.vmm.api.VirtualMachineMXBean
Throws:
org.ow2.jasmine.vmm.api.InsufficientResourcesException
org.ow2.jasmine.vmm.api.IllegalOperationException
org.ow2.jasmine.vmm.api.BadVMPowerStateException
org.ow2.jasmine.vmm.api.VMMException


Copyright © 2010 OW2 Consortium. All Rights Reserved.