PowerShell Big Hit at VMworld 2008
I had perviously provided a download link for the VMware VI Toolkit within the "PowerShell Downloads" section on this site. To be quite honest the download statistics have been minimal at best. My thoughts were that since this site caters to those whom are learning PowerShell, the readers of this site may not yet have been exposed to virtulization technologies. The way the industry is heading you will… And VMware ESX is most likley the product you will be working with.
While putting together my schedule for VMworld there it was, "Managing VMware with PowerShell." I didn't know what to expect? How well is PowerShell being received as a management tool for VM? Seems kind of strange that a Microsoft technology is utilized to manage a non-Microsoft environment, but that is exactly what's happening here. I got to the break-out session early and was able to get a good seat. By the time the presentation began it was a packed house, they were turning folks away at the door. Clearly those working with VMware were interested in how PowerShell was going to make administration eaiser and I was one of them…
The presenters were:
- Carter Shanklin - Product Manager, VMware
- Andrey Anastasov - PowerShell Architect, VMware
- Dmitry Sotnikov - Manager and Microsoft MVP, Quest Software
Questions
What is the VI Toolkit?
It is a scripting tool based on PowerShell. Since it's based on powershell there are over 125 cmdlets available, many useful actions that can be done at the command line(without scriting).
How much is it?
It's Free!
How does it make my life eaiser?
Save time by automating repetitive tasks and automating time consuming tasks.
Examples
Because VMotion doesn't support moving Virtual Machines that contain a snapshot, how do I find which VMs have a snapshot?
- Get-VM | Get-Snapshot
Find all snapshots older than one month:
- Get-VM | Get-Snapshot | Where{$_.Created -lt (Get-Date).addMonths(-1)
I'm Migrating all VMs from Network A to Network B:
- Get-VM | Get-NetworkAdapter | Where{$_.NetworkName -eq "Network A"} |
Set-NetworkAdapter -NetworkName B
Ensure all VMs have at least 1GB of RAM:
- Get-VM | Where {$_.MemoryMB -lt 1024} | Set-VM -MemoryMB 1024
Update VMware Tools on all VMs in the corporate datacenter:
- Get-Datacenter "corporate" | Get-VM | Update-Tools
Restart an unresponsive VitrualCenter agent:
- Get-VMHost ESXProd1 | Get-VMHostService | Where {$_.key -eq "vmware-vpxa"} |
Restart-VMHostService
Every time you add new LUNS to your environment you have to scan each HBA on all ESX servers. Manually a PITA. Here is how to do it with the VI Toolkit:
- Get-VMHost | Get-VMHostStorage -RescanAllHba
Available Resources:
The VI Toolkit Community, Vi Tookit FAQ, and the VI Tookit Blog are all available here.
The VI Toolkit Community Extensions:
- Modules that can be loaded into your scrpits
- Open Source
- Forums
- Script contibutions
Administrative Tasks made simple
These are some of the tasks that I've started using which has streamlined my job. I've been able to change the VMware tools upgrade policy as every time I update ESX the tools become out-of-date. I've used a number of cmdlets to create reports from Disk space usage to enumerating world wide names. I've also executed scripts in response to VirtualCenter alarms. Check out the available resources above, there are so many ideas out there that will help you in managing your ESX environment using PowerShell.
« PowerShellASP | Home | Enumerate The Remote Event Log with .NET »






Leave a Comment