95 Commits

Author SHA1 Message Date
sophia
a1d429a4e8 Raise more descriptive error if cloud init fails 2020-08-06 15:47:36 -05:00
sophia
0a5a940e58 Raise an error if cloud-init is not found on guest 2020-07-29 12:50:50 -05:00
sophia
c48befbe61 Only do cloud init actions on 'vagrant up' 2020-07-17 09:45:51 -05:00
sophia
3f867e0df4 Add cloud init wait action 2020-07-16 15:40:39 -05:00
Brian Cain
42718437ab
Initial commit of cloud_init setup action
This commit introduces a new builtin action for preparing and
configuring guests cloud_init configs as an iso to be attached later by
the disk actions
2020-06-29 11:00:16 -07:00
sophia
1a758d839b Option to gracefully destroy vm 2020-05-29 15:36:40 -04:00
Brian Cain
e4a57a8e1d
Add virtualbox cleanup_disks action 2020-02-10 12:58:11 -08:00
Brian Cain
cef1bd47b3
Add initial disk builtin action 2019-11-22 14:40:23 -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
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
Brian Cain
87b7514603 (#7188) Clean up vagrant snapshot restore/delete error messages
This commit adds some better handling around the snapshot restore and
delete commands for the virtualbox provider. If a user attempts to restore from
a vm that does not exist, instead of exiting 0 it will raise an
exception saying the virtual machine has not been created yet.
Addtionally, if a user attempts to restore from a snapshot id that does
not exist, instead of printing a complicated exception from the
virtualbox cli tool, it prints a more useful error message telling the
user that the snapshot does not exist.
2017-06-07 09:12:20 -07: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
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
825bd6d5ef Run provisioner cleanup tasks before destroying the VM 2015-11-19 11:14:31 -08:00
Mitchell Hashimoto
6f3ed13f75 providers/virtualbox: run provisioners on suspend resume 2015-11-18 17:16:23 -08:00
Mitchell Hashimoto
36cfc77167 providers/virtualbox: make prepare clone a core thing 2015-10-08 16:02:37 -04:00
Mitchell Hashimoto
5ea24e39d0 providers/virtualbox: unify import/clone 2015-10-08 13:07:05 -04:00
Mitchell Hashimoto
4908cd9cd9 providers/virtualbox: copy SSH key 2015-10-08 12:58:06 -04:00
Mitchell Hashimoto
e9922d1754 providers/virtualbox: discard state if cloning 2015-10-08 12:50:02 -04:00
Mitchell Hashimoto
f0ddac8c9a providers/virtualbox: clone 2015-10-08 12:33:55 -04:00
Mitchell Hashimoto
c5c3ba616b providers/virtualbox: some progress 2015-10-08 12:09:46 -04:00
Mitchell Hashimoto
20310dce0c noop 2015-10-08 11:59:30 -04:00
Mitchell Hashimoto
7480b65e9d providers/virtualbox: use caps for snapshot list 2015-10-08 08:46:36 -04:00
Mitchell Hashimoto
ed4df21c85 commands/snapshot: push and pop 2015-10-07 22:52:27 -04:00
Mitchell Hashimoto
8c0e38b397 providers/virtualbox: snapshot restore 2015-10-07 16:48:29 -04:00
Mitchell Hashimoto
c635352b89 providers/virtualbox: list snapshots, progress for delete 2015-10-07 16:41:58 -04:00
Mitchell Hashimoto
d0e8ecfc73 providers/virtualbox: snapshot save/delete 2015-10-07 16:16:53 -04:00
Mitchell Hashimoto
2c936b2e37 providers/virtualbox: tidying up the linked clone feature 2015-10-06 14:11:41 -04:00
Mitchell Hashimoto
d519d927fa Merge branch 'VB-linked-clone-support' of https://github.com/mpoeter/vagrant into mpoeter-VB-linked-clone-support 2015-10-06 13:50:34 -04:00
Mitchell Hashimoto
061a91d09b providers/virtualbox: workaround IPv6 routing bug in VB
VirtualBox has a bug where the IPv6 route is lost on every other
configuration of a host-only network. This is also triggered when a VM
is booted.

To fix this, we test the route-ability of all IPv6 networks, and
reconfigure if necessary. This is very fast but we still only do this if
we have any IPv6 networks.
2015-09-30 18:19:37 -07:00
Manuel Pöter
f4d1d068f9 Merge branch 'master' into VB-linked-clone-support 2015-07-13 10:56:17 +02:00
Mitchell Hashimoto
7ccec33460 providers/virtualbox: define a sync_folders action to setup NFS
[GH-4344]
2014-10-22 09:26:38 -07:00
mpoeter
c20624bfdc Add support for linked clones for VirtualBox. 2014-09-09 19:17:04 +02:00
Kalman Hazins
bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto
a205cf84a0 providers/virtualbox: don't require valid config on destroy [GH-1629] 2014-04-21 13:56:37 -07:00
Mitchell Hashimoto
6a5fee0191 providers/virtualbox: add post-comm customize step [GH-3080] 2014-03-09 21:35:53 -07:00
Mitchell Hashimoto
1a5ad9f3d5 providers/virtualbox: check for outdated on any start 2014-02-05 21:20:17 -08:00
Mitchell Hashimoto
bfca65b098 core: better output for BoxCheckOutdated 2014-02-05 21:20:16 -08:00
Mitchell Hashimoto
4cedd590d9 providers/virtualbox: use new HandleBox middleware 2014-02-05 21:20:05 -08:00
Mitchell Hashimoto
54f4cffc00 providers/virtualbox: export after checking if package exists [GH-2380] 2013-12-31 08:45:56 -08:00
Mitchell Hashimoto
c1141dded3 providers/virtualbox: don't clear /etc/exports on BSDs for NFS [GH-2645] 2013-12-13 22:03:14 -08:00
Mitchell Hashimoto
55931d507e Merge branch 'nfs-sync-folder-cleanup' of https://github.com/emyl/vagrant into emyl-nfs-sync-folder-cleanup
Conflicts:
	plugins/providers/virtualbox/action.rb
2013-12-06 15:06:34 -08:00
Mitchell Hashimoto
b65462faf1 providers/virtualbox: resume should wait for boot 2013-12-06 13:21:07 -08:00
Emiliano Ticci
07bbca426e NFS/VBox: remove dedicated cleanup action in favour of native routine. 2013-12-04 12:29:09 +01:00
Emiliano Ticci
c95fc4e27c VirtualBox shared folders: remove dedicated cleanup action in favour of native routine. 2013-12-04 12:22:01 +01:00
Mitchell Hashimoto
832a5ef70b providers/virtualbox: clean up synced folders on destroy 2013-12-03 18:44:37 -08:00
Emiliano Ticci
578393ac8e Add cleanup routine to synced folder plugin implementation 2013-12-02 11:19:09 +01:00
Mitchell Hashimoto
0b9861db7d providers/virtualbox: fix broken NFS check 2013-11-22 17:29:35 -08:00
Mitchell Hashimoto
35ac7da5a0 providers/virtualbox: don't use NFS middleware anymore 2013-11-22 17:13:53 -08:00
Mitchell Hashimoto
9d3818a380 providers/virtualbox: use new SyncedFolders middleware 2013-11-22 16:21:14 -08:00