hashicorp/vagrant · warning
Destroying guests with `--parallel` automatically enables `-
Error message
Destroying guests with `--parallel` automatically enables `--force`. Press ctrl-c to cancel.
What it means
When `vagrant destroy` runs with --parallel but without --force, Vagrant warns that parallel destroy automatically enables force mode (per-machine confirmations are skipped), sleeps 5 seconds so you can press ctrl-c, sets options[:force] = true, then destroys every targeted machine concurrently via env.batch.
Source
Thrown at plugins/commands/destroy/command.rb:41
options[:force] = f
end
o.on("--[no-]parallel",
"Enable or disable parallelism if provider supports it (automatically enables force)") do |p|
options[:parallel] = p
end
o.on("-g", "--graceful", "Gracefully poweroff of VM") do |f|
options[:force_halt] = false
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if options[:parallel] && !options[:force]
@env.ui.warn(I18n.t("vagrant.commands.destroy.warning"))
sleep(5)
options[:force] = true
end
@logger.debug("'Destroy' each target VM...")
machines = []
init_states = {}
declined = 0
@env.batch(options[:parallel]) do |batch|
with_target_vms(argv, reverse: true) do |vm|
# gather states to be checked after destroy
init_states[vm.name] = vm.state.id
machines << vm
batch.action(vm, :destroy, force_confirm_destroy: options[:force], force_halt: options[:force_halt])
end
endView on GitHub (pinned to 35f3160f4a)
Solutions
- Press ctrl-c within the 5-second window if the destroy is unintended
- Re-run without --parallel to get per-machine confirmation prompts
- Scope the destroy to named machines: `vagrant destroy --parallel web db`
- Pass --force explicitly in automation to skip both the warning and the 5-second wait
Example fix
# before vagrant destroy --parallel # implies --force for ALL machines # after vagrant destroy --parallel web # only the named machine
Defensive patterns
Strategy: validation
Validate before calling
# Wrapper guard: refuse --parallel destroy unless machine names are given if [[ "$*" == *--parallel* && "$#" -le 1 ]]; then echo "refusing: --parallel destroy of ALL machines; name machines explicitly" >&2 exit 1 fi
Prevention
- Run `vagrant status` before any destroy to see the blast radius
- Prefer naming machines explicitly in destroy commands
- In automation, pass --force yourself so behavior is visible in the script, not implied
When it happens
Trigger: `vagrant destroy --parallel` (no -f/--force) in any environment; the warning prints, sleep(5) runs, and then with_target_vms iterates all machines in reverse order with no further prompts.
Common situations: Multi-machine Vagrantfiles where the operator expected selective per-VM prompts; automation unaware that --parallel implies --force; accidental destruction of the whole environment.
Related errors
- An error occurred while executing multiple actions in parall
- This Vagrant environment has specified that it requires the
- A URL to a Vagrant Cloud server is not set, so boxes cannot
- The box '%{name}' could not be found or could not be accesse
- There was an error while downloading the metadata for this b
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/b6a30d0d1ab51f6b.
Report an issue: GitHub.