Archive for the ‘ VMware ’ Category

Dell UPS & vSphere 5

Installed  a new vSphere 5 environment at a customer.
The customer had a Dell UPS and wanted to be able to shutdown everything after running 30 mins on battery.

I recon VMware should start to built some API’s for hardware suppliers to integrate this more easily.
Although the Dell Multi UPS management software has a plugin for VMware it only allows you to shutdown the hosts, or bring them into maintenace mode.
I haven’t found a way to shut down the virtual machines at the same time witht the plugin.

So I made a workaround.

Dell UPS Management software – vSphere 5

  1. Obtain the Dell Multi UPS Management Console (MUMC) software from http://www.dellups.com/soft-tech-doc.asp
  2. The file is called DELL_MULTI-DEVICE_A00_R318771.exe
  3. I’ve installed the software on the vCenter server since it’s a dedicated physical server.
  4. Once installed, you can access it trough:
    http://127.0.0.1:4679/default.html
    or through the start menu by clicking on the dell mgmt software icon.
  5. The default login is admin/admin
  6. A quick scan is automatically performed

  1. In my case, 2 ups devices have been discovered as well as the management server.
  2. Then go to System
  3. Enable the shutdown module:
  4. Next, we will configure the shutdown module

              

Powersource = the UPS powering the management server
The rest speaks for itself.

I’ve created a shutdownvms.bat script that will bring down everything. (read below)

  1. Shutdownvms.bat
    This is the content of the batchfile, I’ve copied everything in the c:\scripts folder (including powershell.exe en vim.psc1)
    It is important to change the Powershell Executionpolicy otherwise the script won’t run
    Do this once by running “Set-Executionpolicy Bypass”  in a powershell prompt

#———————————————-
# short log file creation
echo Shutdown of all VM’s and ESX hosts is launched at >> c:\scripts\alert.txt
echo %date% %time% >> c:\scripts\alert.txt
#Call the powershell script to shutdown everything
C:\scripts\powershell.exe -PSConsoleFile “C:\scripts\vim.psc1” “& “C:\Scripts\shutdownallvms.ps1” |Out-File C:\scripts\log.txt
# shutdown the server itself
shutdown.exe /s /t 10
exit
#—————————————————-

  1. Shutdownallvms.ps1

Connect-VIServer IPADDRESS

# Get All the ESX Hosts

$ESXSRV = Get-VMHost

# For each of the VMs on the ESX hosts

Foreach ($VM in ($ESXSRV | Get-VM)){

# Shutdown the guest cleanly

$VM | Shutdown-VMGuest -Confirm:$false

}

# Set the amount of time to wait before assuming the remaining powered on guests are stuck

$waittime = 200 #Seconds

$Time = (Get-Date).TimeofDay

do {

# Wait for the VMs to be Shutdown cleanly

sleep 1.0

$timeleft = $waittime – ($Newtime.seconds)

$numvms = ($ESXSRV | Get-VM | Where { $_.PowerState -eq “poweredOn” }).Count

Write “Waiting for shutdown of $numvms VMs or until $timeleft seconds”

$Newtime = (Get-Date).TimeofDay – $Time

} until ((@($ESXSRV | Get-VM | Where { $_.PowerState -eq “poweredOn” }).Count) -eq 0 -or ($Newtime).Seconds -ge $waittime)

# Shutdown the ESX Hosts

$ESXSRV | Foreach {Get-View $_.ID} | Foreach {$_.ShutdownHost_Task($TRUE)}

Write-Host “Shutdown Complete”

I did not wrote this script myself, I got it from the communities forum @ vmware, but I can’t recall from who.

You can do a test from the management menu, but be warned,it WILL shutdown everything.

Hope this helps you out

Patrick

Advertisements

Saving NIC info during P2V

this is something I’ll be testing during a future P2V:
I’ve found it in the comment’s on this blog:
http://blog.scottlowe.org/2009/06/01/vsphere-virtual-machine-upgrade-process/

_______________________________________________________________

Here’s an easy way to dump the IP info to a text file and then reapply it
To dump the IP config using netsh from a command line:
netsh interface ip dump > c:\ipconfig.txt

Since Windows will most likely see the new NIC as “Local Area Connection 2” (or something similar) you have to modify the above text file and change the NIC name to match the new NIC’s name. Or change the new NIC’s name on the host to match what’s in the file above. Either way works.

To re-import it:
netsh -c interface –f c:\ipconfig.txt

This really comes in handy when you have a lot of DNS servers, WINS servers, etc and/or multiple IPs on the same NIC.
_______________________________________________________________

Been looking for something like this 🙂

Also, I’ve discovered that after a P2V of a windows 2003 machine, the SCSI adapter is Buslogic.
It seems this not as good as the LSI adapter so it’s a good thing to upgrade while you’re at it.
I’ll do a blog post on this in the future.

EqualLogic MPIO in vSphere

 Ok, this post is more of a reminder for myself so I don’t have to google the command each time.

Do this before attaching lun’s to the host:

esxcli nmp satp setdefaultpsp –psp VMW_PSP_RR –satp VMW_SATP_EQL

It will put round robin as the default path policy to round robin, saves you lot of time 🙂

‘Slipstreaming’ drivers in the ESX4(i) install ISO

OK, here’s the deal, I downloaded the last ESX4 iso (with update 1-208167) and installed ESX on a brand new Dell R710.
The onboard Broadcom was detected and installed, but to my surprise the 2 INTEL QUAD port cards were not found and therefore not installed.

After some searching I found this iso, named:
vmware-esx-drivers-net-igb_400.1.3.19.12-1.0.4.164009.166506.ISO
It’s possible to use this iso during the manual installation, the intaller will ask you if you want to load additional drivers.  Tried that, and it worked, it found the quad port nics.

So why slipstream ?
Well, I needed to create an unattended installation for a customer and it’s not really unattended if you need to go swapping iso’s during the install phase.

Ok, let’s roll:
The files we will be working with are:

PACKAGES.XML  (in the root)
packageData.pkl (in the VMWARE\RPMS folder)
TRANS.TBL (in the VMWARE\RPMS folder)

Extract these  files from the ISO to a folder.
Oh yeah, before you go launching your favorite ISO software, do NOT, I repeat, do NOT use PowerISO.
PowerISO changes the MD5 checksum of the ISO, making it useless.
I found out the hard way. Instead I recommend MagicISO.

let’s start with putting the newer driver in the \VMWARE\RPMS folder.
Extract the vmware-esx….ISO file you downloaded from VMware.
Goto the .rpm folder and insert the vmware-esx…..x86_64.rpm to the \VMWARE\RPMS folder of the ESX iso.

 

You can delete the other (older)  vmware-esx-drivers-net-igb file as we will no longer need it.

Next, we need to change the TRANS.TBL file, so that it contains the new file.
Use a text editor such as Notepad++ to change any of the files in this tutorial.
do NOT use windows notepad, wordpad, word or whatever texteditor incapable of handling unix formatted files.

In this case, you will find an entry In the Trans.tbl file on line 280 called:
“F VMWARE_ESX_DRIVERS_NET_IGB_.;1”
If you find the line, scroll to the right, and you will see the name of the old rpm.
Only change the right part of this line to the name of the new rpm.

 

Save and close the file.
Next, edit the packages.xml file in the root of the extracted iso.
Goto line 91 and change the old entry to the new one:

 

Save and close.
Next up, packageData.pkl in the \VMWARE\RPMS folder
Goto line 2245 (yes, it’s a long file J also, you can search for “igb” and it will bring you right there)
And as you already guessed, change the entry there.

 

Save and close.
Now, update your ESX iso file with the edited files and new rpm.
After installation with the new ISO, it “should” detect the intel quad port cards.

Hope this helps you out, the same way it did for me 🙂