Wednesday, July 30, 2014

Testing Vagrant Azure provider

Last weekend I tried Vagrant-Azure, it is still a little bit unstable.
First of all, I did some tests with Vagrant and Virtualbox on Windows, following this URL, in this first test everything went fine, no problems.

Later, I wanted to use a Azure as provider and I had to install Vagrant-Azure Plugin
The fun started here, there was a lot of bugs into this software:

It was not clear in the documentation how to fill the variable azure.mgmt_certificate, but here I found a post where this guy was filling it with the PFX, I tried to do it, but it displayed this error:

C:\Users\olopez\vagrant_getting_started>vagrant up --provider=azure
Bringing machine 'default' up with 'azure' provider...
management_service.rb:49:in `rescue in initialize': Management certificate not v
alid. Error: PKCS12_parse: mac verify failure (RuntimeError)
from C:/Users/olopez/.vagrant.d/gems/gems/azure-0.6.3/lib/azure/base_man

After a few minutes I tried to convert the PCKS12 to PEM with passphrase and it worked, but it was asking for the passphrase in every action, so I decided to convert the PFX to PEM without passphrase and it almost worked well, because when it started to provision the virtual machine, the timeout was too short and I had to increase it,  the timeout var was located at line 98 of config.rb as @state_read_timeout = 360 if @state_read_timeout == UNSET_VALUE

The next problem was with Windows Image, it was impossible to me to boot a new Windows image into Azure using Vagrant provider, it fell into a loop looking for port 22 even commenting it into the Vagrantfile as you can see here:

# Provide the following values if creating a *Nix VM
# azure.ssh_port = 'A VALID PUBLIC PORT'
# Provide the following values if creating a Windows VM

On the contrary, Linux Images would work fine, because they had the port 22 listening.

Conclusion, Vagrant-Azure is not mature yet, we will test it again after the summer.

One advice, you can get image name with Azure Powershell using the Get-AzureVMImage

Be patient, because coding a provider is a hard work.

No comments:

Post a Comment