4604 Commits

Author SHA1 Message Date
sophia
169d7b4011 Update photon cap for setting hostname
sqash
2020-07-20 15:19:50 -05:00
sophia
5afd7fdd73 Extract change hostnamet base class 2020-07-20 15:19:50 -05:00
sophia
91ac0681cf Update RHEL cap for setting hostname 2020-07-20 15:19:50 -05:00
sophia
c2b9497923 Update Gentoo cap for setting hostname 2020-07-20 15:19:50 -05:00
sophia
c844f7689d Make pld guest respect 'hostname' network config option 2020-07-20 15:19:50 -05:00
sophia
e4e72522b2 Make slackware guest respect 'hostname' network config option 2020-07-20 15:19:50 -05:00
sophia
326f0a4858 Make atomic-host guest respect 'hostname' network config option 2020-07-20 15:19:50 -05:00
sophia
71ea0e6f2a Make arch guest respect 'hostname' network config option 2020-07-20 15:19:50 -05:00
sophia
18737f29fd Update change host name cap for debian 2020-07-20 15:19:50 -05:00
sophia
d90ae50b60 Update change host name cap for ALT os 2020-07-20 15:19:50 -05:00
Sophia Castellarin
3d4b721a22
Merge pull request #11579 from soapy1/provisioner-communicator_required
Provisioner communicator required
2020-07-17 10:45:34 -05:00
sophia
c48befbe61 Only do cloud init actions on 'vagrant up' 2020-07-17 09:45:51 -05:00
Brian Cain
0198c17c56
Merge pull request #11400 from rmunn/feature/arch-network-with-systemd-networkd
Use systemd-networkd on Archlinux guests
2020-07-16 14:34:54 -07:00
sophia
3f867e0df4 Add cloud init wait action 2020-07-16 15:40:39 -05:00
Brian Cain
8cec544fcc
Merge pull request #11759 from danowar2k/#11758-solaris11-shell-expand-guest-path-capability
Closes #11758
2020-07-16 09:40:22 -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
eecf1dbe57
Add validation error for empty box
This commit adds a unique error message for an empty box value. It
requires modifications to vagrantfile.rb because some Vagrantfile config
is used before validation occurs.
2020-07-13 17:46:28 -04:00
Jeff Bonhag
352b955d09
Treat an empty box value as invalid
This fixes an issue where having a box name set to an empty string will
cause all Vagrant commands to fail with an error like:

ArgumentError: Malformed version number string (random box name)

This may be related to #10663.
2020-07-13 17:37:13 -04:00
Daniel Poggenpohl
3ed2489c4a #11758
- removed superfluous cap/shell_expand_guest_path
- solaris11 guest_capability for shell_expand_guest_path now directly returns the linux capability class
2020-07-11 00:29:44 +02:00
Daniel Poggenpohl
c4b16b509a #11758
- added shell_expand_guest_path capability for solaris11
- added tests for solaris11 shell_expand_guest_path capability
2020-07-10 23:19:34 +02:00
Stephan Wild
4ff1ff5bc0 Set secure boot template setting for hyperv 2020-07-10 20:38:32 +02:00
Jeff Bonhag
de461fa47c
Fix a couple of tests
Use subject instead of invalid_subject because the validation assertions
test the subject double.

This also adds an additional check when validating the `size` attribute
because it is only required for disks of type `:disk`.
2020-07-09 15:33:19 -04: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
21954c29af
Hook into ValidateDiskExt capability 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
33ef2ca017
Add machine name to error messages 2020-07-09 15:11:31 -04:00
Jeff Bonhag
52c1267b2c
Show duplicate values in error messages
This also prevents nil showing up as a duplicate value for disk configs
when `file` is undefined.
2020-07-09 15:10:50 -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
c316d18e35
Apply suggestions from code review
Co-authored-by: Brian Cain <bcain@hashicorp.com>
Co-authored-by: Sophia Castellarin <sophia@hashicorp.com>
2020-07-09 15:09:10 -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
3c0021aac3
Use #read_storage_controllers for #get_port_and_device
This preserves the existing behavior of the method but changes the
implementation to use #read_storage_controllers. The caps that call a
mix of #get_port_and_device and #read_storage_controllers may be a
candidate for further refactoring, but this makes sure that we're
fetching storage attachments consistently.
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
8561467e40
IDE controllers have two devices/port 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