コード例 #1
0
        public static void OnlineAllDynamicDisks()
        {
            List <DynamicDisk> disksToOnline = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks();

            foreach (DynamicDisk disk in disksToOnline)
            {
                ((PhysicalDisk)disk.Disk).SetOnlineStatus(true);
            }
        }
コード例 #2
0
ファイル: LockHelper.cs プロジェクト: yang123vc/iSCSIConsole
        public static LockStatus LockAllDynamicDisks(bool lockAllDynamicVolumes)
        {
            List <DynamicDisk>   disksToLock   = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks();
            List <DynamicVolume> volumesToLock = new List <DynamicVolume>();

            if (lockAllDynamicVolumes)
            {
                volumesToLock = WindowsDynamicVolumeHelper.GetLockableDynamicVolumes(disksToLock);
            }

            LockStatus status = LockAllOrNone(disksToLock, volumesToLock);

            if (status == LockStatus.Success)
            {
                m_lockedDisks.AddRange(disksToLock);
                m_lockedVolumes.AddRange(volumesToLock);
            }
            return(status);
        }
コード例 #3
0
        public static bool AreDynamicDisksOnlineAndWriteable()
        {
            List <DynamicDisk>  disksToLock   = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks();
            List <PhysicalDisk> physicalDisks = new List <PhysicalDisk>();

            foreach (DynamicDisk dynamicDisk in disksToLock)
            {
                if (dynamicDisk.Disk is PhysicalDisk)
                {
                    physicalDisks.Add((PhysicalDisk)dynamicDisk.Disk);
                }
            }

            foreach (PhysicalDisk disk in physicalDisks)
            {
                bool isReadOnly;
                bool isOnline = disk.GetOnlineStatus(out isReadOnly);
                if (!isOnline || isReadOnly)
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #4
0
        /// <summary>
        /// Will not persist across reboots
        /// </summary>
        public static bool OfflineAllDynamicDisks()
        {
            List <DynamicDisk> disksToLock = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks();

            return(OfflineAllOrNone(disksToLock));
        }
コード例 #5
0
        /// <summary>
        /// Will not persist across reboots
        /// </summary>
        public static bool OfflineDiskGroup(Guid diskGroupGuid)
        {
            List <DynamicDisk> disksToOffline = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks(diskGroupGuid);

            return(OfflineAllOrNone(disksToOffline));
        }
コード例 #6
0
        public static void OnlineDiskGroup(Guid diskGroupGuid)
        {
            List <DynamicDisk> disksToOnline = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks(diskGroupGuid);

            OnlineAll(disksToOnline);
        }
コード例 #7
0
        public static bool IsDiskGroupOnlineAndWritable(Guid diskGroupGuid)
        {
            List <DynamicDisk> diskGroup = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks(diskGroupGuid);

            return(IsDiskGroupOnlineAndWritable(diskGroup));
        }
コード例 #8
0
        public static LockStatus LockDynamicDiskGroup(Guid diskGroupGuid, bool lockAllDynamicVolumes)
        {
            List <DynamicDisk> disksToLock = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks(diskGroupGuid);

            return(LockDynamicDiskGroup(disksToLock, lockAllDynamicVolumes));
        }
        public static List <DiskGroupDatabase> ReadFromPhysicalDisks()
        {
            List <DynamicDisk> dynamicDisks = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks();

            return(ReadFromDisks(dynamicDisks));
        }
コード例 #10
0
        public static DiskGroupDatabase ReadFromPhysicalDisks(Guid diskGroupGuid)
        {
            List <DynamicDisk> dynamicDisks = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks(diskGroupGuid);

            return(ReadFromDisks(dynamicDisks, diskGroupGuid));
        }
        public static List <DynamicVolume> GetDynamicVolumes()
        {
            List <DynamicDisk> disks = WindowsDynamicDiskHelper.GetPhysicalDynamicDisks();

            return(DynamicVolumeHelper.GetDynamicVolumes(disks));
        }