vagrant で立ち上げた仮想マシンの停止・再起動・削除

vagrant で立ち上げた仮想マシンの停止・再起動・削除
#05 仮想マシンの停止・再起動・削除
http://dotinstall.com/lessons/basic_vagrant/24105
を参考に
立ち上げた仮想マシンを
停止、終了、再起動、削除していく方法を学習
vagrant up で起動した仮想マシン
が稼働しているという前提
いくつかの操作コマンドがあるのでメモ
status
状態を確認
suspend
スリープ状態にする
resume
スリープからの復帰
halt
仮想マシンの終了
up
仮想マシンの起動
reload
仮想マシンの再起動
destroy
仮想マシンの破棄
では、実践
まず vagrant status
Current VM states:
default running
The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
というように稼働中である running が表示される
vagrant suspend で
[default] Saving VM state and suspending execution…
となり、停止
vagrant up とすれば
[default] VM already created. Booting if it’s not already running…
[default] Resuming suspended VM…
[default] Booting VM…
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
となり、起動する
vagrant resume
の代わりに
vagrant up でもOK
仮想マシンを廃棄するには
vagrant destroy

Are you sure you want to destroy the ‘default’ VM? [Y/N] y
[default] Forcing shutdown of VM…
[default] Destroying VM and associated drives…
となり削除される
稼働中であっても削除される
この削除された結果は
virtualbox にも反映される

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です