import static brooklyn.util.GroovyJavaMethods.truth;
returns the hostname for use by peers in the same subnet,
defaulting to public hostname if nothing special
for use e.g. in clouds like amazon where other machines
in the same subnet need to use a different IP
executes the given statements on the server using jclouds ScriptBuilder,
wrapping in a script which is polled periodically.
the output is returned once the script completes (disadvantage compared to other methods)
but the process is nohupped and the SSH session is not kept,
so very useful for long-running processes
uses submitRunScript to execute the commands, and throws error if it fails or returns non-zero
Retrieves the password for this VM, if one exists. The behaviour/implementation is different for different clouds.
e.g. on Rackspace, the password for a windows VM is available immediately; on AWS-EC2, for a Windows VM you need
to poll repeatedly until the password is available which can take up to 15 minutes.
return (credentials != null) ? credentials.getPassword() : null;