From b79d6bdc272acc73fa01c7881eef5dc1ab108d63 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 13 Apr 2020 14:35:54 -0700 Subject: [PATCH] Actually compare disk size with requested size --- plugins/providers/hyperv/cap/configure_disks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/providers/hyperv/cap/configure_disks.rb b/plugins/providers/hyperv/cap/configure_disks.rb index cf4ca32f1..12b312442 100644 --- a/plugins/providers/hyperv/cap/configure_disks.rb +++ b/plugins/providers/hyperv/cap/configure_disks.rb @@ -116,7 +116,7 @@ module VagrantPlugins # Hyper-V returns disk size in bytes requested_disk_size = disk_config.size disk_actual = machine.provider.driver.get_disk(defined_disk["Path"]) - defined_disk_size = disk_config.size + defined_disk_size = disk_actual["Size"] if defined_disk_size > requested_disk_size # TODO: Check if disk (maybe use file path) is of type `VHDX`. If not, the disk cannot be shrunk