Source:
<code>private boolean deployFromTemplate(final Run<?, ?> run, final Launcher launcher, final TaskListener listener) throws VSphereException { PrintStream jLogger = listener.getLogger(); String expandedClone = clone; String expandedTemplate = template; String expandedCluster = cluster; String expandedDatastore = datastore; EnvVars env; try { env = run.getEnvironment(listener); } catch (Exception e) { throw new VSphereException(e); } if (run instanceof AbstractBuild) { env.overrideAll(((AbstractBuild) run).getBuildVariables()); expandedClone = env.expand(clone); expandedTemplate = env.expand(template); expandedCluster = env.expand(cluster); expandedDatastore = env.expand(datastore); } String resourcePoolName; if ("".equals(resourcePool) || (resourcePool.length() == 0)) { resourcePoolName = "Resources"; } else { resourcePoolName = env.expand(resourcePool); } vsphere.deployVm(expandedClone, expandedTemplate, linkedClone, resourcePoolName, expandedCluster, expandedDatastore, powerOn, jLogger); VSphereLogger.vsLogger(jLogger, "\""+expandedClone+"\" successfully deployed!"); <START> IP = vsphere.getIp(vsphere.getVmByName(expandedClone), 20); <END> VSphereLogger.vsLogger(jLogger, "Successfully retrieved IP for \""+expandedClone+"\" : "+IP); VSphereLogger.vsLogger(jLogger, "Exposing " + IP + " as environment variable VSPHERE_IP"); if (run instanceof AbstractBuild) { VSphereEnvAction envAction = new VSphereEnvAction(); envAction.add("VSPHERE_IP", IP); run.addAction(envAction); } return true; }</code><technical_language>Timeout enough. optionally configurable in VSphere? (Cloning step well) valuable this work powerOn, similarly Cloning does. Alternatively - configurable. Got: java.lang.IllegalArgumentException: Null allowed environment variable: VSPHERE_IP</technical_language>

Target:
private boolean deployFromTemplate(final Run<?, ?> run, final Launcher launcher, final TaskListener listener) throws VSphereException { PrintStream jLogger = listener.getLogger(); String expandedClone = clone; String expandedTemplate = template; String expandedCluster = cluster; String expandedDatastore = datastore; EnvVars env; try { env = run.getEnvironment(listener); } catch (Exception e) { throw new VSphereException(e); } if (run instanceof AbstractBuild) { env.overrideAll(((AbstractBuild) run).getBuildVariables()); expandedClone = env.expand(clone); expandedTemplate = env.expand(template); expandedCluster = env.expand(cluster); expandedDatastore = env.expand(datastore); } String resourcePoolName; if ("".equals(resourcePool) || (resourcePool.length() == 0)) { resourcePoolName = "Resources"; } else { resourcePoolName = env.expand(resourcePool); } vsphere.deployVm(expandedClone, expandedTemplate, linkedClone, resourcePoolName, expandedCluster, expandedDatastore, powerOn, jLogger); VSphereLogger.vsLogger(jLogger, "\""+expandedClone+"\" successfully deployed!"); IP = vsphere.getIp(vsphere.getVmByName(expandedClone), 60); if(IP!=null) { VSphereLogger.vsLogger(jLogger, "Successfully retrieved IP for \"" + expandedClone + "\" : " + IP); VSphereLogger.vsLogger(jLogger, "Exposing " + IP + " as environment variable VSPHERE_IP"); if (run instanceof AbstractBuild) { VSphereEnvAction envAction = new VSphereEnvAction(); envAction.add("VSPHERE_IP", IP); run.addAction(envAction); } return true; } else { VSphereLogger.vsLogger(jLogger, "Error: Timed out after waiting 60 seconds to get IP for \""+expandedClone+"\" "); return false; } }