Automation

 View Only
  • 1.  Error while configuring Infrastructure Traffic Resource

    Posted Aug 17, 2016 07:23 AM

    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



  • 2.  RE: Error while configuring Infrastructure Traffic Resource
    Best Answer

    Posted Aug 17, 2016 08:03 AM

    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