Archive

Archive for the ‘vSphere’ Category

Find VMs with Mismatched OS using PowerCLI

July 27, 2011 1 comment

Almost every environment has one or more VMs where the running OS doesn’t match what is configured on the VM.

 

Let me explain:

Every VM has a property which contains the OS version:

image

This is usually set when you create the VM.  In this example, the VM is set to Windows 7 x64.  But if you install an OS in the VM, VMware is also aware of the Guest OS through VMware Tools.  This is visible on the Summary page of the VM.

image

Both fields should match, but if you upgrade the OS inside the VM and forget to change the Settings of the VM, you have a mismatch.

Read more…

Categories: PowerCLI, VMware, vSphere

Unable to clone disk *.vmdk when converting a VM with Paravirtual disk with VMware Converter

March 16, 2011 2 comments

Last week i was trying to migrate/convert (V2V) a VM with Paravirtual SCSI Controllers.

As you all know, Hard disks attached to Paravirtual SCSI Controllers is ‘the way to go’ in vSphere:

– Lower CPU utilization

– Better performance

– Virtualization aware

– …

However, when you try to convert a VM with Paravirtual SCSI Controller, VMware Converter 4.3 throws you a nice error and the task fails with Status: FAILED: An error occurred during the conversion:

image

Read more…

Categories: VMware, vSphere

Enable RSS (Receive Side Scaling) on Windows 2008 (R2) Virtual Machines

March 3, 2011 9 comments

A nice feature of the VMXNet3 vNIC in vSphere is Receive Side Scaling.

For detailed info, check out http://technet.microsoft.com/en-us/network/dd277646.

I’ll try to summarize it here:

Without RSS, all incoming network traffic is handled by CPU 0.  This could cause a bottleneck on high Network IO machines resulting in an overloaded CPU 0 (where CPU 1, 2, 3, … might be idle).  With RSS enabled, incoming network traffic is handled by all available CPUs.

RSS is available inside a VM on vSphere.  But, you’ll need to have the VMXNet3 adapter in your VM.

Let me show you how to enable this on a Windows 2008 R2 VM.

Read more…

Categories: Network, vSphere

Hot Add Memory on vSphere 4.1. Is it useful?

February 15, 2011 2 comments

Since vSphere 4.1, you can Hot Add memory inside a VM depending on the OS type.

I’m not going into the details on how to add the memory as that is described in numerous posts on the internet.

 

Let’s assume we have a Windows Server 2008 R2 with 5 GB of memory and a x64 application consuming 10 GB of RAM (we use TestLimit64 from sysinternals in this example, but typically this application could be Exchange, SQL, …).  I know, it sounds awful (as a matter of fact, it is awful 🙂 ).

If we look in Task Manager, we can see the server has severe memory shortage:

image

Read more…

Categories: VMware, vSphere

Hot Remove a hard disk from a Virtual Machine on vSphere 4.1

February 14, 2011 8 comments

Hot Adding hard disks has been around since the stone ages on VMware platforms.  As from vSphere 4.1, you can also Hot Remove a hard disk (VMDK and RDMs!) from a Virtual Machines.  This means that there is no downtime for the Virtual Machine and no reboot is necessary!

In my opinion this is a huge improvement and quite a benefit.

You have to be carefull however to remove/disable/uninstall/whatever the hard disk inside the VM first to make sure that the VM is not affected.

The remove operation is not a big deal for vSphere, but if your VM is still accessing that disk, things might get ugly inside the VM…  (just think of a physical Windows box and disappearing SAN connection 🙂 ).

Let’s see how to Hot Remove a hard disk for a Windows Server 2008 R2.  This method works from Windows 2000 and higher but the screenshots might differ.

Read more…

Categories: Storage, VMware, vSphere

How to Hard Kill a stuck VM with PowerCLI

February 9, 2011 2 comments

Sometimes a VM is stuck and can’t be killed with vSphere Client (or from within the VM).

On ESX, you could login and perform the famous kill –9 <PID> to kill the VM.  Most people don’t realize that this functionality has been added to PowerCLI in version 4.1 Update 1.

First, connect directly to the ESX(i) host.

Connect-VIServer -Server <Hostname> -Credential $(Get-Credential -Credential root)

Read more…

Categories: PowerCLI, PowerShell, vSphere

PowerCLI: Convert PortWorldWideName or NodeWorldWideName to hexadecimal format.

February 9, 2011 Leave a comment

If you output one of the fields of $VMHost.Config.StorageDevice.MultipathInfo.Lun[x].Path[x].Transport, you will get the output in standard decimal numbers.

This is different from what is used in SAN environment where they mostly use XX:XX:XX:XX:XX:XX:XX:XX where XX is a hexadecimal number.

 

Use the following code to convert from the decimal format to the hexadecimal SAN format:

[String] $lstrWWNNHex = "{0:x}" -f $NodeWorldWideName
[String] $lstrWWNNHexFormatted = ""
For ($i=0;$i -lt 8;$i++)
{
$lstrWWNNHexFormatted += "{0}:" -f $($lstrWWNNHex.SubString($i * 2, 2))
}
$lstrWWNNHexFormatted = $lstrWWNNHexFormatted.SubString(0, $lstrWWNNHexFormatted.Length - 1)

$NodeWorldWideName is the WWN generated by $VMHost.Config.StorageDevice.MultipathInfo.Lun[x].Path[x].Transport.NodeWorldWideName.  You can use the same for PortWorldWideName.

Categories: PowerCLI, PowerShell, vSphere

How to check if PowerCLI libraries are loaded in PowerShell/PowerGUI

February 3, 2011 2 comments

If you write scripts in PowerShell or PowerGUI, it might be handy to check if the PowerCLI libraries are loaded.

Even though you have PowerCLI installed, this does not mean the objects are loaded in your PowerShell session.

In PowerGUI for example, you can check this by clicking File – PowerShell Libraries.

image

Read more…

Resolving “The server fault ‘SystemError’ had no message” when doing “Edit Settings” on a VM converted from a Template

December 8, 2010 5 comments

When i was trying to edit a VM converted from a template on vCenter 4.1, i stumbled upon the following error:

image

It can resolved by following these steps:

Read more…

Categories: VMware, vSphere

Check HP Management Agents with PowerCLI

November 23, 2010 4 comments

Checking on the existence of HP Management Agents on your ESX hosts and/or their version is rather easy with PowerCLI.

 

Connect to your vCenter hosts using the Connect-VIServer cmdlet (remember that you can connect to multiple servers!).

Read more…

Categories: PowerCLI, vSphere