PowerCLI – VM Guest Disk Sizes

A oneline script to show the VM disk (or partiton) for each of your VM’s:

ForEach ($VM in (Get-VM |Get-View)){($VM.Guest.Disk |Select @{N=“Name“;E={$VM.Name}},DiskPath, @{N=“Capacity(MB)“;E={[math]::Round($_.Capacity/ 1MB)}}, @{N=“Free Space(MB)“;E={[math]::Round($_.FreeSpace / 1MB)}}, @{N=“Free Space %“;E={[math]::Round(((100 * ($_.FreeSpace))/ ($_.Capacity)),0)}}) | Format-Table}

Or look at the “advanced” script of virtu-al (http://www.virtu-al.net/2010/01/27/powercli-virtual-machine-disk-usage/)

Installing ESX 4 u1 on a Dell R710 with Intel Quad Port Adapter

We had a new Dell PowerEdge R710 with an additonal Intel Gigabit ET Quad Port Server Adapter network card.

After installing ESX i saw that the intel NIC wasn’t recognized, so i had to install it myself.

What where the steps i performed to install the drivers (after ESX was installed)?

1. Downloaded drivers from the following page: http://downloads.vmware.com/d/details/esx_esxi40_intel_82575_82576_dt/ZHcqYmR0QGpidGR3
2. Extracted the iso to disk
3. Copied the files with WinSCP over to the Dell server
4. Logged in the ESX server as root
5. Placed the ESX server in maintenance mode
6. Run “esxupdate -bundle=INT-intel-ladd-ddk-igb-1.3.19.12.1-offline_bundle-185976.zip update”
7. Issued a “shutdown -r now” command

After the server was rebooted, the nic was recognized and i did a exit maintenance mode.

Get ESX host CPU and Memory stats

Use the following CLI to get the state of your ESX hosts, the cpu and memory usage:

t-Datacenter | Sort | Get-VMHost | Sort | Get-View |`
Select Name, OverallStatus, `
@{N="CPU Usage (GHz)";E={[math]::round(
$_.Summary.QuickStats.OverallCpuUsage/1024,2)}}, `
@{N="Memory Usage (GB)";E={[math]::round(
$_.Summary.QuickStats.OverallMemoryUsage/1024,2)}}

Add line 7 to it to get all status except green:

Get-Datacenter | Sort | Get-VMHost | Sort | Get-View | `
Select Name, OverallStatus, `
@{N="CPU Usage (GHz)";E={[math]::round(
$_.Summary.QuickStats.OverallCpuUsage/1024,2)}}, `
@{N="Memory Usage (GB)";E={[math]::round(
$_.Summary.QuickStats.OverallMemoryUsage/1024,2)}} | `
Where { $_.OverallStatus -ne "green" }

source: http://laez.nl/quick-and-simple-vmware-esx-host-statistics/

Windows Server Virtualization Links

At the customers site we are calculating Microsoft Licenses to buy for a new environment. A few links with a lot of information about microsoft licensing and vmware:

Windows Server Virtualization Calculators

Edition comparison by Technical Specification

Overview of Licensing for Virtualization

Licensing Microsoft Windows Server 2008 to Run with Virtualization Technologies

Update Firmware DELL PowerEdge under ESX 3.5u2

For a customer we needed to upgrade ESX servers from 32 GB to 46 GB. This type of servers (Dell PowerEdge 2850) had a problem reading 8GB memory modules. To support 8 GB memory modules a minimum BIOS level is 2.3.1 and BMC level 2.10 is required.

Therefore we needed to upgrade the firmware of the BIOS and BMC.

I downloaded the newest Dell images from the Dell site (actually the complete DVD image of all updates) and attached the DVD in the DVD player. After that i mounted the DVD with a ssh session:

mount /dev/cdrom /mnt/cdrom

I browsed to the repository directory of the DVD (offcourse you can copy the files through the netwerk with tools like winscp. Make sure you have the proper rights to execute the files “chmod +x filename.BIN”) and updated the BMC first (no reboot required) with the command:

./BMC_FRMW_LX_R202152.BIN

This will enter the install dialog wich you need to follow. After the BMC update was finished i continued with the BIOS update:

./PE2950_BIOS_LX_2.6.1.BIN

After this the Server needs to reboot on which point (during reboot) i shut down the server and placed the 8 GB memory modules in slot 1, 2, 5 and 6 for optimal performance (this are the first 4 slots).

Find Orphaned VMDK’s

A script to find orphaned vmdk’s on your ESX infrastructure.

Source here: http://communities.vmware.com/docs/DOC-6960

[wpdm_file id=”13″]

If you want to run it to ESX 3.5 make sure you include the snapshot files extension for it (000001.vmdk and so on).

In the following example 00001 and 00002 are added:

#
# Purpose : List all orphaned vmdk on all datastores in all VC's
# Version: 1.0
# Author  : HJA van Bokhoven

#Main

$arrayVC = "YourVirtualCenter"
$OutputFile = "c:\OrphanedVMDK.txt"

Foreach ($strVC in $arrayVC)
{
	Connect-VIServer $strVC
	$arrUsedDisks = Get-VM | Get-HardDisk | %{$_.filename}
	$arrDS = Get-Datastore
	Foreach ($strDatastore in $arrDS)
	{
	   $strDatastoreName = $strDatastore.name
	   Write-Host $strDatastoreName
	   $ds = Get-Datastore -Name $strDatastoreName | %{Get-View $_.Id}
	   $fileQueryFlags = New-Object VMware.Vim.FileQueryFlags
	   $fileQueryFlags.FileSize = $true
	   $fileQueryFlags.FileType = $true
	   $fileQueryFlags.Modification = $true
	   $searchSpec = New-Object VMware.Vim.HostDatastoreBrowserSearchSpec
	   $searchSpec.details = $fileQueryFlags
	   $searchSpec.sortFoldersFirst = $true
	   $dsBrowser = Get-View $ds.browser
	   $rootPath = "["+$ds.summary.Name+"]"
	   $searchResult = $dsBrowser.SearchDatastoreSubFolders($rootPath, $searchSpec)
	   $myCol = @()
	   foreach ($folder in $searchResult)
	   {
	      foreach ($fileResult in $folder.File)
	      {
             $file = "" | select Name, FullPath
		     $file.Name = $fileResult.Path
		     $strFilename = $file.Name
		     IF ($strFilename)
		     {
		     IF ($strFilename.Contains(".vmdk"))
		     {
		     IF (!$strFilename.Contains("-flat.vmdk"))
		     {
		     IF (!$strFilename.Contains("delta.vmdk"))
		     {
		     IF (!$strFilename.Contains("000001.vmdk"))
		     {
		     IF (!$strFilename.Contains("000002.vmdk"))
		     {
		        $strCheckfile = "*"+$file.Name+"*"
			 IF ($arrUsedDisks -Like $strCheckfile){}
	         ELSE
			 {
			 $strOutput = $strDatastoreName + " Orphaned VMDK Found: " + $strFilename
			 $strOutput | Out-File $Outputfile -width 150 -Append
			 }
		     }
		     }
		     }
		     }
		     }
		     }
	      }
	   }
   }
}

Performance Troubleshooting for VMware vSphere 4

Performance problems can arise in any computing environment. Complex application behaviors, changing demands, and shared infrastructure can lead to problems arising in previously stable environments. Troubleshooting performance problems requires an understanding of the interactions between the software and hardware components of a computing environment. Moving to a virtualized computing environment adds new software layers and new types of interactions that must be considered when troubleshooting performance problems.

The attached document is the first installment in a guide covering performance troubleshooting in a vSphere environment. It uses a guided approach to lead the reader through the observable manifestations of complex hardware/software interactions in order to identify specific performance problems. For each problem covered, it includes a discussion of the possible root-causes and solutions. Topics covered include performance problems arising from issues in the CPU, memory, storage, and network subsystems, as well as in the VM and ESX host configuration. Guidance is given on relevant performance metrics to observe using the vSphere Client and esxtop in order to isolate specific performance issues.

This first installment of Performance Troubleshooting for VMware vSphere 4 covers performance troubleshooting on a single VMware ESX 4.0 host. It focuses on the most common performance problems which affect an ESX host. Future updates will add more detailed performance information, including troubleshooting information for more advanced problems and multi-host vSphere deployments.

vsphere4-performance-troubleshooting.pdf

source

Howto Install vmware tools in Ubuntu

source: http://www.ubuntugeek.com/howto-install-vmware-tools-in-ubuntu.html

We have already discussed about VMware server setup in gutsy.Now It is very important that you install VMware Tools in the guest operating system.With the VMware Tools SVGA driver installed, Workstation supports significantly faster graphics performance.The VMware Tools package provides support required for shared folders and for drag and drop operations.

Other tools in the package support synchronization of time in the guest operating system with time on the host, automatic grabbing and releasing of the mouse cursor, copying and pasting between guest and host, and improved mouse performance in some guest operating systems.

Click on VM in the top menu of the VMware Server console and select Install VMware Tools.

 Now you should be able see the following screen here click on install

 Now you should see similar to the following screen on your desktop

 First copy the VMware Tools from the mounted iso to the temporary folder

cp /media/cdrom/VMwareTools-1.0.3-44356.tar.gz /tmp/

Afterwards switch to the temporary folder and unpack the VMware Tools:

cd /tmp/

tar xvfz VMwareTools-1.0.3-44356.tar.gz

Next switch to the folder with the unpacked files and execute the installer:

cd vmware-tools-distrib/

sudo ./vmware-install.pl

Now you will be asked a few questions relating to installation paths etc. Choose the default value every time (simply hit enter).

 After the installation/configuration finished you have to start the VMware Tools:

vmware-toolbox &

Once it opens you should be able to see similar to the following screen

Vmware tools version details

Note: If you close the VMware Tools window, the VMware Tools will be disabled immediately.

VMware ESX and ESXi Comparison

source: http://kb.vmware.com/kb/1006543

VMware ESX and ESXi Comparison

Purpose

This article provides a detailed comparison of VMware ESX and VMware ESXi. The article is separated in to capabilities or features and compared at that level.

Resolution

Capability

VMware ESX

VMware ESXi

Service Console Service Console is a standard Linux environment through which a user has privileged access to the VMware ESX kernel. This Linux-based privileged access allows you to highly customize your environment by installing agents and drivers and executing scripts and other Linux-environment code. VMware ESXi is designed to make the server a computing appliance. Accordingly, VMware ESXi behaves more like firmware than traditional software. To provide hardware-like security and reliability, VMware ESXi does not support a privileged access environment like the Service Console of VMware ESX. To enable interaction with agents, VMware has provisioned CIM Providers through which monitoring and management tasks – traditionally done through Service Console agents – can be performed. VMware has provisioned RCLI to allow the execution of scripts.
Remote CLI VMware ESX Service Console has a host CLI command through which VMware ESX can be configured. ESX 3.5 Update 2 supports RCLI. VMware ESX Service Console CLI has been ported to a Remote CLI (RCLI) for VMware ESXi. RCLI is a virtual appliance that interacts with VMware ESXi hosts to enable host configuration through scripts or specific commands. Note

  • RCLI is limited to read-only access for the free version of VMware ESXi. To enable full functionality of RCLI on a VMware ESXi host, the host must be licensed with VI Foundation, VI Standard, or VI Enterprise.
  • The VMware Infrastructure toolkit for Windows and the Perl toolkit access ESXi through the same API as RCLI. Similarly, these toolkits are limited to read-only access for the free version of VMware ESXi. When the host is upgraded to VI Foundation, VI Standard, or VI Enterprise, these toolkits have write-access and provide a scriptable method for managing ESXi hosts.
  • The following Service Console CLI commands have not been implemented in RCLI:
  • ESXcfg-info
  • ESXcfg-resgrp
  • ESXcfg-swiscsi 
Scriptable Installation VMware ESX supports scriptable installations through utilities like KickStart. VMware ESXi Installable does not support scriptable installations in the manner ESX does, at this time. VMware ESXi does provide support for post installation configuration script using RCLI-based configuration scripts.
Boot from SAN VMware ESX supports boot from SAN. Booting from SAN requires one dedicated LUN per server. VMware ESXi may be deployed as an embedded hypervisor or installed on a hard disk.   In most enterprise settings, VMware ESXi is deployed as an embedded hypervisor directly on the server. This operational model does not require any local storage and no SAN booting is required because the hypervisor image is directly on the server.

 

The installable version of VMware ESXi does not support booting from SAN.

Serial Cable Connectivity VMware ESX supports interaction through direct-attached serial cable to the VMware ESX host. VMware ESXi does not support interaction through direct-attached serial cable to the VMware ESXi host at this time.
SNMP VMware ESX supports SNMP. VMware ESXi supports SNMP when licensed to a VI Foundation, VI Standard, or VI Enterprise edition. The free version of VMware ESXi does not support SNMP.
Active Directory Integration VMware ESX supports Active Directory integration through third-party agents installed on the Service Console. VMware ESXi with a Virtual Infrastructure license and in conjunction with VirtualCenter allows users to be authenticated via Active Directory. In this configuration, users can log in directly to an ESXi host and authenticate using a local username and password. The free version of VMware ESXi does not support Active Directory integration at this time.
HW Instrumentation Service Console agents provide a range of HW instrumentation on VMware ESX. VMware ESXi provides HW instrumentation through CIM Providers. Standards-based CIM Providers are distributed with all versions of VMware ESXi. VMware partners may inject their own proprietary CIM Providers in customized versions of VMware ESXi. To obtain a customized version of VMware ESXi, you typically have to purchase a server with embedded VMware ESXi through a server vendor. At this time, HP also offers its customized VMware ESXi Installable on www.vmware.com. Dell, IBM, and FSC will soon offer their customized version of VMware ESXi on www.vmware.com.

 

Remote console applications like Dell DRAC, HP iLO, IBM RSA, and FSC iRMC S2 are supported with ESXi.

 

Note: COS agents have a longer lineage than CIM Providers and are therefore more mature. VMware is actively working with its 250+ partners to close the CIM Provider–Service Console agent gap.

Software Patches and Updates VMware ESX software patches and upgrades behave like traditional Linux based patches and upgrades. The installation of a software patch or upgrade may require multiple system boots as the patch or upgrade may have dependencies on previous patches or upgrades. VMware ESXi patches and updates behave like firmware patches and updates. Any given patch or update is all-inclusive of previous patches and updates. That is, installing patch version “n” includes all updates included in patch versions n-1, n-2, and so forth.
VI Web Access VMware ESX supports managing your virtual machines through VI Web Access. You can use the VI Web Access to connect directly to the ESX host or to the VMware Infrastructure Client. VMware ESXi does not support web access at this time.
Licensing VMware ESX hosts can be licensed as part of a VMware Infrastructure 3 Foundation, Standard, or Enterprise suite.  VMware ESXi hosts can be individually licensed (for free) or licensed as part of a VMware Infrastructure 3 Foundation, Standard, or Enterprise suite. Individually licensed ESXi hosts offer a subset of management capabilities (see SNMP and Remote CLI).

 

 

ESXi – Free License

(ESX not available without VI)

VI Foundation

(with ESX or ESXi)

VI Standard

(with ESX or ESXi)

VI Enterprise

(with ESX or ESXi)

Core hypervisor functionality

Yes

Yes

Yes

Yes

Virtual SMP

Yes

Yes

Yes

Yes

VMFS

Yes

Yes

Yes

Yes

VirtualCenter Agent

 

Yes

Yes

Yes

Update Manager

 

Yes

Yes

Yes

Consolidated Backup

 

Yes

Yes

Yes

High Availability

 

 

Yes

Yes

VMotion

 

 

 

Yes

Storage VMotion

 

 

 

Yes

DRS

 

 

 

Yes

DPM

 

 

 

Yes