VMware Cloud Community
smalapaka
Contributor
Contributor

Looking for script to collect network configs

Hi,

i am trying to find a script to collect / backup the network configuration of vcenter hosts/guests before doing a tools upgrade any suggestions

Thanks

Sastry

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

Well, those are 2 entirely different things.

Collecting the network config of your ESXi servers is quite straight-forward.

Alan did a good post on that in his PowerCLI: vProfiles. It might not be exactly what you are looking for, but it should give you a good idea what information can be retrieved.

Btw are these standard switches or distributed scwitches, or a mix ?

Collecting network configs from the guest OS is a bit different.

There are a number of supported guest OS for which this is supported by the Get-VMGuestNetworkInterface cmdlet, but there are some guest OS that are not supported for this cmdlet.

Which OS are you looking at ?


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

Reply
0 Kudos
smalapaka
Contributor
Contributor

Hi,

I was basically looking getting the Windows Servers, there are some Linux servers in the mix. Hopefully which ever is not the script might just skip.

Thanks

Sastry V. Malapaka

VMWare SME - GTS Services Delivery Virtualization CoC

From: LucD <communities-emailer@vmware.com>

To: Sastry Malapaka/Paramus/Contr/IBM@IBMUS,

Date: 04/30/2013 05:40 PM

Subject: New message: "Looking for script to collect network configs"

Reply
0 Kudos
LucD
Leadership
Leadership

You didn't say explictely what you want to get from the network configuration.

Is it something like this you are looking for ?

Get-VM | where {$_.Guest.ExtensionData.GuestFamily -match "windows"} | 
Get-VMGuestNetworkInterface | Select @{N="VM";E={$_.VM.Name}},Name,Ip,SubnetMask,DefaultGateway,
 
@{N="DNS";E={[string]::Join(',',$_.Dns)}},
  @{N="Wins";E={[string]::Join(',',$_.Wins)}}  

As you might notice there will be some internal NICs in the output (loopback adapters....).

These can be excluded with a Where-clause if needed.


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

Reply
0 Kudos