4253 Commits

Author SHA1 Message Date
Chris Roberts
7d44fef00e
Merge pull request #11428 from chrisroberts/fix/windows-reboot
Catch any StandardError exception while waiting for Windows reboot
2020-03-09 16:48:27 -07:00
Chris Roberts
193eb11277
Merge pull request #11427 from chrisroberts/fix/auto-hook-creation
Update dynamic action hooks implementation
2020-03-09 16:46:27 -07:00
Chris Roberts
7c2083d5da Update how delayed actions are stored to avoid accessing uninitialized value 2020-03-05 13:25:57 -08:00
Chris Roberts
6f707c829d Catch any StandardError exception while waiting for Windows reboot
This prevents any unexpected connection related error from breaking
the wait loop while windows reboots. If an underlying problem unrelated
to the guest is causing exceptions, the exception will still be raised
to the user, simply after the loop has exceeded the defined maximum
wait time.

Fixes #11238
2020-03-03 17:02:04 -08:00
Chris Roberts
eba18091f9
Merge pull request #11391 from chrisroberts/fix/winrm-server-retry
Update exit code value used for retry check - ArgumentException
2020-03-03 16:26:33 -08:00
Chris Roberts
660166720b Update delayed execution implementation to utilized appended action hook 2020-03-03 16:23:31 -08:00
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
Chris Roberts
e430809cdd Update exit code value used for retry check - ArgumentException 2020-02-12 16:42:21 -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
baabf6650f
Check for provider capability with disk_ext types before using it 2020-02-12 15:59:37 -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
b11aa53294
Remove unused experimental flag for disk enablement 2020-02-10 13:03:58 -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
f59a5c2c70
Enable virtualbox and disk config in single flag 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