• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Management & Automation

Scripts, scripts, scripts… come and get them!

Duncan Epping · Dec 18, 2008 ·

I was just pointed out to this amazing topic on the VMTN Forums by William Lam and Tuan Duong. These guys created a whole bunch of scripts and decided to share them with the rest of the world:

My colleague (Tuan Duong) and I (William Lam) have been working on a virtualization/VDI deployment project over the last six months. The result of this work is a set of scripts that assist in provisioning and managing the server and lab environment for the Residential Networking Services (ResNet) at the University of California, Santa Barbara.

We took the approach of developing scripts that would be free in nature to support a variety of offerings that currently exist in the enterprise space. One such tool that we would like to share with the VMware community is our Linked Clones script that was developed at the beginning of the summer of 2008. This script functions similarly to the View Composer component in the recent release of VMware View 3 but with relatively relaxed requirements.

A description and more details of the Linked Clones script can be found at:

http://communities.vmware.com/docs/DOC-9020

Another script that complements the Linked Clone’s script is our custom management script “*my-vmware-cmd*” which can be found at:

http://communities.vmware.com/docs/DOC-9061

An example of our implementation of these scripts can be found at:

http://communities.vmware.com/docs/DOC-9201

We also have other scripts and resources that have been consolidated onto a webpage and would like to share it:

http://www.engineering.ucsb.edu/~duonglt/vmware/

We hope that the community finds some of these scripts to be useful in aiding VI administrators to manage their virtual infrastructure and look forward to any feedback that is provided.

Thanks
William lamw and Tuan tlduong

Check these scripts out if you’re looking for a linked clone solution on a non View Composer environment. Their website also contains a bunch of scripts, tips and tricks. One that really stands out is the RDM script, believe me this is a must have for your toolkit:

Download: rdm.sh – 11/03/08
Compatiable with: ESX 3.5+ and ESXi

This script is used to locate all virtual machines that have an RDM mapping and provides the VMs Name, Hard Disk label shown on the VIC/VC, Datastore, LUN UUID, HBA/LUN, Compatibility Mode (Phys/Virt), DiskMode and Capacity.

Add Custom Fields to VI Client with Powershell Part 2!

Duncan Epping · Dec 17, 2008 ·

Yesterday I blogged about the Powershell script that Hugo Peeters created for adding a snapshot Column to your VI Client with Powershell. Hugo used a custom field to show this data and I wrote the following:

Some of you might say that this lacks the detail one would love to see within vCenter. Well knowing Hugo my guess it that this will evolve fast, and I expect some cool additions coming up.

Well I wasn’t expecting Hugo to be this quick, but he just blogged about four new additions:

Total Snapshot Size

The number of snapshots is quite interesting, but even more interesting, is the total size of the delta files all snapshots are occupying. They might be eating up all your precious SAN space. Plus, reverting to or committing a large snapshot is tricky. Add-VMSnapshotSize.ps1

Host Hardware Model

Want to see what models of hardware you are using in your datacenter? You could look at the summary tab of each host. Or run this script to add the info to the every Hosts tab in the VI Client. Select your Datacenter, select the Hosts tab and enjoy! Add-VMHostModel.ps1

Host ESX Version

Did you update all your ESX Servers to the latest version? Check it quickly using this script. Add-VMHostVersion.ps1

Host LUN Count

Last but certainly not least: are you sure every datastore you are using is available to all your ESX Servers? It is visible at a glance when you add the LUN Count to your VI Client! Add-VMHostLUNCount.ps1

So what can we expect in the future? I really don’t know… but my guess is that we can expect a lot more coming up over the next few days.

[update: if any of the links fail, here’s the source article.]

Snapshot info within vCenter?

Duncan Epping · Dec 16, 2008 ·

snapsHugo Peeters has done it again. He created another very usefull script. This time Hugo created a script which adds a “custom field” within vCenter with Snapshot information, the amount of snapshots that is.

Some of you might say that this lacks the detail one would love to see within vCenter. Well knowing Hugo my guess it that this will evolve fast, and I expect some cool additions coming up.

If you don’t want to wait just check his post, download the code and start modifying / adding yourself. Hugo outlined the concept so it should be fairly easy to add new functionality to it.

And if you haven’t done it by now, add Hugo’s blog to your RSS Reader or Bookmarks!

Zero-out all vm’s from just one script!

Duncan Epping · Dec 12, 2008 ·

I’ve been thinking for a while about this. How can I zero-out all my vm’s with just one schedule. I don’t want to manually add a schedule every single time I roll out a VM, I want a central point for administering this.

Today I noticed the blog on using the VIX API. The VIX API can be used for all sorts of things, including copying files to all your VM’s or installing MSI on your VM’s. (Check the blog article for a complete list of supported operations for the VMRUN command.)

If you can install MSI’s then you can also run a simple vbs script:

vmrun -T virtualcenter01 -h https://virtualcenter01.yellow-bricks.local/sdk -u root -p yell0wbricks -gu user -gp userpw runProgramInGuest "[storage1] Windows/Windows.vmx" c:\windows\system32\sdelfrag.vbs

Unfortunately I wasn’t able to test it myself, but it should work just fine. If anyone is able to test it please let me know.

Thanks Carter!

Get VMware Disk Usage with Powershell

Duncan Epping · Dec 10, 2008 ·

There are a couple of guys in the Virtualization Community that are really into powershell. Hugo Peeters is one of those guys. This time Hugo created a powershell script to track diskspace all the way from the VM’s filesystem to the VMFS Datastore:

So you might want to check if you are wasting a lot of this space. When you look at the storage in VMware, it consists of multiple abstraction layers. A virtual machine has one or more Logical Disks, which are indicated by driveletters. You can use WMI to determine the amount of used and free space (Win32_LogicalDisk). One or more logical disks are contained in a partition. One or more partitions reside on a physical disk. That physical disk is really a virtual disk, a vmdk file to be precise. One or more vmdk files reside in a Datastore, which can be found on a LUN on your SAN.
The following script enumerates most of these layers (from logical disk to datastore) and calculates the used and free space. The final line exports the results to a csv file for use in Excel. And the script also helps you to calculate the average free space by showing the totals without the duplicates (don’t try to average the averages in excel, that’s not accurate because datastores contain duplicates and averages should be weighed).

Check Hugo’s post for the script.

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 33
  • Page 34
  • Page 35
  • Page 36
  • Page 37
  • Interim pages omitted …
  • Page 44
  • Go to Next Page »

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Also visit!

For the Dutch-speaking audience, make sure to visit RunNerd.nl to follow my running adventure, read shoe/gear/race reviews, and more!

Do you like Hardcore-Punk music? Follow my Spotify Playlist!

Do you like 80s music? I got you covered!

Copyright Yellow-Bricks.com © 2026 · Log in