Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 229915

Import Vm Network adapter port groups from csv.

$
0
0

I am taking my esxi host and disconnecting them from a vcenter 5.5 and importing them to a vcenter 6.5. I am using distributed switch for these vm's. After I add the host into vcenter 6.5 I add it to my imported VDS. The host and vms connect with no issue and I do have the option of migrating the port groups but I have have thousands of vms to migrate. I am not losing network connectivity but I notice the network adapter as blank and does not have the proper network ( port group).

 

I have the script below that exports all the vm port groups to a csv but I need help with script that will import the csv and change all the vms to their proper portgroups. Some of my vms have multiple nics also.

 

Pull script

Connect-VIServer -Server "vcenter" -User admin -Password admin

Get-DataCenter BNA | Get-VM | Get-NetworkAdapter | Select-Object @{N="VM";E={$_.Parent.Name}},@{N="NIC";E={$_.Name}},@{N="Network";E={$_.NetworkName}} | Export-csv C:\temp\VMPortGroups.csv

Disconnect-VIServer -Server * -Force

 

The csv export looks like this

   

VMNICNetwork
BNALAPTL303Network adapter 1

VLAN612_Development

 

Thanks for any help.


Viewing all articles
Browse latest Browse all 229915

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>