vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Enhancement Request: Disk resize for vmware provider

Open dastonzerg opened this issue 1 year ago • 7 comments

Is your feature request related to a problem? Please describe. I am using Macbook pro M1. I am using vmware fusion as the provider and have installed vagrant-vmware-desktop plugin. I am trying to follow https://developer.hashicorp.com/vagrant/docs/disks/usage to resize a VM I have created. However it has no effect after I added config.vm.disk :disk, size: "100GB", primary: true and do vagrant halt then vagrant up.

I even tried with v.gui = true and then I was able to see the VM in vmware fusion, I tried to resize the hard disk after deleting the snapshots, but disk size doesn't change at all. Attaching a new disk also didn't help.

I just started to use Vagrant yesterday and I really like it. Appreciate the community for developing it! I hope there is at least a workaround for resizing disk for vmware provided VMs.

Describe the solution you'd like Add config.vm.disk :disk, size: "100GB", primary: true and it should work like described in https://developer.hashicorp.com/vagrant/docs/disks/usage for vmware provider. I noticed that it says "Currently, only VirtualBox is supported." currently.

Describe alternatives you've considered N/A

Additional context N/A

dastonzerg avatar Feb 22 '24 06:02 dastonzerg

There is a related thread in discuss.hashicorp.com asking about this How to resize virtual hard drive with vmware-desktop but there is no response yet.

dastonzerg avatar Feb 22 '24 06:02 dastonzerg

I'm also facing the same issue. the disk is full ~30GB. I changed the vagrantfile to specify 100GB; and also tried adding a second disk in there; but I don't see any change when I run df in the guest VM. I'm running Ubuntu 22.04 in the VM; vagrant is running on a host Mac (Sonoma/Apple Silicon).

I also looked if this could be done manually from VMWare itself, but this option is disabled because the VM is a 'linked clone':

Screenshot 2024-06-06 at 1 19 48 PM

I wasn't familiar with the term, so I tried adding the following in my Vagrantfile:

vm.linked_clone = false

but the option is still grayed out. perhaps I have to make a new VM from scratch with that linked clone setting false.

Did you ever find a solution @dastonzerg ?

ghost avatar Jun 06 '24 17:06 ghost

I tried creating a brand new vagrant provisioned Ubuntu 22.04 VM, with 100GB set both in the Vagrantfile as well as the VMWare desktop GUI settings; made sure snapshots were deleted; and the Vagrantfile set linked_clones to false. When I log into the machine with vagrant ssh, It still thinks the available disk size is under 30GB.

Anyone else have ideas?

ghost avatar Jun 17 '24 17:06 ghost

I think this is part of by #112. @chrisroberts, can you please confirm?

ChristoWolf avatar Aug 12 '24 11:08 ChristoWolf

Even after trying the v3.0.4 plugin with VMware Workstation Pro, the disk does not grow when uping. Am I missing something?

ChristoWolf avatar Aug 16 '24 06:08 ChristoWolf

There is the VM disk size and OS part to expanding. To grow a disk you need cloud-init auto grow turned on. Otherwise you have to manually expand the partition and then expand the file system to use the newly expanded partition. Clouds like AWS and azure do it through cloud-init or their agent/software running on the cloud instance.

Stromweld avatar Aug 16 '24 13:08 Stromweld

Wow, of course, I completely forgot to consider partitioning. Thanks for clarifying!

ChristoWolf avatar Aug 20 '24 06:08 ChristoWolf