-
Notifications
You must be signed in to change notification settings - Fork 41
VDPortGroup
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Server | Key | string | The name of the Server we are trying to connect to. The Server can only be a vCenter. | |
Credential | Mandatory | PSCredential | The credentials needed for connection to the specified Server. | |
Name | Key | string | The name of the Distributed Port Group. | |
VdsName | Mandatory | string | The name of the vSphere Distributed Switch associated with the Distributed Port Group. | |
Ensure | Mandatory | Ensure | Value indicating if the Distributed Port Group should be Present or Absent. | Present, Absent |
Notes | Optional | string | The description for the Distributed Port Group. | |
NumPorts | Optional | int | The number of ports that the Distributed Port Group will have. If the parameter is not specified, the number of ports for the Distributed Port Group is 128. | |
PortBinding | Optional | PortBinding | The port binding setting for the Distributed Port Group. | Static, Dynamic, Ephemeral |
VLanId | Optional | int | The VLAN ID for the Distributed Port Group. Valid values are integers in the range of 1 to 4094. If 0 is specified, the VLAN type is None. | |
ReferenceVDPortGroupName | Optional | string | The name for the reference Distributed Port Group. The properties of the new Distributed Port Group will be cloned from the reference Distributed Port Group. |
The resource is used to create, modify the configuration or remove the specified Distributed Port Group.
Creates a new Datacenter Datacenter in the Root Folder of the Inventory. Creates a new vSphere Distributed Switch MyVDSwitch in the Network Folder of Datacenter Datacenter. Creates a new Distributed Port Group MyVDPortGroup on vSphere Distributed Switch MyVDSwitch with Static Port Binding, 128 Ports and VLAN ID 1.
Configuration VDPortGroup_CreateVDPortGroup_Config {
Param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$Server,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
$Credential
)
Import-DscResource -ModuleName VMware.vSphereDSC
Node localhost {
Datacenter Datacenter {
Server = $Server
Credential = $Credential
Name = 'Datacenter'
Location = ''
Ensure = 'Present'
}
VDSwitch VDSwitch {
Server = $Server
Credential = $Credential
Name = 'MyVDSwitch'
Location = ''
DatacenterName = 'Datacenter'
DatacenterLocation = ''
Ensure = 'Present'
DependsOn = '[Datacenter]Datacenter'
}
VDPortGroup VDPortGroup {
Server = $Server
Credential = $Credential
Name = 'MyVDPortGroup'
VdsName = 'MyVDSwitch'
Ensure = 'Present'
NumPorts = 128
Notes = 'MyVDPortGroup Notes'
PortBinding = 'Static'
VLanId = 1
DependsOn = '[VDSwitch]VDSwitch'
}
}
}
Creates a new Datacenter Datacenter in the Root Folder of the Inventory. Creates a new vSphere Distributed Switch MyVDSwitch in the Network Folder of Datacenter Datacenter. Creates a new Distributed Port Group MyVDPortGroup on vSphere Distributed Switch MyVDSwitch with Static Port Binding and 128 Ports. Creates a new Distributed Port Group MyVDPortGroupViaReferenceVDPortGroup on vSphere Distributed Switch MyVDSwitch. The properties of the new Distributed Port Group will be cloned from the Reference Distributed Port Group MyVDPortGroup.
Configuration VDPortGroup_CreateVDPortGroupViaReferenceVDPortGroup_Config {
Param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$Server,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
$Credential
)
Import-DscResource -ModuleName VMware.vSphereDSC
Node localhost {
Datacenter Datacenter {
Server = $Server
Credential = $Credential
Name = 'Datacenter'
Location = ''
Ensure = 'Present'
}
VDSwitch VDSwitch {
Server = $Server
Credential = $Credential
Name = 'MyVDSwitch'
Location = ''
DatacenterName = 'Datacenter'
DatacenterLocation = ''
Ensure = 'Present'
DependsOn = '[Datacenter]Datacenter'
}
VDPortGroup VDPortGroup {
Server = $Server
Credential = $Credential
Name = 'MyVDPortGroup'
VdsName = 'MyVDSwitch'
Ensure = 'Present'
NumPorts = 128
Notes = 'MyVDPortGroup Notes'
PortBinding = 'Static'
DependsOn = '[VDSwitch]VDSwitch'
}
VDPortGroup VDPortGroupViaReferenceVDPortGroup {
Server = $Server
Credential = $Credential
Name = 'MyVDPortGroupViaReferenceVDPortGroup'
VdsName = 'MyVDSwitch'
Ensure = 'Present'
ReferenceVDPortGroupName = 'MyVDPortGroup'
DependsOn = '[VDPortGroup]VDPortGroup'
}
}
}
Removes Distributed Port Group MyVDPortGroup on vSphere Distributed Switch MyVDSwitch.
Configuration VDPortGroup_RemoveVDPortGroup_Config {
Param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$Server,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
$Credential
)
Import-DscResource -ModuleName VMware.vSphereDSC
Node localhost {
VDPortGroup VDPortGroup {
Server = $Server
Credential = $Credential
Name = 'MyVDPortGroup'
VdsName = 'MyVDSwitch'
Ensure = 'Absent'
}
}
}
- Home
- Tips & Tricks
- Cluster
- DRSRule
- Datacenter
- DatacenterFolder
- DatastoreCluster
- DatastoreClusterAddDatastore
- DrsCluster
- Folder
- HACluster
- NfsDatastore
- NfsUser
- PowerCLISettings
- StandardPortGroup
- StandardSwitch
- VDPortGroup
- VDSwitch
- VDSwitchVMHost
- VMHostAcceptanceLevel
- VMHostAccount
- VMHostAdvancedSettings
- VMHostAgentVM
- VMHostAuthentication
- VMHostCache
- VMHostConfiguration
- VMHostDCUIKeyboard
- VMHostDnsSettings
- VMHostFirewallRuleset
- VMHostGraphics
- VMHostGraphicsDevice
- VMHostIPRoute
- VMHostIScsiHba
- VMHostIScsiHbaTarget
- VMHostIScsiHbaVMKernelNic
- VMHostNetworkCoreDump
- VMHostNtpSettings
- VMHostPciPassthrough
- VMHostPermission
- VMHostPhysicalNic
- VMHostPowerPolicy
- VMHostRole
- VMHostSNMPAgent
- VMHostSatpClaimRule
- VMHostScsiLun
- VMHostScsiLunPath
- VMHostService
- VMHostSettings
- VMHostSharedSwapSpace
- VMHostSoftwareDevice
- VMHostStorage
- VMHostSyslog
- VMHostTpsSettings
- VMHostVDSwitchMigration
- VMHostVMKernelActiveDumpFile
- VMHostVMKernelActiveDumpPartition
- VMHostVMKernelDumpFile
- VMHostVMKernelModule
- VMHostVdsNic
- VMHostVss
- VMHostVssBridge
- VMHostVssMigration
- VMHostVssNic
- VMHostVssPortGroup
- VMHostVssPortGroupSecurity
- VMHostVssPortGroupShaping
- VMHostVssPortGroupTeaming
- VMHostVssSecurity
- VMHostVssShaping
- VMHostVssTeaming
- VMHostvSANNetworkConfiguration
- VmfsDatastore
- vCenterSettings
- vCenterStatistics
- vCenterVMHost