VagrantのアップグレードでVMware providerエラー

最近は主にAnsibleのテスト環境用にVagrantを使用している。Virtual Boxは重い印象があるのでVMにはVMware Fusionを利用している。

playbookの記述が出来上がってくるとそれほど使う機会もないので、Vagrantのアップグレードとか頭になかったので全然してなかった。
バージョンを調べてみたら当然のことながら新しいバージョンがリリースされていたのでアップグレードしてみたところ、次のようなエラーで動かなくなってしまった。

$ vagrant init
An unexpected error occurred while loading the Vagrant VMware
provider. Please contact support with the following
error code: '7'.
Vagrant failed to initialize at a very early stage:

The plugins failed to load properly. The error message given is
shown below.

exit

VMware Fusionをproviderとして使用するプラグインもアップデートが必要なのかと思って、vagrant plugin updateを実行してみたが何も変わらない。

An unexpected error occurred while loading the Vagrant VMware provider · Issue #3299 · mitchellh/vagrant

プラグインのアップデートもないのもおかしいなと思って調べてみたところ、githubのissueが見つかり、そのコメントに「一度バージョンを戻してプラグインをアップデートした後、再度Vagrantをアップグレードすると動くよ」というのが見つかったので、その通りにすると動作するようになった。

今回はバージョン1.7.4から1.8.6にアップグレードしたので、以前のバージョンも配布しているURLから古い方のバージョンである1.7.4のパッケージをダウンロードしてダウングレードを実行。

Vagrant Versions | HashiCorp Releases

vagrant plugin updateを実行してプラグインをアップデートする。今度はちゃんとアップデートができた。

$ vagrant plugin update

Updating installed plugins...
Updated 'vagrant-share' to version '1.1.5'!
Updated 'vagrant-vmware-fusion' to version '4.0.12'!

この状態で再度Vagrantのバージョンを1.8.6をインストールすることで、無事アップグレードが完了した。

$ vagrant -v
Vagrant 1.8.6

$ vagrant init
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.