Add error for when disks defined are greater than the max limit

This commit is contained in:
Brian Cain 2020-01-17 12:48:56 -08:00
parent 1e2570a599
commit 2176216bf8
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
3 changed files with 10 additions and 3 deletions

View File

@ -904,6 +904,10 @@ module Vagrant
error_key(:virtualbox_broken_version_040214)
end
class VirtualBoxDisksDefinedExceedLimit < VagrantError
error_key(:virtualbox_disks_defined_exceed_limit)
end
class VirtualBoxGuestPropertyNotFound < VagrantError
error_key(:virtualbox_guest_property_not_found)
end

View File

@ -19,10 +19,8 @@ module VagrantPlugins
return if !Vagrant::Util::Experimental.feature_enabled?("virtualbox_disk_hdd")
if defined_disks.size > MAX_DISK_NUMER
# TODO: THORW AN ERROR HERE
#
# you can only attach up to 30 disks per controller, INCLUDING the primary disk
raise Exception, "fix me"
raise Vagrant::Errors::VirtualBoxDisksDefinedExceedLimit
end
machine.ui.info("Configuring storage mediums...")

View File

@ -1641,6 +1641,11 @@ en:
4.2.14 contains a critical bug which prevents it from working with
Vagrant. VirtualBox 4.2.16+ fixes this problem. Please upgrade
VirtualBox.
virtualbox_disks_defined_exceed_limit: |-
VirtualBox only allows up to 30 disks to be attached to a single guest using the SATA Controller,
including the primray disk.
Please ensure only up to 30 disks are configured for your guest.
virtualbox_guest_property_not_found: |-
Could not find a required VirtualBox guest property:
%{guest_property}