VMware Cloud Community
dhanu2k7
Enthusiast
Enthusiast

setting VLAN for each VM's

Hello

Can anyone help me for setting up VLAN's for each VM's listed in CSV something like below

I have created 3 excel sheet where first column refer VMName, second refer network card 1, network card 2, third refers VLAN detail for each network card, so I want to change VLAN for each VM as per CSV

VMNAME     NICName     VLAN

VMName1     NIC1      VLAN ID

VMNAME1    NIC2      VLAN ID

VMNAME2      NIC1      VLANID

VMNAME2     NIC2        VLANID

VMNAME2    NIC3           VLANID     

Tags (4)
0 Kudos
4 Replies
LucD
Leadership
Leadership

Not sure I'm understanding your request.

A VLANId is defined on a portgroup, and you can attach the vNIC on a VM to a portgroup.

But there is no direct way to specify a VLANId on a vNIC.

Do the portgroups correponding with the VLANIds already exist?

Do the portgroups need to  created?

But that requires some more info, what should be the portgroup name, which vSwitch do the portgroups need to be defined on? ...


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

0 Kudos
dhanu2k7
Enthusiast
Enthusiast

LucD

Hi Lucd

Thanks for reply and sorry for the making confusion, Yes I have respective portgroup for each VM in csv format we need to attach NIC1, NIC2 etc to respective portgroup on each VM

this is Distribution switch and its virtual machine port group

it would be good if you provide me script today as there is migration is going on..

0 Kudos
dhanu2k7
Enthusiast
Enthusiast

Hello

can you please help me with script?

thanks

0 Kudos
LucD
Leadership
Leadership

Can you tell me what you have in the CSV file?


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

0 Kudos