VMware Cloud Community
kesavphp
Enthusiast
Enthusiast
Jump to solution

Script for Vmware Hard disk expand in GUI

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

Reply
0 Kudos
1 Solution

Accepted Solutions
kesavphp
Enthusiast
Enthusiast
Jump to solution

Hello,

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

View solution in original post

Reply
0 Kudos
4 Replies
MBreidenbach0
Hot Shot
Hot Shot
Jump to solution

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.

Reply
0 Kudos
JCMorrissey
Expert
Expert
Jump to solution

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/
Reply
0 Kudos
kesavphp
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
kesavphp
Enthusiast
Enthusiast
Jump to solution

Hello,

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

Reply
0 Kudos