<?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 Moving vNIC on existing VM to new DVS portgroup in vSphere SDK for Perl Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-SDK-for-Perl-Discussions/Moving-vNIC-on-existing-VM-to-new-DVS-portgroup/m-p/1375847#M1477</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code: &lt;A href="http://pastebin.com/GRsniSVe"&gt;http://pastebin.com/GRsniSVe&lt;/A&gt; will run to completion with no errors, but doesn't actually move the vNIC to the designated portgroup.&amp;nbsp; It successfully finds the portgroup by its VLAN id [Line 79], finds the VM by its name [Line 96], and finds the first vNIC on the VM [Line 121]... after that I'm attempting to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;[Line 126] Create a new connection to the portgroup with DistributedVirtualSwitchPortConnection-&amp;gt;new&lt;/LI&gt;&lt;LI&gt;[Line 130] Create new vNIC backing info using that connection with VirtualEthernetCardDistributedVirtualPortBackingInfo-&amp;gt;new&lt;/LI&gt;&lt;LI&gt;[Line 131] Update the vNIC's "backing" property to the new backing info, preserving any other config it may have **&lt;/LI&gt;&lt;LI&gt;[Line 147] Create a new device config spec with the updated vNIC using VirtualDeviceConfigSpec-&amp;gt;new&lt;/LI&gt;&lt;LI&gt;[Line 168] Creating a new VM config spec using the new device config spec using VirtualMachineConfigSpec-&amp;gt;new&lt;/LI&gt;&lt;LI&gt;[Line 178] Calling ReconfigVM( ) on the VM, passing in the new VM config spec&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Printing out these objects at various points appears to show all the correct properties.&amp;nbsp; Even after the error-free ReconfigVM( ) call, printing out the VM data model at the end of the script [Line 207] shows the updated portgroup connection.&amp;nbsp; But the vNIC never actually moves.&amp;nbsp; I'd really appreciate any guidance on what I've done wrong here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** I have a hunch it has something to do with updating the vNIC vs. creating a new empty one, but I don't want to change the vNIC's MAC or any other properties.&amp;nbsp; I'm thinking if make an empty vNIC with nothing but this new backing info, how will ReconfigVM know which vNIC to update?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: herrdr (adding line numbers)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Aug 2016 03:29:32 GMT</pubDate>
    <dc:creator>herrdr</dc:creator>
    <dc:date>2016-08-06T03:29:32Z</dc:date>
    <item>
      <title>Moving vNIC on existing VM to new DVS portgroup</title>
      <link>https://communities.vmware.com/t5/vSphere-SDK-for-Perl-Discussions/Moving-vNIC-on-existing-VM-to-new-DVS-portgroup/m-p/1375847#M1477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code: &lt;A href="http://pastebin.com/GRsniSVe"&gt;http://pastebin.com/GRsniSVe&lt;/A&gt; will run to completion with no errors, but doesn't actually move the vNIC to the designated portgroup.&amp;nbsp; It successfully finds the portgroup by its VLAN id [Line 79], finds the VM by its name [Line 96], and finds the first vNIC on the VM [Line 121]... after that I'm attempting to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;[Line 126] Create a new connection to the portgroup with DistributedVirtualSwitchPortConnection-&amp;gt;new&lt;/LI&gt;&lt;LI&gt;[Line 130] Create new vNIC backing info using that connection with VirtualEthernetCardDistributedVirtualPortBackingInfo-&amp;gt;new&lt;/LI&gt;&lt;LI&gt;[Line 131] Update the vNIC's "backing" property to the new backing info, preserving any other config it may have **&lt;/LI&gt;&lt;LI&gt;[Line 147] Create a new device config spec with the updated vNIC using VirtualDeviceConfigSpec-&amp;gt;new&lt;/LI&gt;&lt;LI&gt;[Line 168] Creating a new VM config spec using the new device config spec using VirtualMachineConfigSpec-&amp;gt;new&lt;/LI&gt;&lt;LI&gt;[Line 178] Calling ReconfigVM( ) on the VM, passing in the new VM config spec&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Printing out these objects at various points appears to show all the correct properties.&amp;nbsp; Even after the error-free ReconfigVM( ) call, printing out the VM data model at the end of the script [Line 207] shows the updated portgroup connection.&amp;nbsp; But the vNIC never actually moves.&amp;nbsp; I'd really appreciate any guidance on what I've done wrong here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** I have a hunch it has something to do with updating the vNIC vs. creating a new empty one, but I don't want to change the vNIC's MAC or any other properties.&amp;nbsp; I'm thinking if make an empty vNIC with nothing but this new backing info, how will ReconfigVM know which vNIC to update?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: herrdr (adding line numbers)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Aug 2016 03:29:32 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-SDK-for-Perl-Discussions/Moving-vNIC-on-existing-VM-to-new-DVS-portgroup/m-p/1375847#M1477</guid>
      <dc:creator>herrdr</dc:creator>
      <dc:date>2016-08-06T03:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Moving vNIC on existing VM to new DVS portgroup</title>
      <link>https://communities.vmware.com/t5/vSphere-SDK-for-Perl-Discussions/Moving-vNIC-on-existing-VM-to-new-DVS-portgroup/m-p/1375848#M1478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming new portgroup on the same vDS, this works for me.&amp;nbsp;(let me know if this assumption is incorrect so I can look further into this...):&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P class="p1"&gt;First identify your network adapter as $adpater and your new port group is $pg...Afterward:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;my&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;$dvsUUID&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;$adapter-&amp;gt;backing-&amp;gt;port-&amp;gt;{&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;'switchUuid'&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;}&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1" style="line-height: 1.25;"&gt;my&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3" style="line-height: 1.25;"&gt;$network&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; = Vim::find_entity_views(&lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;view_type&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;"Network"&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;properties&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; =&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;'name'&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;], );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1" style="line-height: 1.25;"&gt;foreach&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;@$network&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt;) { &lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;$pgKey&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt; = &lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;$_-&amp;gt;{&lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;'mo_ref'&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;}-&amp;gt;{&lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;'value'&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;}&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt; &lt;/SPAN&gt;&lt;SPAN class="s1" style="line-height: 1.25;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt; (&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;$pg&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt; &lt;/SPAN&gt;&lt;SPAN class="s1" style="line-height: 1.25;"&gt;eq&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt; &lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;$_-&amp;gt;name&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt;);}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1" style="line-height: 1.25;"&gt;my&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3" style="line-height: 1.25;"&gt;$port&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; = new DistributedVirtualSwitchPortConnection( &lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;portgroupKey&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="s3" style="line-height: 1.25;"&gt;$pgKey&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;switchUuid&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="s3" style="line-height: 1.25;"&gt;$dvsUUID&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;,);&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;&lt;SPAN class="s1" style="line-height: 1.25;"&gt;my&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3" style="line-height: 1.25;"&gt;$backing&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; = new VirtualEthernetCardDistributedVirtualPortBackingInfo(&lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;port&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="s3" style="line-height: 1.25;"&gt;$port&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s3" style="line-height: 1.25;"&gt;$adapter-&amp;gt;backing&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s3" style="line-height: 1.25;"&gt;$backing&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt;);&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;my&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;$devspec&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = VirtualDeviceConfigSpec-&amp;gt;new(&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;device&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;$adapter&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;,&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;operation&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; =&amp;gt; VirtualDeviceConfigSpecOperation-&amp;gt;new(&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;'edit'&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;my&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;$pgChangespec&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = VirtualMachineConfigSpec-&amp;gt;new(&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;deviceChange&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; =&amp;gt; [ &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;$devspec&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; ] );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;$vm_view-&amp;gt;ReconfigVM&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 1.25;"&gt;spec&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 1.25;"&gt;$pgChangespec&lt;/SPAN&gt;&lt;SPAN class="s5" style="line-height: 1.25;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 05:54:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-SDK-for-Perl-Discussions/Moving-vNIC-on-existing-VM-to-new-DVS-portgroup/m-p/1375848#M1478</guid>
      <dc:creator>MR-Z</dc:creator>
      <dc:date>2016-08-24T05:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Moving vNIC on existing VM to new DVS portgroup</title>
      <link>https://communities.vmware.com/t5/vSphere-SDK-for-Perl-Discussions/Moving-vNIC-on-existing-VM-to-new-DVS-portgroup/m-p/1375849#M1479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much MR-Z. &amp;nbsp;I was missing:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN class="s4" style="line-height: 16px;"&gt;operation&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 16px;"&gt;&amp;nbsp;=&amp;gt; VirtualDeviceConfigSpecOperation-&amp;gt;new(&lt;/SPAN&gt;&lt;SPAN class="s4" style="line-height: 16px;"&gt;'edit'&lt;/SPAN&gt;&lt;SPAN class="s2" style="line-height: 16px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:56:07 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-SDK-for-Perl-Discussions/Moving-vNIC-on-existing-VM-to-new-DVS-portgroup/m-p/1375849#M1479</guid>
      <dc:creator>herrdr</dc:creator>
      <dc:date>2016-08-31T14:56:07Z</dc:date>
    </item>
  </channel>
</rss>

