kesavphp
Enthusiast
Enthusiast

Script for Vmware Hard disk expand in GUI

Jump to solution

Hello,

I am deploying the VM from ovf template. I want to increase the disk space (capacity) for the newly deployed VM.

Every time i want to login and increase the disk from the Vmware vsphere client GUI. Is there any script using PHP Or API to increase the disk space in the GUI.

Please suggest me if any other languages scripts available like python Or Java also.

Thank you in advance.

Regards,

Kesavaraja

0 Kudos
1 Solution

Accepted Solutions
kesavphp
Enthusiast
Enthusiast

Hello,

I found the solution, You can use vmkfstools to expand your hard disk.

View solution in original post

0 Kudos
4 Replies
MBreidenbach0
Hot Shot
Hot Shot

PowerShell based PowerCLI can do this. You'd also have to expand the partition inside from the OS and how to do that depends on the VMs OS. PowerCLI can run scripts inside VMs but this has some requirements to work properly.

I had a project where we had to deploy a lot of Windows VMs based on a common template. What we did was write a PowerCLI script which reads a CSV file which contains data which template has to be cloned and which adjustments to the cloned VM have to be done (portgroup, network settings, vcpus, memory, additional disks etc). Since we only had a small number of different disk layouts we prepared some scripts which formatted + mounted the additional disks, stored these scripts in the VM template and used the OS customization specification to call the script after VM deployment.

0 Kudos
JCMorrissey
Expert
Expert

More details related to PowerCLI enclosed

https://ps1code.com/2017/10/17/extend-vm-guest-part-powercli/

Please consider marking as "helpful", if you find this post useful. Thanks!... http://johncmorrissey.wordpress.com/
0 Kudos
kesavphp
Enthusiast
Enthusiast

Thank you MBreidenbach0 and JCMorrissey

Sorry i forgot to mention, as I am using Linux OS. So i could not able to use the Powercli codes. Please kindly suggest me the way to implement any script to use in Linux.

0 Kudos
kesavphp
Enthusiast
Enthusiast

Hello,

I found the solution, You can use vmkfstools to expand your hard disk.

View solution in original post

0 Kudos