Source:
<code>public NodeAndInitialCredentials<ServerInfo> createNodeWithGroupEncodedIntoName(String tag, String name, Template template) { long bootSize = (long) (template.getHardware().getVolumes().get(0).getSize() * 1024 * 1024 * 1024l); logger.debug(">> creating boot drive bytes(%d)", bootSize); DriveInfo drive = client .createDrive(new Drive.Builder().name(template.getImage().getId()).size(bootSize).build()); logger.debug("<< drive(%s)", drive); boolean success = driveNotClaimed.apply(drive); if (!success) { client.destroyDrive(drive.getUuid()); <START> throw new IllegalStateException("could not create drive in time!"); <END> } logger.debug(">> imaging boot drive source(%s)", template.getImage().getId()); client.imageDrive(template.getImage().getId(), drive.getUuid(), ImageConversionType.GUNZIP); boolean ready = driveNotClaimed.apply(drive); if (!ready) { client.destroyDrive(drive.getUuid()); throw new IllegalStateException("could not image drive in time!"); } logger.debug("<< imaged (%s)", success); template.getOptions().userMetadata(ComputeServiceConstants.NODE_GROUP_KEY, tag); Server toCreate = small(name, drive.getUuid(), defaultVncPassword).mem(template.getHardware().getRam()) .cpu((int) (template.getHardware().getProcessors().get(0).getSpeed())) .tags(template.getOptions().getTags()).userMetadata(template.getOptions().getUserMetadata()).build(); ServerInfo from = client.createServer(toCreate); client.startServer(from.getUuid()); from = client.getServerInfo(from.getUuid()); return new NodeAndInitialCredentials<ServerInfo>(from, from.getUuid(), LoginCredentials.builder() .password(defaultVncPassword).build()); }</code><technical_language>Add _which_ drive here, timeout</technical_language>

Target:
public NodeAndInitialCredentials<ServerInfo> createNodeWithGroupEncodedIntoName(String tag, String name, Template template) { long bootSize = (long) (template.getHardware().getVolumes().get(0).getSize() * 1024 * 1024 * 1024l); logger.debug(">> creating boot drive bytes(%d)", bootSize); DriveInfo drive = client .createDrive(new Drive.Builder().name(template.getImage().getId()).size(bootSize).build()); logger.debug("<< drive (%s)", drive); boolean success = driveNotClaimed.apply(drive); if (!success) { client.destroyDrive(drive.getUuid()); throw new IllegalStateException(String.format("could not create drive %s in time!", drive)); } logger.debug(">> imaging boot drive source(%s)", template.getImage().getId()); client.imageDrive(template.getImage().getId(), drive.getUuid(), ImageConversionType.GUNZIP); boolean ready = driveNotClaimed.apply(drive); if (!ready) { client.destroyDrive(drive.getUuid()); throw new IllegalStateException(String.format("could not image drive %s in time!", drive)); } logger.debug("<< imaged (%s)", drive); template.getOptions().userMetadata(ComputeServiceConstants.NODE_GROUP_KEY, tag); Server toCreate = small(name, drive.getUuid(), defaultVncPassword).mem(template.getHardware().getRam()) .cpu((int) (template.getHardware().getProcessors().get(0).getSpeed())) .tags(template.getOptions().getTags()).userMetadata(template.getOptions().getUserMetadata()).build(); ServerInfo from = client.createServer(toCreate); client.startServer(from.getUuid()); from = client.getServerInfo(from.getUuid()); return new NodeAndInitialCredentials<ServerInfo>(from, from.getUuid(), LoginCredentials.builder() .password(defaultVncPassword).build()); }