asaf129
Contributor
Contributor

Error while configuring Infrastructure Traffic Resource

Jump to solution

hi,

im trying to configure some Infrastructure Traffic Resource, but while creating a dpec object i get this error:

    $dvswitch = get-vdswitch | select -First 1

    $spec = New-Object VMware.Vim.VMwareDVSConfigSpec

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

    $spec.InfrastructureTrafficResourceConfig = New-Object VMware.Vim.DvsHostInfrastructureTrafficResource

    $spec.InfrastructureTrafficResourceConfig.AllocationInfo = New-Object VMware.Vim.DvsHostInfrastructureTrafficResourceAllocation

    The property 'AllocationInfo' cannot be found on this object. Verify that the property exists and can be set.

    At line:1 char:5

    +     $spec.InfrastructureTrafficResourceConfig.AllocationInfo = New-Object VMware ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

        + FullyQualifiedErrorId : PropertyAssignmentException

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

The InfrastructureTrafficResourceConfig property on the DVSConfigSpec object expects an array of DvsHostInfrastructureTrafficResourceAllocation objects.

Try like this

$spec = New-Object VMware.Vim.VMwareDVSConfigSpec

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

$spec.InfrastructureTrafficResourceConfig = @(New-Object VMware.Vim.DvsHostInfrastructureTrafficResource)

$spec.InfrastructureTrafficResourceConfig[0].AllocationInfo = New-Object VMware.Vim.DvsHostInfrastructureTrafficResourceAllocation

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
1 Reply
LucD
Leadership
Leadership

The InfrastructureTrafficResourceConfig property on the DVSConfigSpec object expects an array of DvsHostInfrastructureTrafficResourceAllocation objects.

Try like this

$spec = New-Object VMware.Vim.VMwareDVSConfigSpec

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

$spec.InfrastructureTrafficResourceConfig = @(New-Object VMware.Vim.DvsHostInfrastructureTrafficResource)

$spec.InfrastructureTrafficResourceConfig[0].AllocationInfo = New-Object VMware.Vim.DvsHostInfrastructureTrafficResourceAllocation

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos