static org.ovirt.engine.core.common.businessentities.VmTemplate setUpEntityExpectations( org.ovirt.engine.core.common.businessentities.VmTemplate entity, int index) { entity.setId(GUIDS[index]); entity.setClusterId(GUIDS[2]); entity.setName(NAMES[index]); entity.setDescription(DESCRIPTIONS[index]); entity.setCpuPerSocket(4); entity.setNumOfSockets(2); entity.setDefaultDisplayType(DisplayType.qxl); entity.setNumOfMonitors(2); entity.setVmType(VmType.Server); return entity; }
private void onEditInstanceType() { UnitVmModel model = (UnitVmModel) getWindow(); if (!model.validateInstanceTypePart()) { return; } VmTemplate instanceType = (VmTemplate) Cloner.clone(selectedItem); instanceType.setTemplateType(VmEntityType.INSTANCE_TYPE); buildVmStatic(instanceType); instanceType.setDescription(model.getDescription().getEntity()); UpdateVmTemplateParameters updateInstanceTypeParameters = new UpdateVmTemplateParameters(instanceType); updateInstanceTypeParameters.setSoundDeviceEnabled(model.getIsSoundcardEnabled().getEntity()); updateInstanceTypeParameters.setConsoleEnabled(model.getIsConsoleDeviceEnabled().getEntity()); updateInstanceTypeParameters.setBalloonEnabled(model.getMemoryBalloonDeviceEnabled().getEntity()); updateInstanceTypeParameters.setVirtioScsiEnabled(model.getIsVirtioScsiEnabled().getEntity()); if(model.getIsHeadlessModeEnabled().getEntity()) { updateInstanceTypeParameters.getVmTemplateData().setDefaultDisplayType(DisplayType.none); } setVmWatchdogToParams(model, updateInstanceTypeParameters); setRngDeviceToParams(model, updateInstanceTypeParameters); BuilderExecutor.build(model, updateInstanceTypeParameters, new UnitToGraphicsDeviceParamsBuilder()); getWindow().startProgress(); Frontend.getInstance().runAction( ActionType.UpdateVmTemplate, updateInstanceTypeParameters, new UnitVmModelNetworkAsyncCallback(model, addInstanceTypeNetworkManager, instanceType.getId()), this ); }
parameters.getVmTemplateData().setDefaultDisplayType(DisplayType.none);
obj.setStoragePoolId(instance.getStoragePoolId()); obj.setStoragePoolName(instance.getStoragePoolName()); obj.setDefaultDisplayType(instance.getDefaultDisplayType()); obj.setPriority(instance.getPriority()); obj.setIsoPath(instance.getIsoPath());