48 Commits

Author SHA1 Message Date
Jeff Bonhag
c52eb1b44c
Feature: ISO attachment for VirtualBox
This builds on the existing disk functionality, and adds some special
IDE controller-related flavor.

Considerations for IDE controllers:
- Primary/secondary attachments, so that each port can have two devices
  attached
- Adding the ability to address a specific controller name for disk
  attachment

This also prevents a user from attaching multiple instances of the same
ISO file, because VirtualBox will assign each of these the same UUID
which makes disconnection difficult. However, if multiple copies of the
ISO are attached to different devices, removing the DVD config will
cause the duplicate devices to be removed.

We may want to consider additional work to make the storage controllers
truly generic.
2020-07-09 15:07:27 -04:00
Brian Cain
d35feb62a3
Simplify key check for provider option config 2020-06-30 14:23:34 -07:00
Brian Cain
b36db04b3d
Validate and get default disk extensions for provider
This commit updates the hyperv and virtualbox provider caps to validate
and also return the default disk extension.
2020-06-30 14:23:34 -07:00
Brian Cain
c063ca6100
Replace invalid disk name characters with underscore 2020-06-30 14:23:34 -07:00
Brian Cain
96d19264b6
Automatically remove invalid file characters for disk name
This commit copies what Vagrant does to filter out guest names with
invalid characters, and applies the same regex to disk names.
2020-06-30 14:23:34 -07:00
Brian Cain
66fe2e2854
Ensure size param is set for a disk 2020-06-30 14:23:34 -07:00
Brian Cain
754928a206
Ensure provider_config is a hash before calling .empty? 2020-06-30 14:23:34 -07:00
Brian Cain
cf063c6e38
Update validation to look for if provider_config is empty not nil 2020-06-30 14:22:41 -07:00
Brian Cain
192caab02d
Fix provider_config merging for disk config 2020-06-30 14:22:41 -07:00
Brian Cain
cafb6ec239
Remove extra provider_config option 2020-06-30 14:22:41 -07:00
Brian Cain
a3c2e31f01
Set default disk format for vmware_desktop 2020-06-30 14:22:41 -07:00
Brian Cain
fe7705e694
Update how disk_ext default is set
Prior to this commit, the default value of disk_ext was set in the
finalize! method, and was really only valid for the virtualbox provider.
This commit updates that by moving the step into the validate function,
which has access to the machines provider.
2020-06-30 14:22:41 -07:00
Brian Cain
baabf6650f
Check for provider capability with disk_ext types before using it 2020-02-12 15:59:37 -08:00
Brian Cain
c5f4534487
Add virtualbox capability for validating disk extension types 2020-02-12 13:21:09 -08:00
Brian Cain
fddcd71eaf
Default to vdi since virtualbox default is vdi 2020-02-10 12:58:11 -08:00
Brian Cain
a3b07a884a
Add way to configure disk extension 2020-02-10 12:58:11 -08:00
Brian Cain
b388b34846
Update todos and method docs 2020-02-10 12:58:11 -08:00
Brian Cain
ffe8fcef9b
Make name required for defining non-primary disks 2020-02-10 12:58:11 -08:00
Brian Cain
ec350861cd
Write down metadata for disk configs after configuring disks 2020-02-10 12:58:11 -08:00
Brian Cain
26d922ad0e
Add todo for fixing default disk names 2020-02-10 12:58:11 -08:00
Brian Cain
a38f0bb8c0
Improve default vagrant disk name 2020-02-10 12:58:11 -08:00
Brian Cain
f8449063b6
Have default names for primary and non-primary disks 2019-11-22 14:40:23 -08:00
Brian Cain
b56dede627
Do not set primary option if it's not UNSET or false 2019-11-22 14:40:23 -08:00
Brian Cain
b5b59a4eee
Base name for disk is vagrant_primary if primary 2019-11-22 14:40:23 -08:00
Brian Cain
ea7a230cb6
Move disk config validation messages to locales file 2019-11-22 14:40:23 -08:00
Brian Cain
57fd731fbf
Add warning if machines provider was not found in disk provider config
opts
2019-11-22 14:40:23 -08:00
Brian Cain
3a2b4ddef2
Validate that disk file exists in disk config validate 2019-11-22 14:40:23 -08:00
Brian Cain
2e324a4971
Add conversion method for shortcut size in disk config 2019-11-22 14:40:23 -08:00
Brian Cain
271cf8a603
Begin to add Numeric class helper for converting size strings 2019-11-22 14:40:23 -08:00
Brian Cain
a457dee8b0
Set default disk to non-primary 2019-11-22 14:40:23 -08:00
Brian Cain
a51e9b1fa1
Support both kinds of provider config options for disk config 2019-11-22 14:40:23 -08:00
Brian Cain
83fea21ff1
Simplify builtin disk action 2019-11-22 14:40:23 -08:00
Brian Cain
e598007237
Add provider specific disk options under provider_config hash 2019-11-22 14:40:23 -08:00
Brian Cain
6c54bf6ad9
Fix logger namespace typo 2019-11-22 14:40:23 -08:00
Brian Cain
d54e870752
Add file option to disk config 2019-11-22 14:40:23 -08:00
Brian Cain
499e39dd10
Ensure primary is true or false 2019-11-22 14:40:23 -08:00
Brian Cain
c18f36e516
Fix code comment typo 2019-11-22 14:40:23 -08:00
Brian Cain
ad73969010
Fixup disk config parsing to allow hash and block 2019-11-22 14:40:23 -08:00
Brian Cain
7cfccb5cfd
Update variable docs for disk name 2019-11-22 14:40:23 -08:00
Brian Cain
ee751ca6e1
Add disk name for disk config 2019-11-22 14:40:23 -08:00
Brian Cain
995c4bbc60
Add validation for disk configs 2019-11-22 14:40:23 -08:00
Brian Cain
a18ce4f732
Add primary config option for disk 2019-11-22 14:40:23 -08:00
Brian Cain
ee388d8293
Ensure config is renamed to options 2019-11-22 14:40:23 -08:00
Brian Cain
34673fe5f9
Add disk class function for provider layers 2019-11-22 14:40:23 -08:00
Brian Cain
abcc334900
Add note about disk options value 2019-11-22 14:40:23 -08:00
Brian Cain
1a21782bd5
Add note about disk name 2019-11-22 14:40:23 -08:00
Brian Cain
e361900d3a
Update doc string for name attribute 2019-11-22 14:40:23 -08:00
Brian Cain
aa5a3ef7f7
Add initial disk management config class 2019-11-22 14:40:23 -08:00