Esempio n. 1
0
 private static DynamicVolume GetVolume(DiskGroupDatabase database, VolumeRecord volumeRecord, ComponentRecord componentRecord)
 {
     if (componentRecord.ExtentLayout == ExtentLayoutName.Concatenated)
     {
         if (componentRecord.NumberOfExtents == 1)
         {
             // Simple volume
             return(GetSimpleVolume(database, componentRecord, volumeRecord));;
         }
         else
         {
             // spanned volume
             SpannedVolume volume = GetSpannedVolume(database, componentRecord, volumeRecord);
             return(volume);
         }
     }
     else if (componentRecord.ExtentLayout == ExtentLayoutName.Stripe)
     {
         // striped volume
         StripedVolume volume = GetStripedVolume(database, componentRecord, volumeRecord);
         return(volume);
     }
     else if (componentRecord.ExtentLayout == ExtentLayoutName.RAID5)
     {
         Raid5Volume volume = GetRAID5Volume(database, componentRecord, volumeRecord);
         return(volume);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 2
0
        private static SpannedVolume GetSpannedVolume(DiskGroupDatabase database, ComponentRecord componentRecord, VolumeRecord volumeRecord)
        {
            List <DynamicColumn> columns = GetDynamicVolumeColumns(database, componentRecord, volumeRecord);

            SpannedVolume volume = new SpannedVolume(columns[0], volumeRecord.VolumeGuid, database.DiskGroupGuid);

            volume.VolumeID      = volumeRecord.VolumeId;
            volume.Name          = volumeRecord.Name;
            volume.DiskGroupName = database.DiskGroupName;
            return(volume);
        }