ForwardOrReverse

Latest Posts

PowerShell: Get VMs running on a single host

I wanted to perform an action on all of the VMs on a particular host, but using my connection to Virtual Center instead of reconnecting directly to the host.  I found something interesting.

This is wrong:
Get-VMhost esx1.local | Get-VM #Not what I expected.

This does not work as I expected. It gets all of the VMs in the cluster instead of just the ones registered with the host.  My best guess is that this is because the host is not really a container object when in a cluster.

As a workaround you have to do something like this:
Get-VM | Where-Object {$_.Host.Name -eq ” esx1.local”}

To cut down on Get-VM processing time do:
Get-VMhost esx1.local | Get-VM | Where-Object {$_.Host.Name -eq “esx1.local”}

The first part of the pipeline still gets all of the VMs in the cluster, but this is better than all of the VMs in Virtual Center.

I thought I had a good solution and then a co-worker showed me a command line that he got from somewhere (sorry, don’t know where) that cut the processing time in half (Measure-Command is great).

(Get-VMhost esx1.local | Get-View).VM | % {$_ | Get-VIObjectByVIView}

Update 3/5/2009 — As Jeremy indicated in the comments, this is a more appropriate way to use Get-VIObjectByVIView:

(Get-VMhost esx1.local | Get-View).VM | Get-VIObjectByVIView

Validating Ubuntu Installed Files

I had an issue where I ran a vendor provided install script and my kernel sound drivers were deleted.  I recovered them just fine, but it had me wondering about how I could be sure that no other files were missing or corrupted.

After some searching online I found a reference to someone checking a package using dpkg’s md5sums.  This and some poking around gave me what I needed.


cd /
sudo /usr/bin/md5sum -c /var/lib/dpkg/info/*.md5sums | tee /tmp/md5sum_results.txt

After that run is complete you can use grep to find things that are not OK and investigate them. If this is to be used for security validation the md5sums and related tools need to be stored on read only media.

PowerShell ISE Custom Menu

Here is some code that I am working on for customizing the PowerShell ISE to do some things that I would like it to do.

Update 1/22/2009: After switching to a full WordPress install I don't have a problem uploading code files any more.  Keep any eye on this page for any updates to the custom ISE menu.  Feedback is welcomed.
#
# Add Run with arguments capability
#
$psise.CustomMenu.Submenus.Clear()
$__menu__ = $psise.CustomMenu.Submenus.Add("Run Script With Arguments", $null, $null)
$__menu__.SubMenus.Add("Run", {. $psise.CurrentOpenedFile.FullPath $__scriptargs__}, "Ctrl+Alt+R") | Out-Null


(more…)

Package error with HP RDP and ESX 3.5 Update 1

The scripted install fails and the installer reports that it can not find some package files. The files were extracted from an ISO that was verified using md5sum.
When I extracted the files from the ISO image using MagicISO or DaemonTools on Windows a few of the files have invalid names. It looks just fine when I mount the ISO in my Ubuntu Linux VM though. I burnt the ISO to a disk and the same files have incorrect names.

Here are the files I had problems with, both wrong names and correct names:

VMware\RPMS\
VMware-esx-drivers-scsi-aacraid_esx30-350.1.1.5.2vmw-82663.i386
VMware-esx-drivers-scsi-aacraid_esx30-350.1.1.5.2vmw-82663.i386.rpm
VMware-esx-drivers-scsi-lpfc_elx_v740-350.7.4.0.13.1-82663.i386
VMware-esx-drivers-scsi-lpfc_elx_v740-350.7.4.0.13.1-82663.i386.rpm
VMware-esx-drivers-scsi-qla2300-v707_vmw-350.7.8.32-82663.i386.r
VMware-esx-drivers-scsi-qla2300-v707_vmw-350.7.8.32-82663.i386.rpm
VMware-esx-drivers-scsi-mptscsi_2xx-350.2.6.48.13vmw-82663.i386
VMware-esx-drivers-scsi-mptscsi_2xx-350.2.6.48.13vmw-82663.i386.rpm

Looks like this is a known VMware issue. The message towards the end of this forum post provides more information.http://communities.vmware.com/thread/139118

VC Upgrade to 2.5 and XP template issues

We upgraded to Virtual Center 2.5 and our XP deployments failed to join the domain. When I logged onto the VM I received a popup about an unsigned driver issue for the network card. Turns out a patch to the network driver in ESX 3.0.1 updated the driver to version 2.0.0.9 and there was a version of it in C:\WINDOWS\system32\ReinstallBackups. ESX 3.0.2 has a version of 2.0.0.8 so it looks like the problem was resolved within ESX itself.

I am not sure what changed in the deployment process for this issue to show itself after a VC upgrade, but here is what I did to resolve the issue in the template.

  1. Convert to virtual machine
  2. Power on
  3. Uninstall VMware tools and reboot
  4. Dismiss hardware dialogs
  5. Delete the VMware driver folders in C:\WINDOWS\system32\ReinstallBackups
  6. Delete lgotsync, vmmouse, vmx_svga, and vmxnet from windows\system32\drivers
  7. Search for driver files in other locations and delete them
  8. Reboot
  9. Install the current VMware tools
  10. Reboot
  11. Configure display settings
  12. Shutdown
  13. Convert to template

Basic install of bcfg2 on ESX 3.5

I am working on the configuration management problem and have been toying with getting bcfg2 working on ESX 3.5. My goal is to have an isolated install that does not require modifying the existing system files or upgrading any packages. My approach to doing this is to create a local Python 2.5 install and install the bcfg2 packages there.

This is just a start, but I thought I would put it out there for anyone who wants to work on something similar.

Installing bcfg2 on ESX 3.5 v 0.00001

ESX Server Configuration Management

I am not very happy with the landscape of configuration management software out there for VMware ESX server.  I am investigating using projects such as Bcfg2 to administer my servers.  I am working with Bcfg2 because I do not have a lot of experience with these types of software and I am interested in learning more about Python.

Of course these types of packages fail when you look at ESX 3i, but I am not convinced that I will be an early adopter of that platform.  I have tried to automate a few things with the VI SDK, but I am having trouble finding all of the information that I want to audit.

If anyone knows about a good CM solution for ESX please let me know.

IT Infrastructure Performance – Research

I have been working on methods to benchmark the Windows infrastructure team at work and I have not been finding much luck finding existing metrics. I was not too happy with the last Gartner review of our IT department, but perhaps that is all that is out there. I have developed some thoughts on the matter and once I am fairly certain they make sense I will post them here.

I have come across a pretty interesting book on measuring business processes. It is How to Measure Anything: Finding the Value of “Intangibles” in Business. The book walks you through quantitative decision making and how to do this with things that you might have previously thought were immeasurable.

Infrastructure Value != Utilization

A common problem in infrastructure groups is determining the value that we provide to the organization. One common way of thinking about this is in terms of asset utilization. Messages such as “take your servers from 5% utilization to 60%” are very common in virtualization value propositions, but I do not think that capacity utilization is the correct measurement of infrastructure value. That value is derived from being able to run an application at adequate performance levels. It does not matter what the utilization is. Take the following hypothetical scenario measuring performance in CPU or memory:

utilization_comparison_small

Both of these systems are running the same application and provide the same benefit to the organization, but the higher utilization solution actually costs more. When thinking about it this way I think that it becomes clear that higher utilization is not a good indicator of infrastructure efficiency in providing value to the organization.