String regionId = template.getLocation().getId();
String imageId = template.getImage().getProviderId();
String flavorId = template.getHardware().getProviderId();
logger.debug(">> creating new server region(%s) name(%s) image(%s) flavor(%s) options(%s)", regionId, name, imageId, flavorId, options);
ServerCreated lightweightServer = novaApi.getServerApi(regionId).create(name, imageId, flavorId, options);
Server server = novaApi.getServerApi(regionId).get(lightweightServer.getId());
logger.trace("<< server(%s)", server.getId());
ServerInRegion serverInRegion = new ServerInRegion(server, regionId);
if (!privateKey.isPresent() && lightweightServer.getAdminPass().isPresent())
credentialsBuilder.password(lightweightServer.getAdminPass().get());
return new NodeAndInitialCredentials<ServerInRegion>(serverInRegion, serverInRegion.slashEncode(), credentialsBuilder
.build());
}