}
@Override
public IMachine apply(MasterSpec masterSpec) {
VmSpec vmSpec = masterSpec.getVmSpec();
IsoSpec isoSpec = masterSpec.getIsoSpec();
String masterName = vmSpec.getVmName();
IMachine masterMachine =
checkNotNull(createAndRegisterMachineFromIsoIfNotAlreadyExists.apply(masterSpec), "master machine");
// Launch machine and wait for it to come online
machineController.ensureMachineIsLaunched(masterName);
String installationKeySequence = isoSpec.getInstallationKeySequence().replace("PRECONFIGURATION_URL",
preconfigurationUrl);
configureOsInstallationWithKeyboardSequence(masterName, installationKeySequence);
masterMachine.setExtraData(GUEST_OS_USER, masterSpec.getLoginCredentials().getUser());
masterMachine.setExtraData(GUEST_OS_PASSWORD, masterSpec.getLoginCredentials().getPassword());