hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.05k stars 4.42k forks source link

Unable to set the primary disk size on VMware #13230

Open edricus opened 1 year ago

edricus commented 1 year ago

Debug output

==> vagrant: You have requested to enabled the experimental flag with the following features:
==> vagrant: 
==> vagrant: Features:  disks
==> vagrant: 
==> vagrant: Please use with caution, as some of the features may not be fully
==> vagrant: functional yet.
Bringing machine 'default' up with 'vmware_desktop' provider...
==> default: Cloning VMware VM: 'generic/debian11'. This can take some time...
==> default: Checking if box 'generic/debian11' version '4.2.16' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
Shrinking disks is not supported. Not shrinking disk vagrant_primary

Expected behavior

Vagrant should be able to resize the primary disk on vmware like said in the documentation

Actual behavior

"Shrinking disks is not supported. Not shrinking disk vagrant_primary"

Reproduction information

Vagrant version

Vagrant 2.3.7

Host operating system

Debian 12

Guest operating system

Debian 11

Steps to reproduce

  1. Install VMware extension (vagrant-vmware-desktop)
  2. Add the "config.vm.disk :disk, size: "20GB", primary: true" option
  3. vagrant up

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "generic/debian11"
  config.vm.hostname = "lab"
  config.vm.disk :disk, size: "20GB", primary: true
  config.vm.provider "vmware_desktop" do |vmware|
    vmware.utility_certificate_path = "/opt/vagrant-vmware-desktop/certificates"
    vmware.force_vmware_license = "professional"
    vmware.gui = true
    vmware.nat_device = "vmnet2"
    vmware.vmx["memsize"] = "2048"
    vmware.vmx["numvcpus"] = "2"
  end
end
GameBurrow commented 9 months ago

The issue you have is that you're trying to make disk smaller than the box disk is - none of the providers support that even without vagrant.

If my memory is correct, generic/debian11 disks are 128GB

tmiklu commented 8 months ago

@GameBurrow what's needs to be done it this case? Should we need to create custom box with different disk size?

GameBurrow commented 8 months ago

@GameBurrow what's needs to be done it this case? Should we need to create custom with different disk size?

As far as I know, do make it smaller? You can't (at least not easily) unless you make your own base box.

kong62 commented 8 months ago

config.vm.disk :disk, size: "600GB", primary: true not work

[vagrant@centos7-01 ~]$ lsblk
NAME                    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                       8:0    0  128G  0 disk
├─sda1                    8:1    0    1G  0 part /boot
└─sda2                    8:2    0  127G  0 part
  ├─centos_centos7-root 253:0    0  125G  0 lvm  /
  └─centos_centos7-swap 253:1    0    2G  0 lvm  [SWAP]
sr0                      11:0    1 1024M  0 rom
GameBurrow commented 8 months ago

config.vm.disk :disk, size: "600GB", primary: true not work

[vagrant@centos7-01 ~]$ lsblk
NAME                    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                       8:0    0  128G  0 disk
├─sda1                    8:1    0    1G  0 part /boot
└─sda2                    8:2    0  127G  0 part
  ├─centos_centos7-root 253:0    0  125G  0 lvm  /
  └─centos_centos7-swap 253:1    0    2G  0 lvm  [SWAP]
sr0                      11:0    1 1024M  0 rom

As I mentioned earlier, you can't make the disk smaller. As you see default size is 128GB, you are trying to set it to 60GB which you cannot do

EDIT: nvm, I'm blind

dastonzerg commented 5 months ago

@GameBurrow He is trying to set to 600GB not 60GB

mitchellmote commented 4 months ago

I am also having the same issues.

I am unable to increase the default disk size parameters of the box. I'm forced to manually create the VM with the proper disk size for now as 80GB is not big enough for me on my W2022 server build.