1205 Commits

Author SHA1 Message Date
Brian Cain
4df346c5c6
Add resize for disks
Also add warnings in case disk resize request is smaller than original
disk size.
2020-02-10 12:58:11 -08:00
Brian Cain
7e686e6f70
Attach harddisk after creation 2020-02-10 12:58:11 -08:00
Brian Cain
1c87351c94
Begin to add method for determining the proper port and device 2020-02-10 12:58:11 -08:00
Brian Cain
2a3f9dad29
Remove uuid from params
No need to pass in machine uuid as it is a class variable already for the driver
2020-02-10 12:58:11 -08:00
Brian Cain
259cb5fcca
Attempt to create and attach disk to guest 2020-02-10 12:58:11 -08:00
Brian Cain
9b83e2ac30
Move around pry 2020-02-10 12:58:11 -08:00
Brian Cain
35c8db56ec
Add handling for configuring and creating disks with vbox provider 2020-02-10 12:58:11 -08:00
Brian Cain
cac56c983c
Add extra key for vbox driver with listing hdds 2020-02-10 12:58:11 -08:00
Brian Cain
5be7989f2d
Add basic driver methods for disk operations 2020-02-10 12:58:11 -08:00
Brian Cain
16cccd504a
Add virtualbox driver method for obtaining vm information 2020-02-10 12:58:11 -08:00
Brian Cain
9bf41d34ba
Add some basic driver methods for configuring disks 2020-02-10 12:58:11 -08:00
Brian Cain
55cb8d1f0a
Add configure_disk blank unit test file and some method docs 2020-02-10 12:58:11 -08:00
Brian Cain
fc54996ba8
Add beginning of ConfigureDisks capability to VirtualBox provider 2020-02-10 12:58:11 -08:00
Terry Burton
c9ca7b8f57
docker provider: Don't explode when removing an image if it is in use
Output from recent Docker has changed:

    Stderr: Error response from daemon: conflict: unable to delete 0ba49dd235e5 (cannot be forced) - image is being used by running container 250bbe980448

Fixes #7245
2020-01-30 20:06:32 +00:00
Jeff Bonhag
d7a5f74897
Fixes #11128: Error if machine folder inaccessible (#11239)
This commit catches the Errno::EPERM raised by the operating system if
the machine folder is inaccessible and displays it as a more friendly
error message.

This can be an issue on macOS Catalina if virtual machine files are kept
in a special directory (Documents/Downloads/Desktop) that Vagrant's
embedded Ruby is not allowed to access.
2019-12-17 12:41:12 -05:00
Brian Cain
fb4e6985e1
Fixes #11249: Add VirtualBox provider support for version 6.1.x
This commit adds support for VirtualBox version 6.1.x. It simply
inherits from the base 6.0.x provider class.
2019-12-11 13:25:11 -08:00
Brian Cain
cef1bd47b3
Add initial disk builtin action 2019-11-22 14:40:23 -08:00
Brian Cain
2901dae948
Add option for docker executor to handle stderr from results
Instead of always joining stdout and stderr, only join the two if the
caller explicitly asks for it. Otherwise, only return stdout.
2019-11-22 12:04:09 -08:00
Brian Cain
4d70856b8a
Enhance docker build matching for determining built container ID
Prior to this commit, docker would look for a container ID based on
"Successfully built" string. This output does not exist if a user has
enabled the experimental feature buildkit. This commit updates the build
behavior to match against both kinds of outputs, and instead of using
`scan`, it uses MatchData and groups the container id with match group
name `:id` instead of making hard assumptions with the matches being
contained inside arrays from scan.
2019-11-19 10:59:28 -08:00
Juha Ruotsalainen
4fc8b07974
Removed the word 'done'.
There are cases, when 'done' is prefix with a duration, like `... 0.1s done`.
2019-11-19 10:02:03 -08:00
Rumpu-Jussi
f3629ebd09
Buildkit-based output processed a bit differently. 2019-11-19 10:02:03 -08:00
Juha Ruotsalainen
8041d0ae78
Build quietly and capture the image hash
At least on macOS combo Catalina + Docker engine 19.03.4 + Docker desktop 2.1.0.4 + vagrant 2.2.6 the original `matches = result.scan(/Successfully built (.+)$/i)` -line fails to generate a match. With this change I can `vagrant up --provider=docker` successfully.
2019-11-19 10:02:03 -08:00
Dan Čermák
435a32684f
Only return interfaces where addr is not nil
tunnel interfaces on Linux have addr set to nil which makes the function
list_interfaces fail with a backtrace.
2019-10-10 10:49:03 -07:00
Brian Cain
e6d47329ee
Add note about removing prefix workaround 2019-10-09 16:07:21 -07:00
Brian Cain
8458a21657
Determine prefix with netmask 2019-10-09 15:40:36 -07:00
Brian Cain
62b7e35169
Fixes #11094: Determine prefix for docker public networks
Prior to this commit, the docker action was using the method `prefix` on
an IPv4 and IPv6 address. This works fine for ruby versions 2.5 and
newer, however the ruby shipped with Vagrant is before 2.5, and
therefore the IPv4 and IPv6 classes do not have the prefix method,
resulting in an error. This commit fixes that by using a different
method of determining the prefix.
2019-10-09 09:56:59 -07:00
Brian Cain
f1ea4eaac0
Ensure build_args are passed into docker compose config file
Prior to this commit, the docker compose build method would not properly
set build_args if given in a Vagrantfile. This commit fixes that by
using the passed in key `extra_args` from the docker build action.
2019-10-07 12:48:59 -07:00
Brian Cain
96e275451c
Merge pull request #10938 from andersk/virtualbox-usable
virtualbox: Fix usability test to reject bad installs without crashing
2019-10-07 09:04:24 -07:00
Anders Kaseorg
4afd370d6a virtualbox: Fix usability test to reject bad installs without crashing
If VirtualBox is installed but the kernel module is missing or the
service is stopped, the usability test should fail without crashing so
we can fall back to other providers.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-04 15:56:10 -07:00
Brian Cain
8f856949f2
Merge pull request #10978 from mrshanahan/fix-issue-10973
Fixes issue hashicorp#10973: checks that VMMS WMI reference is null & throws appropriately
2019-10-01 11:12:41 -07:00
Anders Kaseorg
5b4dcf9443
providers/docker: Fix usability check
In commit 7980178d194bb21bde2e21858fbc969e4cc7eb3f (#10879) I added a
`usable?` class method to `VagrantPlugins::DockerProvider::Provider`.
However, commit 34e53a5a4b208edcc3e25c1f0e3aa0ef56e8d8d9 (#10890)
incorrectly changed it to an instance method.  This rendered it
ineffective because it’s called on the class, not an instance.  Change
it back to a class method.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-09-10 15:10:43 -07:00
Brian Cain
09af983caa
Fixes #11051: Only use host vm if specified
Prior to this commit, the docker login action assumed that if there was
a password to authenticate with, Vagrant was using a host vm to run
docker. This is likely due to some legacy decisions with how Vagrant
used to manage running docker. This commit fixes that by only grabbing a
host_vm lock if the host_vm is actually in use, otherwise login
normally.
2019-09-05 14:54:40 -07:00
Matt Shanahan
6caa7bfa86 Fixes issue hashicorp#10973: checks that VMMS WMI reference is null & throws appropriately 2019-07-19 07:48:03 +02:00
Brian Cain
fb80e8da9f
Merge pull request #10890 from briancain/add-usability-check-for-docker-plus-tests
Add usability check for docker plus tests
2019-06-05 07:58:23 -07:00
Brian Cain
34e53a5a4b
Add docker provider class test
This commit introduces aa provider_test class for the Docker provider
2019-06-04 13:24:07 -07:00
Anders Kaseorg
7980178d19 providers/docker: Add usability test
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-05-30 13:13:43 -07:00
Brian Cain
ca0fd64ded
Fixes #10798: Enhance how docker compose driver path expands
Prior to this commit, the docker compose driver would _always_ path
expand a host volume no matter what. This is not always the correct
option, for example if that host volume is actually a reference to a key
inside a `volumes` hash instead of a path on disk. This commit changes
that by looking to see if the requested host volume is actually a
defined key inside the compose config, and if not, it will path expand
it like before. Otherwise it will leave the key "as is".
2019-04-29 16:14:37 -07:00
Brian Cain
75d4aa42a1
Ensure non-existent machines do not attempt to list snapshots
Prior to this commit, if a snapshot restore was run on an entire
environment with some non-existent guests, Vagrant would attempt to list
their snapshots with a nil id. This commit fixes that by returning an
empty list of snapshots if the machine has not been created yet.
2019-04-09 13:11:19 -07:00
Brian Cain
4f80a9e6d5
Add test for requesting public ip range for docker network provider 2019-03-22 09:02:40 -07:00
Brian Cain
6bffdca972
Add beginning of connect network tests for docker provider 2019-03-21 16:06:24 -07:00
Brian Cain
88a18fe2c5
Add public network tests for docker provider 2019-03-21 16:06:11 -07:00
Brian Cain
82700d95b3
Ensure subnet is used if specified from user config options 2019-03-21 15:29:04 -07:00
Brian Cain
8c169714c5
Ensure variable names exist in method 2019-03-21 11:39:16 -07:00
Brian Cain
96a19aa00c
Fix how options to cli args are handled
Since options could also be defined as strings, convert it all to string
and compare those instead
2019-03-21 11:15:41 -07:00
Brian Cain
5215354d16
Fix missing docker error classes, and finish out initial #call tests 2019-03-21 10:50:45 -07:00
Brian Cain
1027636e41
Split up and rename unit tests for docker network operations 2019-03-20 15:14:39 -07:00
Brian Cain
eb75431c4a
Update docker driver and docker driver unit tests 2019-03-20 14:50:28 -07:00
Chris Roberts
623a1815ae Allow use of subnet option when defining private network with dhcp type 2019-03-19 14:35:40 -07:00
Chris Roberts
670bef6596 Allow custom subnet to be provided when private network type is dhcp 2019-03-19 14:20:14 -07:00
Chris Roberts
afb6c20581 Fix option mask to be expected netmask 2019-03-19 14:03:03 -07:00