2013-09-03 18:08:28 +00:00
|
|
|
---
|
2017-03-28 01:19:52 +00:00
|
|
|
layout: "intro"
|
2013-09-06 16:50:43 +00:00
|
|
|
page_title: "Teardown - Getting Started"
|
2013-09-03 18:08:28 +00:00
|
|
|
sidebar_current: "gettingstarted-teardown"
|
2016-01-19 18:08:53 +00:00
|
|
|
description: |-
|
|
|
|
We now have a fully functional virtual machine we can use for basic
|
|
|
|
web development. But now let us say it is time to switch gears, maybe work
|
|
|
|
on another project, maybe go out to lunch, or maybe just time to go home.
|
|
|
|
How do we clean up our development environment?
|
2013-09-03 18:08:28 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Teardown
|
|
|
|
|
|
|
|
We now have a fully functional virtual machine we can use for basic
|
2016-01-19 18:08:53 +00:00
|
|
|
web development. But now let us say it is time to switch gears, maybe work
|
2013-09-03 18:08:28 +00:00
|
|
|
on another project, maybe go out to lunch, or maybe just time to go home.
|
|
|
|
How do we clean up our development environment?
|
|
|
|
|
|
|
|
With Vagrant, you _suspend_, _halt_, or _destroy_ the guest machine.
|
|
|
|
Each of these options have pros and cons. Choose the method that works
|
|
|
|
best for you.
|
|
|
|
|
|
|
|
**Suspending** the virtual machine by calling `vagrant suspend` will
|
2016-01-19 18:08:53 +00:00
|
|
|
save the current running state of the machine and stop it. When you are
|
2013-09-03 18:08:28 +00:00
|
|
|
ready to begin working again, just run `vagrant up`, and it will be
|
|
|
|
resumed from where you left off. The main benefit of this method is that it
|
|
|
|
is super fast, usually taking only 5 to 10 seconds to stop and start your
|
|
|
|
work. The downside is that the virtual machine still eats up your disk space,
|
|
|
|
and requires even more disk space to store all the state of the virtual
|
|
|
|
machine RAM on disk.
|
|
|
|
|
2014-12-19 15:38:56 +00:00
|
|
|
**Halting** the virtual machine by calling `vagrant halt` will gracefully
|
|
|
|
shut down the guest operating system and power down the guest machine.
|
2016-01-19 18:08:53 +00:00
|
|
|
You can use `vagrant up` when you are ready to boot it again. The benefit of
|
2014-12-19 15:38:56 +00:00
|
|
|
this method is that it will cleanly shut down your machine, preserving the
|
2014-06-19 02:51:39 +00:00
|
|
|
contents of disk, and allowing it to be cleanly started again. The downside is
|
|
|
|
that it'll take some extra time to start from a cold boot, and the guest machine
|
2013-09-03 18:08:28 +00:00
|
|
|
still consumes disk space.
|
|
|
|
|
2014-12-19 15:38:56 +00:00
|
|
|
**Destroying** the virtual machine by calling `vagrant destroy` will remove
|
|
|
|
all traces of the guest machine from your system. It'll stop the guest machine,
|
2016-01-19 18:08:53 +00:00
|
|
|
power it down, and remove all of the guest hard disks. Again, when you are ready to
|
2014-06-19 02:51:39 +00:00
|
|
|
work again, just issue a `vagrant up`. The benefit of this is that _no cruft_
|
2013-09-03 18:08:28 +00:00
|
|
|
is left on your machine. The disk space and RAM consumed by the guest machine
|
|
|
|
is reclaimed and your host machine is left clean. The downside is that
|
|
|
|
`vagrant up` to get working again will take some extra time since it
|
2016-01-19 18:08:53 +00:00
|
|
|
has to reimport the machine and re-provision it.
|
2014-12-19 15:38:56 +00:00
|
|
|
|
2016-01-19 18:08:53 +00:00
|
|
|
## Next Steps
|
|
|
|
|
|
|
|
You have successfully suspended, halted, and destroyed your virtual environment
|
|
|
|
with Vagrant. Read on to learn how to
|
2017-03-28 01:19:52 +00:00
|
|
|
[rebuild the environment](/intro/getting-started/rebuild.html).
|