From 2108b5a695ca3e437f994eeb3096152b46b0cc24 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 13 Apr 2020 16:08:49 -0700 Subject: [PATCH] Begin to handle cleaning up disks with hyper-v --- plugins/providers/hyperv/cap/cleanup_disks.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/providers/hyperv/cap/cleanup_disks.rb b/plugins/providers/hyperv/cap/cleanup_disks.rb index 815d0360a..fc3322d2b 100644 --- a/plugins/providers/hyperv/cap/cleanup_disks.rb +++ b/plugins/providers/hyperv/cap/cleanup_disks.rb @@ -31,6 +31,17 @@ module VagrantPlugins # find d in defined_disk # if found, continue on # else, remove the disk + + # look at Path instead of Name or UUID + disk_name = File.basename(d["path"], '.*') + dsk = defined_disks.select { |dk| dk.name == disk_name } + primary_disk_uuid = "" + ## todo: finish this + if !dsk.empty? || d["uuid"] == primary_disk_uuid + next + else + #remove disk from guest, and remove from system + end end end end