Optional<OperatingSystem> optionalOperatingSystem = tryExtractOperatingSystemFrom(imageId);
if (optionalOperatingSystem.isPresent()) {
virtualGuestBuilder.operatingSystem(optionalOperatingSystem.get());
// the imageId specified is a the id of a public/private/flex image
} else {
VirtualGuestBlockDeviceTemplateGroup blockDeviceTemplateGroup = VirtualGuestBlockDeviceTemplateGroup
.builder().globalIdentifier(imageId).build();
virtualGuestBuilder.blockDeviceTemplateGroup(blockDeviceTemplateGroup).build();
}
// set multi-disks
if (templateOptions.getBlockDevices().isPresent()) {