checkArgument(template.getOptions().getClass().isAssignableFrom(GleSYSTemplateOptions.class),
"options class %s should have been assignable from GleSYSTemplateOptions", template.getOptions().getClass());
GleSYSTemplateOptions templateOptions = template.getOptions().as(GleSYSTemplateOptions.class);
CreateServerOptions createServerOptions = new CreateServerOptions();
createServerOptions.ip(templateOptions.getIp());
template.getOptions().userMetadata(ComputeServiceConstants.NODE_GROUP_KEY, group);
Map<String, String> md = metadataAndTagsAsCommaDelimitedValue(template.getOptions());
if (md.size() > 0) {
String description = Joiner.on('\n').withKeyValueSeparator("=").join(md);
// TODO: get glesys to stop stripping out equals and commas!
createServerOptions.description(base16().lowerCase().encode(description.getBytes(UTF_8)));
}
ServerSpec.Builder<?> builder = ServerSpec.builder();
builder.datacenter(template.getLocation().getId());
builder.templateName(template.getImage().getId());
builder.platform(template.getHardware().getHypervisor());