vCenter Appliance without DHCP server

If you don’t have an active DHCP server, and/or your newly installed vCenter Server Appliance isn’t acquiring an IP address upon startup, you may need to use VI to statically assign an IP configuration.

1) Login into the console as root. The default password is vmware.

2) Type the following command to navigate to the interface configuration file:

vi /etc/sysconfig/networking/devices/ifcfg-eth0

3) You’ll now be viewing the interface configuration file. You can use the arrow keys to navigate to the different lines of the config. Firstly, you’ll want to make sure BOOTPROTO=static, and STARTMODE=auto. Lastly, you’ll want to add the following 5 lines:

TYPE=Ethernet
USERCONTROL=no
IPADDR=IP_ADDRESS
NETMASK=SUBNET
BROADCAST=IP_BROADCAST_ADDRESS

The final config should look like the following:

DEVICE=eth0
BOOTPROTO=static
STARTMODE=auto
TYPE=Ethernet
USERCONTROL=no
IPADDR=IP_ADDRESS
NETMASK=SUBNET
BROADCAST=IP_BROADCAST_ADDRESS

4) Now that you’re finished editing the NIC config, press ESC, press shift+; and then type wq and press Enter. It should say that ifcfg-eth0 has been written.

5) Type service network restart

6) You should now be able to see the vCenter login page via https://vCenter_IP_ADDRESS:5480. Keep in mind that there is no default gateway on the appliance, so you will only be able to access the webpage from a box on the local subnet. Login to the web interface and assign a default gateway from there.

Logging Persistant Pings With Timestamps

This can be helpful if you want to run a persistent ping to a host, and log the results to a file to be reviewed later. There are two methods:

LOG ONLY PING FAILURES – This method will log only the failures or timed-out ping requests and their times. Cut and paste the below script into a txt doc. Save the text document as ping.vbs on the root of C:\. Open a CMD prompt, cd to the root of C and type: cscript ping.vbs x.x.x.x pinglog.txt

hostIp      = wscript.arguments(0)
logfilename = wscript.arguments(1)
Set fso     = CreateObject("Scripting.FileSystemObject")
Set Shell   = CreateObject("Wscript.Shell")
' OpenTextFile Method requires a Const value
' (Over)Write = 2  Append = 8   
Set logfile = fso.OpenTextFile(logfilename, 8, True)
shellstring = "%comspec% /c ping -t " & hostIP
Set oExec   = Shell.Exec(shellstring)
wscript.echo "Ping Error log With Timestamp - Ctrl + C to halt"
Do While oExec.StdOut.AtEndOfStream <> True
      pingline = Date & " " & Time & " " & oExec.StdOut.ReadLine
      If InStr(pingline, "TTL=") = 0 Then
         logfile.WriteLine(pingline)
      End If
Loop

LOG PING SUCCESS AND FAILURES– This method will produce an enormous log if left running over an extending period of time. Instead of capturing times of failures only, this will log each successful ping also. Cut and paste the below script into a txt doc. Save the text document as ping.vbs on the root of C:\. Open a CMD prompt, cd to the root of C and type: cscript ping.vbs x.x.x.x pinglog.txt

hostIp      = wscript.arguments(0)
logfilename = wscript.arguments(1)
Set fso     = CreateObject("Scripting.FileSystemObject")
Set Shell   = CreateObject("Wscript.Shell")
' OpenTextFile Method requires a Const value
' (Over)Write = 2  Append = 8   
Set logfile = fso.OpenTextFile(logfilename, 8, True)
shellstring = "%comspec% /c ping -t " & hostIP
Set oExec   = Shell.Exec(shellstring)
wscript.echo "Ping Error log With Timestamp - Ctrl + C to halt"
Do While oExec.StdOut.AtEndOfStream <> True
      pingline = Date & " " & Time & " " & oExec.StdOut.ReadLine
      If InStr(pingline, "TTL=") - 128 Then
         logfile.WriteLine(pingline)
      End If
Loop