Commit Graph

888 Commits

Author SHA1 Message Date
Brian Cain 000457a012
Update how docker network provider creates networks
This commit updates the docker network provider to only create networks
by subnet rather than per-container.
2019-03-01 16:07:53 -08:00
Brian Cain c20de9044d
Log information if unsupported docker network option is provided 2019-03-01 08:34:43 -08:00
Brian Cain 4a0f1a0a33
Update docker network action to auto-generate cli flags
This commit updates the docker network behavior to auto-generate the
docker network command flags from Vagrants network config option.
2019-03-01 08:34:43 -08:00
Brian Cain b5a092397f
Add new function for handling vagrant options to docker network cli
flags
2019-03-01 08:34:43 -08:00
Brian Cain dc5f8c66f2
Add todo comment for future fixup 2019-03-01 08:34:43 -08:00
Brian Cain 4dc5f7c330
Add basic ability to configure some networks for containers 2019-03-01 08:34:43 -08:00
Brian Cain e860c7709d
Begin to setup and configure docker networks for containers 2019-03-01 08:34:43 -08:00
Brian Cain 8013d8d5ef
Move around Network setup action for docker provider 2019-03-01 08:34:43 -08:00
Brian Cain 63ba0f9964
Add DestroyNetwork action to docker provider 2019-03-01 08:34:43 -08:00
Brian Cain 349cc5ddac
Add placeholder network destroy action for docker 2019-03-01 08:34:43 -08:00
Brian Cain a336aa687c
Add logger and start to iterate over networks in config 2019-03-01 08:34:43 -08:00
Brian Cain bed653eeb4
Autoload and use Network action on up 2019-03-01 08:34:43 -08:00
Brian Cain 67ea15126d
Make opts var optional for docker driver methods 2019-03-01 08:34:43 -08:00
Brian Cain 627251a307
Add basic docker network action 2019-03-01 08:34:43 -08:00
Brian Cain ec2e0380ee
Add basic docker driver methods for `docker network` subcommand 2019-03-01 08:34:43 -08:00
Brian Cain 4c61eaa933
Fixes #10643: Ensure paths are properly expanded when comparing synced folders
Prior to this commit, the docker action would attempt to compare and
validate synced folders based on their string value, rather than their
actual path value. This commit updates that by path expanding the mounts
when comparing a containers synced folders.
2019-02-04 11:15:40 -08:00
Chris Roberts cf99438f1f Update base path on windows to use common file separator
On Windows the File::SEPARATOR ends up being `/` which causes
issues with the new way the path is being extracted from the
vbox information. When on Windows (even with WSL), automatically
convert the path to use common forward slash separator. This
fixes path modifications used for storing guest disks.
2019-01-29 11:09:25 -08:00
Chris Roberts c999e7c3d4 Update behavior of `snapshot restore` and `snapshot pop`
Both of these commands failed to default the options disabling
the provisioning from ignoring the sentinel file. This resulted
in different behavior than what was seen with the `up` and
`resume` commands which would only provision items with run set
to "always". This defaults the options to proper match the behavior
of `up` and `resume` to be consistent.

This also adds an extra `--no-start` flag to allow users to restore
a snapshot but not start the restored guest immediately.

Fixes #6752
2018-12-07 16:17:44 -08:00
Chris Roberts 55a8649963 Adjust requirement on warnings for VirtualBox NIC
The changeset _did_ get included in the 5.2.22 release so adjust
the requirement to only warn on previous versions
2018-12-06 15:40:31 -08:00
Chris Roberts d589aa9f81 Update default_nic_type implementation within VirtualBox provider
In some cases the E1000 NIC type is the only acceptable value. Since
defaulting causes breakages to existing boxes, leave the default value
as `nil` but check the VirtualBox version in use and print warning to
user if VirtualBox version is vulnerable and E1000 NIC types are
configured for use within defined network adapters.
2018-11-26 15:58:45 -08:00
Chris Roberts b8f5752a82 Update VM import for VirtualBox 6 driver
The dry run import with VirtualBox 6 no longer provides full paths
for disks. Extract base path from suggested settings file location
and use that to generate full path name using provided disk base
name.
2018-11-15 11:04:08 -08:00
Chris Roberts efbf99c451
Merge pull request #10409 from chrisroberts/e-vbox-ssh-port-detect
Update VirtualBox driver ssh_port helper
2018-11-13 15:44:15 -08:00
Chris Roberts 7750d6182d
Merge pull request #10410 from chrisroberts/f-hyperv-net-typo
Fix typo in hyper-v network configuration detection script
2018-11-13 15:43:03 -08:00
Chris Roberts 8f49e05ad4
Merge pull request #10406 from chrisroberts/e-hyperv-destroy
Disable automatic checkpoints prior to VM removal
2018-11-13 15:22:11 -08:00
Chris Roberts 9dd137633a Fix typo in hyper-v network configuration detection script 2018-11-13 15:11:04 -08:00
Chris Roberts c7721f619b Update VirtualBox driver ssh_port helper
Be more restrictive when matching the port forward used for
SSH. Allow matching simply on the guest port, but also include
extra matching criteria for cases where multiple results may
be returned.
2018-11-13 15:04:12 -08:00
Chris Roberts 0ea4dcdc6e Disable automatic checkpoints prior to VM removal 2018-11-13 13:09:12 -08:00
Chris Roberts 83ed01869d Ignore errors when generating new VM configuration
The default error action is to stop. When generating the initial
VM configuration during import, if the Compare-VM command fails
it results in a generic error message. Instead the error should
be ignored so the source VM can be inspected and a useful error
message can be returned to the user.
2018-11-13 12:21:17 -08:00
Chris Roberts d8bbc5ce09 Add support for specifying the default NIC type used for guest adapters
Provides support for defining the NIC type used for any guest adapter
which does not define an adapter type. This is defaulted to "virtio".
2018-11-07 15:53:46 -08:00
Chris Roberts 9d728682c4 Add vbox provider driver for 6.0 2018-11-06 16:50:17 -08:00
Chris Roberts de42681742 Inherit from common base since 5.1 driver has no changes 2018-11-06 16:50:17 -08:00
Brian Cain bcb6bf8acd
Merge pull request #10347 from briancain/add-timeout-for-ssh-info-hyperv
Fixes #10229: Add proper reboot capability for Windows guests
2018-11-06 09:25:36 -08:00
Chris Roberts d5f3600c4b
Merge pull request #10366 from chrisroberts/f-hyperv-vlan
Remove module loading from vlan script
2018-11-05 12:53:33 -08:00
Chris Roberts 5add5c24fe Show formatted error message with address and netmask 2018-11-02 15:03:22 -07:00
Mikhail Zholobov d9d081199c
action/network: Validate IP settings, show human-readable error 2018-11-02 22:29:19 +01:00
Mikhail Zholobov a02aaa3195
action/network: Refactor the calculation of host-only adapter IP and DHCP settings 2018-11-02 22:28:49 +01:00
Chris Roberts 1ece44ca84 Remove module loading from vlan script 2018-11-02 10:42:28 -07:00
Brian Cain 54c8ebc31a
Fixes #10229: Add timeout for changing hostname on windows
Prior to this commit, if Windows was slow to reboot, Vagrant would fail
to find the right IP address to upload the wait_for_reboot script to.
This commit fixes this race condition by adding a timeout to ensure that
Vagrant can retry. It also properly catches an exception in the winrm
ready? method for checking if a guest is properly ready for
communications.
2018-11-02 09:23:00 -07:00
Brian Cain 580bcaebb0
Merge pull request #10311 from briancain/DOCKER-VM-FOLDER-MOUNT
Deterministic host VM synced folder location for Docker provider
2018-10-24 16:19:41 -07:00
Brian Cain 7c06950e43
Ensure true or false for automount option 2018-10-23 09:00:55 -07:00
Brian Cain 6d0dfb2690
Fixes #10016: Add `automount` flag if specified with synced_folder
This commit adds a new option to virtualbox synced_folders called
`automount`, where if set to true, will supply the `--automount` flag to
virtualbox.
2018-10-22 15:45:32 -07:00
Brian Cain 94bb50fa7e
Add test for syncing folders with docker provider 2018-10-17 14:14:27 -07:00
Martin Jonas 238338d803
Deterministic host VM synced folder location for Docker provider to prevent broken sync after host VM shutdown
Fix for #10282
2018-10-17 11:28:24 -07:00
Chris Roberts 080dd748ef
Merge pull request #10265 from chrisroberts/f-win-chktyp
Only configure CheckpointType if available to be configured.
2018-10-09 14:47:15 -07:00
Chris Roberts 88469d99f7 Only configure CheckpointType if available to be configured. 2018-10-04 15:24:05 -07:00
Chris Roberts 9c1ab2bd9f Wrap automatic checkpoint enable to prevent inadvertent execution 2018-10-04 15:16:58 -07:00
Chris Roberts 85dc0ebec9 Allow automatic mac address assignment with virtuabox provider 2018-10-01 11:05:28 -07:00
Brian Cain 4612619dc4
Fixup docker config update 2018-09-19 10:52:59 -07:00
Oleksiy Protas 166fe374b6
More explicit logging and 'dockerfile' option support 2018-09-19 10:25:37 -07:00
Oleksiy Protas cbc69f5158
Build from git operation for docker 2018-09-19 10:24:09 -07:00
Oleksiy Protas de6a1794c7
Config, validation and test 2018-09-19 10:24:09 -07:00
Oleksiy Protas 8d1b5fc1c9
Docu changes for building Docker images from git 2018-09-19 10:24:05 -07:00
Chris Roberts 1f74aedeaa Check for automatic checkpoint support before configuring
The AutomaticCheckpointsEnabled option may not always be available
depending on the version in use. Check for support before applying
the configured value. If automatic checkpoints are to be enabled
and support is not available, force an error.
2018-09-05 13:37:45 -07:00
Brian Cain c2cff0dc07
Merge pull request #10100 from briancain/DOCKER-TOOLBOX
Convert windows paths for volume mounts on docker driver
2018-08-17 15:08:59 -07:00
Brian Cain 5d2d784ae7
(#9085) - Add test for converting windows paths
This commit adds a test for checking that a windows path for mounting a
volume in a container is properly converted into something that's
usable.
2018-08-08 10:30:04 -07:00
Chris Roberts de284a9056
Merge pull request #10079 from chrisroberts/f-win-virt-ext
Enable ExposeVirtualizationExtensions only when available
2018-07-31 13:54:55 -07:00
Chris Roberts 9c149ba8b1 Only enable ExposeVirtualizationExtensions if available within Hyper-V version 2018-07-31 13:33:41 -07:00
Cédric Félizard f53238d253 Skip link-local addresses when fixing IPv6 route
This occurs with a Linux host when a link-local address is configured
for vboxnet0 (which is the default for VirtualBox 5.2.6).

`connect': Invalid argument - connect(2) for "fe80::ffff:ffff:ffff:ffff" port 80 (Errno::EINVAL)
2018-07-30 15:00:35 -07:00
Matthew Olenik 428eb3ed93
Support Docker volume consistency for synced folders
Adds the `docker_consistency` option, which sets the Docker volume
consistency level. This can be used to greatly improved synced folder
performance, especially on macOS.

See for details: moby/moby#31047
2018-07-27 15:16:39 -07:00
Chris Roberts 110600970a
Merge pull request #10000 from chrisroberts/f-hyperv-access-localized
Fix Hyper-V access check
2018-07-18 16:39:54 -07:00
Chris Roberts 8aa74a03a0 Differentiate checkpoints and automatic checkpoints
Provide separate configuration settings for enabling/disabling
checkpoints and automatic checkpoints with Hyper-V provider.
2018-07-13 15:23:09 -07:00
Chris Roberts cf29085d33 Fix root directory generation on failed access 2018-07-06 16:27:52 -07:00
Chris Roberts 15dacc80c0 Update ACL check to use identifier to prevent localization errors 2018-07-06 16:25:05 -07:00
Chris Roberts a9bc0bb800 Do not provision and configure when state is saved 2018-07-06 15:49:36 -07:00
Chris Roberts 630bc6540d Enable standard checkpoint on VM for snapshot if disabled 2018-07-06 15:29:07 -07:00
Chris Roberts 101fc447ec Add Hyper-V access check on data directory 2018-06-18 15:36:45 -07:00
Chris Roberts 941dd77a90 Force string conversion on paths 2018-06-18 09:53:06 -07:00
Chris Roberts fe8fe55d1f Delete and re-create data directory when destroying guest 2018-06-18 09:09:27 -07:00
Chris Roberts a8abb6898c Fix PowerShell cmdlet name for clones 2018-06-18 09:09:01 -07:00
Chris Roberts 1e5c8bf275 Add check for WSL when determining if Hyper-V is usable 2018-06-18 09:08:35 -07:00
Chris Roberts d84f29f12c Just provide module path as conversion is done earlier 2018-06-18 09:08:05 -07:00
Chris Roberts 55aaa1d258 Update path usages to support Hyper-V provider access from WSL 2018-06-15 09:03:18 -07:00
Chris Roberts 8fbf27772a Always ensure full path to configuration file on import 2018-06-15 07:48:14 -07:00
Chris Roberts 694104b005 Attempt to provide helper error message on failed VM import
When importing a Hyper-V VM fails, attempt to manually build
a system definition and inspect the result to determine cause
of the failure.
2018-06-14 16:40:37 -07:00
Chris Roberts 3919455f08
Merge pull request #9932 from chrisroberts/e-hyperv-maxmem-chk
Validate maxmemory setting within Hyper-V provider
2018-06-13 14:52:09 -07:00
Chris Roberts 4d3f5d33c6
Merge pull request #9925 from chrisroberts/u-powershelling
Misc. PowerShell cleanup
2018-06-13 14:51:43 -07:00
Chris Roberts 9482f351fc Validate maxmemory setting within Hyper-V provider
Forces an error if maxmemory value is less than the configured
minimum or startup memory.

Fixes #9477
2018-06-13 13:27:11 -07:00
Chris Roberts 1554f447f2 Disconnect all configured network adapters
When importing a Hyper-V VM ensure all adapters are disconnected from
switches that were used when the box was built.
2018-06-13 07:59:56 -07:00
Chris Roberts 57842d7269 Update powershell messaging functions to not include second `-` character. 2018-06-12 16:47:47 -07:00
Tony Apuzzo 5ac8bb8620 Correct typo, $Enable instead of $enabled. 2018-06-07 15:00:09 -06:00
Chris Roberts 73c09de1a9 Add deprecation warning when `differencing_disk` option is used 2018-05-29 10:21:06 -07:00
Chris Roberts c238dc0a35 Include machine name when raising invalid box errors 2018-05-25 16:43:17 -07:00
Chris Roberts 35d8920325 Case insensitive switch check and only write sentinel file if not found 2018-05-25 15:11:58 -07:00
Chris Roberts 2bd6f537ef Clean up syntax and force string type when setting integration option 2018-05-25 10:11:05 -07:00
Chris Roberts d2bc634623 Add vm_integration_services validation 2018-05-24 16:55:35 -07:00
Chris Roberts 52bae21933 Remove unused PowerShell scripts 2018-05-24 15:33:36 -07:00
Chris Roberts e6457d5061 Overhaul the Hyper-V provider 2018-05-24 14:43:44 -07:00
Chris Roberts 2730fe7ec9 Update script parameter name in option to switchid
Fixes #9774
2018-05-04 08:55:18 -07:00
Chris Roberts 02b9d625d3
Merge pull request #9759 from StefanScherer/wsl-remove-raise-vboxmanage-missing
Allow other providers in WSL
2018-05-03 12:42:16 -07:00
Brian Cain e1129d27f9
Merge pull request #9761 from briancain/FIX-DOCKER-EXEC
Use Util::SafeExec if docker-exec is run with `-t` option
2018-05-02 15:47:46 -07:00
Brian Cain 79e535a7ee
(#9622) Use SafeExec for docker-exec
This commit uses the internal helper SafeExec rather than using the
Kernel class directly. It also adds a test to ensure that if the `-t`
option is used, it will call SafeExec.
2018-05-02 14:23:50 -07:00
Stefan Scherer f14e8bcbf2
Allow other providers in WSL 2018-05-02 22:36:17 +02:00
Chris Roberts fbcd86993b
Merge pull request #9737 from chrisroberts/e-hyper-v-addr
Check neighbors for valid guest address when default lookup fails
2018-05-02 08:54:57 -07:00
Chris Roberts 9f08337ce1 Ignore errors on neighbor lookup and validate result 2018-04-30 17:39:27 -07:00
Chris Roberts e47e1df228 Reference Hyper-V switch by ID instead of name
Keep track of selected Hyper-V switch using the ID instead of name
to prevent any encoding issues that may occur switching between
PowerShell and Ruby. With the IDs staying consistent, the switch
name can be fetched from the provided ID.

Fixes #9679 #8794 #9451
2018-04-27 16:52:16 -07:00
Chris Roberts d15ff38d5c Check neighbors for valid guest address when default lookup fails
If the guest address is unavailable via Hyper-V inspection, extract
MAC address of network adapters and check neighbor information for
any currently matching known address.
2018-04-26 12:53:52 -07:00
Isaac Freeman de71626922 docker: use Kernel.system for docker-exec when -t is given 2018-04-18 17:50:47 -04:00
Brian Cain 4db3d49157
Improve network collision error message
This commit provides a bit more information when a non-hostonly network
collides with a host network.
2018-04-12 14:16:13 -07:00
Josh Soref 1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Chris Roberts 51232f9a03 When matching hostonly adapter name, force common types
Force a string type for comparison to prevent false positives when
the name is unset (resulting in a nil value).
2018-03-09 14:15:31 -08:00