This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void doClone(String url, String username, String password, String vmname, String clonename) throws Exception | |
{ | |
ServiceInstance si = new ServiceInstance(new URL(url), username, password, true); | |
Folder rootFolder = si.getRootFolder(); | |
VirtualMachine vm = (VirtualMachine) new InventoryNavigator(rootFolder).searchManagedEntity("VirtualMachine", vmname); | |
if(vm==null) | |
{ | |
System.out.println("VM " + vmname + " not found"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void doChangeNic(String url, String username, String password, String hostname, String vmname, String portGroup) | |
{ | |
ServiceInstance si = new ServiceInstance(new URL(url), username, password, true); | |
Folder rootFolder = si.getRootFolder(); | |
VirtualMachine vm = null; | |
HostSystem host = null; | |
vm = (VirtualMachine) new InventoryNavigator(rootFolder).searchManagedEntity("VirtualMachine", vmname); | |
host = (HostSystem) new InventoryNavigator(rootFolder).searchManagedEntity("HostSystem", hostname); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void doChangeVnc(String url, String username, String password, String vmname, String vncport) throws Exception | |
{ | |
ServiceInstance si = new ServiceInstance(new URL(url), username, password, true); | |
Folder rootFolder = si.getRootFolder(); | |
VirtualMachine vm = null; | |
vm = (VirtualMachine) new InventoryNavigator(rootFolder).searchManagedEntity("VirtualMachine", vmname); | |
if(vm==null) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void doSnapshot(String url, String username, String password, String vmname, String snapshotname) throws Exception | |
{ | |
ServiceInstance si = new ServiceInstance(new URL(url), username, password, true); | |
Folder rootFolder = si.getRootFolder(); | |
VirtualMachine vm = null; | |
vm = (VirtualMachine) new InventoryNavigator(rootFolder).searchManagedEntity("VirtualMachine", vmname); | |
if(vm==null) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am grier on github. | |
* I am grier (https://keybase.io/grier) on keybase. | |
* I have a public key whose fingerprint is AF58 9598 C074 1AFE FD2F AEDA 30EA 25BF 7546 63ED | |
To claim this, I am signing this object: |