Created
August 21, 2014 17:48
-
-
Save michaelrice/0e83c59bd46eb85aa56c to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Adds host to vcenter. | |
* | |
* @param fqdn | |
* @param sslThumbprint | |
* @param password | |
* @return | |
* @throws Exception | |
*/ | |
String addHostToVC(String fqdn, String sslThumbPrint, String pass) throws Exception { | |
log.trace("Adding host to VC") | |
HostConnectSpec hcSpec = new HostConnectSpec() | |
hcSpec.with{ | |
hostName = fqdn | |
sslThumbprint = sslThumbPrint | |
userName = "root" | |
password = pass | |
} | |
Task task = getHostFolder().addStandaloneHost_Task(hcSpec, null, true, getHostLicense()) | |
String res = task.waitForMe() | |
return res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment