A. Mikkelsen

VMware ESX scripts, commands, tools and other nice to know things that will make your virtualization days easier!!!!

Browsing Posts tagged esx

Time keeping in a virtual environment can be a challenge to setup.

To help you, VMware has maintained a KB on the subject.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1318

The KB presents best practices for achieving accurate timekeeping in Windows Guest operating systems. These recommendations include a suggested configuration for timesynchronization in the guest and on the host.

A more specific guide also exists for Windows and Linux servers:
For Windows read:
http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1318&sliceId=1&docTypeID=DT_KB_1_1&dialogID=73678717&stateId=0%200%2078515868
For Linux read:
http://kb.vmware.com/selfservice/microsites/microsite.do?cmd=displayKCPopup&docType=kc&externalId=1006427&sliceId=1&docTypeID=DT_KB_1_1

It’s great reading, but very nerdy :-)

Yesterday we released version 49 of the ESXHealthScript.

Kenneth Mazie. (kcmazie aka. kcmjr) has done a huge job in updating and adding new features to the script.

  • Added automatic detection for ESX 3 or ESX 4
  • Added corrections for changes with ESX4
  • Added Cisco CDP info listing (from user Carson)
  • Added corrections to v4 tomcat server

To read more about the ESXHealthScript please visit the project web site.
https://sourceforge.net/projects/esxhealthscript/

If you are using the script, and have ideas for new features/functions, please let us know on the projects website or even better post the needed code :-)

vLogView by Xtravirt

No comments

vLogView, helps you view and search all LOG files from each of your ESX hosts from a single application.

For more info and the latest download, visit http://xtravirt.com/xd10132

vlogview

Free virtualization fools

1 comment

David Davis has put together a list of what he thinks is some of the best free virtualization tools avaiable.

I still think that he is missing a few, like

See the full article at
http://searchservervirtualization.techtarget.com

If you are looking for a easy and simple guide for setting up iSCSI on vSphere (ESX 4.x) you might want to take a look at this guide from www.techhead.co.uk
http://www.techhead.co.uk/vmware-esxi-4-0-vsphere-connecting-to-an-iscsi-storage-target

VMware have released a demo on YouTube that shows a “must have” for PowerShell users who automate and manage vSphere and vCenter through PowerShell.

The project is named “Onyx” and works like a middelware between the vCenter Client and the vCenter Server.
Onyx is unfortunately still in a private beta and therefore not acceble to the Public…….. :-(

Read more on rtfm-ed.co.uk.
http://www.rtfm-ed.co.uk/?p=1643

Or read more on the “get-scripting podcast” blog
http://get-scripting.blogspot.com/2009/08/get-scripting-podcast-episode-12-carter.html

After almost 2 years of silence a new version of the ESXHealthScript has surfaced.

Version 0.30 is released.

But ESX as a VM with running VM’s is new.

It’s now possible to run ESX as a VM on an ESX server or in a Workstation.

See howto
http://www.vcritical.com/2009/05/vmware-esx-4-can-even-virtualize-itself/

A fellow member in the Danish Usergroup has created a very simple backup script for ESX and ESXi using PowerShell and VCB.

http://www.virtualize.dk

I like that it’s small and simple.
Keep up the good work….

Right after lunch today I had a host (3.5 U3) crach with a kernel panic.

It shouldn’t be a problem for clusters running HA, but on this cluster I had disabled HA bacause of an error and hadn’t had the time to depug :-( .
So my VM’s couldn’t be started on a new host and I’m not going to manually register 116 VM’s on another host – so I was forced to find a soultion.

I did a bit of googleing and found VMware KB10196.
I followed the steps and everything is now working – AND HA IS ENABLED :-)

This is the steps i followed:

  1. Reboot the host into “VMware ESX servere (Debug mode)”
  2. Log in with a user with root permissions and run the following commands.
    esxcfg-boot -p (reloads the PCI data)
    esxcfg-boot -b (sets up boot information)
    esxcfg-boot -r (refreshes initrd)
  3. Now just reboot the host.

After the reboot the host should work as normal. From the VC Client you can verify that the host is connected to VC.

Have you ever needed to verify the security or hardened state of you ESX hosts?

If yes, then these tools from ConfigureSoft.com or TripWire.com will help you make the process easier.
If no, take a look at the tools anyway – it’s always nice to know if your “babies” are safe ;-) .

http://www.configuresoft.com/compliance-checker.aspx
Compliance Checker for VMware ESX, checks the compliance of VMware ESX hosts against VMware hardening guidelines and Center for Internet Security (CIS) benchmarks.

Compliance Checker for PCI DSS, checks the compliance of servers and desktops against PCI DSS v1.2 requirements as specified by PCI Security Standards Council.

TripWire ConfigCheck

http://tripwire.com/configcheck/download.cfm
Read a great how to.
http://searchvmware.techtarget.com/tip/0,289483,sid179_gci1344980,00.html

After we have allowed Windows 2008 Servers in our VMware VI enviroment, we been having problems sysprepping Windows 2008 Server.
So here is a quick guide to sysprep a Windows 2008 server in a VMware VI enviroment.
(Use this workaround until VMware VI allows you run sysprep against a WIN2008 Server)

  1. Change the source or templates Guest Operating Systemsetting to “Vista (32 bit)” or “Vista (64 bit)” depending on the installation of the Windows 2008 server installation.
  2. Clone the VM or template and you are now able to customize your Win2008 server with sysprep.
  3. After the cloning is done Power On the new VM and let the customization complete.
  4. Shutdown the VM and change the Guest Operating Systemsetting back to “Windows Server 2008 (32/64 bit)”

The reason the above workaround works is that Vista and Server 2008 has sysprep build into the OS and the sysprep in both OS’s and are based on the same technology.

Read more here

http://www.vmwareinfo.com/2008/05/sysprep-windows-2008-in-vmware.html

http://communities.vmware.com/message/934733#934733

http://technet.microsoft.com/en-us/library/cc766514.aspx

2 years ago a VMUG user in Denmark created a Ubuntu VM that could graficily could show the develeoment of the amount of VM’s in a Cluster.

Unfurtionally someone stole my labtop and the VM :-) .

So I had to create a new. And of cause it’s based on PowerShell ;-) .

The webpages shows the following information

  • Amount of VM’s in each Cluster
  • Amount of Hosts in each Cluster
  • The size of each Datastore and the amount of free disk space

Get the source code in the Download section under Vi Toolkit for Windows

Today I had to upgrade all our Jumphost VM’s from 256MB to 512MB of memory (more than 200 VM’s).
There are two ways accomplice this.

1. Do it manually (Very time consuming)

2. Script it with PowerShell

As the lazy person I am I decided that scripting was the way forward.
The script I came up with is as follows:

Connect-VIServer "vi_servername" -User "vi_username" -Password password"

# Select all VM's that have less than 512MB and change the Memory to 512MB
foreach ($vm in Get-VM | Select Name,MemoryMB | Where-Object{$_.MemoryMB -lt "512"}){
Set-VM $vm.Name -MemoryMB "512" -Confirm:$FALSE
}

To suppress the script to prompt for acceptance each time I added the following option
-Confirm:$FALSE

The script easily be changed to add or update other VM hardware settings.
- Number of CPU’s (Set-VM <vm-name> -NumCpu 2)

- Rename VM (Set-VM <vm-name> -Name “NewName”)

Find more options and ideas in the “Automating VMware with PowerShell – Hands-On Lab” from VMworls 2008.

Just remember if a VM is running you have to poweroff or shutdown the VM before the changes will take effect.
This is because a restart or reset does’t reload the vmx file.

Update:

The script is now updates so it also implements the following settings

  • Sets Memory Reservation to half of the amount of ram.
  • Sets Memory Limit to “Unlimited”
  • Sets the VM to check for new VMware Tools on PowerOn.
  • Sets the VM to sync time from host.

Take a look at the scripts here.

Today i came across an article from techtarget.com about securing and auditing VM’s and ESX hosts.

There are a few free tools that can help you audit your host servers. Tripwire’s ConfigCheck and Configuresoft’s Compliance Checker for ESX, both of which are lite versions of each company’s enterprise-level product.

Read the full article here.

A few weeks ago we were conducting a vRanger DR test of a VM (new host and new LUN).

The VM was restored succesfull, but when we powered it on we discovered that it for some unexplaned reason had lost the SCSI0:1 (100GB) and SCSI0:2(300GB) VMDK’s.
It had created two new 20GB VMDK’s instead.
We searched the LUN and found the two orginal *-flatvmdk files but not the descripter files.

Use Putty to identify the size of the *-flatvmdk file. ex. 100GB

ls -lah

From a VM (not running) create a new disk with the same size as the one you are missing. The name is not important.

Locate the newly created *.vmdk and *-flat.vmdk file. Copy the new *.vmdk file to the folder that contains the orginal *-flat.vmdk file.

cp rescue_me.vmdk /vmfs/volumes/mysan/rescued/rescued.vmdk

Use VI or NANO to change the following line as below from:
RW 419426200 VMFS “rescue_me-flat.vmdk”

To:
RW 419430500 VMFS “rescued-flat.vmdk”

Make sure that the name of the .vmdk file correspond to the SCSI*:*.fileName in the vmx file.
Now just power on the VM and the orginal disks are intac.

UPDATE
Today I found out that esXpress has created a website that can create a VMDK descriptor file.
http://www.esxpress.com/tools/wrapgen.php

Below is an exampel for the rescure_me-flat.vmdk file with a size of 100GB (107374182400 bytes)
esXpress WMDK descriptor file creator

The past few days I have been trying to learn the basic of PowerShell and the VIToolkit for Windows.
And after playing around with it, I thought that the best way to learn PowerShell was to have a goal.

And what better goal than converting the vcinfo script I created with VIPerlToolkit.

A beta version of the script is now avaiable for download – get it here.
But I have to warn you – the script is still in beta.

I have added a few of the old information and some new ones.
More info will be added when I get the time.

If you have any suggestions on what info the script should show in VC, please let me know.

Powered by WordPress Web Design by SRS Solutions © 2010 A. Mikkelsen Design by SRS Solutions