LoginSignup
19

More than 5 years have passed since last update.

Vagrantで仮想マシンを停止&破壊&再作成するワンライナー

Last updated at Posted at 2013-10-27
vagrant halt && vagrant destroy -f && vagrant up

ポイント

  • destroyで-f (--force) オプションを付ければY/n 聞かれない。
  • 別途vagrantのchef provision連携機能を設定しておけば、これだけでレシピの新規実行ができるので楽です。

動機

なぜこんなワンライナーを使う必要があるのか?

  • 起動中の状態でvagrant destroyするとうまくいかないことがある
  • vagrant reloadだと/vagrant 共有ディレクトリがマウントされないことがある
  • vagrant haltで1分ほど待たされる
  • vagrant destroyでも数分待たされる
  • 「待ち時間」は1回にしたい

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19