<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: New-VDPortgroup : Operation is not valid due to the current state of the object. in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220922#M74251</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the explanation Luc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Dec 2019 15:22:41 GMT</pubDate>
    <dc:creator>mc1903cae</dc:creator>
    <dc:date>2019-12-30T15:22:41Z</dc:date>
    <item>
      <title>New-VDPortgroup : Operation is not valid due to the current state of the object.</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220916#M74245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting the following error when adding new port groups to an existing vDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(198, 198, 198); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;&lt;P&gt;New-VDPortgroup : Operation is not valid due to the current state of the object.&lt;/P&gt;&lt;P&gt;At P:\VMware\Create vDS PortGroups\Create vDS PortGroups - New v2.ps1:30 char:25&lt;/P&gt;&lt;P&gt;+ ... t-VDSwitch $vDS | New-VDPortgroup -Name $vDS_PGName -VlanId $vDS_VLAN&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : NotSpecified: (:) [New-VDPortgroup], InvalidOperationException&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + FullyQualifiedErrorId : System.InvalidOperationException,VMware.VimAutomation.Vds.Commands.Cmdlets.NewVDPortgroup&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new port groups ARE added despite the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Powershell script I am using is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="_jivemacro_uid_15777104448421088 jive_macro_code jive_text_macro" data-renderedposition="330_8_1232_544" jivemacro_uid="_15777104448421088" modifiedtitle="true"&gt;&lt;P&gt;# vCenter Credentials&lt;/P&gt;&lt;P&gt;$VIServer = "mc-vcsa-v-301a.momusconsulting.com"&lt;/P&gt;&lt;P&gt;$VIUsername = 'administrator@vsphere.local'&lt;/P&gt;&lt;P&gt;$VIPassword = 'Pa55word5!'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# The vDS to add the PortGroups to&lt;/P&gt;&lt;P&gt;$vDS = "vDS1_SiteA-65"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# vCenter vDS Port Group and VLAN - "{PGName}" = "{VLAN ID}"&lt;/P&gt;&lt;P&gt;$vDS_VLAN_PGNAME = @{&lt;/P&gt;&lt;P&gt;"VLAN050_Prod-VMs-A" = "50"&lt;/P&gt;&lt;P&gt;"VLAN101_Management-A" = "101"&lt;/P&gt;&lt;P&gt;"VLAN102_vMotion-A" = "102"&lt;/P&gt;&lt;P&gt;"VLAN103_vSAN-A" = "103"&lt;/P&gt;&lt;P&gt;"VLAN104_iSCSI1-A" = "104"&lt;/P&gt;&lt;P&gt;"VLAN105_iSCSI2-A" = "105"&lt;/P&gt;&lt;P&gt;"VLAN106_Replication-A" = "106"&lt;/P&gt;&lt;P&gt;"VLAN107_NFS-A" = "107"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vCenter = Connect-VIServer $VIServer -User $VIUsername -Password $VIPassword -WarningAction SilentlyContinue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$vDS_VLAN_PGNAME.GetEnumerator() | Sort-Object -Property Name | Foreach-Object {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $vDS_PGName = $_.Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $vDS_VLAN = $_.Value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VDSwitch $vDS | New-VDPortgroup -Name $vDS_PGName -VlanId $vDS_VLAN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A bit confused. Would appreciate it if anyone can shine a light on why this is erroring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 13:10:11 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220916#M74245</guid>
      <dc:creator>mc1903cae</dc:creator>
      <dc:date>2019-12-30T13:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: New-VDPortgroup : Operation is not valid due to the current state of the object.</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220917#M74246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might want to edit out those credentials!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 13:17:42 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220917#M74246</guid>
      <dc:creator>T180985</dc:creator>
      <dc:date>2019-12-30T13:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: New-VDPortgroup : Operation is not valid due to the current state of the object.</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220918#M74247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. No worries, it is an isolated test lab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 13:28:39 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220918#M74247</guid>
      <dc:creator>mc1903cae</dc:creator>
      <dc:date>2019-12-30T13:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: New-VDPortgroup : Operation is not valid due to the current state of the object.</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220919#M74248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you stop/start your PS/PowerCLI session between trials?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 14:15:39 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220919#M74248</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2019-12-30T14:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: New-VDPortgroup : Operation is not valid due to the current state of the object.</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220920#M74249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you. I hadn't tried closing and reopening my PS session. I have now and I no longer get the error!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What had I done/not done/missed? Still a bit confused.!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://communities.vmware.com/t5/image/serverpage/image-id/16233i1CDF7ED85FB29F12/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 14:33:45 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220920#M74249</guid>
      <dc:creator>mc1903cae</dc:creator>
      <dc:date>2019-12-30T14:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: New-VDPortgroup : Operation is not valid due to the current state of the object.</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220921#M74250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You didn't do anything wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS and/or PowerCLI sometimes get garbage in the objects they keep in memory.&lt;BR /&gt;That message you got is in a lot of the cases by such a mishap.&lt;BR /&gt;A stop/start of the session lets you start afresh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 15:14:19 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220921#M74250</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2019-12-30T15:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: New-VDPortgroup : Operation is not valid due to the current state of the object.</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220922#M74251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the explanation Luc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 15:22:41 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/New-VDPortgroup-Operation-is-not-valid-due-to-the-current-state/m-p/2220922#M74251</guid>
      <dc:creator>mc1903cae</dc:creator>
      <dc:date>2019-12-30T15:22:41Z</dc:date>
    </item>
  </channel>
</rss>

