34 Commits

Author SHA1 Message Date
Chris Roberts
513be177d3 Remove experimental checks
Removes experimental checks on existing experimental features.
2023-09-08 14:15:34 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01: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
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
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
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
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
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
61f59de69b
Extract StorageController object 2020-07-09 15:07:47 -04:00
Jeff Bonhag
2e879aa06f
Scan storage controllers for DVD cleanup 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
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
4130cfe497
Properly check for disk paths when cleaning up disks in hyper-v 2020-06-30 14:23:34 -07:00
Brian Cain
dafb60ad4f
Update experimental feature flag for disk 2020-02-12 15:38:34 -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
e4782e9d6a
Add method doc for method 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
1b5f8760d0
Simplify get_port_device and add note about duplicated method in class 2020-02-10 12:58:11 -08:00
Brian Cain
c679b3f470
Remove TODO 2020-02-10 12:58:11 -08:00
Brian Cain
424450cf16
Change info level from removing disks to WARN 2020-02-10 12:58:11 -08:00
Brian Cain
98ab1798a2
Only cleanup disks if defined from previous run 2020-02-10 12:58:11 -08:00
Brian Cain
d810f32ec5
Move message into info rather than detail for visibility 2020-02-10 12:58:11 -08:00
Brian Cain
9712c599fe
Update method docs for cleanup_disks cap 2020-02-10 12:58:11 -08:00
Brian Cain
71c3e36635
Raise exception if port and device cannot be determined 2020-02-10 12:58:11 -08:00
Brian Cain
6ba621ac92
Add ability to cleanup and close mediums for a guest 2020-02-10 12:58:11 -08:00
Brian Cain
ad798c2c12
Pass in disk meta file for cleanup_disks 2020-02-10 12:58:11 -08:00
Brian Cain
e4a57a8e1d
Add virtualbox cleanup_disks action 2020-02-10 12:58:11 -08:00