september 2009 - Posts

Check ntp status and time on your ESX servers
30 sep 2009 21:10

Inspired by dkfbp in the VMware Community forums, i made this simple script that checks the date/time and ntpd service status of your ESX servers.

Its a Powershell/vSphere PowerCLI script that basically serves as a wrapper for plink.exe which then executes commands to a list of provided ESX servers to check.
You can download plink from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Just place plink.exe in the same folder as Get-ESXTime.ps1 and execute. The script is attached with a .txt extension so just rename to .ps1

If you would like to send the script in an email, just uncomment the SMTP part at the bottom of the script.

Here is a screenshot if what the output looks like:

image

Using WOL from the internet
17 sep 2009 19:05

Being able to use Wake On Lan (WOL) thrue a router from the internet, seemed like the perfect match for my new Windows Home Server. Not wanting the server to be on at all times this feature would make me able to power the server up, get the files i need and power it back down. Meanwhile cutting down on my power bill, and saving the planet one server at the time.

I'm using a ASUS P5Q-VM motherboard with a Realtek LOM. For that to work with WOL i nedded to make a few changes in the BIOS and in Windows device manager.

Press DEL to enter BIOS and make the following canges:

Power > APM Configuration
Set "Power On By PCIE Devices" to "Enabled"

This is the only option required to be set in the bios. PXE support and "Power On Ny PCI Devices" it not required. At least not in my case.

Boot the system into WIndows and enter device manager, and continue to properties for the Realtek NIC. If you are using WHS either log on to the WHS using RDP or install the Advanced Admin Console to gain easy access to the device manager.

Go to "Power Management" tab and click "Allow this device to bring the computer out of standby"

Under the "Advanced" tab set:

"Wake-On-Lan Capabilities" = "Magic Packet"
"Wake-On-Lan After Shutdown" = "Enable"

Now on to the router/firewall configuration.

If your router does NOT support WOL forward you can just configure a NAT entry that forwards UDP port 9 to your broadcast address internally. If you use 192.168.1.0/24 you would create the rule to point to 192.168.1.255. My Zyxel router does not support WOL forward, so i just created that NAT rule which works fine.

Thats it for the configurationpart. Just shut down your computer and team up with a WOL program! I would recommend Magic Packet Sender - http://magicpacket.free.fr/ - easy to use interface, and you can save your settings in profiles. If you just want to use the WOL from the internet there are browser based options like this one at DSLReport - http://www.dslreports.com/wakeup

 

How-to: Configure DELL servers for use with vSphere DPM
5 sep 2009 23:47

One of the neat little feature upgrades in ESX 4 compared to 3.x is that Distributed Power Management (DPM) is now officially supported. In 3.5 it was experimental and the only way to power on your hosts was using WOL. In ESX 4 features like IPMI and iLO are supported, which makes for a more reliable usage.

Enabling IPMI can either be done using the web-interface or the DRAC configuration tool accessible when booting the system.

To enable the feature using the web-interface first log in to the DRAC interface and click on "Remote Access" in the menu to the left and then on the "Configuration" to the right. Scroll down to "IPMI LAN Settings" and check the "Enable IPMI over LAN" checkbox as in the screenshot below:

To enable IPMI over LAN using the DRAC config util boot the server and press CTRL+E when prompted to enter DRAC configuration. Set the "IPMI Over LAN" to "On". Save settings and exit.

When the servers is back up you can configure the ESX to attach to the BMC using IPMI. To do this start the vSphere client and mark the server you want to configure then click the "Configuration" tab, "Power Management" (under "Software") and the "Properties…" on the top right corner.
Enter the username and password used for logging in to the DRAC, the IP of the DRAC and the MAC address. To get easy access to the DRAC MAC address, simply ping the DRAC IP and run arp –a from a Windows command prompt and copy/paste the MAC from there.

After making the changes to all ESX servers in your cluster you are ready to start configuring and using DPM.

Even if you do not have a DRAC in your DELL servers you should be able to configure IPMI using the shared NIC feature. IPMI is standard on most DELL servers even without the DRAC installed.

I assume that the process is very similar if you have HP or IBM servers. If you are having trouble configuring IPMI/iLO properties for those kinds of servers, check that IPMI is enabled.

Bacis configuration changes in Linux - ESX/Appliances
2 sep 2009 15:33

I always get lost when it comes to configuring things like DNS, default gateway, IP settings and so on in Linux - more precise ESX and appliances.

Being tired of always have to google the answers, this post should cover how to do basic IP configuration changes in Linux.
The paths are taken from the VMware vMA 4.0 appliances, which is based on RedHat distribution. I figure most of the filenames are the same, but for some distros the paths might be different. They are in some cases my experience tells me.

Default gateway and hostname:

File:
/etc/sysconfig/network

Values:
HOSTNAME=FQDN
GATEWAY=10.0.0.1

DHCP, IP and netmask:

File:
/etc/sysconfig/network-scripts/ifcfg-eth0 (where eth0 corresponds to the interface you want to configure eth1, eth2 etc.)

Values:
BOOTPROTO=none (configures the device for static IP, set to =DHCP for...yes DHCP)
IPADDR=10.0.0.1
NETMASK=255.255.255.0

DNS and search order:

File:
/etc/resolv.conf

Values:
search domain.com (this corresponds to DNS suffix in the windows world)
nameserver 10.0.0.1
nameserver 10.0.0.2

nameserver values are picked on the order they are listed.

After you have made the changes restart networking on the host:

service network restart

One more thing i always forget hot to set: Keyboard layout
In many cases when deploying linux based appliances, the default keyboard is en-US, which can be bothersome when using a Danish keyboard. loadkeys should do the work:

loadkeys dk

A good command to know as well is the find command

find / -name resolv*

The first argument is the path to start in, and the -name defines what file you are looking for. The examples also shows that you can use wildcards when searching.

Thats all i remembered i forgot for now. Will update the post when i forget some more.

Thanks to http://www.linuxquestions.org/ - a really nice place for those of us who get lost when paths do not start with C:\ ...