526 Commits

Author SHA1 Message Date
Jeff Bonhag
a10b2c3108
Fix #11403: Parse list dhcpservers output on VirtualBox 6.1 (#11404)
This commit creates a custom `read_dhcp_servers` method in the
VirtualBox 6.1 driver to handle changes made in the ouput of
`VBoxManage list dhcpservers`.

Tests for VirtualBox 6.1+ can no longer use the shared examples for the
VirtualBox 4.x driver, because the `read_dhcp_servers` change is not
backwards compatible.

This commit also creates the boilerplate for a VirtualBox 6.x shared
example in case we want to put tests there in the future.
2020-02-18 15:14:31 -05:00
Brian Cain
96d7c19c06
Abstract out recovery method for resizing disk failures
This commit moves out the recovery steps for failures when Vagrant
attempts to resize disks. It wraps itsemf in a begin/rescue in case an
additional error occurs, we can still surface the original error that
caused the resizing to fail.
2020-02-13 09:42:18 -08:00
Brian Cain
625bbf9cc8
Add more specific rescue exceptions for when errors occur for resizing
disks
2020-02-12 16:26:18 -08:00
Brian Cain
42133ad34e
Move strings into locales file 2020-02-12 16:22:02 -08:00
Brian Cain
37f8df174c
Freeze all values in valid disk ext default types 2020-02-12 16:00:23 -08:00
Brian Cain
dafb60ad4f
Update experimental feature flag for disk 2020-02-12 15:38:34 -08:00
Brian Cain
c5f4534487
Add virtualbox capability for validating disk extension types 2020-02-12 13:21:09 -08:00
Brian Cain
2174f4c219
Write up recovery message for when vagrant fails to resize vmdk disks 2020-02-12 10:24:38 -08:00
Brian Cain
d5e12dab17
Store backup disk location as local var 2020-02-12 09:56:41 -08:00
Brian Cain
1826d210a0
Recover from cloning and resizin disk failures
This commit adds some recovery if Vagrant fails to reattach or clone a
vmdk disk that needs to be resized. It first moves the original disk
(after cloning) to a backup file. If something fails, it will reattach
the original disk to the guest and continue to raise the exception.
2020-02-11 16:02:24 -08:00
Brian Cain
6fcc5fa31a
Raise error if guest has no available ports for attaching disks 2020-02-11 13:06:57 -08:00
Brian Cain
4866709c67
Move disk cloning to virtualbox driver 5 2020-02-10 15:17:23 -08:00
Brian Cain
5bc0b28116
Update how to check for empty string 2020-02-10 13:21:27 -08:00
Brian Cain
00d7ecb57f
Remove explicit return for disk configure methods 2020-02-10 13:04:47 -08:00
Brian Cain
b2a89f8711
Remove old comment on vbox driver disk method 2020-02-10 12:58:11 -08:00
Brian Cain
773a3aeb7e
Add optional hash arguments to driver methods 2020-02-10 12:58:11 -08:00
Brian Cain
b9a72ce8ff
Make get_port_and_device disk method a driver method instead 2020-02-10 12:58:11 -08:00
Brian Cain
252a7f7a4e
Do not clean up and detach primary disk 2020-02-10 12:58:11 -08:00
Brian Cain
8654b2bb67
Add note about provider specific disk configs 2020-02-10 12:58:11 -08:00
Brian Cain
72576d3046
Rename method for clarity for what it handles 2020-02-10 12:58:11 -08:00
Brian Cain
6ea3c3f40e
Move current_disk work into own method 2020-02-10 12:58:11 -08:00
Brian Cain
e4782e9d6a
Add method doc for method 2020-02-10 12:58:11 -08:00
Brian Cain
236815f2ff
Attempt to connect vagrant managed disks to guest if not attached 2020-02-10 12:58:11 -08:00
Brian Cain
d215d9d785
Only log warning when cleaning up disks
If a disk exists but isn't attached to a guest, don't attempt to remove
disk from guest.
2020-02-10 12:58:11 -08:00
Brian Cain
2e53c21fea
Return empty hash instead of null from configure_disks 2020-02-10 12:58:11 -08:00
Brian Cain
df742603cb
Add code comment about when SATA controller has no more open ports 2020-02-10 12:58:11 -08:00
Brian Cain
3d4d0be58f
Attach disk to next available port to avoid port fragmentation
This commit ensures that vagrant attaches a new disk to the _next
available_ port, rather than the last one "used". This can occur if a
disk has been removed in a previous run, leaving a port open
2020-02-10 12:58:11 -08:00
Brian Cain
c0fb8af1a3
Fix NUMBER typo 2020-02-10 12:58:11 -08:00
Brian Cain
2db81b049b
Only look at SATA Controller disk images 2020-02-10 12:58:11 -08:00
Brian Cain
f6a5a3ae41
Simplify determining next port to use 2020-02-10 12:58:11 -08:00
Brian Cain
9a5ce8381b
Add comment field for new disks 2020-02-10 12:58:11 -08:00
Brian Cain
98a81aac6b
Move show_vm_info call 2020-02-10 12:58:11 -08:00
Brian Cain
1b5f8760d0
Simplify get_port_device and add note about duplicated method in class 2020-02-10 12:58:11 -08:00
Brian Cain
8407fb28cb
Add more code comments for configuring disk class 2020-02-10 12:58:11 -08:00
Brian Cain
6376962209
Simplify obtaining port and device number info 2020-02-10 12:58:11 -08:00
Brian Cain
c049dd9211
Rename method to match functionality
This method now only returns the next available port, as virtualbox
guests can only have 1 device controller.
2020-02-10 12:58:11 -08:00
Brian Cain
6676fe6f7f
Remove stale TODOs 2020-02-10 12:58:11 -08:00
Brian Cain
524d98fe5c
Add comment about MAX_DISK_SIZE const 2020-02-10 12:58:11 -08:00
Brian Cain
cb3cc42dce
Determine primary disk through vm_info rather than list_hdds 2020-02-10 12:58:11 -08:00
Brian Cain
17b75db35b
Move disk driver methods into virtualbox version 5 2020-02-10 12:58:11 -08:00
Brian Cain
2176216bf8
Add error for when disks defined are greater than the max limit 2020-02-10 12:58:11 -08:00
Brian Cain
1e2570a599
Add methods for controller attaching 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
4a4a48b69c
More descriptive name for disk data 2020-02-10 12:58:11 -08:00
Brian Cain
91e9de79a9
Add warning for currently unsupported disk types 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
7215764130
Remove medium vars from base driver 2020-02-10 12:58:11 -08:00
Brian Cain
e31b013df8
Ensure vmdk disks that are resized stay in original format 2020-02-10 12:58:11 -08:00
Brian Cain
16c38ed9f4
Fix params for attach_disk driver call 2020-02-10 12:58:11 -08:00
Brian Cain
c679b3f470
Remove TODO 2020-02-10 12:58:11 -08:00