• 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

Scripting

Balancing LUN paths with powershell

Duncan Epping · Jan 30, 2009 ·

Just noticed this pingback. The topic title “Balancing LUN paths on your ESX hosts with powershell” sounded promising so I headed over. Justin Emerson is the owner of the blog and he wrote a short but effective script that changes the active paths on your active/active SAN(FIXED).

After watching this video that was posted by the VI Toolkit team, I immediately thought of this script that was posted quite a while back on Yellow Bricks. I decided to try to recreate this script in PowerShell, and while I was at it expand it so it would modify all nodes in a cluster at once. As such I wrote the following script. Please feel free to give feedback or make modifications! You can download it from my Sky Drive or check it out here.

Head over to Justin’s site, pick up the script and give it a try… and most importantly give Justin feedback on the results and what could be improved!

VI Toolkit 1.5 & Podcast!

Duncan Epping · Jan 28, 2009 ·

VMware released version 1.5 of the VI Toolkit for Windows today! Most of you probably already read about it by now, if you didn’t here is the download link, and the link to the release notes.

So much have been added that it would be pointless to blog about all the changes, 32 new cmdlets and 25 new options for existing cmdlets. Check the release notes and the documentation for info on all these additions! Be sure to also check out these video’s, they give you a great view on the endless possibilities.

Carter Shanklin will join the VMTN Podcast today to discuss this new Release so join the podcast, it will start in 45 minutes from now(wednesday 28 January)!

“Quick” Migration for VM’s running on ESXi 3.5u2+

Duncan Epping · Jan 27, 2009 ·

Mike D was the first one that actually wrote a powershell quick migration script that exactly does the same as Microsofts Quick Migration. (Suspend on host 1, Resume on host 2.) Yesterday William Lam emailed me about a script that he created that actually does the same as Mike D’s script. But, William’s script was specifically designed for ESXi and he used Perl to do the job. Before we get into the “is this supported with the current API/RCLI discussion“, William contacted VMware and certain procedures used will be restricted again in the next update for ESXi.

William described his script as follows:

ESXi is a formidable hypervisor solution in both licensed and free operation mode. When fully licensed in a Virtual Center cluster, ESXi’s features (VMotion, HA, DRS, VCB, etc…) are indistinguishable from ESX. One feature of importance, VMotion, is used to perform live migrations of VMs that reside on shared storage from one host to another. In free operation mode however, ESXi hosts are independent of each other, in which case, useful features like VMotion become unusable.

The motivation for this script (ghettoQuickMigrate.sh) then is to provide administrators running the free version of ESXi on several hosts with the capability to perform Hyper-V-like “quick” migrations of virtual machines residing on shared storage between the hosts. VMware’s VIMA virtual appliance was chosen as the central launch point for the quick migration process. ghettoQuickMigration.sh is executed from within VIMA and is compatible with ESXi 3.5u2+.

William wrote an extensive Communities blog post on how this script works, what the requirements are and how to set this up. Another reason for you to start using VIMA!

Compare your hosts…

Duncan Epping · Jan 19, 2009 ·

One of the most promising features in my opinion for the upcoming version of ESX definitely is “Host Profiles”. With host profiles you can ensure that each and every single ESX Host has been installed in the same way. But this feature isn’t available yet, and you would probably like to know if at least all hosts in a Cluster share the same LUN’s and/or Portgroups.

Well, it’s no surprise probably that Hugo Peeters created a script that does exactly that:

This Powershell script generates an overview of any items that are not available to every ESX server in a VMware cluster. These items might prevent your vm’s being vmotioned by DRS or restarted by HA. Pretty serious business, I’d say!

The items involved are:
1. datastores
2. LUNs (important when using Raw Device Mappings)
3. port groups

Hugo exports the output to a nice html file so no more importing to Excel needed or whatever.

Hop over to Hugo and pick up the script. The link is at the bottom of the article!

Orphaned vmdk’s

Duncan Epping · Jan 16, 2009 ·

While doing a “mini-healthcheck” at a customer site I noticed a specific Datastore with less than 2% of free diskspace. After a bit of research an orphaned VMDK was found. Orphaned vmdk’s are virtual hard-disks that are not connected to a VM. Probably because they were removed from the inventory without deleting the files.

You can easily find these orphaned vmdk’s via the Service Console:

find -iname “*-flat.vmdk” -mtime +7

For those that don’t like using the Service Console you can also check this with Powershell Ad van Bokhoven created a nice script which he describes as follows:

This script asks the virtual center what the disk are of each VM and puts this into an array. After this, it reads all files on all datastores. If the file is a vmdk file, it will check wheter this file is in the array. If it’s not, you’ve found a orphaned vmd.

I would advise to regularly check your environment on orphaned disks, it can save precious diskspace.

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Interim pages omitted …
  • Page 18
  • 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)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in