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.

Physical Memory Limits for Windows Releases

Physical Memory Limits: Windows 7 The following table specifies the limits on physical memory for Windows 7. Version Limit on X86 Limit on X64 Windows 7 Ultimate 4 GB 192 GB Windows 7 Enterprise

Why 247Rack Is Recommended

Only 247Rack can give you most flexible and 100% customizable VMware Solution. We have given our customers the freedom to configure every single part as their choice. Our scalable cloud

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