Search in sources :

Example 6 with Boot

use of org.ovirt.engine.api.model.Boot in project ovirt-engine by oVirt.

the class BackendVmResourceTest method testStartWithBootDev.

@Test
public void testStartWithBootDev() throws Exception {
    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));
}
Also used : OperatingSystem(org.ovirt.engine.api.model.OperatingSystem) Action(org.ovirt.engine.api.model.Action) RunVmOnceParams(org.ovirt.engine.core.common.action.RunVmOnceParams) Vm(org.ovirt.engine.api.model.Vm) Boot(org.ovirt.engine.api.model.Boot) Test(org.junit.Test)

Example 7 with Boot

use of org.ovirt.engine.api.model.Boot in project ovirt-engine by oVirt.

the class V3OperatingSystemInAdapter method adapt.

@Override
public OperatingSystem adapt(V3OperatingSystem from) {
    OperatingSystem to = new OperatingSystem();
    if (from.isSetBoot()) {
        Boot toBoot = new Boot();
        Boot.DevicesList toDevicesList = new Boot.DevicesList();
        List<BootDevice> toDevices = toDevicesList.getDevices();
        from.getBoot().stream().map(V3Boot::getDev).map(BootDevice::fromValue).forEach(toDevices::add);
        toBoot.setDevices(toDevicesList);
        to.setBoot(toBoot);
    }
    if (from.isSetCmdline()) {
        to.setCmdline(from.getCmdline());
    }
    if (from.isSetInitrd()) {
        to.setInitrd(from.getInitrd());
    }
    if (from.isSetKernel()) {
        to.setKernel(from.getKernel());
    }
    if (from.isSetType()) {
        to.setType(from.getType());
    }
    if (from.isSetVersion()) {
        to.setVersion(adaptIn(from.getVersion()));
    }
    return to;
}
Also used : V3OperatingSystem(org.ovirt.engine.api.v3.types.V3OperatingSystem) OperatingSystem(org.ovirt.engine.api.model.OperatingSystem) V3Boot(org.ovirt.engine.api.v3.types.V3Boot) BootDevice(org.ovirt.engine.api.model.BootDevice) V3Boot(org.ovirt.engine.api.v3.types.V3Boot) Boot(org.ovirt.engine.api.model.Boot)

Aggregations

Boot (org.ovirt.engine.api.model.Boot)7 OperatingSystem (org.ovirt.engine.api.model.OperatingSystem)4 BootDevice (org.ovirt.engine.api.model.BootDevice)2 Host (org.ovirt.engine.api.model.Host)2 Template (org.ovirt.engine.api.model.Template)2 Vm (org.ovirt.engine.api.model.Vm)2 V3Boot (org.ovirt.engine.api.v3.types.V3Boot)2 V3OperatingSystem (org.ovirt.engine.api.v3.types.V3OperatingSystem)2 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)2 OsRepository (org.ovirt.engine.core.common.osinfo.OsRepository)2 HashSet (java.util.HashSet)1 Test (org.junit.Test)1 Action (org.ovirt.engine.api.model.Action)1 Display (org.ovirt.engine.api.model.Display)1 ExternalHostProvider (org.ovirt.engine.api.model.ExternalHostProvider)1 GuestOperatingSystem (org.ovirt.engine.api.model.GuestOperatingSystem)1 HighAvailability (org.ovirt.engine.api.model.HighAvailability)1 InstanceType (org.ovirt.engine.api.model.InstanceType)1 Kernel (org.ovirt.engine.api.model.Kernel)1 TemplateVersion (org.ovirt.engine.api.model.TemplateVersion)1