diff --git a/plugins/kernel_v2/config/disk.rb b/plugins/kernel_v2/config/disk.rb index 423be34a8..d1691320d 100644 --- a/plugins/kernel_v2/config/disk.rb +++ b/plugins/kernel_v2/config/disk.rb @@ -110,9 +110,8 @@ module VagrantPlugins @name = "vagrant_primary" else # TODO: Can't rely on `id` because it changes in between vagrant runs - # - # INSTEAD: Make name a hard requirement, and see if that solves things - @name = "vagrant_#{@type.to_s}_#{@id.split("-").last}" + #@name = "vagrant_#{@type.to_s}_#{@id.split("-").last}" + @name = nil end end @@ -157,6 +156,10 @@ module VagrantPlugins end end + if !@name + errors << I18n.t("vagrant.config.disk.no_name_set", machine: machine.name) + end + errors end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 1d91de3f5..abbd79f26 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -1812,6 +1812,8 @@ en: Disk file '%{file_path}' for disk '%{name}' on machine '%{machine}' does not exist. missing_provider: |- Guest '%{machine}' using provider '%{provider_name}' has provider specific config options for a provider other than '%{provider_name}'. These provider config options will be ignored for this guest + no_name_set: |- + A 'name' option is required when defining a disk for guest '%{machine}'. common: bad_field: "The following settings shouldn't exist: %{fields}" chef: