VMware Cloud Community
me119394
Contributor
Contributor

How do you ensure configuration consistency across your ESXi4 vNetwork STANDARD switches

Hi,

I'm fairly new to vNetwork switches, my experience with vSphere has been on an administration side of things. I'm now wanting to delve deeper into the workings and have found out that there are 2 types of switches: Standard and Distributed, with the dv switch only being available with the Enterprise Plus licence.

My question is, if I were working in a small company and could only afford upto the Enterprise licence I would only be able to utilise Standard switches.

Is there a way of exporting the port configuration from a master esxi host and then importing those settings to all the other hosts in the cluster....?

I can see user error kicking in if you had a fair number of hosts and loads of port configs to then manually input and change. The key thing that I'm trying to get at is a way of keeping consistency across all my hosts in a cluster, it would be like having a GOLD VM template where you'd definitely know 100% that the VM is build to your exact spec.

Any ideas or tips & tricks would be greatly appreciated.

Reply
0 Kudos
6 Replies
rickardnobel
Champion
Champion

One option is Host Profiles which can be used to apply consistent configuration across hosts, unfortunately that feature is also Enterprise Plus only.

It is possible to create all networking settings (vSwitches, uplinks, portgroups, VLANs, vmkernel ports) through the command line. The commands are esxcfg-vswitch, esxcfg-vmknic and so on. With some work you could create a "template" with these commands and when adding new hosts you could paste the lines into the newly setup ESXi.   But not really easy. Smiley Happy

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
peetz
Leadership
Leadership

Scripting is the way to do this ...

At Virtu-Al.net you can find a PowerCLI scripts that copies the vSwitch and portgroup configuration from one host to another. Looks like this is what you need. See here:

http://www.virtu-al.net/2009/06/27/powercli-easy-vswitch-portgroup-setup/

- Andreas

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
me119394
Contributor
Contributor

Hey Andreas,

That was spot on, just been through Al's website and I was like a child in a toy store, I wanted it all.....

Thanks for your help.

Steve

Reply
0 Kudos
Josh26
Virtuoso
Virtuoso

I have a PowerCLI script that basically says "do this to each host".

If you write the VLAN/portgroup change you want to add into such a script, and make every change this way, they will always be consistent.

Reply
0 Kudos
me119394
Contributor
Contributor

@Josh26: Any chance I can get a copy of that script ?

Reply
0 Kudos
Josh26
Virtuoso
Virtuoso

me119394 wrote:

@Josh26: Any chance I can get a copy of that script ?

Sure.

PowerCLI C:\> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
PowerCLI C:\> Connect-VIServer localhost

PowerCLI C:\> Get-VMHost | foreach {

     New-VirtualPortGroup -VirtualSwitch ( Get-VirtualSwitch -Name vSwitch0 -VMHost $_ ) -Name TestPG -VLanId 905 }