It was only a question of time when it will be released – a VMWare specific toolkit for Windows PowerShell. I hope I’ll have a time to test this toolkit soon with VMWare Server 2.0 (after it’ll be released); nevertheless, even on paper it sounds promising with 120+ powershell cmdlets centered around managing and automation of VM.
Note: As you might know I was not a particular fan of PowerShell, but I changed my mind :-). I was skeptical about PowerShell when Microsoft announced new scripting environment (what’s wrong with WSH that I’m already familiar with?), but now I understand the importance and potential of this product, it really deserves power in it’s name. If you’re Windows system administrator you’re better off to start learning Powershell right now (if you’re already not) – it’ll make your life much easier and your employment prospect safer;-).
I have a couple of VMWare guest machines (Windows XP & Windows 2003) with inappropriate sized disks. Instead of adding new disks I want to resize the existing ones. Quick search on Google revealed that this is quite easy to do. According to instructions found in Expanding a virtual disk and Increase your Virtual machine’s disk capacity the way to do it is:
1) Backup VM directory in case something goes wrong
2) After clean shutdown of VM resize the vmdisk with command line tool vmware-vdiskmanager.exe
cmd> "D:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe" -x 16Gb "D:\VM\WinXP\WinXPd2.vmdk"
3) In step 2 we extended “physical” disk for VM, now we have to expand disk at VM OS partition level as well. In Windows XP/2003 we can use diskpart command line tool for that (see second referenced document from above).
Start VM (Windows XP/2003), logon as someone with Adminisatrator rights and extend partition:
cmd> diskpart diskpart> list volume diskpart> select volume=n diskpart> extend
In case you want to extend system disk then you’ll have to mount that disk with another VM and then extend the partition with diskpart.