Setting Default VDSwitch security for vCloud with PowerCLI

June 11, 2013

Table of Contents

Being versed with knowledge on vCloud provider have in many occasions helped my friends who have their own private vCloud ,so I thought it will be a good  idea to share this with you.

It is about setting default security permissions for all new  VDportgroups that were created by vCloud director. Which defers from when setting security on a single portgroup. It sets the default for all portgroups created after the setting change?

############################################

# Configuration Settings                   #

############################################

$switchName=”dvSwitch”

$promiscuous=$true

$forgedTransmits=$false

$macChanges=$false

###################################################

# no need to edit anything below this line #

###################################################

$dvSwitch = Get-VDSwitch $switchname

$spec = New-Object VMware.Vim.VMwareDVSConfigSpec

$spec.configVersion = $dvswitch.ExtensionData.Config.ConfigVersion

$spec.DefaultPortConfig = New-Object VMware.Vim.VMwareDVSPortSetting

$spec.DefaultPortConfig.SecurityPolicy = New-Object VMware.Vim.DVSSecurityPolicy

$spec.DefaultPortConfig.SecurityPolicy.AllowPromiscuous = New-Object VMware.Vim.BoolPolicy

$spec.DefaultPortConfig.SecurityPolicy.AllowPromiscuous.Value = $promiscuous

 

$spec.DefaultPortConfig.SecurityPolicy.MacChanges = New-ObjectVMware.Vim.BoolPolicy

$spec.DefaultPortConfig.SecurityPolicy.MacChanges.Value = $macChanges

$spec.DefaultPortConfig.SecurityPolicy.ForgedTransmits = New-Object VMware.Vim.BoolPolicy

$spec.DefaultPortConfig.SecurityPolicy.ForgedTransmits.Value = $forgedTransmits

$dvswitch.ExtensionData.ReconfigureDvs_Task($spec)

Luckily this will be help to those who need it.

Home

Share on
Facebook
Twitter
LinkedIn
Pinterest
More posts

Dedicated Servers Quick Guide

What is a Dedicated Servers? Why bother using a dedicated server over a VPS or Shared Hosting?A dedicated server is a server 100% dedicated to your website/project or business needs.

vCheck6 Utility Commands

There is a new release of the vCheck6 and those with need for more info they can visit the vCheck 6 release page and ensure to visit the vCheck plugins

VMware vCenter Server 5.1 Update 2

There are some new features in the new VMware released some days back a vCenter Server 5.1 update 2 build 1473063. This update enables the customization for windows 8.1, windows

Get 90% Discount

First 3 People gets the Bonus!
Don't Miss Out Our Big Sale

Get 0-90% On All
247Rack Services

247Rack

The Sale Is Until The End Of March