org.ow2.jasmine.vmm.agent.driver.xen
Class XenSSH

java.lang.Object
  extended by org.ow2.jasmine.vmm.agent.driver.xen.XenSSH

public class XenSSH
extends java.lang.Object

The XenSSH class gathers static methods wrapping SSH remote invocation to shell scripts that must be installed on Xen backend hosts.


Constructor Summary
XenSSH()
           
 
Method Summary
static RemoteExec.Result createVM(XenHost host, java.lang.String vmName, org.ow2.jasmine.vmm.api.VMConfigSpec vmSpec, java.lang.String templateFileName)
          Creates a new VM
static RemoteExec.Result destroyVM(XenHost host, java.lang.String vmName)
          Destroys a VM
static RemoteExec.Result migrateVM(XenHost sourceHost, java.lang.String vmName, java.lang.String targetHostName)
          Migrates a VM
static RemoteExec.Result postMigrateVM(XenHost sourceHost, java.lang.String vmName, java.lang.String targetHostName)
          Performs management operations after a successful VM migration
static RemoteExec.Result resumeVM(XenHost host, java.lang.String vmName)
          Resumes a suspended VM
static RemoteExec.Result shutdownVM(XenHost host, java.lang.String vmName)
          Shutdowns a VM
static RemoteExec.Result startVM(XenHost host, java.lang.String vmName)
          Starts a stopped VM
static RemoteExec.Result suspendVM(XenHost host, java.lang.String vmName)
          Suspends a VM
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XenSSH

public XenSSH()
Method Detail

createVM

public static RemoteExec.Result createVM(XenHost host,
                                         java.lang.String vmName,
                                         org.ow2.jasmine.vmm.api.VMConfigSpec vmSpec,
                                         java.lang.String templateFileName)
                                  throws RemoteExec.SshException
Creates a new VM

Parameters:
host - target host
vmName - VM label
vmSpec - VM parameters
templateFileName - absolute path of the template image
Returns:
SSH result
Throws:
RemoteExec.SshException - raised if the SSH connection cannot be established

suspendVM

public static RemoteExec.Result suspendVM(XenHost host,
                                          java.lang.String vmName)
                                   throws RemoteExec.SshException
Suspends a VM

Parameters:
host - host containing the VM
vmName - label of the VM to suspend
Returns:
SSH result
Throws:
RemoteExec.SshException - raised if the SSH connection cannot be established

resumeVM

public static RemoteExec.Result resumeVM(XenHost host,
                                         java.lang.String vmName)
                                  throws RemoteExec.SshException
Resumes a suspended VM

Parameters:
host - host containing the VM
vmName - label of the VM to resume
Returns:
SSH result
Throws:
RemoteExec.SshException - raised if the SSH connection cannot be established

startVM

public static RemoteExec.Result startVM(XenHost host,
                                        java.lang.String vmName)
                                 throws RemoteExec.SshException
Starts a stopped VM

Parameters:
host - host containing the VM
vmName - label of the VM to start
Returns:
SSH result
Throws:
RemoteExec.SshException - raised if the SSH connection cannot be established

shutdownVM

public static RemoteExec.Result shutdownVM(XenHost host,
                                           java.lang.String vmName)
                                    throws RemoteExec.SshException
Shutdowns a VM

Parameters:
host - host containing the VM
vmName - label of the VM to shutdown
Returns:
SSH result
Throws:
RemoteExec.SshException - raised if the SSH connection cannot be established

destroyVM

public static RemoteExec.Result destroyVM(XenHost host,
                                          java.lang.String vmName)
                                   throws RemoteExec.SshException
Destroys a VM

Parameters:
host - host containing the VM
vmName - label of the VM to destroy
Returns:
SSH result
Throws:
RemoteExec.SshException - raised if the SSH connection cannot be established

migrateVM

public static RemoteExec.Result migrateVM(XenHost sourceHost,
                                          java.lang.String vmName,
                                          java.lang.String targetHostName)
                                   throws RemoteExec.SshException
Migrates a VM

Parameters:
sourceHost - host containing the VM to migrate
vmName - label of the VM to migrate
targetHostName - host to which the VM will migrate
Returns:
SSH result
Throws:
RemoteExec.SshException - raised if the SSH connection cannot be established

postMigrateVM

public static RemoteExec.Result postMigrateVM(XenHost sourceHost,
                                              java.lang.String vmName,
                                              java.lang.String targetHostName)
                                       throws RemoteExec.SshException
Performs management operations after a successful VM migration

Parameters:
sourceHost - host containing the VM which has migrated
vmName - label of the migrated VM
targetHostName - host which has received the migrated VM
Returns:
SSH result
Throws:
RemoteExec.SshException - raised if the SSH connection cannot be established


Copyright © 2009 OW2 Consortium. All Rights Reserved.