hashicorp/vagrant · error
Disk '%{name}' could not be found, and could not be properly
Error message
Disk '%{name}' could not be found, and could not be properly removed. Please remove this disk manually if it still exists What it means
Error "Disk '%{name}' could not be found, and could not be properly removed. Please remove this disk manually if it still exists" thrown in hashicorp/vagrant.
Source
Thrown at plugins/providers/hyperv/cap/cleanup_disks.rb:46
# @param [Hash] disk_meta - A hash of all the previously defined disks from the last configure_disk action
def self.handle_cleanup_disk(machine, defined_disks, disk_meta)
all_disks = machine.provider.driver.list_hdds
disk_meta.each do |d|
# look at Path instead of Name or UUID
disk_name = File.basename(d["Path"], '.*')
dsk = defined_disks.select { |dk| dk.name == disk_name }
if !dsk.empty? || d["primary"] == true
next
else
LOGGER.warn("Found disk not in Vagrantfile config: '#{d["Name"]}'. Removing disk from guest #{machine.name}")
machine.ui.warn(I18n.t("vagrant.cap.cleanup_disks.disk_cleanup", name: d["Name"]), prefix: true)
disk_actual = all_disks.select { |a| File.realdirpath(a["Path"]) == File.realdirpath(d["Path"]) }.first
if !disk_actual
machine.ui.warn(I18n.t("vagrant.cap.cleanup_disks.disk_not_found", name: d["Name"]), prefix: true)
else
machine.provider.driver.remove_disk(disk_actual["ControllerType"], disk_actual["ControllerNumber"], disk_actual["ControllerLocation"], disk_actual["Path"])
end
end
end
end
def self.handle_cleanup_dvd(machine, defined_disks, disk_meta)
# Get a list of all attached DVD drives
attached = machine.provider.driver.read_scsi_controllers.map do |controller|
controller["Drives"].map do |drive|
drive if drive["DvdMediaType"].to_i == 1
end.compact
end.flatten.compact
# Generate list of dvd disks that previously
# existed but are no longer defined
orphan_attachments = disk_meta.find_all do |mdisk|View on GitHub (pinned to 35f3160f4a)
When it happens
Trigger: Thrown at plugins/providers/hyperv/cap/cleanup_disks.rb:46 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/a49d80290474488b.
Report an issue: GitHub.