Search in sources :

Example 86 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class JsonObjectSerializationEntitiesTest method randomStorageDomainStatic.

private static StorageDomainStatic randomStorageDomainStatic() {
    RandomUtils random = RandomUtils.instance();
    StorageDomainStatic sds = new StorageDomainStatic();
    sds.setId(Guid.newGuid());
    sds.setStorage(random.nextString(10));
    sds.setStorageType(random.nextEnum(StorageType.class));
    sds.setStorageName(random.nextString(10));
    sds.setDescription(random.nextString(10));
    sds.setWarningLowSpaceIndicator(5);
    sds.setCriticalSpaceActionBlocker(10);
    return sds;
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) RandomUtils(org.ovirt.engine.core.utils.RandomUtils)

Example 87 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class DataCenterGuideModel method savePosixStorage.

private void savePosixStorage(final TaskContext context) {
    this.context = context;
    StorageModel model = (StorageModel) getWindow();
    boolean isNew = model.getStorage() == null;
    storageModel = model.getCurrentStorageItem();
    PosixStorageModel posixModel = (PosixStorageModel) storageModel;
    path = posixModel.getPath().getEntity();
    storageDomain = new StorageDomainStatic();
    storageDomain.setStorageType(isNew ? storageModel.getType() : storageDomain.getStorageType());
    storageDomain.setStorageDomainType(isNew ? storageModel.getRole() : storageDomain.getStorageDomainType());
    storageDomain.setStorageName(model.getName().getEntity());
    storageDomain.setStorageFormat(model.getFormat().getSelectedItem());
    AsyncDataProvider.getInstance().getStorageDomainsByConnection(new AsyncQuery<>(storages -> {
        if (storages != null && storages.size() > 0) {
            String storageName = storages.get(0).getStorageName();
            onFinish(context, false, storageModel, ConstantsManager.getInstance().getMessages().createOperationFailedDcGuideMsg(storageName));
        } else {
            saveNewPosixStorage();
        }
    }), null, path);
}
Also used : PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) SearchType(org.ovirt.engine.core.common.interfaces.SearchType) Arrays(java.util.Arrays) RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) GuideModel(org.ovirt.engine.ui.uicommonweb.models.GuideModel) IFrontendMultipleActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) ManagementNetworkOnClusterOperationParameters(org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters) PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) NewEditStorageModelBehavior(org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior) AttachStorageDomainToPoolParameters(org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters) VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) Set(java.util.Set) AddSANStorageDomainParameters(org.ovirt.engine.core.common.action.AddSANStorageDomainParameters) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus) Collectors(java.util.stream.Collectors) MoveHost(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost) List(java.util.List) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) StorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel) AddVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters) ClusterModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) ITaskTarget(org.ovirt.engine.ui.uicompat.ITaskTarget) Guid(org.ovirt.engine.core.compat.Guid) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback) TaskContext(org.ovirt.engine.ui.uicompat.TaskContext) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) FrontendMultipleActionAsyncResult(org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult) Task(org.ovirt.engine.ui.uicompat.Task) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GetDeviceListQueryParameters(org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Frontend(org.ovirt.engine.ui.frontend.Frontend) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) ChangeVDSClusterParameters(org.ovirt.engine.core.common.action.ChangeVDSClusterParameters) ClusterListModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel) Model(org.ovirt.engine.ui.uicommonweb.models.Model) StoragePoolStatus(org.ovirt.engine.core.common.businessentities.StoragePoolStatus) MoveHostData(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHostData) SanStorageModelBase(org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) Linq(org.ovirt.engine.ui.uicommonweb.Linq) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) ApproveVdsParameters(org.ovirt.engine.core.common.action.hostdeploy.ApproveVdsParameters) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) Collections(java.util.Collections) VDS(org.ovirt.engine.core.common.businessentities.VDS) LunModel(org.ovirt.engine.ui.uicommonweb.models.storage.LunModel) Timer(com.google.gwt.user.client.Timer) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) StorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel)

Example 88 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class DataCenterGuideModel method saveNfsStorage.

private void saveNfsStorage(final TaskContext context) {
    this.context = context;
    StorageModel model = (StorageModel) getWindow();
    boolean isNew = model.getStorage() == null;
    storageModel = model.getCurrentStorageItem();
    NfsStorageModel nfsModel = (NfsStorageModel) storageModel;
    path = nfsModel.getPath().getEntity();
    storageDomain = new StorageDomainStatic();
    storageDomain.setStorageType(isNew ? storageModel.getType() : storageDomain.getStorageType());
    storageDomain.setStorageDomainType(isNew ? storageModel.getRole() : storageDomain.getStorageDomainType());
    storageDomain.setStorageName(model.getName().getEntity());
    storageDomain.setStorageFormat(model.getFormat().getSelectedItem());
    AsyncDataProvider.getInstance().getStorageDomainsByConnection(new AsyncQuery<>(storages -> {
        if (storages != null && storages.size() > 0) {
            String storageName = storages.get(0).getStorageName();
            onFinish(context, false, storageModel, ConstantsManager.getInstance().getMessages().createOperationFailedDcGuideMsg(storageName));
        } else {
            saveNewNfsStorage();
        }
    }), null, path);
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) SearchType(org.ovirt.engine.core.common.interfaces.SearchType) Arrays(java.util.Arrays) RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) GuideModel(org.ovirt.engine.ui.uicommonweb.models.GuideModel) IFrontendMultipleActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) ManagementNetworkOnClusterOperationParameters(org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters) PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) NewEditStorageModelBehavior(org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior) AttachStorageDomainToPoolParameters(org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters) VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) Set(java.util.Set) AddSANStorageDomainParameters(org.ovirt.engine.core.common.action.AddSANStorageDomainParameters) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus) Collectors(java.util.stream.Collectors) MoveHost(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost) List(java.util.List) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) StorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel) AddVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters) ClusterModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) ITaskTarget(org.ovirt.engine.ui.uicompat.ITaskTarget) Guid(org.ovirt.engine.core.compat.Guid) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback) TaskContext(org.ovirt.engine.ui.uicompat.TaskContext) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) FrontendMultipleActionAsyncResult(org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult) Task(org.ovirt.engine.ui.uicompat.Task) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GetDeviceListQueryParameters(org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Frontend(org.ovirt.engine.ui.frontend.Frontend) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) ChangeVDSClusterParameters(org.ovirt.engine.core.common.action.ChangeVDSClusterParameters) ClusterListModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel) Model(org.ovirt.engine.ui.uicommonweb.models.Model) StoragePoolStatus(org.ovirt.engine.core.common.businessentities.StoragePoolStatus) MoveHostData(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHostData) SanStorageModelBase(org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) Linq(org.ovirt.engine.ui.uicommonweb.Linq) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) ApproveVdsParameters(org.ovirt.engine.core.common.action.hostdeploy.ApproveVdsParameters) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) Collections(java.util.Collections) VDS(org.ovirt.engine.core.common.businessentities.VDS) LunModel(org.ovirt.engine.ui.uicommonweb.models.storage.LunModel) Timer(com.google.gwt.user.client.Timer) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) StorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel)

Example 89 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class DataCenterGuideModel method saveLocalStorage.

private void saveLocalStorage(final TaskContext context) {
    this.context = context;
    StorageModel model = (StorageModel) getWindow();
    VDS host = model.getHost().getSelectedItem();
    boolean isNew = model.getStorage() == null;
    storageModel = model.getCurrentStorageItem();
    LocalStorageModel localModel = (LocalStorageModel) storageModel;
    path = localModel.getPath().getEntity();
    storageDomain = new StorageDomainStatic();
    storageDomain.setStorageType(isNew ? storageModel.getType() : storageDomain.getStorageType());
    storageDomain.setStorageDomainType(isNew ? storageModel.getRole() : storageDomain.getStorageDomainType());
    storageDomain.setStorageName(model.getName().getEntity());
    AsyncDataProvider.getInstance().getStorageDomainsByConnection(new AsyncQuery<>(storages -> {
        if (storages != null && storages.size() > 0) {
            String storageName = storages.get(0).getStorageName();
            onFinish(context, false, storageModel, ConstantsManager.getInstance().getMessages().createOperationFailedDcGuideMsg(storageName));
        } else {
            saveNewLocalStorage();
        }
    }), host.getStoragePoolId(), path);
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) SearchType(org.ovirt.engine.core.common.interfaces.SearchType) Arrays(java.util.Arrays) RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) GuideModel(org.ovirt.engine.ui.uicommonweb.models.GuideModel) IFrontendMultipleActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) ManagementNetworkOnClusterOperationParameters(org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters) PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) NewEditStorageModelBehavior(org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior) AttachStorageDomainToPoolParameters(org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters) VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) Set(java.util.Set) AddSANStorageDomainParameters(org.ovirt.engine.core.common.action.AddSANStorageDomainParameters) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus) Collectors(java.util.stream.Collectors) MoveHost(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost) List(java.util.List) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) StorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel) AddVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters) ClusterModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) ITaskTarget(org.ovirt.engine.ui.uicompat.ITaskTarget) Guid(org.ovirt.engine.core.compat.Guid) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback) TaskContext(org.ovirt.engine.ui.uicompat.TaskContext) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) FrontendMultipleActionAsyncResult(org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult) Task(org.ovirt.engine.ui.uicompat.Task) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GetDeviceListQueryParameters(org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Frontend(org.ovirt.engine.ui.frontend.Frontend) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) ChangeVDSClusterParameters(org.ovirt.engine.core.common.action.ChangeVDSClusterParameters) ClusterListModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel) Model(org.ovirt.engine.ui.uicommonweb.models.Model) StoragePoolStatus(org.ovirt.engine.core.common.businessentities.StoragePoolStatus) MoveHostData(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHostData) SanStorageModelBase(org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) Linq(org.ovirt.engine.ui.uicommonweb.Linq) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) ApproveVdsParameters(org.ovirt.engine.core.common.action.hostdeploy.ApproveVdsParameters) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) Collections(java.util.Collections) VDS(org.ovirt.engine.core.common.businessentities.VDS) LunModel(org.ovirt.engine.ui.uicommonweb.models.storage.LunModel) Timer(com.google.gwt.user.client.Timer) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) VDS(org.ovirt.engine.core.common.businessentities.VDS) PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) StorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel)

Example 90 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class ExportVmCommand method buildMoveOrCopyImageGroupParametersForMemoryDumpImage.

private MoveOrCopyImageGroupParameters buildMoveOrCopyImageGroupParametersForMemoryDumpImage(Guid containerID, DiskImage disk) {
    MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(containerID, disk.getId(), disk.getImageId(), getParameters().getStorageDomainId(), ImageOperation.Copy);
    StorageDomainStatic sourceDomain = storageDomainStaticDao.get(disk.getStorageIds().get(0));
    // so we need to use copy collapse in order to convert it to be sparsed in the export domain
    if (sourceDomain.getStorageType().isBlockDomain()) {
        params.setUseCopyCollapse(true);
        params.setVolumeType(VolumeType.Sparse);
        params.setVolumeFormat(VolumeFormat.RAW);
    }
    return params;
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) MoveOrCopyImageGroupParameters(org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters)

Aggregations

StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)92 Guid (org.ovirt.engine.core.compat.Guid)39 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)35 ArrayList (java.util.ArrayList)33 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)31 Test (org.junit.Test)23 Pair (org.ovirt.engine.core.common.utils.Pair)19 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)18 StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)15 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)15 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)14 List (java.util.List)13 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)13 StorageDomainManagementParameter (org.ovirt.engine.core.common.action.StorageDomainManagementParameter)13 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)13 VDS (org.ovirt.engine.core.common.businessentities.VDS)12 HashSet (java.util.HashSet)11 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)11 ActionType (org.ovirt.engine.core.common.action.ActionType)11 AttachStorageDomainToPoolParameters (org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters)10