public void setAutoStartup(boolean value) { vmStatic.setAutoStartup(value); }
/** * Creates an array of VM static which was initiated for Priority and MigrationSupport order, and modified the * auto-startup to reflect the precedence of the auto-startup column on top the Priority. * * @return an array of VmStatics, in descending order according to: auto_startup, priority, MigrationSupport. The * auto_startup is the one being checked */ private VmStatic[] initVmStaticsOrderedByAutoStartup(List<VmStatic> vmStatics) { VmStatic[] vmStaticArray = initVmStaticsOrderedByPriority(vmStatics); // Swapping the first two VmStatics VmStatic tempVmStatic = vmStaticArray[0]; vmStaticArray[0] = vmStaticArray[1]; vmStaticArray[1] = tempVmStatic; // Maintaining the order correctness of the elements by incrementing the auto_startup of the first element vmStaticArray[0].setAutoStartup(true); updateArrayOfVmStaticsInDb(vmStaticArray); return vmStaticArray; }
/** * {@code initVmStaticsOrderedByAutoStartup(List)} is the first method in VMs order selection tests. The other init * methods: <br> * {@code initVmStaticsOrderedByPriority} and {@code initVmStaticsOrderedByAutoStartup} are relying on each other * for creating an array of VM Static objects.<br> * Each of the methods modifies the VM static array according to the column which is being tested, started from the * least important column to the most.<br> * That way prioritizing a preceded column should be reflected in the selection and therefore to validate the order * is maintained. * * @return an array of VmStatics, in descending order according to: auto_startup, priority, MigrationSupport.<br> * The MigrationSupport is the one being checked.<br> */ private VmStatic[] initVmStaticsOrderedByMigrationSupport(List<VmStatic> vmStatics) { VmStatic[] vmStaticArray = new VmStatic[getEntitiesTotalCount()]; vmStaticArray = vmStatics.toArray(vmStaticArray); // initialize the VMs with equal settings: non HA, priority 1 and MIGRATABLE for (VmStatic element : vmStaticArray) { element.setAutoStartup(false); element.setPriority(1); element.setMigrationSupport(MigrationSupport.MIGRATABLE); } // set higher migration support value for the first VM vmStaticArray[0].setMigrationSupport(MigrationSupport.PINNED_TO_HOST); vmStaticArray[1].setMigrationSupport(MigrationSupport.IMPLICITLY_NON_MIGRATABLE); updateArrayOfVmStaticsInDb(vmStaticArray); return vmStaticArray; }
private static VmStatic doMapVmBaseHwPartToVmStatic(VmBase entity, VmStatic staticVm, Version version) { staticVm.setMemSizeMb(entity.getMemSizeMb()); staticVm.setMaxMemorySizeMb(entity.getMaxMemorySizeMb()); staticVm.setAutoStartup(entity.isAutoStartup()); staticVm.setSmartcardEnabled(entity.isSmartcardEnabled()); staticVm.setDefaultBootSequence(entity.getDefaultBootSequence()); staticVm.setDefaultDisplayType(entity.getDefaultDisplayType()); staticVm.setNumOfSockets(entity.getNumOfSockets()); staticVm.setCpuPerSocket(entity.getCpuPerSocket()); staticVm.setThreadsPerCpu(entity.getThreadsPerCpu()); staticVm.setNumOfMonitors(entity.getNumOfMonitors()); staticVm.setSingleQxlPci(entity.getSingleQxlPci()); staticVm.setPriority(entity.getPriority()); staticVm.setUsbPolicy(entity.getUsbPolicy()); staticVm.setTunnelMigration(entity.getTunnelMigration()); staticVm.setMigrationSupport(entity.getMigrationSupport()); staticVm.setMigrationDowntime(entity.getMigrationDowntime()); staticVm.setDedicatedVmForVdsList(entity.getDedicatedVmForVdsList()); staticVm.setMinAllocatedMem(entity.getMinAllocatedMem()); staticVm.setNumOfIoThreads(entity.getNumOfIoThreads()); return staticVm; }
obj.setIsoPath(instance.getIsoPath()); obj.setOrigin(instance.getOrigin()); obj.setAutoStartup(instance.isAutoStartup()); obj.setCpuPerSocket(instance.getCpuPerSocket()); obj.setThreadsPerCpu(instance.getThreadsPerCpu());