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