VMware: Interpreting esxtop Statistics


Scott Drummond of VMware has just created a document of the forums that details the Esxtop command. The document is splitted in the following sections:

Section 1. Introduction
Section 2. CPU
Section 2.1 Worlds and Groups
Section 2.2 Global Statistics
Section 2.3 World Statistics
Section 3. Memory
Section 3.1 Machine Memory and Guest Physical Memory
Section 3.2 Global Statistics
Section 3.3 Group Statistics
Section 4 Disk
Section 4.1 Adapter, Device, VM screens
Section 4.2 Disk Statistics
Section 4.2.1 I/O Throughput Statistics
Section 4.2.2 Latency Statistics
Section 4.2.3 Queue Statistics
Section 4.2.4 Error Statistics
Section 4.2.5 PAE Statistics
Section 4.2.6 Split Statistics
Section 4.3 Batch Mode Output
Section 5 Network
Section 5.1 Port
Section 5.2 Port Statistics
Section 6. Interrupt

The rest of the article can be found over here: http://communities.vmware.com/docs/DOC-9279

VMware: Autostart from the COS


Duncan heeft vandaag de volgende blogpost http://www.yellow-bricks.com/2009/01/01/check-if-autostart-is-enabled-from-the-cos/ online gezet, over het nakijken van de autostart (van VM’s) feature in het COS.

I didn’t know this was possible. But you can easily check via the COS if autostarting of VM’s in enabled or not according to this KB article:

Via het volgende commando kun je nakijken of de setting op false staat:

cat /etc/vmware/hostd/vmAutoStart.xml | grep ‘<enabled>false</enabled>’

image

Via de volgende commando’s kun je deze setting aanpassen:

Om de setting op true te zetten voer je het volgende commando uit:

perl -p -i.old -e ‘s/<enabled>false/<enabled>true/g’ /etc/vmware/hostd/vmAutoStart.xml 
de optie –i.old zorgt er voor dat er een backup gemaakt wordt

Om de setting op false te zetten voer je het volgende commando uit:

perl -p -i.old -e ‘s/<enabled>true/<enabled>false/g’ /etc/vmware/hostd/vmAutoStart.xml

VMware: VMFS Best Practices


The VMware Virtual Machine File System (VMFS) is a high performance cluster file system that allows virtualization to scale beyond the boundaries of a single system. Designed, constructed, and optimized for the virtual server environment, VMFS increases resource utilization by providing multiple virtual machines with shared access to a consolidated pool of clustered storage. And VMFS provides the foundation for virtualization spanning multiple servers, enabling services such as VMware VmotionTM, Distributed Resource Scheduler, and VMware High Availability.
VMFS also reduces management overhead by providing a highly effective virtualization management layer, one that is especially suitable for large-scale enterprise data centers. Administrators employing VMFS find it easy and straightforward to benefit from the greater efficiency and increased storage utilization offered by the use of shared resources.
This paper gives a technology overview of VMFS, including a discussion of features and their benefits. The paper highlights how VMFS capabilities enable greater scalability and decreased management overhead. It also provides best practices and architectural considerations for deployment of VMFS.

You can download the whitepaper over here: http://communities.vmware.com/docs/DOC-9276

VMware: Creating VMware ESX Unattended Install Media


Paul Shannon heeft weer een super document gemaakt over het maken van een Unattended Installatie CD voor VMWare ESX. In de tijd van ESX 2.5.x heb ik ook eens zo’n CD gemaakt door de volgende guide te gebruiken: http://www.vmprofessional.com/index.php?content=kickstart_2. Helaas werkte deze guide niet meer met ESX 3.5. Ik ben dus erg blij met het document van Paul. Thanks Paul!

Paul schrijft het volgende op zijn blog:

I had a customer that had a requirement to backup the ESX Service Console settings and wanted to know the best files to backup. I suggested that it may be more prudent to create unattended installation media to make restores more seamless. This took a turn and I was asked to make a single CD that was capable of restoring any one of the 11 ESX hosts in the clusters. With a lot of reading and a lot of testing this was achieved and this document explains how I did it.

Download het document hier: http://www.vm-aware.com/files/tech_notes/Creating_Custom_ESX_CD.pdf

Bron: http://www.vm-aware.com/2008/12/22/creating-vmware-esx-unattended-install-media/

Add Custom Fields to VI Client with Powershell (Samples)


Hugo Peeters heeft zijn Powershell scripts voor het vullen van Custom Fields in vCenter gepost:

Snapshot Count

I already showed you how to do this, but I have now added an IF-statement so that only changes are updated (equal values are not overwritten). And I have added Julian Wood’s correction. Add-VMSnapshotCount.ps1

Total Snapshot Size

The number of snapshots is quite inetresting, but even more interesting, is the total size of the delta files all snapshots are occupying. They might be eating up all your precious SAN space. Plus, reverting to or committing a large snapshot is tricky. Add-VMSnapshotSize.ps1

Host Hardware Model

Want to see what models of hardware you are using in your datacenter? You could look at the summary tab of each host. Or run this script to add the info to the every Hosts tab in the VI Client. Select your Datacenter, select the Hosts tab and enjoy! Add-VMHostModel.ps1

Host ESX Version

Did you update all your ESX Servers to the latest version? Check it quickly using this script. Add-VMHostVersion.ps1

Host LUN Count

Last but certainly not least: are you sure every datastore you are using is available to all your ESX Servers? It is visible at a glance when you add the LUN Count to your VI Client! Add-VMHostLUNCount.ps1

 

Check zijn site voor allerlei top Powershell scripts: http://www.peetersonline.nl/

 

Bron: http://www.peetersonline.nl/index.php/vmware/add-custom-fields-to-vi-client-with-powershell-samples/

Script: Defrag all Local VMDK’s.


powerShellIcon

De volgende function zoekt eerst alle *.VMX bestanden op en vervangt daarna de extentie *.VMX naar *.VMDK. Deze *.VMDK bestanden worden in de $List geplaatst. Daarna worden alle VMDK’s gedefragmenteerd via de vmware-vdiskmanager.exe.

function Defrag-allVMDKs{
param([string]$path)
$vdiskmanager = “C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe”
$parameter = “-d”
$List = get-childitem $path -recurse | where {$_.extension -eq “.vmx”} |
foreach-object -process { $_.FullName } | ForEach-Object {$_ -replace “.vmx”, “.vmdk”}
ForEach($vmdk in $List)
{
echo $vmdk
& $vdiskmanager $parameter $vmdk
}
}

Via het volgende commando kun de bovenstaande function gebruiken.

Defrag-allVMDKs <drive>\<path>

Als je dit in de Shell uitvoerd ziet het er als volgt uit:

image

VMware: Snapshot Information in vCenter


 image

Hugo Peeters heeft een powershell script gemaakt welke het aantal snapshots laat zien in een custom field binnen vCenter.

Although I spend quite some time in the Powershell Command Line Interface, the main tool for managing the Virtual Infrastructure remains the VI Client. So wouldn’t it be great if we could somehow show the results of our Powershell VI Toolkit scripts inside the VI Client?
Well, we can! Let’s take a closer look at Custom Fields / Custom Attributes.
If you select either a VMHost (ESX Server) or a VM in the VI Client and open the Summary tab, you will see the Annotations section in the bottom left. When you click Edit, I’m sure you have used the Notes section to enter Descriptions. But have you ever used the Attributes section? Here you can manually add and remove custom attributes and their values. Go ahead and create one. Then select a cluster or datacenter and click the Hosts or Virtual Machines tab. You will notice you can display your custom attribute in this table view, just like all the other properties of your VMs / Hosts. Pretty sweet!
image

Voor meer info zie Hugo zijn post: http://www.peetersonline.nl/index.php/vmware/add-snapshot-information-to-the-vi-client-using-powershell/

Script: Backup VMware Workstation VM’s


 

Via het onderstaande script kun je redelijk eenvoudig een backup maken van je VMware Workstation VM’s. Mocht de VM nog actief zijn, dan wordt deze “netjes” afgesloten en vervolgens gekopieerd naar een directory op een netwerk share. Dit script heb ik geschreven voor een VM die bij ons in productie draait onder VMware Workstation (deze VM heeft een seriële modem aangekoppeld). Zo wordt er elke dag via een scheduled task een backup gemaakt.

De volgende parameters moet je meegeven aan de onderstaande function backup-wsvm:

  • $vmname – de naam van de VM.
  • $vmx – pad naar het vmx bestand.
  • $vmdir – de directory waarin de VM staat.
  • $vmbackup – de directory waar de VM naar toe gekopieerd moet worden.

function backup-wsvm{
  param([string]$vmname, [string]$vmx, [string]$vmdir, [string]$vmbackup)
 
  $driveltr = “v:”
  $share = \\server\share
  $date = get-date -uformat “%m-%d-%Y”
  $vmrun = “C:\Program Files\VMware\VMware Workstation\vmrun.exe”
  $stop = “stop”
  $start = “start”
  $soft = “soft”
  $Result = test-path -path “$vmbackup\$date\$vmname”

  if ($Result -eq $false)
  {
    net use $driveltr $share
    New-Item “$vmbackup\$date\$vmname” -type directory
        & $vmrun $stop $vmx $soft
            Copy-Item $vmdir $vmbackup\$date\ -recurse
                & $vmrun $start $vmx
                    net use $driveltr /Delete
   }
}

Daarna kun je via de volgende code een backup maken van je vm:

$vmname = “Powershell_Lab”
backup-wsvm “$vmname” “D:\vmware\$vmname\$vmname.vmx” “D:\vmware\$vmname” “V:\vmbackup”

VMware: VMware-mount


In deze post lees je hoe je via de bashshell en via de gui in Workstation een VMDK kunt mounten.

Before you begin to map a virtual disk, make sure that all virtual machines that use the disk are powered off. Also, take the following considerations into account:

Linux

Onder linux (Ubuntu) werkt het als volgt:

Maak eerst een directory aan, waar je de mount naar toe wilt verwijzen:

sudo mkdir /media/vmdk

Daarna kun je via het volgende commando de vmdk mounten:

sudo vmware-mount /path/to/vm.vmdk /media/vmdk

unmounten gaat als volgt:

sudo vmware-mount -d /media/vmdk/

Mocht het unmounten niet lukken dan kun je het forceren via het volgende commando:

sudo vmware-mount -x of -X

Windows

Start VMware Workstation.

File – Map or Disconnect Virtual Disks…

image

Daarna blader je naar de .vmdk die je wilt toevoegen en geef je de Drive letter aan.

image

nadat je op OK hebt klikt wordt de vmdk geopent.

image

Als je klaar bent kun je de vmdk ook weer unmounten via dezelfde wizard.