Monday, August 18, 2014

Vagrant Cheatsheet

Here is a good Vagrant command cheatsheet that some might find helpful if using Vagrant for various tasks. Recently started using Vagrant to help manage my virtualbox instances and it has quickly become one of my favorite tools in my Lab. Many companies like CoreOS are beginning to put their releases into Vagrant files to easily allow users to begin testing or playing with pre-configured environments in a matter of minutes. You can even create your own environment and put it out there for others to use. The cheatsheet is command plus a short description.  Be sure to Check it out. Also check out the Command-Line documentation on Vagrant's site for additional options.



Vagrant Commands: vagrant command options


 vagrant up  - This command is used to create and configure your guest environment/machines based on your Vagrantfile. Also multiple other options can be used.

 vagrant status  - This command is used to check the status of the Vagrant managed machines. 

 vagrant reload  - This command is used to do a complete reload on the Vagrantfile. Use this command anytime you make a change to the Vagrantfile. This command will do the same thing as running a halt command and then running an up command directly after.

 vagrant halt  - Executing this is self-explanatory, bring down the environment Vagrant is managing.

 vagrant suspend  - This command suspends the environment instead of shutting it down. Enables a quicker startup of the environment when brought back up later.

 vagrant resume  - Command is used after putting environment in a suspended state.

 vagrant destroy  - Beware. This command will bring down the environment if running and then destroys all of the resources that were created along with the initial creation.

 vagrant package  - This command is used to package a running virtualbox environment in a re-usable box. 

 vagrant ssh  - SSH into you vagrant running machines.



There are several other commands of course to explore.