After reading some articles on the site of luc (www.lucd.info)
I used some of his functions to create some dswitches.
For the creation of portgroups i wanted to change the security settings to disallow, promiscious mode, mac changes and forged transmits, like so:
$spec.defaultPortConfig.securityPolicy = New-Object VMware.Vim.DVSSecurityPolicy
$spec.defaultPortConfig.securityPolicy.allowPromiscuous = $false
$spec.defaultPortConfig.securityPolicy.forgedTransmits = $false
$spec.defaultPortConfig.securityPolicy.macChanges = $false
But for some reason this doesn't work, i get the following error:
Exception setting "MacChanges": "Cannot convert value "False" to type "VMware.V
im.BoolPolicy". Error: "Invalid cast from 'System.Boolean' to 'VMware.Vim.BoolP
olicy'.""
What am i doing wrong?
Try this:
$spec.defaultPortConfig.securityPolicy.macChanges = New-Object VMware.Vim.BoolPolicy $spec.defaultPortConfig.securityPolicy.macChanges.Value= $false
The same approach applies to allowPromiscuous and forgedTransmits properties.
Regards,
Yasen
Try this:
$spec.defaultPortConfig.securityPolicy.macChanges = New-Object VMware.Vim.BoolPolicy $spec.defaultPortConfig.securityPolicy.macChanges.Value= $false
The same approach applies to allowPromiscuous and forgedTransmits properties.
Regards,
Yasen
Thanks.
It works now.
Thanks.
It works now.