253 Commits

Author SHA1 Message Date
sophia
2a8372a272 Add mount type cap 2020-08-19 15:00:40 -05:00
sophia
bc898e385d Update tests for synced folder typed hash 2020-08-19 15:00:40 -05:00
sophia
faad9f2717 Add tests 2020-08-19 15:00:40 -05:00
Chris Roberts
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
cam
67fdc3855f HyperV - Adding ability to disable Enhanced session transport type 2020-08-06 16:04:21 -07:00
cam
f6875818dc Hyperv: moving session transport type config from string to boolean for enhanced mode aka HvSocker 2020-08-06 16:04:17 -07:00
cam
3dd7c89bf0 hyper-v: Hyper-V: add support for EnhancedSessionTransportType. Addresses #9823 2020-08-06 16:02:26 -07:00
Brian Cain
50766b2f14
Merge pull request #11767 from briancain/fix/ensure-isolated-disk-checks
Ensure VirtualBox Disk capability works only off of guest attached disks
2020-07-29 12:57:55 -07:00
Brian Cain
60ef0d7d9c
Use existing disk structure rather than finding port/device again 2020-07-27 13:46:03 -07:00
Brian Cain
e2c844db74
Properly determine disk recovery
Because Vagrant no longer determines `all_disks` through `vboxmanage
list hdds`, it can't rely on unattached disks existing in `all_disks`.
This commit fixes that by including the results from `list hdds` to
determine if Vagrant needs to reattach a disk created by Vagrant that
failed to be attached previously.
2020-07-27 13:31:28 -07:00
Sophia Castellarin
a883a8a7c7
Merge pull request #11738 from uzxmx/fix-failed-tests
Fix sometimes-failed test cases that depend on running order
2020-07-16 11:38:02 -05:00
Brian Cain
ece5449dd2
Update virtualbox configure_disks to use storage controller attachments
This commit updates how Vagrant manages disk state with the virtualbox
provider. Instead of using the raw structure from `list_hdds` for
all_disks, it instead uses that data that now lives inside the
controllers attachment structure.
2020-07-14 09:22:55 -07:00
Brian Cain
f33d513969
Include detailed info about each disk in attachment structure
This commit includes all detailed disk information from VirtualBox
inside its storage structure in Vagrant. This gives Vagrant more
detailed access for a disk beyond its uuid and port/device such as its
capacity and the type of disk it's classified as.
2020-07-13 17:06:23 -07:00
Brian Cain
a6e8c21af8
Update virtualbox to only obtain guest disks instead of all disks
This commit updates how the virtualbox provider obtains `all_disks`.
Instead of using the `list_hdds` driver method, which lists al known
harddisks for an entire VirtualBox installation, it instead uses that
array of disks to filter out the proper disks associated with the guest,
given its existance inside the guests controller attachments.
2020-07-13 16:00:40 -07:00
Jeff Bonhag
3cb01415e4
Add support for SCSI controllers
SCSI controllers are a lot like SATA controllers. This commit also
changes some controller detection logic to take boot priority into
account when selecting an appropriate controller.
2020-07-09 15:11:35 -04:00
Jeff Bonhag
883e45cc49
Refactor: isolate "storage bus" logic
Move all storage bus logic into the storage controller class. Since most
of the storage controller interaction only cares about the storage
controller name, we can simplify #get_controller and isolate the storage
controller detection-type logic in the StorageControllerArray.
2020-07-09 15:11:34 -04:00
Jeff Bonhag
ff9f9c40e8
Differentiate between controller "not found" errors
This commit adds a new error message to be raised if a VM has no
supported storage controllers. This lets us differentiate between two
different "controller not found" scenarios:

1. If we are looking for a controller that we're expecting to find (i.e.
one that was recorded in the disk metadata file)
2. If we are poking around for the *best* controller to use in a
configuration task
2020-07-09 15:10:50 -04:00
Jeff Bonhag
8c58e3f6f6
Refactor out method for getting the primary disk 2020-07-09 15:10:50 -04:00
Jeff Bonhag
63e168386a
Clean up disk_meta/dvd_meta in tests
- Add a type check for disk_meta/dvd_meta
- Fix up some places where metadata keys were using symbol keys instead of
quoted names
2020-07-09 15:10:48 -04:00
Jeff Bonhag
423e212f58
Create Storage Controller array
This is an array-like object that's useful for answer questions about
the storage controllers arragement as a whole.
2020-07-09 15:09:10 -04:00
Jeff Bonhag
84d2c38cc2
Disallow multiple copies of the same ISO
This makes disk/dvd behavior more consistent, and makes it easier to
determine whether a dvd is already attached.
2020-07-09 15:09:10 -04:00
Jeff Bonhag
724687a601
Fix stale controller state
This was causing multiple dvds to be attached to the same port/device.
2020-07-09 15:09:10 -04:00
Jeff Bonhag
d71a5bf453
Fall back on finding disk attachment by UUID 2020-07-09 15:09:10 -04:00
Jeff Bonhag
a4a082e70e
Prevent multiple calls to #read_storage_controllers 2020-07-09 15:09:09 -04:00
Jeff Bonhag
f72ae72aaa
Change method signature
This commit changes the method signature of the VirtualBox driver
methods so they mirror the underlying VBoxManage command.
2020-07-09 15:09:09 -04:00
Jeff Bonhag
ff53c64fbc
Fix test, add test .recover_from_resize 2020-07-09 15:09:09 -04:00
Jeff Bonhag
dfd3bc915c
Remove disks based on metadata
This commit changes the disk_cleanup behavior to remove disks based on
what has been recorded in the disk_meta file.
2020-07-09 15:09:07 -04:00
Jeff Bonhag
e01b51fa43
Disk management with a single controller
.configure_disks is responsible for determining the disk controller(s)
to use, given the machine configuration and the current disk config.
When a machine has a single controller, use it for all attachments.

When a machine has multiple controllers, attach disks to the SATA
controller and DVDs to the IDE controller.

This commit also returns additional attachment information
(controller/port/device) with the disk metadata.
2020-07-09 15:07:49 -04:00
Jeff Bonhag
c9bdcb6839
Error on unsupported storage controller type 2020-07-09 15:07:49 -04:00
Jeff Bonhag
53f7412821
Make VirtualBoxDisksDefinedExceedLimit error generic
Create a #limit method in the StorageController class so we can
customize the error message when a storage controller is full.
2020-07-09 15:07:49 -04:00
Jeff Bonhag
1e6eb0d636
Raise an error if primary disk can't be found 2020-07-09 15:07:49 -04:00
Jeff Bonhag
61f43fb59f
Require controller name for #remove_disk
Also use #get_controller methods when attaching a disk.
2020-07-09 15:07:48 -04:00
Jeff Bonhag
4736fbc88f
Require storage controller for .get_next_port
This also includes #get_controller refactorings and cleanup for the
cleanup_disks capabaility.
2020-07-09 15:07:48 -04:00
Jeff Bonhag
958023dbb9
Create #get_controller method in driver
This makes it easier to check if the required controller can be found,
and automatically raise an error if it is not.

Add a #storage_bus method to the StorageController class as a shorthand
way to check the general storage controller type.
2020-07-09 15:07:48 -04:00
Jeff Bonhag
3a515cc7d6
Error if the required storage controller not found
This commit adds a new error type that can be raised whenever a storage
controller of the required type is not found. This indicates that a user
needs to either add the storage controller manually or change their disk
configuration.

It also removes the last hardcoded instance of "SATA Controller" as a
default argument.
2020-07-09 15:07:48 -04:00
Jeff Bonhag
38e986300b
Fix up tests to use new interface 2020-07-09 15:07:47 -04:00
Jeff Bonhag
61f59de69b
Extract StorageController object 2020-07-09 15:07:47 -04:00
Jeff Bonhag
8739c04aa9
Mock out storage controllers 2020-07-09 15:07:47 -04:00
Jeff Bonhag
8407d79100
Refactor disk configuration to use dynamic names
This commit adds a new VirtualBox provider helper method to return a
list of storage controllers so Vagrant can find a storage controller
with the desired characteristics (type IDE or SATA).

This still needs to get wired up to the disk cleanup method.
2020-07-09 15:07:46 -04:00
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
Mingxiang Xue
035ae6d460 Fix sometimes-failed test cases that may depend on running order
Signed-off-by: Mingxiang Xue <mingxiangxue@gmail.com>
2020-07-03 20:40:02 +08:00
Brian Cain
13c91d68a6
Only grab provider_config if provider key exists and config isn't empty 2020-06-30 14:23:34 -07:00
Brian Cain
4130cfe497
Properly check for disk paths when cleaning up disks in hyper-v 2020-06-30 14:23:34 -07:00
Brian Cain
f8dfcadb70
Only convert BlockSizeBytes option for Hyper-V disk provider_config 2020-06-30 14:23:34 -07:00
Brian Cain
56645b7bc5
Finish up configure_disk_test unit tests 2020-06-30 14:23:34 -07:00
Brian Cain
99d244c4ed
Build out initial tests for configure_disks 2020-06-30 14:23:34 -07:00
Brian Cain
234bff9271
Add cleanup_disks_test unit test file 2020-06-30 14:23:34 -07:00
Brian Cain
5258c68cf2
Fixup disk unit tests 2020-06-30 14:22:41 -07:00
Brian Cain
9020868a93
Add initial files for Hyper-V disk configuration and management 2020-06-30 14:22:41 -07:00
sophia
fe7968315b Add option to allow/disable fstab modification
Defaults to allow modification of fstab
2020-05-29 15:29:21 -04:00