Hello,
Is there any way to resize the vmdk file like in kvm by resize2fs on esxi cli?
vmkfstools: Virtual Disk Options
this option kust increase the hard size, I want to change the VM partition automatically and assign the free hard.
So if you want to increase the size of a guest OS partition there are generally 3 steps:
ESXi: Increase the size of the virtual disk
Guest OS: Rescan/remount the disk
Guest OS: Increase the partition size
The first step you can achieve with the vSphere Client or vmkfstools, the others will depend on the guest OS inside the VM.
Actually that is the problem, I want to do the guest part automatically.
I have written 3 shell script but it doesn't work on every Linux distros:
here is the script: https://paste.ubuntu.com/p/HMZRv2PY8k/
But, I should write a shell script for every guest os which is stupid.
Is there any way to have a general script to extend disk automatically?
The process/commands will vary from guest OS to guest OS, the best overall approach is probably to use PowerCLI to execute all the various steps required.
As a moderator, I'm moving this thread to the PowerCLI area.
Do you have VMware Tools installed and running on the guest OS on those VM?
If yes, you could try the Invoke-VMScript cmdlet to run your script in the guest OS of each of those VM.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference