Unsolved
This post is more than 5 years old
116 Posts
0
4492
powershell scripts to leverage UBERalign for virtual disk alignment
This post is meant to be an example of how you can leverage Nick Weaver's creation of the UBERalign tool's REST API in order to kick off alignment and checking jobs for Virtual Disks from the Powershell console. The scripts attached allow command and control capability of the UBERalign Virtual Appliance along with necessary steps for the VMware environment to orchestrate an alignment.
See the following links for information.
http://nickapedia.com/2011/11/03/straighten-up-with-a-new-uber-tool-presenting-uberalign/
http://nickapedia.com/2011/11/07/for-advanced-users-uberalign-api-cli-powershell/
http://virtualgeek.typepad.com/virtual_geek/2011/11/first-of-a-series-of-holiday-giftsuberalign.html
The first link above is from Nick's page where the tool can be downloaded. It consists of two different pieces, a Virtual Appliance which servers to receive REST API calls and does the heavy lifting work in aligning VMs, as well as the UBERalign .NET console. The console's purpose is mainly to coordinate or orchestrate alignment jobs to specified aligners (vApps).
An option that makes the tool UBERcool is that it has a REST interface at the Virtual Appliance layer. This means that we can cook up our own Powershell (or language of choice) logic to work with our VM's and then coordinate the alignment of those VMs. See the attached screenshots and scripts!
Thanks Nick, great addition to the community and a great representation providing REST to make an UBERscalable tool.
Example runtime
get-vm winxptest* | .\ps_uberaligner.ps1 -valignervm valigner01 -valignerip ip
Features (ps_uberaligner)
Checks to see that you have started PowerCLI and logged into a viserver
Programmatic approach to sending jobs to aligner
Snapshot prior to alignment
Background job runs to lock aligner exclusively for system's use
Allow for receving pipe input, ie. get-vm vmname* | .\ps_uberaligner.ps1
Align, check alignment, space reclaim functionality
Linux style output of operations (OK, FAILED)
Progress bar for status of alignment
Futures
Allow to receive action to perform on VMs from pipe input, ie. select *,@{n="action";e={"align"}}
Multiple virtual disks on same VM
Multiple Aligner Support (can be done via multiple powercli windows, or other methods)
vCenter plugin
WARNING: This tool can cause permanent damage to a Virtual Machine and its disks, this is not an EMC supported tool, and we advise this currently be used in lab environments. Please post questions to this forum.