Consumption of all dynamically allocated space in Hyper-v with freebsd

We use in the Company Windows 2012 R2 with Hyper-V and host pfSense on it in addition to other SOs.

With pfSense, it consumes the maximum size of the one available in Windows 2012 HD, but the actual space is small.

With other systems, which are also virtual machines with dynamically allocated space this does not happen.

Would you know what could be done?

 1
Author: gmsantos, 2019-08-14

1 answers

Friend This is due to the fact of the type of disk they chose when creating the server.
See, the Hyper - V gives you 3 options fixed, dynamic and differential.

  1. Fixed
    In this format it will already allocate all informed space of the host'S HD.

  2. Dynamic
    Here it allocates space as your VM grows.

  3. Differential
    In this it is necessary to already have a disk file that we call parent, the parent will have no modifications, everything you do again will be created in a new file. (Used more for labs, for example, you want to mount a lab with 3 windows server, to take up less space create a file only with the S. O. installed and it will be your parent disk, then create 3 VMs with differential disk type and point to the parent, so you will have only the consumption of 1 OS instead of 3.

In your case this PfSense was mounted using the fixed, which is normal, since the fixed offers more performance than others.
To learn more about the subject of a look at this link .

There are ways to shrink the size of the disk, but you would have to first enter the VM, decrease the size of the disk inside (in windows done by "Disk Manager" and in linux it could be done by Gparted") and then edit the disk by Hyper-V using shrink. This link shows with pictures how it can be done.
but have a lot be careful, because by decreasing the size of the disk you may end up losing some information and corrupting the same

 2
Author: Murilo Portugal, 2019-08-14 11:39:28