vagrant global-status --pruneでゾンビ仮想マシンを削除する
vagrant global-status は、存在しない仮想マシンを表示してしまうことがある。
$ vagrant global-status
id name provider state directory
-------------------------------------------------------------------------
55f191d default virtualbox poweroff /Users/DQNEO/hoge/kitchen
8486738 default virtualbox running /Users/DQNEO/hoge/kitchen2
2aa592d default virtualbox running /private/tmp/chef-repo
97b443d default virtualbox poweroff /Users/DQNEO/vagrants/emacs
4a39c61 default virtualbox poweroff /Users/DQNEO/vagrants/hhvm
e440391 default virtualbox running /Users/DQNEO/vagrants/kqui-kitchen
The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date. To interact with any of the machines, you can go to
that directory and run Vagrant, or you can use the ID directly
with Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"
仮想マシンが6個も表示されていますが、本当はこのうち3個はサクジョ済みなので実在しないのです。
vagrant global-status --pruneでゴミ掃除
$ vagrant global-status --prune
/Users/DQNEO/vagrants/hhvm/Vagrantfile:5: warning: already initialized constant VAGRANTFILE_API_VERSION
/Users/DQNEO/hoge/kitchen2/Vagrantfile:5: warning: previous definition of VAGRANTFILE_API_VERSION was here
/Users/DQNEO/vagrants/kqui-kitchen/Vagrantfile:5: warning: already initialized constant VAGRANTFILE_API_VERSION
/Users/DQNEO/vagrants/hhvm/Vagrantfile:5: warning: previous definition of VAGRANTFILE_API_VERSION was here
id name provider state directory
-------------------------------------------------------------------------
8486738 default virtualbox running /Users/DQNEO/hoge/kitchen2
4a39c61 default virtualbox poweroff /Users/DQNEO/vagrants/hhvm
e440391 default virtualbox running /Users/DQNEO/vagrants/kqui-kitchen
ゾンビマシンが消えて、ちゃんと3個になりました!
カテゴリ:
Vagrant