Commit Graph

625 Commits

Author SHA1 Message Date
Seth Vargo e270e7df27
provider/docker: Add -u flag to exec 2016-05-31 20:05:27 -04:00
Seth Vargo cfac24779c
provider/docker: Separate -i and -t flags for exec 2016-05-31 20:05:27 -04:00
Seth Vargo bf96b3348b
provider/docker: Add docker-exec command
This adds a new core command, `docker-exec`, which allows the user to
exec into an already-running container.

- Fixes #6566
- Fixes #5193
- Fixes #4904
- Fixes #4057
- Fixes #4179
- Fixes #4903
2016-05-31 20:05:26 -04:00
Seth Vargo 38f23fe001
providers/docker: Allow TCP and UDP ports on same number
This commit changes the way ports are aggregated in the Docker provider.
Previously ports were aggregated by their "number", but that is not a
truly unique representation. Instead, the protocol is now taken into
account when generating the port map.

Fixes GH-5527
2016-05-30 17:23:44 -04:00
Seth Vargo e2fadbcf08
Add a log message when the VM master is missing 2016-05-29 01:19:56 -04:00
Seth Vargo 1e7c8e8d6c
Use LF instead of CRLF 2016-05-29 01:18:24 -04:00
Seth Vargo d3d88f5d91 Merge pull request #7126 from jjulien/iss_6742
Fixed linked clone failure when master VM is missing
2016-05-29 01:14:04 -04:00
Seth Vargo b11f8cbd1b Merge pull request #7293 from ericpulvino/master
Set max_network_adapters to 36 for Virtualbox
2016-05-29 00:55:44 -04:00
Seth Vargo 3d2390fc94
Give a unique, prefixed name to all tempfiles
This commit basically grepped the code base for all uses of Dir.mktmpdir
and Tempfile.new/open and ensures the value is unique within the
code base and also prefixed with `vagrant-`.

Previously, most invocations of these commands simply used "vagrant",
thus making them indistinguishable when trying to identify leaks.
2016-05-28 23:22:34 -04:00
Ray Ruvinskiy e42f346b1d
Make `start` action run provisioners if VM is running
Previously, there was no one gesture that would start a VM if it was not
running and run the appropriate provisioners regardless of its original
state. `vagrant up` did nothing if the VM was running, while
`vagrant provision` did nothing if the VM was not running.

Change the semantics of `vagrant up`, via the start actions of the providers,
to go through the provisioning logic even if the VM is already running.
The semantics of `run: "once"` vs `run: "always"` are respected.

Tested with the VirtualBox provider but not the others.

Resolves #4421
2016-05-27 19:00:33 -04:00
Seth Vargo 68329817ad Merge pull request #7290 from phyber/fix/master/prepare_nfs_settings_machine_ip_fix
prepare_nfs_settings: Try harder to get all machine IPs.
2016-05-27 18:38:03 -04:00
Seth Vargo 8c11b537ba
Allow Mac/Windows users to use Docker native 2016-05-27 17:36:07 -04:00
Seth Vargo db1f98ffd6 Merge pull request #7298 from till/t/docker-for-mac-beta
Change: disable the linux switch (Docker for Mac/Windows, etc.)
2016-05-27 17:25:13 -04:00
Seth Vargo efdb148f61
Move pre-flight package validation to middleware
This commit separates the scratch and output directory creation from the
main package middleware into its own PackageSetupFolders middleware.
Additionally, the validation that ensures an output file does not exist
is moved into a validation function that can be shared across multiple
methods.

This refactor permits a pre-flight check to ensure box packaging would
be successful before actually stopping the VM.

Fixes GH-7351
2016-05-27 17:07:04 -04:00
Seth Vargo 08550b6888 Merge pull request #7108 from jtopper/fix_hyperv_status_exception
HyperV: Reinstate compatibility with PowerShell 4
2016-05-20 10:46:01 -04:00
Jon Topper 0a7c20a93a Determine status behaviour based on PS version 2016-05-13 17:50:24 +01:00
Jon Topper df4caf0757 Add snapshots to Hyper-V driver 2016-05-13 16:58:08 +01:00
David O'Rourke 985f1d4dda prepare_nfs_settings: Fix add_ips_to_env!, spec test passes again. 2016-05-10 11:16:21 +01:00
till 647bd6114c Change: disable the linux switch (Docker for Mac/Windows, etc.) 2016-05-08 21:35:12 +02:00
Eric Pulvino 45e52e3bf1 Updated ./plugins/providers/virtualbox/driver/base.rb file, set max_network_adapters to 36 for Virtualbox so all 36 adapters are cleared prior to programming interfaces. This fix is per issue 7286 --> https://github.com/mitchellh/vagrant/issues/7286 2016-05-08 00:11:22 -04:00
David O'Rourke ed708645b2 prepare_nfs_settings: Try harder to get all machine IPs.
Vagrant was not behaving correctly in configurations where there was
a static IP on a VirtualBox `intnet` interface and a DHCP `:hostonly`
interface configured.

Since `machine_ip` attempted to get static addresses `||` dynamic
addresses, it would simply use the static machine address and
continue.

This commit corrects this behaviour by collecting all static and
dynamic addresses into the `machine_ip` array instead of just one or
the other.

The result of this is a correctly generated `/etc/exports` on the
host machine, allowing NFS mounts to work correctly in this type of
environment.
2016-05-05 14:41:03 +01:00
Seth Vargo 6c01aaf6ab Merge pull request #7090 from mac2000/master
hyperv differencing disk
2016-04-17 23:14:29 +05:30
Seth Vargo d565c2f07e Check both stderr and stdout
Different vbox versions print this to different streams, so check both
just to be sure
2016-03-17 10:52:10 -04:00
Seth Vargo 5b336949b5 Merge pull request #7050 from md55/snapshots-in-virtualbox41
Adds snapshot commands in VirtualBox 4.1
2016-03-17 10:48:03 -04:00
John Julien e0ecda961c Fixed linked clone failure when master VM is missing
If the master VM is removed, but the master_id file exists, Vagrant
would still attempt to clone using the master_id rather then
importing re-importing first.

Fixes #6742
2016-03-09 19:33:47 -06:00
Matt Wrock 508492faae fixes #7098 only specifying Hyper-V generation if the parameter is supported 2016-03-04 23:42:17 -08:00
Marchenko Alexandr 51d7c98d49 hyperv differencing disk 2016-03-01 17:23:38 +02:00
Evgeniy N 890820eaf6 Add snapshot commands
Fixed error remains in other versions:
  return [] if e.extra_data[:stdout].include?("does not have")
should be
  return [] if e.extra_data[:stderr].include?("does not have")

Many methods are the same in different version_X, and should be moved to Base class.
2016-02-18 11:47:07 +06:00
Kevin Blair 026243c88b Typo
Changed message to match HyperV terminology
2016-02-16 14:58:42 +00:00
Kevin Blair 343a43cae6 Preserve Disk Image Name
detect and preserve the original name of the disk image rather than forcing it to be disk
2016-02-16 14:57:53 +00:00
Mitchell Hashimoto 06a1461081 Merge pull request #6662 from lukebakken/fixes/lrb/gh-4503-hyper-v-admin-privs
Fix for 4503
2015-12-14 15:56:55 -08:00
Luke Bakken 57187c9f88 Add method to detect if a Windows user is a member of the "Hyper-V Administrators" group.
Modify Hyper-V provider to require a user to either be an Administrator or a member of "Hyper-V Administrators"
2015-12-10 07:04:39 -08:00
Timur Alperovich a56e118b16 Use <prefix>::1 as the IPv6 adapter IP.
Set the IPv6 adapter IP to be <prefix>::1. Otherwise, guest to host
communication over IPv6 is not routed correctly. This means that
consumers should not specify <prefix>::1 IP addresses to VirtualBox,
which should be a reasonable restriction.

Fixes #6658
2015-12-09 17:22:02 -08:00
Seth Vargo aca1e041f6 Rename network to interface 2015-12-08 11:05:39 -05:00
Seth Vargo 9ba8cfcd50 Separate logic into other functions for readability 2015-12-08 10:52:54 -05:00
Timur Alperovich bcf61d001b Only consider the VM interfaces in the IPv6 fixup.
Vagrant should only consider the host-only interfaces used by the
virtual machine in the IPv6 fixup code. There may be other interfaces
present on the system with IPv6 addresses that for various reasons
would fail the routing check (for example, an interface with no
machines attached).

The patch changes the behavior to not scan all of the host-only
interfaces and adds a unit test for the behavior (that the correct IP
is validated).

Lastly, there is a small fix here that may not be an issue for most
people where the IPv6 prefix was asummed to be a multiple of 16 for
the purposes of constructing the UDP probe datagram. This assumption
has been removed.

Fixes #6586
2015-12-08 10:44:07 -05:00
Seth Vargo f20c08f57f Return nil if the VM is not running when looking at forwarded ports 2015-11-24 16:33:09 -05:00
Seth Vargo 844cca9013 Skip nil IP addresses in ipv6 fix
Fixes GH-6558
2015-11-23 17:20:20 -05:00
Seth Vargo 7b89ecc230 Add public_address cap for VirtualBox
Fixes GH-5978
2015-11-23 16:23:22 -05:00
Mitchell Hashimoto 24799575c3 providers/hyperv: fix error 2015-11-23 12:06:11 -08:00
Mitchell Hashimoto b23b48a614 providers/hyper-v: support more than one NIC [GH-4346] 2015-11-23 12:05:37 -08:00
Mitchell Hashimoto 55e872eda4 Merge pull request #6118 from mjaverto/patch-1
Fix Win 10 Enterprise Vagrant Error
2015-11-23 11:45:23 -08:00
Mitchell Hashimoto dbf419abad providers/virtualbox: ignore unknown status interfaces [GH-6061] 2015-11-23 10:15:32 -08:00
Mitchell Hashimoto 3c2fab9d0d providers/virtualbox: more robust lookup for VBoxManage on Win 2015-11-20 15:56:14 -08:00
Mitchell Hashimoto 270c0726df Merge pull request #6552 from mitchellh/f-cache-vbox
providers/virtualbox: cache VirtualBox version [GH-6468]
2015-11-19 11:20:09 -08:00
Mitchell Hashimoto a75b14b769 providers/virtualbox: wrap version set in mutex 2015-11-19 11:19:56 -08:00
Seth Vargo 825bd6d5ef Run provisioner cleanup tasks before destroying the VM 2015-11-19 11:14:31 -08:00
Mitchell Hashimoto fb511a43d9 providers/virtualbox: store version on instance as well 2015-11-19 11:02:00 -08:00
Mitchell Hashimoto d56c8fda18 providers/virtualbox: cache VirtualBox version [GH-6468] 2015-11-19 11:00:02 -08:00
Mitchell Hashimoto 6f3ed13f75 providers/virtualbox: run provisioners on suspend resume 2015-11-18 17:16:23 -08:00