Brian over at “Quick and Dirty Scripting�? a blog that focuses on automating system administration tasks for Linux, Windows, and VMware ESX is (like me) a VMware PowerShell pioneer. He created a script that creates a new virtual machine. He also tried to create a new VM from a template, but he continually got an error while doing so. I guess this just goes to show that VMware is still developing this code and it has some ways to go.
Wednesday, November 14. 2007
Creating a Virtual Machine with Powershell
Tuesday, November 13. 2007
Integrate VMware PowerShell with Workflow Studio
Workflow Studio is a new platform that enables simple yet enterprise-scale data center and business process automation through the power of Windows PowerShell and the flexibility of workflow. Through a graphical workflow designer, you can build full automation of your business and/or IT processes including user account management, server and application provisioning, security enforcement and automation, disaster recovery automation, and routine and emergency maintenance on data center resources. You can integrate all these features with the VMware PowerShell command let’s and automate and provision VMware’s virtual machines. The image shows a simple tryout. Within the hour I created a workflow that creates a CSV file with all the virtual machines registered at a Virtual Center Server. The trail period is 30 days so I got 29 days of fun left. ;-)
Sunday, November 11. 2007
My first VMware PowerShell script
Several months ago I created a Visual Basic program named VMCDConnected. This application checks if one of your virtual machines is connected to an ISO image. When you have created a DRS cluster the virtual machines in this cluster are automatically migrated to the least busy ESX host. These migrations depend on VMotion. The most common show stopper for VMotion is a connected CD that’s not on shared storage. With one click of a button all the CD’s are disconnected. This weekend I had the change to try out the VMware Infrastructure Toolkit for Windows. It provides a core set of Windows PowerShell cmdlets for managing VI. Within minutes I created a script with the same features as my Visual Basic application. The difference is that creating the Visual basic program took me over a month. One other big difference is that the PowerShell script only counts five lines of code. The image shows a glimpse of the Visual Basic Object Browser investigating the Toolkit’s classes and properties. Building Visual Basic application on top of the Toolkit will also become a lot easier.
For the creation of the five-liner I used the script editor from PowerGui and the VMworld presentation “Managing VMware Infrastructure with Windows PowerShell�? presented by Antonio Dias and Danny Kim. VMware is preparing a technology preview of the PowerShell. If you'd be interested in receiving an early version of that software and you'd be willing to try it out and send them feedback, please send email to vi_tk_4win-admin@vmware.com.
Add-PSnapin VMware.VimAutomation.Core
Get-VIServer vcserver.local
$vms = Get-VM
$CDConnected = Get-CDDrive $vms | where {$_.ISOPath -like "*.ISO*"}
Set-CDDrive -connected 0 $CDConnected
Wednesday, October 31. 2007
PowerShell Script to Query ESX Servers
Since Antonio Dias and his colleagues are is still busy with writing the VMware command-let’s for PowerShell we have to find an alternate way to use PowerShell in combination with ESX server. TechProsaic created a PowerShell script that uses plink to communicate with ESX server. This script can do some basic things like snapshots and get a list of VM’s.
Friday, October 26. 2007
VMware PowerShell command-let’s
Since Antonio Dias and his colleagues over at VMware are very bussy with creating PowerShell command-let’s I thought lets take a dive into this new scripting language. Windows PowerShell introduces the concept of a cmdlet (pronounced "command-let"), a simple, single-function command-line tool built into the shell. You can use each cmdlet separately, but their power is realized when you use these simple tools in combination to perform complex tasks. Windows PowerShell includes more than one hundred basic core cmdlets, and you can write your own cmdlets and share them with other users. Like many shells, Windows PowerShell gives you access to the file system on the computer. In addition, Windows PowerShell providers enable you to access other data stores, such as the registry and the digital signature certificate stores, as easily as you access the file system. There is a powerful Tool available on the internet, called PowerGUI. It is a Free GUI (Graphical User Interface) PowerShell Tool sponsered by Quest. The PowerGUI allows we to use the Windows PowerShell in a familiar and intuitive GUI, like a MMC console. To download the PowerGui, we can check the new version out, at the official site: http://www.powergui.org/