}
@Override
public Hardware apply(final VirtualMachineTemplateInVirtualDatacenter templateInVirtualDatacenter) {
VirtualMachineTemplate template = templateInVirtualDatacenter.getTemplate();
VirtualDatacenter virtualDatacenter = templateInVirtualDatacenter.getZone();
HardwareBuilder builder = new HardwareBuilder();
builder.providerId(template.getId().toString());
builder.id(template.getId().toString() + "/" + virtualDatacenter.getId());
builder.uri(template.getURI());
builder.name(template.getName());
builder.processor(new Processor(template.getCpuRequired(), DEFAULT_CORE_SPEED));
builder.ram(template.getRamRequired());
// Location information
builder.location(virtualDatacenterToLocation.apply(virtualDatacenter));
builder.hypervisor(virtualDatacenter.getHypervisorType().name());
builder.supportsImage(ImagePredicates.idEquals(template.getId().toString()));
VolumeBuilder volumeBuilder = new VolumeBuilder();
volumeBuilder.bootDevice(true);
volumeBuilder.size(toGb(template.getHdRequired()));