Vagrant Environment Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
=Internal=
=Internal=
* [[Vagrant_Concepts#Environment_Operations|Vagrant Concepts - Environment]]
* [[Vagrant_Concepts#Environment_Operations|Vagrant Concepts]]
* [[Vagrant Operations#Environment Operations|Vagrant Operations]]
* [[Vagrant Operations#Environment Operations|Vagrant Operations]]


=Operations=
=Operations=
==init==
{{External|https://www.vagrantup.com/docs/cli/init.html}}
This command initializes the current directory to be a Vagrant [[Vagrant_Concepts#Environment|environment]] by creating an initial [[Vagrantfile]] if one does not already exist.
vagrant init


==global-status==
==global-status==
{{External|https://www.vagrantup.com/docs/cli/global-status.html}}


  vagrant global-status
  vagrant global-status
Line 13: Line 22:
<syntaxhighlight lang='text'>
<syntaxhighlight lang='text'>
id      name        provider state  directory
id      name        provider state  directory
--------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------
1a4c3f3  blue     aws   running /Users/ovidiufeodorov/tmp/blue
1a4c3f3  blue         aws     running /Users/ovidiufeodorov/tmp/blue
266ef17  red aws   running /Users/ovidiufeodorov/tmp/red
266ef17  red         aws     running /Users/ovidiufeodorov/tmp/red
</syntaxhighlight>
</syntaxhighlight>
The command does not actively verify the state of machines, it is instead based on a cache, so you may see stale results.
To refresh the cache:
vagrant global-status --prune

Latest revision as of 19:59, 17 November 2019

External

Internal

Operations

init

https://www.vagrantup.com/docs/cli/init.html

This command initializes the current directory to be a Vagrant environment by creating an initial Vagrantfile if one does not already exist.

vagrant init

global-status

https://www.vagrantup.com/docs/cli/global-status.html
vagrant global-status

This command tells the state of all active Vagrant environments for the currently logged in user:

id       name         provider state   directory
------------------------------------------------------------------------
1a4c3f3  blue         aws      running /Users/ovidiufeodorov/tmp/blue
266ef17  red          aws      running /Users/ovidiufeodorov/tmp/red

The command does not actively verify the state of machines, it is instead based on a cache, so you may see stale results.

To refresh the cache:

vagrant global-status --prune