/** * This is a work-around for a VDSM bug. The call to GetDeviceList causes a necessary refresh in the VDSM, without * which the creation will fail. */ private void refreshHostStorage(Guid hostId) { getBackendCollection(QueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, StorageType.ISCSI, false, null, false)); }
public GetDeviceListQueryParameters(Guid vdsId, StorageType storageType, boolean checkStatus, Set<String> lunIds, boolean validateHostStatus) { super(vdsId); setStorageType(storageType); setCheckStatus(checkStatus); setLunIds(lunIds); setValidateHostStatus(validateHostStatus); }
private List<LUNs> getDeviceList(Guid hostId, StorageType storageType) { return getEntity(List.class, QueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, storageType, false, null, false), "GetDeviceList", true); }
protected List<LUNs> getLogicalUnits() { boolean reportStatus = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, REPORT_STATUS, true, true); GetDeviceListQueryParameters params = new GetDeviceListQueryParameters(asGuid(hostId), StorageType.UNKNOWN, reportStatus, null, true); return getBackendCollection(QueryType.GetDeviceList, params); }
private void saveSanStorage() { StorageModel storageModel = (StorageModel) getWindow(); final SanStorageModelBase sanStorageModelBase = (SanStorageModelBase) storageModel.getCurrentStorageItem(); Guid hostId = sanStorageModelBase.getContainer().getHost().getSelectedItem().getId(); if (sanStorageModelBase.getAddedLuns().isEmpty()) { onSaveSanStorage(); return; } Set<String> unkownStatusLuns = sanStorageModelBase.getAddedLuns().stream().map(LunModel::getLunId).collect(Collectors.toSet()); Frontend.getInstance() .runQuery(QueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, sanStorageModelBase.getType(), true, unkownStatusLuns, false), new AsyncQuery<QueryReturnValue>(response -> { if (response.getSucceeded()) { List<LUNs> checkedLuns = (ArrayList<LUNs>) response.getReturnValue(); postGetLunsMessages(sanStorageModelBase.getUsedLunsMessages(checkedLuns)); } else { sanStorageModelBase.setGetLUNsFailure( ConstantsManager.getInstance() .getConstants() .couldNotRetrieveLUNsLunsFailure()); } }, true)); }
public void saveNewSanStorage() { StorageModel storageModel = (StorageModel) getWindow(); final SanStorageModelBase sanStorageModelBase = (SanStorageModelBase) storageModel.getCurrentStorageItem(); Guid hostId = sanStorageModelBase.getContainer().getHost().getSelectedItem().getId(); Set<String> unkownStatusLuns = new HashSet<>(); for (LunModel lunModel : sanStorageModelBase.getAddedLuns()) { unkownStatusLuns.add(lunModel.getLunId()); } Frontend.getInstance() .runQuery(QueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, sanStorageModelBase.getType(), true, unkownStatusLuns, false), new AsyncQuery<QueryReturnValue>(response -> { if (response.getSucceeded()) { List<LUNs> checkedLuns = (ArrayList<LUNs>) response.getReturnValue(); postGetLunsMessages(sanStorageModelBase.getUsedLunsMessages(checkedLuns)); } else { sanStorageModelBase.setGetLUNsFailure( ConstantsManager.getInstance() .getConstants() .couldNotRetrieveLUNsLunsFailure()); } }, true)); }
new GetDeviceListQueryParameters(host.getId(), getType(), false, null, false), asyncQuery); getContainer().startProgress();