static org.ovirt.engine.core.common.businessentities.VM setUpEntityExpectations( org.ovirt.engine.core.common.businessentities.VM entity, VmStatistics statistics, int index, Guid vmId) { entity.setId(vmId); entity.setClusterId(GUIDS[2]); entity.setName(NAMES[index]); entity.setVmDescription(DESCRIPTIONS[index]); entity.setCpuPerSocket(4); entity.setNumOfSockets(2); entity.setUsageMemPercent(20); entity.getGraphicsInfos().put(GraphicsType.VNC, new GraphicsInfo()); entity.setNumOfMonitors(2); entity.setVmType(VmType.Server); entity.setRunOnVdsName(NAMES[NAMES.length - 1]); entity.setOrigin(index == 0 ? OriginType.HOSTED_ENGINE : OriginType.OVIRT); entity.setBootSequence(null); entity.getStaticData().setSmallIconId(GUIDS[2]); entity.getStaticData().setLargeIconId(GUIDS[3]); setUpStatisticalEntityExpectations(entity, statistics); return entity; }
vm.setVmDescription(description); updateMaxMemoryIfUnspecified(instanceType, vm);
private void postInstanceTypeNameUniqueCheck() { UnitVmModel model = (UnitVmModel) getWindow(); VM vm = new VM(); buildVmStatic(vm.getStaticData()); vm.setVmDescription(model.getDescription().getEntity()); AddVmTemplateParameters addInstanceTypeParameters = new AddVmTemplateParameters(vm, model.getName().getEntity(), model.getDescription().getEntity()); addInstanceTypeParameters.setTemplateType(VmEntityType.INSTANCE_TYPE); addInstanceTypeParameters.setVmTemplateId(null); addInstanceTypeParameters.setPublicUse(true); addInstanceTypeParameters.setSoundDeviceEnabled(model.getIsSoundcardEnabled().getEntity()); addInstanceTypeParameters.setConsoleEnabled(model.getIsConsoleDeviceEnabled().getEntity()); addInstanceTypeParameters.setBalloonEnabled(model.getMemoryBalloonDeviceEnabled().getEntity()); addInstanceTypeParameters.setVirtioScsiEnabled(model.getIsVirtioScsiEnabled().getEntity()); if(model.getIsHeadlessModeEnabled().getEntity()) { addInstanceTypeParameters.getVm().setDefaultDisplayType(DisplayType.none); } setVmWatchdogToParams(model, addInstanceTypeParameters); setRngDeviceToParams(model, addInstanceTypeParameters); BuilderExecutor.build(model, addInstanceTypeParameters, new UnitToGraphicsDeviceParamsBuilder()); getWindow().startProgress(); Frontend.getInstance().runAction( ActionType.AddVmTemplate, addInstanceTypeParameters, new UnitVmModelNetworkAsyncCallback(model, addInstanceTypeNetworkManager), this ); }
vm.setClusterName(instance.getClusterName()); vm.setVmCreationDate(instance.getVmCreationDate()); vm.setVmDescription(instance.getVmDescription()); vm.setComment(instance.getComment()); vm.setCustomEmulatedMachine(instance.getCustomEmulatedMachine());