@Mapping(from = BootSequence.class, to = Boot.class) public static Boot map(BootSequence bootSequence, Boot template) { Boot boot = template != null ? template : new Boot(); Boot.DevicesList list = new Boot.DevicesList(); boot.setDevices(list); List<BootDevice> devices = list.getDevices(); switch (bootSequence) { case C:
if (boot != null && boot.isSetDevices() && boot.getDevices().isSetDevices()) { entity.setDefaultBootSequence(VmMapper.map(model.getOs().getBoot(), null));
vm.getOs().getBoot().getDevices().isSetDevices()) { params.setBootSequence(map(vm.getOs().getBoot(), null)); vm.getOs().getBoot().getDevices().isSetDevices()) { params.setBootSequence(map(vm.getOs().getBoot(), null));
@Mapping(from = Boot.class, to = List.class) public static BootSequence map(Boot boot, BootSequence template) { Set<BootDevice> devSet = new LinkedHashSet<>(); for (BootDevice device : boot.getDevices().getDevices()) { if (device != null) { devSet.add(device);
assertNotNull(transform.getOs()); assertTrue(transform.getOs().isSetBoot()); assertEquals(model.getOs().getBoot().getDevices().getDevices(), transform.getOs().getBoot().getDevices().getDevices()); assertEquals(model.getOs().getKernel(), transform.getOs().getKernel()); assertEquals(model.getOs().getInitrd(), transform.getOs().getInitrd());
assertEquals(model.getBios().getBootMenu().isEnabled(), transform.getBios().getBootMenu().isEnabled()); assertTrue(transform.getOs().isSetBoot()); assertEquals(model.getOs().getBoot().getDevices().getDevices(), transform.getOs().getBoot().getDevices().getDevices()); assertEquals(model.getOs().getKernel(), transform.getOs().getKernel()); assertEquals(model.getOs().getInitrd(), transform.getOs().getInitrd());
from.getDisplay().setType(DisplayType.SPICE); from.getPayloads().getPayloads().get(0).setType(VmDeviceType.CDROM); List<BootDevice> devices = from.getOs().getBoot().getDevices().getDevices(); for (int i = 0; i < devices.size(); i++) { devices.set(i, BootDevice.HD);
if (from.isSetBoot()) { Boot toBoot = new Boot(); Boot.DevicesList toDevicesList = new Boot.DevicesList(); List<BootDevice> toDevices = toDevicesList.getDevices(); from.getBoot().stream() .map(V3Boot::getDev)
if (fromBoot.isSetDevices()) { List<V3Boot> toBoot = to.getBoot(); fromBoot.getDevices().getDevices().forEach(device -> { V3Boot boot = new V3Boot(); boot.setDev(device.value());
@Override protected Template postPopulate(Template from) { from.setType(VmType.DESKTOP); from.setStorageErrorResumeBehaviour(VmStorageErrorResumeBehaviour.AUTO_RESUME); from.setOrigin(OriginType.VMWARE.name().toLowerCase()); List<BootDevice> devices = from.getOs().getBoot().getDevices().getDevices(); for (int i = 0; i < devices.size(); i++) { devices.set(i, BootDevice.NETWORK); } while (from.getCpu().getTopology().getSockets() == 0) { from.getCpu().getTopology().setSockets(MappingTestHelper.rand(100)); } while (from.getCpu().getTopology().getCores() == 0) { from.getCpu().getTopology().setCores(MappingTestHelper.rand(100)); } from.setTimeZone(new TimeZone()); from.getTimeZone().setName("Australia/Darwin"); from.getSerialNumber().setPolicy(SerialNumberPolicy.CUSTOM); from.getMigration().setAutoConverge(InheritableBoolean.TRUE); from.getMigration().setCompressed(InheritableBoolean.TRUE); from.getDisplay().setDisconnectAction(DisplayDisconnectAction.LOCK_SCREEN.toString()); for (NicConfiguration nicConfiguration : from.getInitialization().getNicConfigurations().getNicConfigurations()) { nicConfiguration.setBootProtocol(BootProtocol.STATIC); } return from; }
@Test public void testStartWithBootDev() { setUpWindowsGetEntityExpectations(1, false); setUriInfo(setUpActionExpectations(ActionType.RunVmOnce, RunVmOnceParams.class, new String[] { "VmId", "BootSequence" }, new Object[] { GUIDS[0], BootSequence.N })); Action action = new Action(); action.setVm(new Vm()); action.getVm().setOs(new OperatingSystem()); action.getVm().getOs().setBoot(new Boot()); action.getVm().getOs().getBoot().setDevices(new Boot.DevicesList()); action.getVm().getOs().getBoot().getDevices().getDevices().add(BootDevice.NETWORK); verifyActionResponse(resource.start(action)); }
/** * Create an instance of {@link Boot.DevicesList } * */ public Boot.DevicesList createBootDevicesList() { return new Boot.DevicesList(); }