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.

vSphere 5.1 New Storage Features

VMFS File Sharing Limits In previous versions of vSphere, the maximum number of hosts which could share a read-only file on a VMFS volume was 8. The primary use case

Setup Nginx Website Easy Simple Guide

What is needed for a quick Nginx server and website setup? A Dedicated or VPS Server A compatible operating system 247Rack recommends: Centos OS A domain name pointed to the

Live Help

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