About
You arrived at the weblog of Geert Baeke. I am the technology manager for a company called Xylos (Belgium). I mostly work with Microsoft technologies such as Windows, Active Directory, Exchange, Sharepoint, MSCS, and more. I am also actively busy with VMware's products, focussing on VMware ESX.

Sections
Search






XBOX 360

RSS Newsfeeds
baeke.info Main RSS Feed Main Page RSS
Virtual Machines RSS Feed Virtual Machines RSS
View Article  Quick Tip: using vmware-cmd with multiple virtual machines

The vmware-cmd.pl script is a standard script you can run on the ESX console to do stuff with virtual machines from the command line. For example, to stop a virtual machine, you can use:

vmware.cmd <path_to_vmx> stop

Above, <path_to_vmx> is the path to a virtual machine's vmx file (configuration file) like /vmfs/volumes/vmfs02/vm007/vm007.vmx.

What if you want to stop all the virtual machines on an ESX server or just a subset? In that case, do the following from the command line (one line):

vmware.cmd -l | while read vmxpath; do vmware-cmd $vmxpath stop; done

If you want to do some filtering, you can do something like this:

vmware.cmd -l | grep labsrv | while read vmxpath; do vmware-cmd $vmxpath stop; done

The above command will only perform the stop operations on virtual machines that have labsrv in the vmx filepath.

View Article  PowerShell support in Virtual Machine Manager

Jeffrey Snover wrote an interesting article for the Windows PowerShell blog about PowerShell functionality in System Center Virtual Machine Manager (SCVMM). In it, he compares a shell script to disconnect virtual media from virtual machines to a few PowerShell cmdlets to do the same thing.

Indeed, when you compare the scripts, there is no doubt that it is much easier in PowerShell. But to be fair, you don't have to write such a script using bash shell scripting and vmware-cmd.pl. You can also do it using pure Perl or with the COM API from VBScript or .NET. With VBScript and the COM API, it would be much simpler.

Of course, nothing beats the simplicity of these cmdlets. This has already been demonstrated by Exchange Server 2007 and its cmdlets where they replace tedious scripting with VBScript.

 

Login
User name:
Password:
Remember me 
This Month
January 2007
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Networking
View Geert Baeke's profile on LinkedIn

Services

Powered by BlogHarbor
Powered by BlogHarbor
StatCounter