use of org.ovirt.engine.api.model.VcpuPin in project ovirt-engine by oVirt.
the class VmMapperTest method postPopulate.
@Override
protected Vm postPopulate(Vm from) {
from.setType(MappingTestHelper.shuffle(VmType.class));
from.setStorageErrorResumeBehaviour(MappingTestHelper.shuffle(VmStorageErrorResumeBehaviour.class));
from.setOrigin(OriginType.VMWARE.name().toLowerCase());
from.getDisplay().setType(MappingTestHelper.shuffle(DisplayType.class));
from.getPayloads().getPayloads().get(0).setType(MappingTestHelper.shuffle(VmDeviceType.class));
List<BootDevice> devices = from.getOs().getBoot().getDevices().getDevices();
for (int i = 0; i < devices.size(); i++) {
devices.set(i, MappingTestHelper.shuffle(BootDevice.class));
}
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));
}
CpuTune cpuTune = new CpuTune();
VcpuPin pin = new VcpuPin();
pin.setVcpu(33);
pin.setCpuSet("1-4,6");
VcpuPins pins = new VcpuPins();
pins.getVcpuPins().add(pin);
cpuTune.setVcpuPins(pins);
from.getCpu().setCpuTune(cpuTune);
from.setTimeZone(new TimeZone());
from.getTimeZone().setName("Australia/Darwin");
// VmPlacement - multiple hosts
from.setPlacementPolicy(createPlacementPolicy(Guid.EVERYONE, Guid.SYSTEM));
// Guest Nics configurations
for (NicConfiguration guestNic : from.getInitialization().getNicConfigurations().getNicConfigurations()) {
guestNic.setBootProtocol(MappingTestHelper.shuffle(BootProtocol.class, BootProtocol.AUTOCONF));
}
from.getDisplay().setType(DisplayType.SPICE);
from.getSerialNumber().setPolicy(SerialNumberPolicy.CUSTOM);
from.getDisplay().setFileTransferEnabled(true);
from.getDisplay().setCopyPasteEnabled(true);
from.getMigration().setAutoConverge(InheritableBoolean.TRUE);
from.getMigration().setCompressed(InheritableBoolean.TRUE);
from.getDisplay().setDisconnectAction(DisplayDisconnectAction.LOCK_SCREEN.toString());
return from;
}
Aggregations