社内であげた?あげた人いる?って聞いてみたら
「あげるわけないじゃないですか。そんなんで仕事止まったらどうすんすか」
とかいわれたので果敢にあげてみた。
2013/12/13 おっと、問題発生のため追記(下の方)
2013/12/19 1.4.1 が出ていたのでインストールして問題解決された事を確認しました。
果敢にといいつつゲストOS上のUbuntu12(64bit)で実験w
$ vagrant --version Vagrant 1.3.5 $ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.4.0_x86_64.deb $ sudo dpkg -i vagrant_1.4.0_x86_64.deb $ vagrant --version Vagrant 1.4.0
特段問題なく入る。
vagrant-lxc plugin はuninstall/reinstallしろといわれる。
$ vagrant plugin The following plugins were installed with a version of Vagrant that had different versions of underlying components. Because these component versions were changed (which rarely happens), the plugins must be uninstalled and reinstalled. To ensure that all the dependencies are properly updated as well it is _highly recommended_ to do a `vagrant plugin uninstall` prior to reinstalling. This message will not go away until all the plugins below are either uninstalled or uninstalled then reinstalled. The plugins below will not be loaded until they're uninstalled and reinstalled: vagrant-lxc
uninstall/reinstallする。
$ vagrant plungin uninstall vagrant-lxc $ vagrant plugin install vagrant-lxc Installing the 'vagrant-lxc' plugin. This can take a few minutes... Installed the plugin 'vagrant-lxc (0.7.0)'!
問題ない。
起動。
$ vagrant up --provider=lxc Bringing machine 'default' up with 'lxc' provider... [default] Setting up mount entries for shared folders... [default] -- /vagrant [default] Starting container... [default] Waiting for machine to boot. This may take a few minutes... [default] Machine booted and ready! [default] VM already provisioned. Run `vagrant provision` or use `--provision` to force it $ vagrant ssh Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.8.0-33-generic x86_64) * Documentation: https://help.ubuntu.com/ Last login: Thu Dec 12 13:23:06 2013 from x.x.x.x vagrant@hogehoge:~$
問題ない。
新機能として気になっていたMachine Readable Output – Command-Line Interface – Vagrant Documentationを試す。
$ vagrant status --machine-readable 1386855563,default,provider-name,lxc 1386855563,default,state,running 1386855563,default,state-human-short,running 1386855563,default,state-human-long,The VM is running. To stop this VM%!(VAGRANT_COMMA) you can run `vagrant halt` to\nshut it down forcefully%!(VAGRANT_COMMA) or you can run `vagrant suspend` to simply\nsuspend the virtual machine. In either case%!(VAGRANT_COMMA) to restart it again%!(VAGRANT_COMMA)\nsimply run `vagrant up`. $ vagrant status --machine-readable 1386855795,default,provider-name,virtualbox 1386855795,default,state,not_created 1386855795,default,state-human-short,not created 1386855795,default,state-human-long,The environment has not yet been created. Run `vagrant up` to\ncreate the environment. If a machine is not created%!(VAGRANT_COMMA) only the\ndefault provider will be shown. So if a provider is not listed%!(VAGRANT_COMMA)\nthen the machine is not created for that environment. $ vagrant box list --machine-readable 1386855599,,box-name,lxc-centos6.4 1386855599,,box-provider,lxc 1386855599,,box-name,lxc-centos6.4-2013-10-24 1386855599,,box-provider,lxc 1386855599,,box-name,lxc-centos64 1386855599,,box-provider,lxc 1386855599,,box-name,lxc-quantal64
まあまあよい。status時の「not created」を解析しづらくて面倒だったのでこの書式なら問題ない。
が,「box list」時の出力やだなー。一行で「box-name,
ちょっとこの実験用マシンはプラグインが vagrant-lxc しか入っていなかったのでほかのプラグイン入っている状態で再度試しますね。
メインマシンにはこいつらが入っているので、これが動けば個人的には問題ないかなと。
sahara (0.0.15)
vagrant-berkshelf (1.2.0)
vagrant-omnibus (1.1.2)
vagrant-vbguest (0.10.0.pre1)
追記。
メインマシンの MacOSX(Marvericks) で Vagrant 1.3.5 to 1.4.0 チャレンジした。
インストールは「MAC OS X Universal (32 and 64-bit)」をダウンロードして
Vagrant-1.4.0.dmg ダブルクリックしてインストール。
$ vagrant --version Vagrant 1.4.0 $ vagrant plugin list The following plugins were installed with a version of Vagrant that had different versions of underlying components. Because these component versions were changed (which rarely happens), the plugins must be uninstalled and reinstalled. To ensure that all the dependencies are properly updated as well it is _highly recommended_ to do a `vagrant plugin uninstall` prior to reinstalling. This message will not go away until all the plugins below are either uninstalled or uninstalled then reinstalled. The plugins below will not be loaded until they're uninstalled and reinstalled: sahara, vagrant-berkshelf, vagrant-omnibus, vagrant-vbguest sahara (0.0.16) vagrant-berkshelf (1.3.6) vagrant-omnibus (1.1.2) vagrant-vbguest (0.10.0)
プラグインは全部 uninstall/reinstall しなきゃいけないのか。めんどいな。
あ、先ほどとバージョンかわりました。とりあえず1.3.5の状態で全部アップデートかけて
全部気持ちよく最新にしてますよっと。
$ vagrant plugin uninstall sahara $ vagrant plugin uninstall vagrant-berkshelf $ vagrant plugin uninstall vagrant-omnibus $ vagrant plugin uninstall vagrant-vbguest $ vagrant plugin list No plugins installed. Yoshitomo-no-MacBook-Pro:ubuntu yosiwo$ vagrant plugin install sahara Installing the 'sahara' plugin. This can take a few minutes... Installed the plugin 'sahara (0.0.16)'! $ vagrant halt [default] Attempting graceful shutdown of VM... Yoshitomo-no-MacBook-Pro:ubuntu yosiwo$ vagrant plugin install vagrant-vbguest Installing the 'vagrant-vbguest' plugin. This can take a few minutes... Installed the plugin 'vagrant-vbguest (0.10.0)'!
えっと、vagrant-omnibus, vagrant-berkshelf はインストールして遊んだ後は
二度と使ってないのでいいやってことで検証しないで削除したままにします。(苦笑
sahara と vagrant-vbguest の挙動はすべての機能を試した訳ではないのですが
とりあえず問題なく動いているように感じます。
sandbox rollback 動作OK。
vbguestも入っていなければ入れる、入っていれば入れないという動きはしているので特に問題なし。
という訳で Vagrant 1.4.0 ライフを満喫します。
既存のOSを立ち上げているときには気がつかなかったんだけど、新規initしたときや
destroy/upし直したときなどに下記のようなエラーがでた。
[default] Configuring and enabling network interfaces... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! /sbin/ifdown eth1 2> /dev/null Stdout from the command: Stderr from the command:
これはどうもguestが CentOS で、 private_network を設定しているときに出るようである。
config.vm.network :private_network, ip: "192.168.33.xx"
"Configuring and enabling network interfaces" fails with ssh error · Issue #2614 · mitchellh/vagrant
Issueを探ってみるとこれであるようだ。既に解決してcloseされているので 1.4.1 で解決という事になりそうかな。
という訳で private_network を使ってないよーという人やCentOS使ってないねんって人は気にせずあげても大丈夫そうかな。
使っている人は 1.4.1 をまつか、CentOS使わないか、まあ自分でVirtualBoxからネットワーク追加して、
ifconfig書けば問題は無いっすけど、Vagrantになれるとそれすらめんどいのよねー(苦笑
参考にしていただければ!