Commit Graph

3101 Commits

Author SHA1 Message Date
Mitchell Hashimoto 07157b47ae Only allow one provider active machine at a time.
Temporary limitation of Vagrant to only allow one active machine with a
provider at a time. That means you cant `up` a machine with both vmware
and virtualbox at the same time. In the future you will be able to but
to avoid various edge cases for now we're disallowing it.
2012-12-30 10:52:01 -10:00
Mitchell Hashimoto 526603dbbf Lots more logging in with_target_vms 2012-12-29 18:34:11 -10:00
Mitchell Hashimoto 9257fe3d98 Environment#active_machines
This returns a list of active machines for the environment. An active
machine is a machine that at one point was created by Vagrant.
2012-12-27 19:28:05 -10:00
Mitchell Hashimoto 4e649cc987 Upgrade V1-style dotfile to V2
See the code and comments for details on how this is done. As usual, we
are very careful about this so as not to inadvertently destruct real
user data.
2012-12-26 22:41:42 -08:00
Mitchell Hashimoto 495479f480 Merge branch 'new-data-tiers'
This branch changes how local data is stored for Vagrant environments
from a single "dotfile" approach to having a directory of data, more
similar in style to git.

When a V1-style dotfile is encountered, it is automatically upgraded
to the new style directory format.
2012-12-26 22:03:16 -08:00
Mitchell Hashimoto cd969e1e05 Remove the dotfile_name configuration option.
The dotfile is gone now so the configuration option is obselete
2012-12-26 21:45:24 -08:00
Mitchell Hashimoto c0c3e7bf43 Remove Vagrant::DataStore
We just don't use it yet and the old implementation was sketchy. I was
not happy with it.
2012-12-26 21:45:24 -08:00
Mitchell Hashimoto b15a6dee0e Log more information about the machine 2012-12-26 21:45:24 -08:00
Mitchell Hashimoto 3baa31460f Store machine ID in "id" file in data directory.
Instead of storing an "active" hash in the local_data of an Environment,
we now place the ID of a machine in the "id" file of the machine data
directory. This file is read upon re-instantiation in order to load the
proper state.
2012-12-26 21:45:23 -08:00
Mitchell Hashimoto d18edc3ce5 Detect a V1 environment and stub upgrade process 2012-12-26 21:45:23 -08:00
Mitchell Hashimoto cc18492c7a Local data path introduced
The local data path is set to the `ROOT_DIR/.vagrant` by default and is
a directory where Vagrant can store environment-local state. This can be
overriden on a per-Environment basis using the `local_data_path`
option.
2012-12-26 21:45:23 -08:00
Mitchell Hashimoto 5cb2f3275a Get rid of a silly constant for subdirs in Environment
The data is only used once anyways so just use a local variable.
2012-12-26 21:45:23 -08:00
Mitchell Hashimoto d54d58c09c Call `finalize!` properly on provider configurations 2012-12-26 21:44:43 -08:00
Mitchell Hashimoto e955596939 Set a default for the "gui" option for VirtualBox 2012-12-25 09:18:47 -08:00
Mitchell Hashimoto 54a2f6b89e Change boot_mode to a provider config `gui`.
OLD:

config.vm.boot_mode = :gui

NEW:

config.vm.provider :virtualbox do |vb|
  vb.gui = true
end
2012-12-25 09:00:06 -08:00
Mitchell Hashimoto 2cfc5986d2 Wording changes in the status command. VM => machine 2012-12-24 10:00:28 -08:00
Mitchell Hashimoto 8fe0f86dbd The --provider flag for `up` now actually does something. 2012-12-23 21:23:08 -08:00
Mitchell Hashimoto 92436ee547 Re-order things in CHANGELOG 2012-12-23 17:43:00 -08:00
Mitchell Hashimoto fdf7d5a8ed Update CHANGELOG structure 2012-12-23 17:42:20 -08:00
Mitchell Hashimoto 8cc4910fa9 Merge commit that got missed. Ignore changes in this comit. Read message
This branch brings in a whole lot of awesome. The name does not do it
justice. The list of things that comes into play here:

* "virtualbox" is no longer hardcoded anywhere in core. It is the default
  provider, yes, but it is 100% possible now to slip in another provider
  and have it work.

* `vagrant up --provider` is a thing. This allows you to specify an
  alternate provider. Note that the other commands don't support
  `--provider` yet so its not THAT useful, but its getting really close.

* True V2 configuration is in place. That means that `Vagrant.configure`
  calls now are loading a completely new configuration version, and old
  1.0.x Vagrantfiles are V1 configuration. V1 configuration is upgraded
  automatically internally, so backwards compatibility is maintained.
  Magic, people, magic.

* `config.vm.provider` is the major new configuration option. This is
  how provider-specific configuration will be done. For example, Vagrant
  has always provided a way to make a pass of `VBoxManage` calls to
  customize your VM via `config.vm.customize` in V1. This now exists
  as a VirtualBox configuration option. See the example here:
  https://gist.github.com/98f5a0df6a05286dfb73

* Unit tests no longer depend on VirtualBox being installed, because for
  unit tests we slip in a "no-op" provider, which is a fully valid
  Vagrant provider plug-in that does... NOTHING! Brilliant!

* Lots of core middleware executor improvements that make writing and
  using middleware stacks a lot more enjoyable. Enjoy a set of "standard
  library middlewares" provided by Vagrant in Vagrant::Action::Builtin.

The multi-provider is really shaping up here.
2012-12-23 16:34:09 -08:00
Mitchell Hashimoto 178c47992c Remove unused files 2012-12-23 16:29:26 -08:00
Mitchell Hashimoto a671fdcbcb Upgrade sub-VM defines from old config 2012-12-23 16:29:26 -08:00
Mitchell Hashimoto 3808ea377f Upgrade all other default configurations to V2 2012-12-23 16:29:26 -08:00
Mitchell Hashimoto bf53abca76 VM config upgrades provisioners 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto ed6123ac77 Upgrade all VM configs except provisioners (TODO still) 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto b0b7c56aa3 More accurate commenting/documentation on the command helpers 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto 9f6b091575 Comment clarification 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto 9f893534f1 Upgrade VM customizations 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto e88d735cb6 Make configured VM providers default to an empty one 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto 553d4a828a Make sure provider config is always available even if no block was given 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto 6478139cee Move config.vm.customize to VirtualBox specific option 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto 66849fda20 When recovering on import and destroying, force it 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto dffbf6eb09 Allow COnfirm calls to be forced by specifying a force_key 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto 50d7b0aba4 Fix bug where Call didn't propagate recovery. Warden has no recovery.
The issue here is that when a middleware failed and a recovery sequence
started, it would halt at the "call" step because the "Call" didn't
properly recover the child sequence.

An additional issue was that a Warden had no "recover" method, meaning
embedded Wardens wouldn't recover their stacks properly.
2012-12-23 16:29:25 -08:00
Mitchell Hashimoto a6e0d3908f Create a "dummy" provider for tests 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto ac7958a43b Environment#primary_machine takes a provider argument. Use it. 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto 128c06e78d Environment#default_provider 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto 1ee470a551 Begin work on supporting provider-specific configuration
This works by registering a `config` with `:provider => true` with the
same name as your provider. Vagrant will then automatically configure
the provider when `config.vm.provider` is used.
2012-12-23 16:29:24 -08:00
Mitchell Hashimoto 666f9f802d When upgrading V1 `vm` config, don't set on new if it wasn't set before 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto 99c5cddb7d V2 config supports the concept of an "UNSET" value when doing merges
This value should be used as a default, and allows the parent `merge`
method to "just work" most of the time.
2012-12-23 16:29:24 -08:00
Mitchell Hashimoto b6c6614fd8 Basic upgrade support for the `vm` config settings. VERY basic. 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto 2da812bd48 Change log levels of some messages that are useful 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto e16010041a Warden only logs an error once 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto cc24d7b196 Better logging for the box collection 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto c9d5cff7be Add in some logging 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto 819140bbc2 Don't error if box doesn't exist on load 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto a4713d5a84 No need to call `load!` anymore, since it doesn't exist 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto 0ec639c8e1 BoxCollection#find should only find V1 box when searching for vbox 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto e2dd0b0cf2 Get machine tests passing again with new environment 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto f2b91d26fd Load the configuration per machine, so that provider boxes work
Boxes are provider-specific, and we don't know the provider until
Environment#machine is called, so we need to build up the machine
configuration during this time.
2012-12-23 16:29:23 -08:00