virtual grind thoughts from the virtual world


Using PowerCLI To Answer All CD-ROM Override Questions

I recently ran in to a scenario where multiple cd-rom drives were disconnected from 100's of virtual machines and there were questions generated for each. In order to quickly answer and clear the questions, you can simply use this one liner after connecting to vCenter (Connect-VIServer):

Get-VM | Get-VMQuestion | Set-VMQuestion -Option "Yes" -Confirm:$false

Note than the "-Confirm:$false" will not prompt you as the script runs, taking care of each question automatically. If you would rather see each confirmation, you can remove the the Confirm switch.


Using PowerCLI to Answer VM Questions

I recently have been testing some vendor's storage solutions and fast provisioning in vCloud Director. During the testing, I create a load simulator to mimic 1000 virtual machines inflating disks, testing write patterns, etc. In any case, during the testing, I was able to completely obliterate the vendor's write cache and write IOPS, causing datastore issues. This also caused 1000 virtual machines to get stalled due to datastores being filled up, and having a question placed on them.

In order to quickly answer these 1000 questions, this PowerCLI example worked like a charm:

Get-VM LoadTest* | Get-VMQuestion | Set-VMQuestion --Option "Cancel"

In this example, I wanted to answer "Cancel" on all VM's connected named LoadTest*


Setting Default Path Selection Policy (PSP) – Round Robin

When using a storage technology such as Compellent, the ability to take advantage of multipathing is highly desirable. To utilize multipathing you must select the correct Path Selection Policy (PSP) on each ESX/ESXi host.

By default, the "Fixed (VMware)" path selection policy is selected on a new ESX/ESXi install. As you add volumes across multiple hosts in a cluster, this become a pain to change the path selection to "Round Robin (VMware)" on each volume on each host.

Fortunately, changing the default PSP is very easy with the following esxcli command:

esxcli nmp satp setdefaultpsp --satp="VMW_SATP_DEFAULT_AA" --psp="VMW_PSP_RR"

Please note that you want to first verify your "Storage Array Type" before setting the above policy. For Compellent, as of this post, the storage array type is "VMW_SATP_DEFAULT_AA". Other vendors may require a different type, such as "VMW_SATP_EVA" or "VMW_SATP_EQL".


vCenter Orchestrator Plug-in for vCloud Director

The vCenter Orchestrator team at VMware recently released a plug-in for vCloud Director. If you are not currently using Orchestrator, the product has come a long way since the 3.x days.

vCenter Orchestrator can be used to automate tons of taks in vCenter. The latest version also makes use of a feature rich client that can be used to easily automate workflows and common tasks. After using the latest version for some time now, I am quite impressed.

The latest plug-in for vCloud Director really expands the functionality of Orchestrator into your vCD environment.

More info on vCenter Orchestrator can be found here.

The vCenter Orchestrator Team Blog post on the plug-in can be found here.


VMware’s Project Onyx

I just discovered an alpha release of a great new automation tool dubbed "Project Onyx".

From the project page:

"Project Onyx is a new tool in that generates code based on the mouse clicks you make in the vSphere Client. Project Onyx makes it easy to see what is happening behind the covers and can help with development of scripts and automation solutions. Please refer to the Using Project Onyx video for set up and more information."

Setting up the tool is very easy and it looks like the tool proxies a connection to ESX/VC from your local machine. From there, regular tasks can be performed in your VSphere Client then captured by Onyx. The resulting Powershell script can than be copied and edited to suit your needs. This is great stuff.

You can read more about Onyx here.