VMware Cloud Community
Punkgeek
Enthusiast
Enthusiast

resize2fs vmdk

     Hello,

Is there any way to resize the vmdk file like in kvm by resize2fs on esxi cli?

Reply
0 Kudos
6 Replies
scott28tt
VMware Employee
VMware Employee

vmkfstools: Virtual Disk Options


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
Punkgeek
Enthusiast
Enthusiast

this option kust increase the hard size, I want to change the VM partition automatically and assign the free hard.

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee

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.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
Punkgeek
Enthusiast
Enthusiast

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?

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee

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.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
LucD
Leadership
Leadership

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

Reply
0 Kudos