how can i resize the hard disk on a vm on the vmware side as well as inside the guest os?
get-vm name | get-harddisk -name "Name" | set-harddisk -Capacitykb 10485760 -guestcredential ??
Hi tdubb. You can use the Set-Harddisk command. When you provide credentials for the guest OS it will use VIX to run a batch script to extend the disk on the guest.
http://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/Set-HardDisk.html
Here is the example provided in the previous link.
Set-HardDisk -HardDisk $harddisk -CapacityKB $extendedCapacity -HostCredential $hostCred -GuestCredential $guestCred
What OS is the guest running. Some Operating Systems either do not have a extend script, or are not supported by VIX.
If you want to have a look at the scripts go here on any server with PowerCLI installed.
%ProgramFiles%\VMware\Infrastructure\vSphere PowerCLI\Scripts
http://www.amazon.com/VMware-vSphere-PowerCLI-Reference-Administration/dp/0470890797
Hi,
IIRC for the WIndows Server 2003 and below it requires restart or not possible. Can you please clarify this if its true ?
on th book page 219 it said that it requires Helper VM, what is that ?
what is
-HostCredential $hostCred -GuestCredential $guestCred?
Hi,
Kindly go through the below link
very informatory
http://www.geekzilla.co.uk/View18A035DE-06FF-4EA6-BC77-57D431CD50DD.htm
Login Credentails of your Host and VM
which OS supports the the VIX script? I am trying to resize that on a win7 machine. I was able to change the disk size but the guest os did not resize it
Get-Harddisk -vm name | where {$_.name -eq "Hard disk 2"}| Set-Harddisk -CapacityKB $value -HostCredential $HostCred -GuestCredential $GuestCred -Confirm:$false
To resize the OS partition you'll need to use the HelperVM parameter on the Set-Harddisk cmdlet.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference