Examples/Resources/cVMNetworkAdapterVlan/VMNetworkAdapterVlanMultipleManagementOS.Example.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
Configuration HostOSAdapterVlan
{
    Import-DscResource -ModuleName cHyper-V -Name cVMNetworkAdapterVlan
    Import-DscResource -ModuleName PSDesiredStateConfiguration

    cVMNetworkAdapterVlan HostOSAdapterVlan {
        Id = 'Management-NIC'
        Name = 'Management-NIC'
        VMName = 'ManagementOS'
        AdapterMode = 'Access'
        VlanId = 10
    }

    cVMNetworkAdapterVlan ClusterAdapterVlan {
        Id = 'Cluster-NIC'
        Name = 'Cluster-NIC'
        VMName = 'ManagementOS'
        AdapterMode = 'Access'
        VlanId = 20
    }

    #The following configuration removes any VLAN setting, if present.
    cVMNetworkAdapterVlan JustAnotherAdapterVlan {
        Id = 'JustAnother-NIC'
        Name = 'JustAnother-NIC'
        VMName = 'ManagementOS'
        AdapterMode = 'Untagged'
    }
}