You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Examples for vNugglets.VDNetworking PowerShell module for VMware vSphere Virtual Distributed Networking management
Get-VNVDTrafficFilterPolicyConfig: Get the VDTrafficFilterPolicy configuration for the given VDPortgroup(s) from VDSwitch(es)
## Get the TrafficFilter policy config for the given VDPortgroupGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficFilterPolicyConfig
Get-VNVDTrafficRule: Get the VDTrafficRule for the TrafficRuleset from the given VDTrafficFilterPolicy configuration from VDPortgroup(s)
## Get the traffic rules from the TrafficeRuleset, which was gotten from the vDPG's TrafficFilterPolicyConfigGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficFilterPolicyConfig|Get-VNVDTrafficRuleSet|Get-VNVDTrafficRule## Get traffic rules whose name is like "myTestRule*"Get-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficFilterPolicyConfig|Get-VNVDTrafficRuleSet|Get-VNVDTrafficRule myTestRule*
Get-VNVDTrafficRuleAction: Get the VDTrafficRule Action for the TrafficRule from the given VDTrafficFilterPolicy configuration from VDPortgroup(s)
## Get the traffic rules action from the traffic rules from the TrafficeRuleset property of the TrafficFilterPolicyConfigGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficFilterPolicyConfig|Get-VNVDTrafficRule|Get-VNVDTrafficRuleAction
Get-VNVDTrafficRuleQualifier: Get the VDTrafficRule Qualifier for the TrafficRule from the given VDTrafficFilterPolicy configuration from VDPortgroup(s)
## Get the traffic rules qualifiers from the traffic rules from the TrafficeRuleset property of the TrafficFilterPolicyConfigGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficFilterPolicyConfig|Get-VNVDTrafficRule|Get-VNVDTrafficRuleQualifier
Get-VNVDTrafficRuleSet: Get the DvsTrafficRuleset for the given VDTrafficFilterPolicy configuration from VDPortgroup(s), or from VDPortgroup(s) directly
## Get the traffic ruleset from the TrafficFilterPolicyConfig object of a given vDPG. Can also get the ruleset from just the vDPG, but this "from TrafficFilterPolicyConfig" method is to help show the relationship between the vDPG, the TrafficFilterPolicyConfig, and the TrafficRulesetGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficFilterPolicyConfig|Get-VNVDTrafficRuleSet## Get the traffic ruleset directly from the given vDPGGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficRuleSet
Get-VNVSwitchByVMHostNetworkAdapter: Get the virtual switch (standard or distributed) with which the given VMHostNetworkAdapter physical NIC is associated, if any.
## Get the vSwitch with which VMNIC2 on myVMHost0.dom.com is associatedGet-VMHostmyVMHost0.dom.com|Get-VMHostNetworkAdapter-Name vmnic2 |Get-VNVSwitchByVMHostNetworkAdapter
New-VNVDTrafficRule: Make new Traffic Rule and add it to the given Traffic Ruleset of a vDPortgroup traffic filter policy
## Create a new Traffic Rule that has two Qualifiers and add it to the given TrafficRuleset from the given vDPortgroup. The new Traffic Rule allows vMotion traffic from given source networkGet-VDPortGroup myVDPG0 |Get-VNVDTrafficRuleSet|New-VNVDTrafficRule-Name "Allow vMotion from source network"-Action (New-VNVDTrafficRuleAction-Allow) -Qualifier (New-VNVDTrafficRuleQualifier-SystemTrafficType vMotion), (New-VNVDTrafficRuleQualifier-SourceIpAddress 10.0.0.0/8)
## Create a new Traffic Rule that has two Qualifiers and add it to the given TrafficRuleset from the given vDPortgroup. The new Traffic Rule adds a DSCP tag with value 8 to VM traffic from given source IPGet-VDPortGroup myVDPG0 |Get-VNVDTrafficRuleSet|New-VNVDTrafficRule-Name "Apply DSCP tag to VM traffic from given address"-Action (New-VNVDTrafficRuleAction-DscpTag 8) -Qualifier (New-VNVDTrafficRuleQualifier-SystemTrafficType virtualMachine), (New-VNVDTrafficRuleQualifier-SourceIpAddress 172.16.1.2) -Direction outgoingPackets
New-VNVDTrafficRuleAction: Make new VMware.Vim.DvsNetworkRuleAction, for use in creating vDPortgroup traffic filter policy rule. Currently supports creating Rule Actions of types DvsAcceptNetworkRuleAction ("Allow"), DvsDropNetworkRuleAction, and DvsUpdateTagNetworkRuleAction
## Create a new DvsAcceptNetworkRuleAction object that will specify an action of "Allow packet"New-VNVDTrafficRuleAction-Allow
## Create a new DvsDropNetworkRuleAction object that will specify an action of "Drop packet"New-VNVDTrafficRuleAction-Drop
## Create a new DvsUpdateTagNetworkRuleAction object that will specify an action of "tag with DSCP value of 8, and clear the QoS tag of packet"New-VNVDTrafficRuleAction-DscpTag 8-QosTag 0
New-VNVDTrafficRuleQualifier: Make new VMware.Vim.DvsNetworkRuleQualifier, for use in creating vDPortgroup traffic filter policy rule
## Create a new DvsSystemTrafficNetworkRuleQualifier for traffic that is vMotionNew-VNVDTrafficRuleQualifier-SystemTrafficType vMotion
## Create a new DvsSystemTrafficNetworkRuleQualifier for traffic that is _not_ Management trafficNew-VNVDTrafficRuleQualifier-SystemTrafficType Management -Negate
## Create a new DvsIpNetworkRuleQualifier for traffice from the given source IP that is _not_ to the given destination network, using TCP (6) protocol, and that is from source ports of 443 or 444New-VNVDTrafficRuleQualifier-SourceIpAddress 172.16.1.2-DestinationIpAddress 10.0.0.0/8-NegateDestinationIpAddress -Protocol 6-SourceIpPort 443-444## Create a new DvsMacNetworkRuleQualifier for traffic from the source MAC address, that is _not_ to the destination MAC, that is using EtherType 0x8922, and that is not on VLAN 10New-VNVDTrafficRuleQualifier-SourceMacAddress 00:00:56:01:23:45-DestinationMacAddress 00:00:56:78:90:12-NegateDestinationMacAddress -EtherTypeProtocol 0x8922-VlanId 10-NegateVlanId
## Create a new DvsMacNetworkRuleQualifier for traffic from the any source MAC address in the given MAC range and that is on VLAN 22New-VNVDTrafficRuleQualifier-SourceMacAddress 00:A0:C9:14:C8:29/FF:FF:00:FF:00:FF -VlanId 22
Remove-VNVDTrafficRule: Remove a Traffic Rule from the given Traffic Ruleset of a vDPortgroup traffic filter policy
## Get the TrafficRules named like "test*" from the TrafficRuleSet for the given vDPortGroup and delete themGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficRuleSet|Get-VNVDTrafficRule-Name test*|Remove-VNVDTrafficRule
Set-VNVDTrafficRuleSet: Set attributes on the DvsTrafficRuleset (like Enable/Disable it) for the given TrafficRuleSet
## Get the traffic ruleset from the TrafficFilterPolicyConfig object of a given vDPG and Enable itGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficFilterPolicyConfig|Get-VNVDTrafficRuleSet|Set-VNVDTrafficRuleSet-Enabled
## Get the traffic ruleset from the given vDPG and Disable itGet-VDSwitch-Name myVDSw0 |Get-VDPortGroup-Name myVDPG0 |Get-VNVDTrafficRuleSet|Set-VNVDTrafficRuleSet-Enabled:$false
Set-VNVMHostNetworkAdapterVDUplink: Set the VDSwitch Uplink for a VMHost physical NIC ("VMNIC") on the VDSwitch of which the VMNIC is already a part
## Set the VMNIC "vminic3" from VMHost myVMHost0.dom.com to be in VDUplink "Uplinks-02" on VDS myVDSwitch0 (the vDSwitch of which VMNIC3 is a part)Get-VMHostmyVMHost0.dom.com|Get-VMHostNetworkAdapter-Name vmnic3 |Set-VNVMHostNetworkAdapterVDUplink-UplinkName Uplinks-02## Set the VMNICs "vminic2", "vminic3" from VMHost myVMHost0.dom.com to be in VDUplinks "Uplinks-01", "Uplinks-02" on VDS myVDSwitch0 (the vDSwitch of which VMNIC2 and VMNIC3 are a part)## Could then check out the current status like:## Get-VDSwitch myVDSwitch0 | Get-VDPort -Uplink | Where-Object {$_.ProxyHost.Name -eq "myVMHost0.dom.com"} | Select-Object key, ConnectedEntity, ProxyHost, Name | Sort-Object ProxyHost, NameSet-VNVMHostNetworkAdapterVDUplink-VMHostNetworkAdapter (Get-VMHostmyVMHost0.dom.com|Get-VMHostNetworkAdapter-Name vmnic2, vmnic3) -UplinkName Uplinks-01, Uplinks-02