Examples/Sample_ciSCSIServerTarget.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
configuration Sample_ciSCSIServerTarget
{
    Param
    (
        [String] $NodeName = 'LocalHost'
    )

    Import-DscResource -Module ciSCSI

    Node $NodeName
    {
        WindowsFeature iSCSITargetServerInstall
        { 
            Ensure = "Present"
            Name = "FS-iSCSITarget-Server"
        }

        ciSCSIVirtualDisk iSCSIClusterVDisk01
        {
            Ensure = 'Present'
            Path = 'D:\iSCSIVirtualDisks\ClusterVdisk01.vhdx'
            DiskType = 'Dynamic'
            SizeBytes = 20GB
            Description = 'Cluster Virtual Disk 01'
            DependsOn = "[WindowsFeature]ISCSITargetServerInstall"
        } # End of ciSCSIVirtualDisk Resource

        ciSCSIVirtualDisk iSCSIClusterVDisk02
        {
            Ensure = 'Present'
            Path = 'D:\iSCSIVirtualDisks\ClusterVdisk02.vhdx'
            DiskType = 'Dynamic'
            SizeBytes = 10GB
            Description = 'Cluster Virtual Disk 02'
            DependsOn = "[WindowsFeature]ISCSITargetServerInstall"
        } # End of ciSCSIVirtualDisk Resource

        ciSCSIServerTarget iSCSIClusterTarget
        {
            Ensure = 'Present'
            TargetName = 'Cluster'
            InitiatorIds = 'iqn.1991-05.com.microsoft:cluster01.contoso.com','iqn.1991-05.com.microsoft:cluster02.contoso.com','iqn.1991-05.com.microsoft:cluster03.contoso.com'
            Paths = 'D:\iSCSIVirtualDisks\ClusterVdisk01.vhdx','D:\iSCSIVirtualDisks\ClusterVdisk02.vhdx'
            iSNSServer = 'isns.contoso.com'
            DependsOn = "[ciSCSIVirtualDisk]iSCSIClusterVDisk01","[ciSCSIVirtualDisk]iSCSIClusterVDisk01"
        } # End of ciSCSIServerTarget Resource
    } # End of Node
} # End of Configuration