VMware Certified Professional 5

I recently completed the requirements for the VMware Certified Professional 5 certification. Achieving certifications isn’t a priority for my current employer (a VMware customer) and as such it had been over 10 years since I last attempted an IT certification. I passed the exam on the first attempt but the questions were a lot harder than I had anticipated. I wanted to point out a couple of very solid resources I used to study for the exam.

First, I watched the 7 part brownbag series on the VCP 5 exam. You can find these episodes here: http://professionalvmware.com/brownbags/. Each one is between 1 and 2 hours long, so put them on your iPad and kick back when you have a chance. This was my first experience watching the brownbags — but it won’t be my last. These are very solid technical presentations and I highly recommend subscribing to in iTunes.

Next, I read through the VCP blueprint from VMware MyLearn. It lists all of the content that could appear on the exam. It is a very short paper, but worth a look. I printed a copy and was going to use it as a check list to figure out what I needed to study…until I found something better.

Finally, I found and used the study guide created by Josh Coen and Jason Langer. It is a 130 page PDF document that is organized by objective just like the VCP blueprint. You can find it here: http://www.virtuallanger.com/vcp5/. This is better than the blueprint as it includes content about each objective and references the associated supporting document you should review.

Here is a bit of free advice. When you study for the exam, don’t discount anything you see in the blueprint. I remember thinking…Oh, nobody would ever use this feature so I don’t need to know it for the exam. That is simply not true. If the feature exists — and more specifically exists on the blueprint — you’ll want to know the material for the exam. Additionally, and this will sound fairly straight forward, be sure to study those things you do NOT know. If you only use vSphere Distributed Switches be sure and study the limitations and use cases of standard switches. If you only use NAS storage be sure to study block storage. Knowing these things will greatly help in passing the exam. Good luck!

Posted in Virtualization | 2 Comments

Power On virtual machine – Unable to access file since it is locked

Several times in the past few weeks I have ran into virtual machines that do not power on because of locked files. Steps to troubleshoot this issue are described in KB10051: Virtual machine does not power on because of locked files. While looking into this topic, I found the following article on vi-tips.com Could not power on VM – lock was not free, which describes the same issue. My issue was encountered on several ESXi 5.0 Update 1 hosts, and according to this vi-tips.com article the issue also exists on ESXi 4.1.

The vi-tips.com post includes several screenshots of how to isolate/troubleshoot this issue. After a few steps, you can use vmkfstools -D /vmfs/volumes/sanvolname/filename-flat.vmdk to determine the MAC address of the VMKernel interface maintaining the lock. A little bit of PowerCLI goes a long way into finding which host uses this interface:

[cc lang=”Powershell”]
Function Get-VMHostNameByMac ([string]$macAddress) {
#The MAC address passed to this function does not need separators, we will remove them if provided
$macAddress = $macAddress.Replace(“:”,””).Replace(“-“,””)

#The MAC property returned by the Get-VMHostNetworkAdapter cmdlet will have a colon separator, so we will remove it for comparison purposes
Get-VMHost | Get-VMHostNetworkAdapter | where {$_.Mac.Replace(“:”,””) -eq $macAddress} | select-Object VMHost, Name, MAC
}
[/cc]

Here is example usage of this command:

Get-VMHostNameByMac '001ec9123456'

Once the locking VMKernel interface is located, we can continue troubleshooting. The vi-tips.com article suggests cold migration of the VM to the locking host and powering on the virtual machine on that host — but I was unable to get that option to work. However, I found that restarting the management agents on the locking host would resolve my issues. Once the management agents were restarted I could power on the VM using any host.

Posted in Scripting, Virtualization | Leave a comment

Verify VAAI settings with PowerCLI

I recently had a need to validate that all hosts in a specific vCenter had appropriate vStorage API for Array Integration (VAAI) settings. I didn’t want to change the values, I was just looking for the existing values. This short code will do just that:

[cc lang=”powershell”]
$myreport = @()
Get-VMHost | %{
$DataMoverHardwareAcceleratedMove = $_ | Get-VMHostAdvancedConfiguration -Name DataMover.HardwareAcceleratedMove
$VMFS3HardwareAcceleratedLocking = $_ | Get-VMHostAdvancedConfiguration -Name VMFS3.HardwareAcceleratedLocking
$DataMoverHardwareAcceleratedInit = $_ | Get-VMHostAdvancedConfiguration -Name DataMover.HardwareAcceleratedInit
$myreport += new-object psobject -property @{
Host = $_.Name
DataMoverHardwareAcceleratedMove = [string]$DataMoverHardwareAcceleratedMove.Values
VMFS3HardwareAcceleratedLocking = [string]$VMFS3HardwareAcceleratedLocking.Values
DataMoverHardwareAcceleratedInit = [string]$DataMoverHardwareAcceleratedInit.Values
}
}
$myreport
[/cc]

The resulting output will list the setting for each option value for each host. Note: 0 = disabled and 1 = enabled.

If you need to make changes to these values on a large number of hosts, check out this article: http://nickapedia.com/2011/03/01/powercli-and-vaai-quick-and-dirty-script/.

Posted in Scripting, Virtualization | Leave a comment

Creating and Reviewing Windows crash dumps in VMware virtual machines

The other day I was assisting a co-worker who needed a memory dump of a Windows virtual machine. He was working with Microsoft support and the support engineer mentioned that the process for gathering this data was different since we were using a virtual machine. I Googled vmware windows memory dump and found VMware KB 1001624, which links to a Microsoft KB article that documents how to make CTRL+ScrollLock+ScrollLock cause a blue screen (which creates a memory dump). This process works the same on both physical and virtual servers.

While that is a fun setting, and has a possible April Fools use case, it doesn’t really help troubleshoot issues. Using this option, the memory dump is caused by the user and requires an outage is required (a reboot to enable the registry key and a blue screen to create the memory dump).

The tool the Microsoft engineer was talking about is vmss2core.exe and it ships with VMware Workstation. I haven’t had a chance to use it in the past, but it is very simple. Here are the steps I used to test this process:

  1. Create a snapshot of a virtual machine with the ‘snapshot the virtual machines memory’ option selected.
  2. Browse to the virtual machine’s folder on the VMFS or NFS volume and download the ‘-snapshot1.vmsn’ file to a temporary directory.
  3. Copy the ‘vmss2core.exe’ file from a VMware Workstation installation to this temporary directory.
  4. Run the following command (where ‘w2k3test01-snapshot1.vmsn’ is the name of your snapshot file):
vmss2core.exe w2k3test01-snapshot1.vmsn -W

This process creates a memory.dmp file in the current directory. This file can be analyzed to determine what was running at the time of the snapshot creation. Note: the vmsn file is slightly larger than the amount of vRAM allocated to the virtual machine and the memory dump is equal to the amount of RAM installed. For a VM with 8GB of RAM you’ll need at least 16GB of disk space to complete this process.

How do I open these memory.dmp files to verify they are working? I’m glad you asked. I found a Network World post from 2005 that outlines the process: http://www.networkworld.com/news/2005/041105-windows-crash.html. You only need to download and install two applications (note: a few dependencies exist for these apps, such as the .NET Framework).

Download and Install Debugging Tools for Windows
Download Windows Symbol Packages

These downloads are free and give you the tools to open/review a crash dump. I don’t have the detailed understanding on how to work with these files, but I wanted to make sure the memory.dmp export worked correctly before sending an 8GB file to Microsoft for analysis.

Posted in Virtualization | 2 Comments

Disable SSL for VMware Converter 5 using powershell

Starting with VMware Converter Standalone 5.0, the default action is to secure the P2V data with SSL. While this is nice if you are converting machines across an untrusted network or need the additional level of security, it can really slow down the P2V process. There is a blog post at Jon Kohler’s Blog and a thread on the VMware Communities about this subject.

I’ve been working on a handful of P2Vs, and I always need to find my notes about the NFC SSL setting to remember exactly what I need to change. While I was waiting on one of these P2Vs to complete, I opened up powershell looking for a way to modify the XML file. I now have a simple script on my management server that:

1.) Finds the right file (based off operating system)
2.) Makes a backup copy of the XML
3.) Adds the useSSL element if it does not exist
4.) Modifies the value of config.nfs.useSSL
5.) Restarts the vmware-converter-agent service

If you are interested in the script, you can download it here: VMwareConverterDisableSSL.ps1

I did notice two possible concerns that aren’t important in my environment but wanted to share them just in case. The backup XML file will be overwritten if this script is ran more than one time. This could be fixed by appending a date stamp or random number to the file name (see line 38). Second, the powershell modified version of the XML file does not preserve white space in the comments, so the resulting output is less lines than the source file. The change works as expected and the service does start, so I wasn’t worried about this difference.

Posted in Scripting, Virtualization | Leave a comment