public StorageLinkPool(StorageLinkConnection storageLinkConnection, string opaque_ref, string friendlyName, string parentStorageLinkPoolId, string storageLinkSystemId, uint capacity, uint usedSpace, StorageLinkEnums.RaidType raidTypes, StorageLinkEnums.ProvisioningType provisioningTypes) : base(storageLinkConnection, opaque_ref, friendlyName) { Util.ThrowIfParameterNull(parentStorageLinkPoolId, "parentStorageLinkPoolId"); Util.ThrowIfParameterNull(storageLinkSystemId, "storageLinkSystemId"); ParentStorageLinkPoolId = parentStorageLinkPoolId; StorageLinkSystemId = storageLinkSystemId; _capacity = capacity; _usedSpace = usedSpace; RaidTypes = raidTypes; ProvisioningTypes = provisioningTypes; }
private static List <CslgParameter> GetProvisioningTypes(StorageLinkEnums.ProvisioningType provisioningType) { List <CslgParameter> output = new List <CslgParameter>(); if ((provisioningType & StorageLinkEnums.ProvisioningType.THICK) != 0) { output.Add(new CslgParameter("THICK", Messages.NEWSR_CSLG_THICK_PROVISIONING)); } if ((provisioningType & StorageLinkEnums.ProvisioningType.THIN) != 0) { output.Add(new CslgParameter("THIN", Messages.NEWSR_CSLG_THIN_PROVISIONING)); } return(output); }
public StorageLinkPool(string opaque_ref, string friendlyName, string parentStorageLinkPoolId, string storageLinkSystemId, uint capacity, uint usedSpace, StorageLinkEnums.RaidType raidTypes, StorageLinkEnums.ProvisioningType provisioningTypes) { Util.ThrowIfStringParameterNullOrEmpty(opaque_ref, "opaque_ref"); Util.ThrowIfParameterNull(friendlyName, "friendlyName"); Util.ThrowIfParameterNull(parentStorageLinkPoolId, "parentStorageLinkPoolId"); Util.ThrowIfParameterNull(storageLinkSystemId, "storageLinkSystemId"); _friendlyName = friendlyName; ParentStorageLinkPoolId = parentStorageLinkPoolId; StorageLinkSystemId = storageLinkSystemId; _capacity = capacity; _usedSpace = usedSpace; RaidTypes = raidTypes; ProvisioningTypes = provisioningTypes; }
public StorageLinkRepository(StorageLinkConnection storageLinkConnection, string opaque_ref, string friendlyName, StorageLinkServer server, string storageSystemId, string storagePoolId, StorageLinkEnums.RaidType raidType, StorageLinkEnums.ProvisioningType provisioningType, StorageLinkEnums.ProvisioningOptions provisioningOptions, string hostGroupId) : base(storageLinkConnection, opaque_ref, friendlyName) { Util.ThrowIfParameterNull(server, "server"); Util.ThrowIfParameterNull(storageSystemId, "storageSystemId"); Util.ThrowIfParameterNull(storagePoolId, "storagePoolId"); Util.ThrowIfParameterNull(hostGroupId, "hostGroupId"); StorageLinkServer = server; StorageLinkSystemId = storageSystemId; StorageLinkPoolId = storagePoolId; RaidType = raidType; ProvisioningType = provisioningType; ProvisioningOptions = provisioningOptions; HostGroupId = hostGroupId; }
private void Update() { var systems = new List <StorageLinkSystem>(); var pools = new List <StorageLinkPool>(); var adapters = new List <StorageLinkAdapter>(); var volumes = new List <StorageLinkVolume>(); var repositories = new List <StorageLinkRepository>(); var server = new StorageLinkServer(this, Host + " " + Username, Host); if (Cache.Server == null) { Invoke(() => Cache.Update(server, new List <StorageLinkSystem>(), new List <StorageLinkPool>(), new List <StorageLinkAdapter>(), new List <StorageLinkVolume>(), new List <StorageLinkRepository>())); } var flags = StorageLinkEnums.FlagsType.NONE; if (RefreshInProgress) { flags = StorageLinkEnums.FlagsType.DEEP_REFRESH_CACHE; } try { foreach (storageAdapterInfo adapterInfo in _service.enumStorageAdapters()) { adapters.Add(new StorageLinkAdapter(this, adapterInfo.objectId, adapterInfo.friendlyName, adapterInfo.name, adapterInfo.storageAdapterCredInputOptions, adapterInfo.defaultNamespace, adapterInfo.defaultPortNumber, adapterInfo.isSMIS)); } storageSystemInfo[] storageSystems; _service.enumStorageSystems(string.Empty, (int)flags, out storageSystems); server = new StorageLinkServer(this, _service.Host + " " + Username, Host); foreach (storageSystemInfo systemInfo in storageSystems) { StorageLinkSystem system = new StorageLinkSystem(this, systemInfo.objectId, systemInfo.friendlyName, server, systemInfo.storageSystemId, systemInfo.serialNum, systemInfo.model, systemInfo.displayName, systemInfo.storageAdapterId, (StorageLinkEnums.StorageSystemCapabilities)systemInfo.capabilities); try { storagePoolInfo[] storagePools; _service.enumStoragePools(systemInfo.storageSystemId, string.Empty, (int)StorageLinkEnums.FlagsType.NONE, out storagePools); storageVolumeInfo[] vols; _service.enumStorageNodes(systemInfo.storageSystemId, string.Empty, string.Empty, (int)flags, out vols); foreach (storagePoolInfo poolInfo in storagePools) { StorageLinkEnums.RaidType raidType = (StorageLinkEnums.RaidType)poolInfo.supportedRaidTypes; StorageLinkEnums.ProvisioningType provTypes = (StorageLinkEnums.ProvisioningType)poolInfo.supportedProvisioningTypes; pools.Add(new StorageLinkPool(this, poolInfo.objectId, poolInfo.friendlyName, poolInfo.parentPool, poolInfo.storageSystemId, poolInfo.sizeInMB, poolInfo.sizeInMB - poolInfo.freeSpaceInMB, (StorageLinkEnums.RaidType)poolInfo.supportedRaidTypes, (StorageLinkEnums.ProvisioningType)poolInfo.supportedProvisioningTypes)); } volumes.AddRange(Array.ConvertAll(vols, v => new StorageLinkVolume(this, v.objectId, server, v.friendlyName, v.storageSystemId, v.storagePoolId, v.sizeInMB, v.usedSpaceInMB))); } catch (SoapException) { //log.Error(e.Message, e); continue; } catch (WebException) { //log.Error(e.Message, e); continue; } systems.Add(system); } storageRepositoryInfo[] srs; _service.enumStorageRepositories(string.Empty, string.Empty, (int)flags, out srs); foreach (storageRepositoryInfo sr in srs) { if (systems.Find(s => s.opaque_ref == sr.storageSystemId) != null && pools.Find(p => p.opaque_ref == sr.storagePoolId) != null) { repositories.Add(new StorageLinkRepository(this, sr.objectId, sr.friendlyName, server, sr.storageSystemId, sr.storagePoolId, (StorageLinkEnums.RaidType)sr.raidType, (StorageLinkEnums.ProvisioningType)sr.provisioningType, (StorageLinkEnums.ProvisioningOptions)sr.useDeduplication, sr.hostGroupUuid)); } } } finally { Invoke(() => Cache.Update(server, systems, pools, adapters, volumes, repositories)); } }