public void onSave() { if (getProgress() != null || !validate()) { return; } startProgress(); VM vm = getVm(); ArrayList<ActionParametersBase> params = new ArrayList<>(); Set<Guid> snapshotDisksIds = null; if (getSnapshotDisks().getSelectedItems() != null) { snapshotDisksIds = getSnapshotDisks() .getSelectedItems() .stream() .map(BaseDisk::getId) .collect(Collectors.toSet()); } CreateSnapshotForVmParameters param = new CreateSnapshotForVmParameters(vm.getId(), getDescription().getEntity(), getMemory().getEntity(), snapshotDisksIds); param.setQuotaId(vm.getQuotaId()); params.add(param); Frontend.getInstance().runMultipleAction(ActionType.CreateSnapshotForVm, params, result -> { SnapshotModel localModel = (SnapshotModel) result.getState(); localModel.stopProgress(); getCancelCommand().execute(); }, this); }
_writer.writeElement(APPLICATIONS_LIST, vm.getAppList()); if (vm.getQuotaId() != null) { _writer.writeElement(QUOTA_ID, vm.getQuotaId().toString());
_writer.writeElement(APPLICATIONS_LIST, vm.getAppList()); if (vm.getQuotaId() != null) { _writer.writeElement(QUOTA_ID, vm.getQuotaId().toString());
@Override public void postDataCenterWithClusterSelectedItemChanged() { updateDefaultHost(); updateCustomPropertySheet(); updateNumOfSockets(); updateQuotaByCluster(vm.getQuotaId(), vm.getQuotaName()); updateCpuPinningVisibility(); updateMemoryBalloon(); updateCpuSharesAvailability(); updateVirtioScsiAvailability(); updateOSValues(); updateInstanceImages(); updateLeaseStorageDomains(vm.getLeaseStorageDomainId()); instanceTypeManager.updateAll(); }
final Guid vmQuota = getVm() != null ? getVm().getQuotaId() : null; final Guid defaultQuota = diskQuota != null ? diskQuota : vmQuota;
@Test public void testGetAllVmsRelatedToQuotaId() { List<VM> result = dao.getAllVmsRelatedToQuotaId(FixturesTool.QUOTA_GENERAL); assertNotNull(result); assertFalse(result.isEmpty()); for (VM vm : result) { assertEquals(FixturesTool.QUOTA_GENERAL, vm.getQuotaId(), "Wrong quota id"); assertEquals("Quota General", vm.getQuotaName(), "Wrong quota name"); assertFalse(vm.isQuotaDefault(), "Quota shouldn't be default"); assertEquals(QuotaEnforcementTypeEnum.DISABLED, vm.getQuotaEnforcementType(), "Wrong quota enforcement type"); } }
@Override public void postDataCenterWithClusterSelectedItemChanged() { updateQuotaByCluster(vm.getQuotaId(), vm.getQuotaName()); updateMemoryBalloon(); updateCpuSharesAvailability(); updateVirtioScsiAvailability(); updateOSValues(); updateTemplate(); updateNumOfSockets(); if(getModel().getSelectedCluster() != null) { updateCpuProfile(getModel().getSelectedCluster().getId(), vm.getCpuProfileId()); } updateCustomPropertySheet(); getModel().getCustomPropertySheet().deserialize(vm.getCustomProperties()); updateLeaseStorageDomains(vm.getLeaseStorageDomainId()); }
vm.setGuestOsTimezoneName(instance.getGuestOsTimezoneName()); vm.setGuestOsTimezoneOffset(instance.getGuestOsTimezoneOffset()); vm.setQuotaId(instance.getQuotaId()); vm.setQuotaName(instance.getQuotaName()); vm.setManagedDeviceMap(instance.getManagedVmDeviceMap());