|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.paulneve.wlab.virtualisation.VirtualisationAccessHyperVImpl
public class VirtualisationAccessHyperVImpl
Implements VirtualisationAccess for the Microsoft HyperV virtualisation backend. Undocumented public getters/setters have values injected via Spring - consult the comments in application-properties.xml for details of what they do.
Field Summary | |
---|---|
(package private) java.lang.String |
diskPath
|
(package private) int |
octet1
|
(package private) int |
octet2
|
(package private) int |
octet3
|
(package private) java.lang.String |
password
|
(package private) java.lang.String |
serverName
|
(package private) java.lang.String |
username
|
Constructor Summary | |
---|---|
VirtualisationAccessHyperVImpl()
Constructor - turns off ridiculously verbose logging on J-Interop library that comes with JWBEM. |
Method Summary | |
---|---|
void |
addNetworkAdapter(com.h9labs.jwbem.msvm.virtualsystemmanagement.MsvmVirtualSystemManagementService vsMgt,
com.h9labs.jwbem.msvm.virtualsystem.MsvmComputerSystem realVm,
boolean legacy)
Adds a network adapter to a VM. |
java.lang.String |
cloneVM(java.lang.String nameOfParent,
java.lang.String nameOfClone)
Sends a request to clone a VM. |
boolean |
createNewVM(java.lang.String nameOfNewVm)
Creates a new VM. |
void |
deleteFile(java.lang.String filename)
Deletes a file off of the backend (i.e. |
void |
deleteSnapshot(java.lang.String name,
int index)
Delete snapshot from VM |
void |
deleteVM(java.lang.String name)
Sends a request to delete a VM. |
java.lang.String |
getDiskPath()
|
int |
getNumberOfCurrentlyRunningVMs()
Does precisely what it says. |
int |
getOctet1()
|
int |
getOctet2()
|
int |
getOctet3()
|
java.lang.String |
getPassword()
|
java.lang.String |
getServerName()
|
java.lang.String |
getUsername()
|
java.lang.String |
getVMIP(java.lang.String name)
Gets the IP address(es) of a VM. |
java.lang.String |
getVMStatus(java.lang.String name)
Gets a VM status. |
boolean |
isAlive(java.lang.String name)
Determines whether a VM is "alive" or not. |
java.util.ArrayList<java.lang.String> |
listVMs()
Does precisely what it says. |
int |
numberOfSnapshots(java.lang.String name)
Returns number of snapshots that VM /name/ has. |
void |
revertToSnapshot(java.lang.String nameOfVm,
int index)
Reverts VM /name/ to snapshot /index/, where the first snapshot (usually the start point of the stage) is 0 |
void |
setDiskPath(java.lang.String diskPath)
|
void |
setOctet1(int r1)
|
void |
setOctet2(int r2)
|
void |
setOctet3(int r3)
|
void |
setParameters(Parameters p)
|
void |
setPassword(java.lang.String password)
|
void |
setServerName(java.lang.String serverName)
|
void |
setStrings(Strings s)
|
void |
setUsername(java.lang.String username)
|
void |
snapshotVm(java.lang.String nameOfVm)
Takes a snapshot of VM |
void |
startVM(java.lang.String name)
Sends a request to start a VM from either a stopped or suspended state. |
void |
suspendVM(java.lang.String name)
Sends a request to suspend a VM that is currently running. |
void |
turnOffVM(java.lang.String name)
"Hard" power down a VM, i.e. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.lang.String serverName
java.lang.String username
java.lang.String password
java.lang.String diskPath
int octet1
int octet2
int octet3
Constructor Detail |
---|
public VirtualisationAccessHyperVImpl()
Method Detail |
---|
public java.lang.String cloneVM(java.lang.String nameOfParent, java.lang.String nameOfClone)
VirtualisationAccess
cloneVM
in interface VirtualisationAccess
nameOfParent
- string, name of parent VM to clonenameOfClone
- string, name of the new clone
public boolean isAlive(java.lang.String name)
VirtualisationAccess
isAlive
in interface VirtualisationAccess
name
- name of VM to check.
public void deleteVM(java.lang.String name)
VirtualisationAccess
deleteVM
in interface VirtualisationAccess
name
- Name of the VM to deletepublic void snapshotVm(java.lang.String nameOfVm)
VirtualisationAccess
snapshotVm
in interface VirtualisationAccess
nameOfVm
- string, i.e. name of VM to create a snapshot forpublic void revertToSnapshot(java.lang.String nameOfVm, int index)
VirtualisationAccess
revertToSnapshot
in interface VirtualisationAccess
nameOfVm
- name of VMindex
- integer, snapshot number to rever topublic int numberOfSnapshots(java.lang.String name)
VirtualisationAccess
numberOfSnapshots
in interface VirtualisationAccess
name
- string, name of VM to get data forpublic void deleteSnapshot(java.lang.String name, int index)
VirtualisationAccess
deleteSnapshot
in interface VirtualisationAccess
name
- name of VM to delete snapshot onindex
- index of snapshot to delete - 0 is first, usually the base snapshot for start of stagepublic java.lang.String getVMIP(java.lang.String name)
VirtualisationAccess
The IP addresses returned should be relative to the WLab server, i.e. ones which can be routed to from the WLab server. External access will use Jumpgate to route through via a single exposed external port/IP.
getVMIP
in interface VirtualisationAccess
name
- Name of VM
public java.lang.String getVMStatus(java.lang.String name)
VirtualisationAccess
getVMStatus
in interface VirtualisationAccess
name
- Name of VM to return status of
public java.util.ArrayList<java.lang.String> listVMs()
VirtualisationAccess
listVMs
in interface VirtualisationAccess
public void startVM(java.lang.String name)
VirtualisationAccess
startVM
in interface VirtualisationAccess
name
- Name of the VM to start.public void turnOffVM(java.lang.String name)
VirtualisationAccess
turnOffVM
in interface VirtualisationAccess
name
- Name of the VM to turn off.public void suspendVM(java.lang.String name)
VirtualisationAccess
suspendVM
in interface VirtualisationAccess
name
- Name of the VM to suspend.public int getNumberOfCurrentlyRunningVMs()
VirtualisationAccess
getNumberOfCurrentlyRunningVMs
in interface VirtualisationAccess
public boolean createNewVM(java.lang.String nameOfNewVm)
nameOfNewVm
- name of VM to create
public void deleteFile(java.lang.String filename)
filename
- file to deletepublic void addNetworkAdapter(com.h9labs.jwbem.msvm.virtualsystemmanagement.MsvmVirtualSystemManagementService vsMgt, com.h9labs.jwbem.msvm.virtualsystem.MsvmComputerSystem realVm, boolean legacy)
vsMgt
- a MsvmVirtualSystemManagementService objectrealVm
- a virtual machine, in the form of a MsvmComputerSystem objectlegacy
- true if we're adding a legacy network adapter, false if notpublic java.lang.String getServerName()
public void setServerName(java.lang.String serverName)
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public int getOctet1()
public void setOctet1(int r1)
public int getOctet2()
public void setOctet2(int r2)
public int getOctet3()
public void setOctet3(int r3)
public java.lang.String getDiskPath()
public void setDiskPath(java.lang.String diskPath)
public void setParameters(Parameters p)
public void setStrings(Strings s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |