Code Monkey home page Code Monkey logo

vagrant-azure's Introduction

PSA: Hi vagrant-azure plugin users, we are unable to continue supporting this project, so it is now archived. Even though this project is archived, the existing plugin will still work as it currently does. This should not affect any workflows currently using vagrat-azure.

We know there are many folks who are actively using this plugin but have long suffered from a lack of support in this project. We would like to encourage the community to fork this project and work together to advance and support Vagrant on Azure.

We thank everyone for their support through usage, issues and contributions.

Vagrant Azure Provider

Gem Version

This is a Vagrant 1.7.3+ plugin that adds Microsoft Azure provider to Vagrant, allowing Vagrant to control and provision machines in Microsoft Azure.

Getting Started

Install Vagrant

Create an Azure Active Directory (AAD) Application

AAD encourages the use of Applications / Service Principals for authenticating applications. An application / service principal combination provides a service identity for Vagrant to manage your Azure Subscription. Click here to learn about AAD applications and service principals.

  • Install the Azure CLI
  • run az login to log into Azure
  • run az ad sp create-for-rbac to create an Azure Active Directory Application with access to Azure Resource Manager for the current Azure Subscription
    • If you want to run this for a different Azure Subscription, run az account set --subscription 'your subscription name'
  • run az account list --query "[?isDefault].id" -o tsv to get your Azure Subscription Id.

The output of az ad sp create-for-rbac should look like the following:

{
  "appId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "displayName": "some-display-name",
  "name": "http://azure-cli-2017-04-03-15-30-52",
  "password": "XXXXXXXXXXXXXXXXXXXX",
  "tenant": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}

The values tenant, appId and password map to the configuration values azure.tenant_id, azure.client_id and azure.client_secret in your Vagrant file or environment variables.

For *nix, edit your Vagrantfile as shown below and provide all the values as explained.

Create a Vagrantfile

Create a directory and add the Linux or Windows Vagrantfile content below to a file named Vagrantfile.

Linux Vagrantfile

Vagrant.configure('2') do |config|
  config.vm.box = 'azure'

  # use local ssh key to connect to remote vagrant box
  config.ssh.private_key_path = '~/.ssh/id_rsa'
  config.vm.provider :azure do |azure, override|

    # each of the below values will default to use the env vars named as below if not specified explicitly
    azure.tenant_id = ENV['AZURE_TENANT_ID']
    azure.client_id = ENV['AZURE_CLIENT_ID']
    azure.client_secret = ENV['AZURE_CLIENT_SECRET']
    azure.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']
  end

end

Windows Vagrantfile

Vagrant.configure('2') do |config|
  config.vm.box = 'azure'

  config.vm.provider :azure do |azure, override|

    # each of the below values will default to use the env vars named as below if not specified explicitly
    azure.tenant_id = ENV['AZURE_TENANT_ID']
    azure.client_id = ENV['AZURE_CLIENT_ID']
    azure.client_secret = ENV['AZURE_CLIENT_SECRET']
    azure.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']

    azure.vm_image_urn = 'MicrosoftSQLServer:SQL2016-WS2012R2:Express:latest'
    azure.instance_ready_timeout = 600
    azure.vm_password = 'TopSecretPassw0rd'
    azure.admin_username = "OctoAdmin"
    override.winrm.transport = :ssl
    override.winrm.port = 5986
    override.winrm.ssl_peer_verification = false # must be false if using a self signed cert
  end

end

Spin Up a Box in Azure

Install the vagrant-azure plugin using the standard Vagrant 1.1+ installation methods. After installing the plugin, you can vagrant up and use azure provider. For example:

$ vagrant box add azure https://github.com/azure/vagrant-azure/raw/v2.0/dummy.box --provider azure
$ vagrant plugin install vagrant-azure
$ vagrant up --provider=azure

This will bring up an Azure VM as per the configuration options set above.

You can now either SSH (if its a *Nix VM) using vagrant ssh, RDP (if its a Windows VM) using vagrant rdp or PowerShell vagrant powershell.

Normally, a lot of the options, e.g., vm_image_urn, will be embedded in a box file and you just have to provide minimal options in the Vagrantfile. Since, we're using a dummy box, there are no pre-configured defaults.

Configuration

The vagrant-azure provide exposes Azure specific configuration options:

Mandatory Parameters

  • tenant_id: Your Azure Active Directory Tenant Id.
  • client_id: Your Azure Active Directory application client id.
  • client_secret: Your Azure Active Directory application client secret.
  • subscription_id: The Azure subscription Id you'd like to use. Note: to procure these values see: Create an Azure Active Directory Application

Optional VM Parameters

  • vm_name: Name of the virtual machine
  • vm_password: (Optional for *nix) Password for the VM -- This is not recommended for *nix deployments
  • vm_size: VM size to be used -- defaults to 'Standard_DS2_v2'. See sizes for *nix, Windows.
  • admin_username: The root/administrator username for the VM

Optional VM Image Parameters

vm_image_urn, vm_vhd_uri, and vm_managed_image_id are mutually exclusive. They should not be used in combination.

  • vm_image_urn: Name of the virtual machine image urn to use -- defaults to 'canonical:ubuntuserver:16.04-LTS:latest'. See documentation for *nix, Windows.
  • vm_vhd_uri: URI to the custom VHD. If the VHD is not publicly accessible, provide a SAS token in the URI.
    • vm_operating_system: (Mandatory) Must provide the OS if using a custom image ("Linux" or "Windows")
    • vm_vhd_storage_account_id: (Manditory) The Storage Account Azure Resource Manager Id where the OS Image is stored (like: /subscriptions/{subscription id}/resourceGroups/{resource group}/providers/Microsoft.Storage/storageAccounts/{account name}).
  • vm_managed_image_id: Create a VM from a generalized VM that is stored as either a managed or unmanaged disk. See: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource

Optional VM Data Disk Parameters (Preview)

The data disk functionality is preview and may change before the 2.0 release.

override.data_disks = [
    # sample of creating empty data disk
    {
      name: "mydatadisk1", 
      size_gb: 30
    }
]

Optional Networking Parameters

  • virtual_network_name: (Optional) Name of the virtual network resource
  • dns_name: (Optional) DNS Label Prefix
  • nsg_name: (Optional) Network Security Group Label Prefix
  • subnet_name: (Optional) Name of the virtual network subnet resource
  • tcp_endpoints: (Optional) The custom inbound security rules part of network security group (a.k.a. opened tcp endpoints). Allows specifying one or more intervals in the form of:
    • an array ['8000-9000', '9100-9200'],
    • a single interval as '8000-9000',
    • a single port as 8000.

Optional Windows Parameters

  • winrm_install_self_signed_cert: (Optional, Windows only) Whether to install a self-signed cert automatically to enable WinRM to communicate over HTTPS (5986). Only available when a custom deployment_template is not supplied. Default 'true'.

Optional Provisioning Parameters

  • instance_ready_timeout: (Optional) The timeout to wait for an instance to become ready -- default 120 seconds.
  • instance_check_interval: (Optional) The interval to wait for checking an instance's state -- default 2 seconds.
  • wait_for_destroy: (Optional) Wait for all resources to be deleted prior to completing Vagrant destroy -- default false.

Optional Azure Parameters

  • endpoint: (Optional) The Azure Management API endpoint -- default ENV['AZURE_MANAGEMENT_ENDPOINT'] if exists, falls back to https://management.azure.com.
  • resource_group_name: (Optional) Name of the resource group to use.
  • location: (Optional) Azure location to build the VM -- defaults to westus

For more information on common scenarios and other features visit the extended documentation.

vagrant-azure's People

Contributors

andyzhangx avatar apestov avatar christopher-hirudayasamy avatar codestothestars avatar codito avatar ddanciu avatar devigned avatar dividedmind avatar eisnerd avatar freedev avatar icarocamelo avatar jamesrenfro avatar joaquincasares avatar kaorimatz avatar kurtzeborn avatar lionelperrin avatar matt-richardson avatar nagwanidheeraj avatar pastcompute avatar ramakrishnan avatar rgardler-msft avatar sai-manoj-kumar avatar savvasramakrishnanvasudevan avatar snesha avatar ssugar avatar vinyar avatar vishrutshah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vagrant-azure's Issues

Loop into ==> default: Looking for 22

Hello again,
When I´m trying to deploy an Windows image with the following lines commented in the vagrantfile:
# azure.ssh_private_key_file = 'PATH TO YOUR KEY FILE'
# azure.ssh_certificate_file = 'PATH TO YOUR CERTIFICATE FILE'

    # 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

The plugin falls into a loop, looking for port TCP 22/SSH port:
==> default: Looking for 22
==> default: Looking for 22
==> default: Looking for 22

It has to test Winrm ports instead SSH ports.

Thanks again.

'ReadyRole' in '360' seconds.

Hello again,
If the provider takes more than 5 minutes to create the instance in Azure, it returns this "error":
==> default: Machine failed to reached state 'ReadyRole' in '360' seconds

and the bootstrap script fails.

In US zone deploy VM is taking arround 8 to 10 minutes.
In the doc is not any var to incrase this timeout, can you include it if it doesn´t exists?

Thanks again.

Compatibility with Azure Pack?

We are experimenting with MS Azure Pack as I was wondering if this would work with an Azure-Pack fronted SCVMM/Hyper-V private cloud as well if the "azure.mgmt_endpoint" is changed to our internal AzurePack URL listening on its default port?

Possible conflict with vagrant-azure spinning up VirtualBox VM

I have tried my first Ubuntu box with vagrant-azure today, thanks for this plugin!
But I have a problem spinning up a local VM with virtualbox provider after installing the vagrant-azure 1.0.5 plugin.

My setup is:

  • Mac Yosemite 10.10.1
  • vagrant 1.6.5
  • VMware Fusion 6.0.5
  • VirtualBox 4.3.20
  • The following vagrant plugins
$ vagrant plugin list
vagrant-azure (1.0.5)
vagrant-multiprovider-snap (0.0.14)
vagrant-cucumber (0.0.8)
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-pristine (0.3.0)
vagrant-serverspec (0.1.0)
vagrant-share (1.1.2, system)
vagrant-vcloud (0.4.3)
vagrant-vmware-fusion (3.1.2)

I have created a simple Vagrantfile for a Windows box and got this error:

$ vagrant up --provider=virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'windows_7'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: win7_default_1418143064904_61689
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 3389 => 3389 (adapter 1)
    default: 22 => 2222 (adapter 1)
    default: 5985 => 55985 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
==> default: Running cleanup tasks for 'shell' provisioner...
/Users/stefan/.vagrant.d/gems/gems/vagrant-azure-1.0.5/lib/vagrant-azure/communication/powershell.rb:24:in `ready?': undefined method `check_winrm' for #<VagrantPlugins::ProviderVirtualBox::Driver::Meta:0x000001029d2f80> (NoMethodError)
    from /Users/stefan/.vagrant.d/gems/gems/vagrant-azure-1.0.5/lib/vagrant-azure/communication/powershell.rb:15:in `wait_for_ready'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'

What makes me wonder is how can the vagrant-azure/communication/powershell.rb be called from vagrant when I want to spin up a box with the virtualbox provider and the default communicators for Vagrant 1.6.x?

The Vagrantfile looks pretty simple:

# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "windows_7"
  config.vm.provider "virtualbox" do |vb|
    vb.gui = true
  end
  config.vm.provision "shell", path: "provision.bat"
end

I am used with the virtualbox, vmware_fusion and vcloud providers, so I thought I just add another cloud provider and get in touch with Azure with vagrant.

Is it possible to use these local providers in parallel with vagrant-azure?
Should I use a special version for this (eg. directly from GitHub)?

I have repeated the vagrant up --provider=virtualbox command and stored the debug log in this gist.

vagrant + azure :: create new virtual machine problem

Hi, Im trying to use vagrant+azure.
I've managed to use vagrant to "power up" an existing machine in the azure environment; but my problem is that I can not create a new virtual box based upon an existing image.

Im using https://github.com/MSOpenTech/vagrant-azure to make the conection between vagrant and azure.

When I run the "vagrant up --provider=azure" command, it ends with an error saying:

"The virtual machine image source is not valid."

The name of the image Im using is an image that I created from a virtual that I'd created using the azure stock librery.

Here is the vagrant file Im using:

-- mode: ruby --

vi: set ft=ruby :

Vagrantfile API/syntax version. Don't touch unless you know what you're doing!

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.box = 'azure2'

config.vm.provider :azure do |azure|
    azure.mgmt_certificate = 'c:\my.pem'
    azure.mgmt_endpoint = 'https://management.core.windows.net'
    azure.subscription_id = '*******-****-****-****************'
    azure.storage_acct_name = '' # optional. A new one will be generated if not provided.

    azure.vm_image = 'HERE_I_WANT_TO_PUT_THE_NAME_OF_THE_IMAGE_I_D_CREATED'
    azure.vm_user = '***' # defaults to 'vagrant' if not provided
    azure.vm_password = '***' # min 8 characters. should contain a lower case letter, an uppercase letter, a number and a special character

    azure.vm_name = 'HERE_I_WANT_TO_PUT_THE_NAME_OF_THE_NEW_VM' 
    azure.cloud_service_name = 'test01jc' # same as vm_name. leave blank to auto-generate
    azure.deployment_name = 'test01jc' # defaults to cloud_service_name
    azure.vm_location = 'East US' # e.g., West US, Este de EE. UU.
    azure.ssh_private_key_file = ''
    azure.ssh_certificate_file = ''

    # Provide the following values if creating a *Nix VM
    azure.ssh_port = ''

    # Provide the following values if creating a Windows VM
    azure.winrm_transport = [ 'http', 'https' ] # this will open up winrm ports on both http (5985) and http (5986) ports
    # azure.winrm_https_port = 'A VALID PUBLIC PORT' # customize the winrm https port, instead of 5986
    # azure.winrm_http_port = 'A VALID PUBLIC PORT' # customize the winrm http port, insted of 5985

    azure.tcp_endpoints = '3389:53389' # opens the Remote Desktop internal port that listens on public port 53389. Without this, you cannot RDP to a Windows VM.
end

config.ssh.username = '***' # the one used to create the VM
config.ssh.password = '***' # the one used to create the VM

end

And this is the command Im using to start everithing up:

vagrant init dumy-box-created
(move to folder and update vagrantfile with the content pasted above)
vagrant up --provider=azure

Please let me know if there is any other information that you keed

Rgds, Jc

BadRequest : Location constraint name is empty or not specified

Vagrant 1.7.2
vagrant-azure (1.1.1)

-- mode: ruby --

vi: set ft=ruby :

Vagrant.configure(2) do |config|
config.vm.box = "azure"

config.vm.provider :azure do |azure|
azure.vm_size = 'ExtraSmall'
azure.mgmt_certificate = '...'
azure.mgmt_endpoint = 'https://management.core.windows.net'
azure.subscription_id = '...'

azure.vm_image = '2b171e93f07c4903bcad35bda10acf22__CoreOS-Stable-522.6.0'                                                                
azure.vm_user = '...'                                                                                                                
azure.vm_password = '...'                                                                                                         
azure.vm_name = 'coreos-node-1'                                                                                                           
azure.cloud_service_name = '...'                                                                                                 
azure.deployment_name = 'coreos-node-1'                                                                                                   

azure.vm_location = 'West Europe'                                                                                                         
azure.ssh_private_key_file = '...'                                                                           
azure.ssh_certificate_file = '...'                                                                           
azure.ssh_port = '...'                                                                                                                   

azure.tcp_endpoints = '80'                                                                                                                

end

config.ssh.username = '...'
config.ssh.password = '...'
end

vagrant up --provider=azure

Creating Storage Account coreosnode1storagezaehc.
BadRequest : Location constraint name is empty or not specified
/home/kamenew/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/core/utility.rb:93:in error_with_exit': BadRequest : Location constraint name is empty or not specified (RuntimeError) from /home/kamenew/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/base_management/management_http_request.rb:81:inwait_for_completion'
from /home/kamenew/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/base_management/management_http_request.rb:55:in call' from /home/kamenew/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/storage_management/storage_management_service.rb:108:increate_storage_account'
from /home/kamenew/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/virtual_machine_management/virtual_machine_management_service.rb:189:in add_role' from /home/kamenew/.vagrant.d/gems/gems/vagrant-azure-1.1.1/lib/vagrant-azure/action/vagrant_azure_service.rb:38:inmethod_missing'
from /home/kamenew/.vagrant.d/gems/gems/vagrant-azure-1.1.1/lib/vagrant-azure/action/run_instance.rb:99:in block in call' from /home/kamenew/.vagrant.d/gems/gems/vagrant-azure-1.1.1/lib/vagrant-azure/action/run_instance.rb:74:insynchronize'
from /home/kamenew/.vagrant.d/gems/gems/vagrant-azure-1.1.1/lib/vagrant-azure/action/run_instance.rb:74:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:95:in block in finalize_action' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in block in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:inbusy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/call.rb:53:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in call' from /home/kamenew/.vagrant.d/gems/gems/vagrant-azure-1.1.1/lib/vagrant-azure/action/os_type.rb:29:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in call' from /home/kamenew/.vagrant.d/gems/gems/vagrant-azure-1.1.1/lib/vagrant-azure/action/connect_azure.rb:44:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/config_validate.rb:25:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/handle_box.rb:56:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in block in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:inbusy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:214:inaction_raw'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:191:in block in action' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:516:inlock'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:inaction'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/batch_action.rb:82:in block (2 levels) in run' from /opt/vagrant/embedded/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:incall'
from /opt/vagrant/embedded/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'

Wiht Multi-Node the Same Disk Is Issued - Error: VHD already exists!

In a multi node setup I run into the issue that all machines create the same disk!? Naming conventions do only include minutes.

They create the disk in the same minute and the automatic naming convention does not distinguish between that. I have to run the multi node setup in --no-parallelwhich takes much longer.

Storage Account xxxxx already exists. Skipped...
Deployment in progress...
# # # # # # BadRequest: The VHD already exists: http://xxxxx.blob.core.windows.net    /vhds/disk_2014_12_06_23_09.vhd==> xxxxx-three: An error occurred. The error will be shown after all tasks complete.
 BadRequest: The VHD already exists: http://xxxxxx.blob.core.windows.net/vhds/disk_2014_12_06_23_09.vhd==> xxxxx-one: An error occurred. The error will be shown after all tasks complete.
 # # # # # succeeded (200)

Would it be possible to have a disk name (prefix/postfix) parameter?

vm_size

Should be updated to include the latest vm sizes...

Azure Certificate Issue

Hello,

I am stuck with an Azure certificate issue & not sure if I have a legitimate issue or if just user error. If this is the wrong "forum" then please just redirect me.

My use case is I have SW running inside Docker containers. I want one Vagrantfile that will let me provision VMs on local PC, AWS & Azure & then start the containers in the new VMs. Right now I have the first two working with Vagrant, but can't seem to get the Azure one working.

I am stuck on a certificate issue... have tried multiple times to generate & rerun, but the console output is cryptic.

C:\Users\jonathan.m.hamilton\Desktop\Docker\Play\Azure>vagrant up --provider=azu
re
C:/Users/jonathan.m.hamilton/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/base_man
agement/base_management_service.rb:48:in `rescue in initialize': Management cert
ificate not valid. Error: Neither PUB key nor PRIV key: nested asn1 error (Runti
meError)
        from C:/Users/jonathan.m.hamilton/.vagrant.d/gems/gems/azure-0.6.4/lib/a
zure/base_management/base_management_service.rb:35:in `initialize'

I ran the following steps... user error or defect? Thanks in advance!

  1. $ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout myPrivateKey.key -out myCert.pem

  2. $ openssl x509 -outform der -in myCert.pem -out myCert.cer

  3. Successfully uploaded myCert.cer to Azure Management Console

  4. Created Vagrantfile (key lines included only)
    Vagrant.configure(2) do |config|
    config.vm.box = 'azure'

    config.vm.provider :azure do |azure|
    azure.mgmt_certificate = 'C:\Users\jonathan.m.hamilton\Desktop\Docker\Play\Azure\myCert.pem'
    azure.private_key_file = 'C:\Users\jonathan.m.hamilton\Desktop\Docker\Play\Azure\myPrivateKey.key'
    azure.certificate_file = 'C:\Users\jonathan.m.hamilton\Desktop\Docker\Play\Azure\myCert.cer'

    end
    end

rsync error. you must have a tty to run sudo

I am running vagrant 1.6.2 on Centos 6.5.
I have following in my vagrantfile.

config.ssh.pty = true
config.vm.synced_folder "/vagrant", "/vagrant", disabled: false

I am getting following error.

sudo: sorry, you must have a tty to run sudo
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

Is there a workaround?

Thanks

Does not work with Vagrant 1.6

Using the plugin with Vagrant 1.6 causes the following error

Bringing machine 'default' up with 'azure' provider...
==> default: HandleBoxUrl middleware is deprecated. Use HandleBox instead.
==> default: This is a bug with the provider. Please contact the creator
==> default: of the provider you use to fix this.
There are errors in the configuration of this machine. Please fix
the following errors and try again:

Windows Azure Provider:
* The following settings shouldn't exist: storage_account_name

plugin install fails on Mac with vagrant

This could easily be due to pilot errors or a screwy set of package installs on my system. Currently, the vagrant-azure plugin won't install into my setup.

lonniev$ vagrant plugin list
chef (11.12.8)
vagrant-aws (0.5.0)
vagrant-hostmanager (1.5.0)
vagrant-librarian-chef (0.2.1)
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.0, system)
vagrant-softlayer (0.3.2)
vagrant-vbguest (0.10.0)
lonniev$ vagrant plugin update
Updating installed plugins...
All plugins are up to date.
lonniev$ vagrant version
Installed Version: 1.6.3
Latest Version: 1.6.3

You're running an up-to-date version of Vagrant!
lonniev$ vagrant plugin install vagrant-azure
Installing the 'vagrant-azure' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing chef (11.10.4), and Bundler cannot continue.
Make sure that `gem install chef -v '11.10.4'` succeeds before bundling.

Explicitly installing the chef gem does not help.

Pass in a virtual network as azure.vm_virtual_network

It looks to me like it's not currently possible to pass in the virtual network name... is that correct? I'm hoping for something like the following:

azure.vm_location = 'West US'
azure.vm_virtual_network_name = 'myExistingVN'

I'm not a Ruby dev, but it looks like editing /vagrant-azure/lib/vagrant-azure/action/run_instance.rb slightly to add the following would be enough.

 options[:vm_virtual_network_name] = config.vm_virtual_network_name unless \
 config.vm_virtual_network_name.nil?

Do you want a pull request for this?

Provide option for setting static ip

Azure allows to set static ip when creating a VM.

The option in azure-cli,
$ azure vm create --help
help: Create a VM
help: Usage: vm create [options] [userName] [password]
help: Options:
// omit
help: -S, --static-ip the static IP address assigned to the virtual machine
// omit

The disk's VHD must be in the same account as the VHD of the source image

Hello,

I'm trying to setup a Debian VM with a image that I've imported, but I got this message:

BadRequest : The disk's VHD must be in the same account as the VHD of the source
image (source account: st635513590758944013.blob.core.windows.net, target accou
nt: nurundevopsstorage.blob.core.windows.net).
Server not created. Error is: BadRequest : The disk's VHD must be in the same ac
count as the VHD of the source image (source account: st635513590758944013.blob.
core.windows.net, target account: nurundevopsstorage.blob.core.windows.net).

Do you have some clues about this error?

Thanks!

"Please install the HighLine or Termios libraries to suppress echoed text."

I am attempting to deploy a VM to Azure using the vagrant-azure plugin.

After running 'vagrant up --provider=azure', the process eventually stalls out at a prompt requesting me to enter a password (as shown below)

==> default: Machine reached state ReadyRole
==> default: VM 'saphoazuredemo' has been started
==> default: Waiting for Communication
==> default: Looking for local port 22
==> default: Found port mapping 22 --> 22
Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text.
[email protected]'s password:

Here is my Vagrantfile:

$script= <<SCRIPT
...(script removed for this post)...
SCRIPT
Vagrant.configure('2') do |config|
    config.vm.box = 'azure'

    config.vm.provider :azure do |azure|
        azure.mgmt_certificate = '/path/to/Azure.pem'
        azure.mgmt_endpoint = 'https://management.core.windows.net'
        azure.subscription_id = 'mySubscritionID'
        azure.storage_acct_name = 'demo' # optional. A new one will be generated if not provided.

        azure.vm_image = 'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB'
        azure.vm_user = 'vagrant' # defaults to 'vagrant' if not provided
        azure.vm_password = 'P244w0rd!' # min 8 characters. should contain a lower case letter, an uppercase letter, a number and a special character

        azure.vm_name = 'demo' # max 15 characters. contains letters, number and hyphens. can start with letters and can end with letters and numbers
        azure.cloud_service_name = '' # same as vm_name. leave blank to auto-generate
        azure.deployment_name = 'demo' # defaults to cloud_service_name
        azure.vm_location = 'Central US' # e.g., West US
        # Provide the following values if creating a *Nix VM
        azure.ssh_port = '22'
    end

    config.vm.provision "shell", inline: $script
end

Please advise... This does not occur when trying from a windows machine....

Host must be Windows?

This plugin requires Windows? This is a very limiting factor. It would be much more useful if there was not a dependency on Windows. A few things I see as issues:

  1. Not everyone is using Windows as their development machine, especially for this type of work. As a community, people complain all the time when it is assumed that you are using Linux, so this just seems to be a roadblock in adoption.

  2. When we want to build automation to use vagrant (in a CI system, for example) we might be using Linux as the OS for the build agent.

Chef wont run on windows vms if port 22 not open on endpoint

I was trying to provision a windows machine using vagrant-azure and then run chef_zero afterwards. But, it would not work until I opened port 22 as an endpoint on azure VM. This is despite it being a windows host. Not sure if ruby library that causes issue, but perhaps worth documenting?

Sample amendment to vagrantfile shown on https://github.com/MSOpenTech/vagrant-azure;

azure.tcp_endpoints = '3389:33389,22' #Map guest RDP to 33389 externally and open SSH port, though we shouldn't need that

Error below;

==> default: Running provisioner: chef_zero...
==> default: VM OS: Windows
==> default: Provisioning for Windows
==> default: Looking for WinRM
==> default: Found public port 5986
at depth 0 - 18: self signed certificate
at depth 0 - 18: self signed certificate
==> default: Vagrant does not support detecting whether Chef is installed
==> default: for the guest OS running in the machine. Vagrant will assume it is
==> default: installed and attempt to continue.
INFO machine: Calling action: read_ssh_info on provider Azure (myazuremachin-asdas@myazure-service-baxjf)
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 1 hooks defined.
INFO runner: Running action: #Vagrant::Action::Builder:0x431f7a8
INFO warden: Calling IN action: #Vagrant::Action::Builtin::ConfigValidate:0x460a8e0
INFO warden: Calling IN action: #VagrantPlugins::WinAzure::Action::ConnectAzure:0x460a8c8
INFO warden: Calling IN action: #VagrantPlugins::WinAzure::Action::ReadSSHInfo:0x4644978
INFO interface: info: Looking for local port 22
INFO interface: info: ==> default: Looking for local port 22
==> default: Looking for local port 22
ERROR warden: Error occurred: undefined method `[]' for nil:NilClass

A successful run looks like this;

==> default: Looking for local port 22
==> default: Found port mapping 22 --> 22
==> default: Looking for local port 22
==> default: Found port mapping 22 --> 22
==> default: Looking for local port 22
==> default: Found port mapping 22 --> 22
Generating chef JSON and uploading...
==> default: Looking for WinRM
==> default: Found public port 5986
at depth 0 - 18: self signed certificate
at depth 0 - 18: self signed certificate
==> default: Looking for WinRM
==> default: Found public port 5986
at depth 0 - 18: self signed certificate
at depth 0 - 18: self signed certificate
==> default: Running chef-zero...
==> default: [2015-04-05T09:29:27+00:00] INFO: Starting chef-zero on host localhost, port 8889
etc....

Community Images (VMDepot)

Is it possible to get the support for community images into vagrant-azure? Similar to -o with azure-cli.

create vm, not cloud service

Hi, Im trying to create a virtual machine, not a cluod service; Im leaving blank the azure.clud_service_name, azure.deplyment_name keys in the vagrant file.

if I do so, I get this message:

"ResourceNotFound : The hosted service does not exist."

Rgds, Jc

Error: PKCS12_parse: invalid null pkcs12 pointer

I'm trying to use vagrant from Linux to create and provision a VM, but I can't get it to connect to our azure subscription. I'm using vagrant 1.7.2. I've tested on a clean centos, ubuntu 14.04 and ubuntu 14.10 boxes as it looks to be a openssl issue.

The azure plugin is:
vagrant-azure (1.1.0)

When I use the command "vagrant up --provider=azure", I get the following error:
/home/user/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/base_management/base_management_service.rb:48:in rescue in initialize': Management certificate not valid. Error: PKCS12_parse: invalid null pkcs12 pointer (RuntimeError) from /home/user/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/base_management/base_management_service.rb:35:ininitialize'
from /home/user/.vagrant.d/gems/gems/azure-0.6.4/lib/azure/virtual_machine_management/virtual_machine_management_service.rb:22:in initialize' from /home/user/.vagrant.d/gems/gems/vagrant-azure-1.1.0/lib/vagrant-azure/action/connect_azure.rb:41:innew'
from /home/user/.vagrant.d/gems/gems/vagrant-azure-1.1.0/lib/vagrant-azure/action/connect_azure.rb:41:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/config_validate.rb:25:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:inblock in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:in busy' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:inrun'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:214:in action_raw' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:191:inblock in action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:516:in lock' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:in action' from /home/user/.vagrant.d/gems/gems/vagrant-azure-1.1.0/lib/vagrant-azure/provider.rb:58:instate'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:480:in state' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:141:ininitialize'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:75:in new' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:75:inmachine'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:614:in machine' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:168:inblock in with_target_vms'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:192:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:192:inblock in with_target_vms'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:174:in each' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:174:inwith_target_vms'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/up/command.rb:74:in block in execute' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:277:inblock (2 levels) in batch'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:275:in tap' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:275:inblock in batch'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:274:in synchronize' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:274:inbatch'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/up/command.rb:58:in execute' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/cli.rb:42:inexecute'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:301:in cli' from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/bin/vagrant:174:in'

I'm pretty sure the cert should be valid, I've generated using various instructions found on the web. All produces same result.

Unable to ssh onto centos guest created by azure

I am running vagrant on a centos 6.5 vm residing on azure. I am able to create a vm but unable to log into it using ssh or putty.
I am getting following error.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

Here is a part of debug output.

==> default: Looking for 22
INFO warden: Calling OUT action: #VagrantPlugins::WinAzure::Action::ReadSSHInfo:0x00000003064d90
INFO warden: Calling OUT action: #VagrantPlugins::WinAzure::Action::ConnectAzure:0x00000003023340
INFO warden: Calling OUT action: #Vagrant::Action::Builtin::ConfigValidate:0x00000003023368
INFO ssh: Attempting SSH connnection...
INFO ssh: Attempting to connect to SSH...
INFO ssh: - Host: rk1010.cloudapp.net
INFO ssh: - Port: 22
INFO ssh: - Username: rk1010
INFO ssh: - Password? true
INFO ssh: - Key Path: []
DEBUG ssh: == Net-SSH connection debug-level log START ==
DEBUG ssh: D, [2014-05-22T14:40:16.165926 #62587] DEBUG -- net.ssh.transport.session[3fce303ee598]: establishing connection to rk1010.cloudapp.net:22
D, [2014-05-22T14:40:16.248272 #62587] DEBUG -- net.ssh.transport.session[3fce303ee598]: connection established
I, [2014-05-22T14:40:16.248631 #62587] INFO -- net.ssh.transport.server_version[3fce301ef670]: negotiating protocol version
D, [2014-05-22T14:40:16.300788 #62587] DEBUG -- net.ssh.transport.server_version[3fce301ef670]: remote is SSH-2.0-OpenSSH_5.3' D, [2014-05-22T14:40:16.300949 #62587] DEBUG -- net.ssh.transport.server_version[3fce301ef670]: local isSSH-2.0-Ruby/Net::SSH_2.9.1 x86_64-linux'
D, [2014-05-22T14:40:16.333991 #62587] DEBUG -- tcpsocket[3fce301ef92c]: read 776 bytes
D, [2014-05-22T14:40:16.334255 #62587] DEBUG -- tcpsocket[3fce301ef92c]: received packet nr 0 type 20 len 772
I, [2014-05-22T14:40:16.334435 #62587] INFO -- net.ssh.transport.algorithms[3fce301eeb58]: got KEXINIT from server
I, [2014-05-22T14:40:16.334741 #62587] INFO -- net.ssh.transport.algorithms[3fce301eeb58]: sending KEXINIT
D, [2014-05-22T14:40:16.335098 #62587] DEBUG -- tcpsocket[3fce301ef92c]: queueing packet nr 0 type 20 len 2020
D, [2014-05-22T14:40:16.335216 #62587] DEBUG -- tcpsocket[3fce301ef92c]: sent 2024 bytes
I, [2014-05-22T14:40:16.335280 #62587] INFO -- net.ssh.transport.algorithms[3fce301eeb58]: negotiating algorithms
D, [2014-05-22T14:40:16.335554 #62587] DEBUG -- net.ssh.transport.algorithms[3fce301eeb58]: negotiated:

  • kex: diffie-hellman-group-exchange-sha1
  • host_key: ssh-rsa
  • encryption_server: aes128-cbc
  • encryption_client: aes128-cbc
  • hmac_client: hmac-sha1
  • hmac_server: hmac-sha1
  • compression_client: none
  • compression_server: none
  • language_client:
  • language_server:
    D, [2014-05-22T14:40:16.335615 #62587] DEBUG -- net.ssh.transport.algorithms[3fce301eeb58]: exchanging keys
    D, [2014-05-22T14:40:16.335999 #62587] DEBUG -- tcpsocket[3fce301ef92c]: queueing packet nr 1 type 34 len 20
    D, [2014-05-22T14:40:16.336085 #62587] DEBUG -- tcpsocket[3fce301ef92c]: sent 24 bytes
    D, [2014-05-22T14:40:16.405624 #62587] DEBUG -- tcpsocket[3fce301ef92c]: read 152 bytes
    D, [2014-05-22T14:40:16.405828 #62587] DEBUG -- tcpsocket[3fce301ef92c]: received packet nr 1 type 31 len 148
    D, [2014-05-22T14:40:16.408315 #62587] DEBUG -- tcpsocket[3fce301ef92c]: queueing packet nr 2 type 32 len 140
    D, [2014-05-22T14:40:16.408436 #62587] DEBUG -- tcpsocket[3fce301ef92c]: sent 144 bytes
    D, [2014-05-22T14:40:16.442514 #62587] DEBUG -- tcpsocket[3fce301ef92c]: read 720 bytes
    D, [2014-05-22T14:40:16.442694 #62587] DEBUG -- tcpsocket[3fce301ef92c]: received packet nr 2 type 33 len 700
    D, [2014-05-22T14:40:16.444630 #62587] DEBUG -- tcpsocket[3fce301ef92c]: queueing packet nr 3 type 21 len 20
    D, [2014-05-22T14:40:16.444740 #62587] DEBUG -- tcpsocket[3fce301ef92c]: sent 24 bytes
    D, [2014-05-22T14:40:16.444858 #62587] DEBUG -- tcpsocket[3fce301ef92c]: received packet nr 3 type 21 len 12
    D, [2014-05-22T14:40:16.445387 #62587] DEBUG -- net.ssh.authentication.session[3fce3018219c]: beginning authentication of `rk1010'
    D, [2014-05-22T14:40:16.445609 #62587] DEBUG -- tcpsocket[3fce301ef92c]: queueing packet nr 4 type 5 len 28
    D, [2014-05-22T14:40:16.445682 #62587] DEBUG -- tcpsocket[3fce301ef92c]: sent 52 bytes
    D, [2014-05-22T14:40:16.545342 #62587] DEBUG -- tcpsocket[3fce301ef92c]: read 52 bytes
    D, [2014-05-22T14:40:16.545589 #62587] DEBUG -- tcpsocket[3fce301ef92c]: received packet nr 4 type 6 len 28
    D, [2014-05-22T14:40:16.545751 #62587] DEBUG -- net.ssh.authentication.session[3fce3018219c]: trying none
    D, [2014-05-22T14:40:16.545984 #62587] DEBUG -- tcpsocket[3fce301ef92c]: queueing packet nr 5 type 50 len 44
    D, [2014-05-22T14:40:16.546076 #62587] DEBUG -- tcpsocket[3fce301ef92c]: sent 68 bytes
    D, [2014-05-22T14:40:16.578073 #62587] DEBUG -- tcpsocket[3fce301ef92c]: read 84 bytes
    D, [2014-05-22T14:40:16.578250 #62587] DEBUG -- tcpsocket[3fce301ef92c]: received packet nr 5 type 51 len 60
    D, [2014-05-22T14:40:16.578383 #62587] DEBUG -- net.ssh.authentication.session[3fce3018219c]: allowed methods: publickey,gssapi-keyex,gssapi-with-mic
    D, [2014-05-22T14:40:16.578506 #62587] DEBUG -- net.ssh.authentication.methods.none[3fce30264c54]: none failed
    D, [2014-05-22T14:40:16.578611 #62587] DEBUG -- net.ssh.authentication.session[3fce3018219c]: trying publickey
    D, [2014-05-22T14:40:16.578735 #62587] DEBUG -- net.ssh.authentication.agent[3fce302a9318]: connecting to ssh-agent
    E, [2014-05-22T14:40:16.578835 #62587] ERROR -- net.ssh.authentication.agent[3fce302a9318]: could not connect to ssh-agent
    E, [2014-05-22T14:40:16.578918 #62587] ERROR -- net.ssh.authentication.session[3fce3018219c]: all authorization methods failed (tried none, publickey)

DEBUG ssh: == Net-SSH connection debug-level log END ==
INFO ssh: SSH not up: #<Vagrant::Errors::SSHAuthenticationFailed: SSH authentication failed! This is typically caused by the public/private
keypair for the SSH user not being properly set on the guest VM. Please
verify that the guest VM is setup with the proper public key, and that
the private key path for Vagrant is setup properly as well.>
DEBUG ssh: Checking whether SSH is ready...
INFO machine: Calling action: read_ssh_info on provider Azure (rk1010@rk1010)
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 1 hooks defined.
INFO runner: Running action: #Vagrant::Action::Builder:0x007f9c604f0e58
INFO warden: Calling IN action: #Vagrant::Action::Builtin::ConfigValidate:0x007f9c604f66c8
INFO warden: Calling IN action: #VagrantPlugins::WinAzure::Action::ConnectAzure:0x007f9c604f66a0
INFO warden: Calling IN action: #VagrantPlugins::WinAzure::Action::ReadSSHInfo:0x007f9c60753ee8
INFO interface: info: Looking for 22

Here is my Vagrantfile

VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'azure'
config.vm.provider :azure do |azure|
azure.mgmt_certificate = '/home/rk1005/certs/elasta.pem'
azure.mgmt_endpoint = 'https://management.core.windows.net'
azure.subscription_id = '56d97109-c8d1-42b7-8f68-2106e7dcaca4'
azure.storage_acct_name = 'stgrk1000' # optional. A new one will be generated if not provided.

    azure.vm_image = '0b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.2-x64-v5.8.8.1'
    azure.vm_user = 'rk1010' # defaults to 'vagrant' if not provided
    azure.vm_password = 'XXXXXXXX' # min 8 characters. should contain a lower case letter, an uppercase letter, a number and a special character

    azure.vm_name = 'rk1010' # max 15 characters. contains letters, number and hyphens. can start with letters and can end with letters and numbers
    azure.cloud_service_name = 'rk1010' # same as vm_name. leave blank to auto-generate
    azure.deployment_name = 'rk1010' # defaults to cloud_service_name
    azure.vm_location = 'East US' # e.g., West US
    azure.ssh_private_key_file = '/home/rk1005/certs/rkKey.key'
    azure.ssh_certificate_file = '/home/rk1005/certs/rkCert.cer'
    # Provide the following values if creating a *Nix VM
    azure.ssh_port = '22'
end
config.ssh.username = 'rk1010' # the one used to create the VM
config.ssh.password = 'XXXXXXXX' # the one used to create the VM

end


Can someone help? I am a new to both vagrant and ssh.

Thanks
Ravi

certificat file from OSX

.vagrant.d/gems/gems/azure-0.6.3/lib/azure/base_management/base_management_service.rb:68:invalidate_configuration': Could not read from file '~/.ssh/azure/azure.cer'. (RuntimeError)`

I'm not sure if I'm using the correct command to generate the cert file, so it could be just me.. can't seem to find any links on google to create anything but a .pem file whereas azure says it will only allow me to upload a .cer file.

I've tried:
openssl req -new -x509 -extensions v3_ca -out azure.pem -days 3650

then converted that to a .cer file... also tried the above with just a .cer extension.

undefined local variable or method `auzre' for main:Object

Hi there,
I'm trying to use Vagrant with vagrant-azure on Ubuntu 14.04. Vagrant installed from http://www.vagrantup.com/downloads.
There is also some warning about LibXML, maybe this is a problem?

michal@progresik:~/dev/vagrant_getting_started$ vagrant up --provider=azure
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1
Vagrant failed to initialize at a very early stage:

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: provider config: azure
Message: undefined local variable or method `auzre' for main:Object

My Vagrantfile is like this from Your readme.

BadRequest : The affinity group name is empty or was not specified.

Even with the changes from #47 creating boxes in virtual networks is not working, at least for me. I might be related to the way I setup the VNet and additionally I don't see the option anymore to associate a VNet with a affinity group and from looking at the code it should use the location instead.

This is related to the Azure Ruby SDK here:
https://github.com/MSOpenTech/azure-sdk-for-ruby/blob/master/lib/azure/virtual_machine_management/virtual_machine_management_service.rb#L111-129

BadRequest : The affinity group name is empty or was not specified.
==> box-one: An error occurred. The error will be shown after all tasks complete.
An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.

An error occurred while executing the action on the 'box-one'
machine. Please handle this error then try again:

Server not created. Error is: BadRequest : The affinity group name is empty or was not specified.

An error occurred while executing the action on the 'box-one'
machine. Please handle this error then try again:

Always tries 'Preparing SMB shared folders' even when configured not to do so...

Hello,

I am testing the vagrant-azure plugin but I am running into various issues, including one listed in the subject of this ticket.

Here is a snippet from the output of 'vagrant up --provider=azure 💯

==> default: VM Status: ReadyRole
==> default: Preparing SMB shared folders...
    default: You will be asked for the username and password to use for the SMB
    default: folders shortly. Please use the proper username/password of your
    default: Windows account.
    default:
    default: Username: foo
    default: Password (will be hidden):
==> default: Mounting SMB shared folders...
We couldn't detect an IP address that was routable to this
machine from the guest machine! Please verify networking is properly
setup in the guest machine and that it is able to access this
host.

As another option, you can manually specify an IP for the machine
to mount from using the `smb_host` option to the synced folder.

And here is the Vagrantfile I am using:

Vagrant.configure('2') do |config|
    config.vm.box = 'azure'

    config.vm.provider :azure do |azure|
        azure.mgmt_certificate = 'pathTo\VagrantAzure.pem'
        azure.mgmt_endpoint = 'https://management.core.windows.net'
        azure.subscription_id = 'xxxxxxxxxxxxxxxxxx'
        azure.storage_acct_name = 'azuredemo' # optional. A new one will be generated if not provided.

        azure.vm_image = 'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB'
        azure.vm_user = 'vagrant' # defaults to 'vagrant' if not provided
        azure.vm_password = 'P244w0rd!' # min 8 characters. should contain a lower case letter, an uppercase letter, a number and a special character

        azure.vm_name = 'azuredemo' # max 15 characters. contains letters, number and hyphens. can start with letters and can end with letters and numbers
        azure.cloud_service_name = '' # same as vm_name. leave blank to auto-generate
        azure.deployment_name = 'azuredemo' # defaults to cloud_service_name
        azure.vm_location = 'Central US' # e.g., West US
        # Provide the following values if creating a *Nix VM
        azure.ssh_port = '22'
    end
    config.vm.provision "shell", inline: $script
    config.ssh.username = 'vagrant' # the one used to create the VM
    config.ssh.password = 'P244w0rd!' # the one used to create the VM
end

Please advise as to how we can prevent the attempting of SMB mounts. Thank you...

Failed to create instance

I have two azure accounts, but one account always failed to create instance.

The error log:

 INFO global: Vagrant version: 1.6.5
 INFO global: Ruby version: 2.0.0
 INFO global: RubyGems version: 2.0.14
 INFO global: VAGRANT_DEFAULT_PROVIDER="parallels"
 INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant"
 INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
 INFO global: VAGRANT_INSTALLER_VERSION="2"
 INFO global: VAGRANT_DETECTED_OS="Darwin"
 INFO global: VAGRANT_INSTALLER_ENV="1"
 INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
 INFO global: VAGRANT_LOG="debug"
 INFO global: Plugins:
 INFO global:   - json = 1.8.1
 INFO global:   - mime-types = 1.25.1
 INFO global:   - mini_portile = 0.6.0
 INFO global:   - nokogiri = 1.6.3.1
 INFO global:   - systemu = 2.6.4
 INFO global:   - macaddr = 1.7.1
 INFO global:   - uuid = 2.3.7
 INFO global:   - azure = 0.6.3
 INFO global:   - bundler = 1.6.6
 INFO global:   - rdoc = 4.1.2
 INFO global:   - rest-client = 1.6.8
 INFO global:   - vagrant-azure = 1.0.5
 INFO global:   - vagrant-login = 1.0.1
 INFO global:   - vagrant-parallels = 1.3.4
 INFO global:   - vagrant-share = 1.1.2
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/box/plugin.rb
 INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/destroy/plugin.rb
 INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/global-status/plugin.rb
 INFO manager: Registered plugin: global-status command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/halt/plugin.rb
 INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/help/plugin.rb
 INFO manager: Registered plugin: help command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/init/plugin.rb
 INFO manager: Registered plugin: init command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/list-commands/plugin.rb
 INFO manager: Registered plugin: list-commands command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/package/plugin.rb
 INFO manager: Registered plugin: package command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin/plugin.rb
 INFO manager: Registered plugin: plugin command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/provision/plugin.rb
 INFO manager: Registered plugin: provision command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/rdp/plugin.rb
 INFO manager: Registered plugin: rdp command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/reload/plugin.rb
 INFO manager: Registered plugin: reload command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/resume/plugin.rb
 INFO manager: Registered plugin: resume command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/ssh/plugin.rb
 INFO manager: Registered plugin: ssh command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/ssh_config/plugin.rb
 INFO manager: Registered plugin: ssh-config command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/status/plugin.rb
 INFO manager: Registered plugin: status command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/suspend/plugin.rb
 INFO manager: Registered plugin: suspend command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/up/plugin.rb
 INFO manager: Registered plugin: up command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/version/plugin.rb
 INFO manager: Registered plugin: version command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/communicators/ssh/plugin.rb
 INFO manager: Registered plugin: ssh communicator
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/communicators/winrm/plugin.rb
 INFO manager: Registered plugin: winrm communicator
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/arch/plugin.rb
 INFO manager: Registered plugin: Arch guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/coreos/plugin.rb
 INFO manager: Registered plugin: CoreOS guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/darwin/plugin.rb
 INFO manager: Registered plugin: Darwin guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/debian/plugin.rb
 INFO manager: Registered plugin: Debian guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/esxi/plugin.rb
 INFO manager: Registered plugin: ESXi guest.
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/fedora/plugin.rb
 INFO manager: Registered plugin: Fedora guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/freebsd/plugin.rb
 INFO manager: Registered plugin: FreeBSD guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/funtoo/plugin.rb
 INFO manager: Registered plugin: Funtoo guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/gentoo/plugin.rb
 INFO manager: Registered plugin: Gentoo guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/linux/plugin.rb
 INFO manager: Registered plugin: Linux guest.
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/mint/plugin.rb
 INFO manager: Registered plugin: Mint guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/netbsd/plugin.rb
 INFO manager: Registered plugin: NetBSD guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/nixos/plugin.rb
 INFO manager: Registered plugin: NixOS guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/omnios/plugin.rb
 INFO manager: Registered plugin: OmniOS guest.
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/openbsd/plugin.rb
 INFO manager: Registered plugin: OpenBSD guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/pld/plugin.rb
 INFO manager: Registered plugin: PLD Linux guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/redhat/plugin.rb
 INFO manager: Registered plugin: RedHat guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/smartos/plugin.rb
 INFO manager: Registered plugin: SmartOS guest.
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/solaris/plugin.rb
 INFO manager: Registered plugin: Solaris guest.
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/solaris11/plugin.rb
 INFO manager: Registered plugin: Solaris 11 guest.
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/suse/plugin.rb
 INFO manager: Registered plugin: SUSE guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/tinycore/plugin.rb
 INFO manager: Registered plugin: TinyCore Linux guest.
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/ubuntu/plugin.rb
 INFO manager: Registered plugin: Ubuntu guest
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/windows/plugin.rb
 INFO manager: Registered plugin: Windows guest.
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/arch/plugin.rb
 INFO manager: Registered plugin: Arch host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/bsd/plugin.rb
 INFO manager: Registered plugin: BSD host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/darwin/plugin.rb
 INFO manager: Registered plugin: Mac OS X host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/freebsd/plugin.rb
 INFO manager: Registered plugin: FreeBSD host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/gentoo/plugin.rb
 INFO manager: Registered plugin: Gentoo host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/linux/plugin.rb
 INFO manager: Registered plugin: Linux host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/null/plugin.rb
 INFO manager: Registered plugin: null host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/opensuse/plugin.rb
 INFO manager: Registered plugin: OpenSUSE host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/redhat/plugin.rb
 INFO manager: Registered plugin: Red Hat host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/slackware/plugin.rb
 INFO manager: Registered plugin: Slackware host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/hosts/windows/plugin.rb
 INFO manager: Registered plugin: Windows host
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/kernel_v1/plugin.rb
 INFO manager: Registered plugin: kernel
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/kernel_v2/plugin.rb
 INFO manager: Registered plugin: kernel
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/providers/docker/plugin.rb
 INFO manager: Registered plugin: docker-provider
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/providers/hyperv/plugin.rb
 INFO manager: Registered plugin: Hyper-V provider
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/providers/virtualbox/plugin.rb
 INFO manager: Registered plugin: VirtualBox provider
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/provisioners/ansible/plugin.rb
 INFO manager: Registered plugin: ansible
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/provisioners/cfengine/plugin.rb
 INFO manager: Registered plugin: CFEngine Provisioner
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/provisioners/chef/plugin.rb
 INFO manager: Registered plugin: chef
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/provisioners/docker/plugin.rb
 INFO manager: Registered plugin: docker
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/provisioners/file/plugin.rb
 INFO manager: Registered plugin: file
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/provisioners/puppet/plugin.rb
 INFO manager: Registered plugin: puppet
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/provisioners/salt/plugin.rb
 INFO manager: Registered plugin: salt
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/provisioners/shell/plugin.rb
 INFO manager: Registered plugin: shell
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/synced_folders/nfs/plugin.rb
 INFO manager: Registered plugin: NFS synced folders
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/synced_folders/rsync/plugin.rb
 INFO manager: Registered plugin: RSync synced folders
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/synced_folders/smb/plugin.rb
 INFO manager: Registered plugin: SMB synced folders
 INFO global: Loading plugins!
 INFO manager: Registered plugin: vagrant-login
 INFO manager: Registered plugin: vagrant-share
 INFO manager: Registered plugin: vagrant-parallels
 INFO manager: Registered plugin: azure
 INFO vagrant: `vagrant` invoked: ["up", "--provider=azure", "--debug"]
DEBUG vagrant: Creating Vagrant environment
 INFO environment: Environment initialized (#<Vagrant::Environment:0x00000101876de0>)
 INFO environment:   - cwd: /Users/study/Dropbox/code_mbpr/vagrant/rtb-spark
 INFO environment: Home path: /Users/study/.vagrant.d
 INFO environment: Local data path: /Users/study/Dropbox/code_mbpr/vagrant/rtb-spark/.vagrant
DEBUG environment: Creating: /Users/study/Dropbox/code_mbpr/vagrant/rtb-spark/.vagrant
 INFO environment: Running hook: environment_plugins_loaded
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x000001009e11e0>
 INFO environment: Running hook: environment_load
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000100aebe28>
 INFO cli: CLI: [] "up" ["--provider=azure"]
DEBUG cli: Invoking command class: VagrantPlugins::CommandUp::Command ["--provider=azure"]
DEBUG command: 'Up' each target VM...
 INFO loader: Set :root = #<Pathname:/Users/study/Dropbox/code_mbpr/vagrant/rtb-spark/Vagrantfile>
DEBUG loader: Populating proc cache for #<Pathname:/Users/study/Dropbox/code_mbpr/vagrant/rtb-spark/Vagrantfile>
DEBUG loader: Load procs for pathname: /Users/study/Dropbox/code_mbpr/vagrant/rtb-spark/Vagrantfile
 INFO loader: Loading configuration in order: [:home, :root]
DEBUG loader: Loading from: root (evaluating)
DEBUG loader: Configuration loaded successfully, finalizing and returning
DEBUG command: Getting target VMs for command. Arguments:
DEBUG command:  -- names: ["default"]
DEBUG command:  -- options: {:provider=>"azure"}
DEBUG command: Finding machine that match name: default
 INFO environment: Getting machine: default (azure)
 INFO environment: Uncached load of machine.
 INFO loader: Set "2160157660_machine_default" = []
 INFO loader: Loading configuration in order: [:home, :root, "2160157660_machine_default"]
DEBUG loader: Loading from: root (cache)
DEBUG loader: Configuration loaded successfully, finalizing and returning
 INFO box_collection: Box found: azure (azure)
 INFO loader: Set :"2157216420_azure_azure" = #<Pathname:/Users/study/.vagrant.d/boxes/azure/0/azure/Vagrantfile>
DEBUG loader: Populating proc cache for #<Pathname:/Users/study/.vagrant.d/boxes/azure/0/azure/Vagrantfile>
DEBUG loader: Load procs for pathname: /Users/study/.vagrant.d/boxes/azure/0/azure/Vagrantfile
 INFO loader: Loading configuration in order: [:"2157216420_azure_azure", :home, :root, "2160157660_machine_default"]
DEBUG loader: Loading from: 2157216420_azure_azure (evaluating)
DEBUG loader: Loading from: root (cache)
DEBUG loader: Configuration loaded successfully, finalizing and returning
 INFO machine: Initializing machine: default
 INFO machine:   - Provider: VagrantPlugins::WinAzure::Provider
 INFO machine:   - Box: #<Vagrant::Box:0x00000100ae3ac0>
 INFO machine:   - Data dir: /Users/study/Dropbox/code_mbpr/vagrant/rtb-spark/.vagrant/machines/default/azure
 INFO command: With machine: default (#<VagrantPlugins::WinAzure::Provider:0x000001010c0880 @machine=#<Vagrant::Machine: default (VagrantPlugins::WinAzure::Provider)>, @driver=#<VagrantPlugins::WinAzure::Driver:0x000001008641f0 @id=nil, @machine=#<Vagrant::Machine: default (VagrantPlugins::WinAzure::Provider)>>, @cap_logger=#<Log4r::Logger:0x0000010086d7c8 @fullname="vagrant::capability_host::vagrantplugins::winazure::provider", @outputters=[], @additive=true, @name="provider", @path="vagrant::capability_host::vagrantplugins::winazure", @parent=#<Log4r::Logger:0x00000101857238 @fullname="vagrant", @outputters=[#<Log4r::StderrOutputter:0x0000010182ebd0 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x0000010182eb58>, @name="stderr", @level=0, @formatter=#<Log4r::DefaultFormatter:0x0000010126be28 @depth=7>, @out=#<IO:<STDERR>>>], @additive=true, @name="vagrant", @path="", @parent=#<Log4r::RootLogger:0x00000101857120 @level=0, @outputters=[]>, @level=1, @trace=false>, @level=1, @trace=false>, @cap_host_chain=[[:azure, #<#<Class:0x0000010086f028>:0x000001008f5d30>]], @cap_args=[#<Vagrant::Machine: default (VagrantPlugins::WinAzure::Provider)>], @cap_caps={:docker=>#<Vagrant::Registry:0x0000010086ea88 @items={:public_address=>#<Proc:0x00000101298fb8@/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/providers/docker/plugin.rb:54>}, @results_cache={}>, :hyperv=>#<Vagrant::Registry:0x0000010086e718 @items={:public_address=>#<Proc:0x00000100854098@/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/providers/hyperv/plugin.rb:25>}, @results_cache={}>, :virtualbox=>#<Vagrant::Registry:0x0000010086e290 @items={:forwarded_ports=>#<Proc:0x00000101865cc0@/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/providers/virtualbox/plugin.rb:27>, :nic_mac_addresses=>#<Proc:0x00000101865bf8@/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/providers/virtualbox/plugin.rb:32>, :public_address=>#<Proc:0x0000010109ea00@/Users/study/.vagrant.d/gems/gems/vagrant-share-1.1.2/lib/vagrant-share.rb:39>}, @results_cache={}>, :parallels=>#<Vagrant::Registry:0x0000010086dde0 @items={:public_address=>#<Proc:0x000001010c3a30@/Users/study/.vagrant.d/gems/gems/vagrant-parallels-1.3.4/lib/vagrant-parallels/plugin.rb:63>, :host_address=>#<Proc:0x000001010c3918@/Users/study/.vagrant.d/gems/gems/vagrant-parallels-1.3.4/lib/vagrant-parallels/plugin.rb:68>, :nic_mac_addresses=>#<Proc:0x000001010c38f0@/Users/study/.vagrant.d/gems/gems/vagrant-parallels-1.3.4/lib/vagrant-parallels/plugin.rb:73>}, @results_cache={}>}>)
 INFO interface: info: Bringing machine 'default' up with 'azure' provider...
Bringing machine 'default' up with 'azure' provider...
 INFO batch_action: Enabling parallelization by default.
 INFO batch_action: Disabling parallelization because only executing one action
 INFO batch_action: Batch action will parallelize: false
 INFO batch_action: Starting action: #<Vagrant::Machine:0x000001009cbc00> up {:destroy_on_error=>true, :parallel=>true, :provision_ignore_sentinel=>false, :provision_types=>nil, :provider=>"azure"}
 INFO machine: Calling action: up on provider Azure (new)
DEBUG environment: Attempting to acquire process-lock: machine-action-fd06b418a8fb617cb13d62cf2a40591f
DEBUG environment: Attempting to acquire process-lock: dotlock
 INFO environment: Acquired process lock: dotlock
 INFO environment: Released process lock: dotlock
 INFO environment: Acquired process lock: machine-action-fd06b418a8fb617cb13d62cf2a40591f
 INFO host: Autodetecting host type for [#<Vagrant::Environment: /Users/study/Dropbox/code_mbpr/vagrant/rtb-spark>]
DEBUG host: Trying: arch
DEBUG host: Trying: darwin
 INFO host: Detected: darwin!
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x0000010086f050>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::HandleBox:0x00000100bf49a0>
 INFO handle_box: Machine already has box. HandleBox will not run.
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000100b4d998>
 INFO warden: Calling IN action: #<VagrantPlugins::WinAzure::Action::ConnectAzure:0x00000100b4d8d0>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::Call:0x000001011f40a8>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000100a19ba8>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::IsState:0x00000100a10ee0>
DEBUG is_state: Checking if machine state is 'NotCreated'
 INFO machine: Calling action: read_state on provider Azure (new)
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x000001011430a0>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::ConfigValidate:0x0000010112b4a0>
 INFO warden: Calling IN action: #<VagrantPlugins::WinAzure::Action::ConnectAzure:0x0000010112b400>
 INFO warden: Calling IN action: #<VagrantPlugins::WinAzure::Action::ReadState:0x000001010202b8>
 INFO machine: New machine ID: "rtb-vagrant-test@study-ea"
 INFO interface: info: Attempting to read state for rtb-vagrant-test in study-ea
 INFO interface: info: ==> default: Attempting to read state for rtb-vagrant-test in study-ea
==> default: Attempting to read state for rtb-vagrant-test in study-ea
 INFO read_state: Machine cannot be found
 INFO machine: New machine ID: nil
 INFO warden: Calling OUT action: #<VagrantPlugins::WinAzure::Action::ReadState:0x000001010202b8>
 INFO warden: Calling OUT action: #<VagrantPlugins::WinAzure::Action::ConnectAzure:0x0000010112b400>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::ConfigValidate:0x0000010112b4a0>
DEBUG is_state: -- Machine state: NotCreated
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::IsState:0x00000100a10ee0>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Warden:0x00000100aea2f8>
 INFO warden: Calling IN action: #<Proc:0x00000100b97d90@/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:94 (lambda)>
 INFO warden: Calling IN action: #<VagrantPlugins::WinAzure::Action::RunInstance:0x00000100aea0f0>
 INFO interface: info: {:vm_name=>"rtb-vagrant-test", :vm_user=>"rtb_admin", :image=>"b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_10-amd64-server-20141022.3-en-us-30GB", :location=>"East Asia"}
 INFO interface: info: ==> default: {:vm_name=>"rtb-vagrant-test", :vm_user=>"rtb_admin", :image=>"b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_10-amd64-server-20141022.3-en-us-30GB", :location=>"East Asia"}
==> default: {:vm_name=>"rtb-vagrant-test", :vm_user=>"rtb_admin", :image=>"b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_10-amd64-server-20141022.3-en-us-30GB", :location=>"East Asia"}
 INFO interface: info: {:cloud_service_name=>"study-ea", :storage_account_name=>"study", :private_key_file=>"key.pem", :certificate_file=>"certificate.pem", :ssh_port=>"22", :vm_size=>"Small"}
 INFO interface: info: ==> default: {:cloud_service_name=>"study-ea", :storage_account_name=>"study", :private_key_file=>"key.pem", :certificate_file=>"certificate.pem", :ssh_port=>"22", :vm_size=>"Small"}
==> default: {:cloud_service_name=>"study-ea", :storage_account_name=>"study", :private_key_file=>"key.pem", :certificate_file=>"certificate.pem", :ssh_port=>"22", :vm_size=>"Small"}
 INFO interface: info: Add Role? - true
 INFO interface: info: ==> default: Add Role? - true
==> default: Add Role? - true
ERROR warden: Error occurred: Server not created. Error is: undefined method `each' for nil:NilClass
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: Server not created. Error is: undefined method `each' for nil:NilClass
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: Server not created. Error is: undefined method `each' for nil:NilClass
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001011f40a8>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Released process lock: machine-action-fd06b418a8fb617cb13d62cf2a40591f
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000101027bd0>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<VagrantPlugins::WinAzure::Errors::ServerNotCreated: Server not created. Error is: undefined method `each' for nil:NilClass>
ERROR vagrant: Server not created. Error is: undefined method `each' for nil:NilClass
ERROR vagrant: /Users/study/.vagrant.d/gems/gems/vagrant-azure-1.0.5/lib/vagrant-azure/action/run_instance.rb:105:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/builder.rb:116:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:66:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:66:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/builtin/call.rb:53:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
/Users/study/.vagrant.d/gems/gems/vagrant-azure-1.0.5/lib/vagrant-azure/action/connect_azure.rb:41:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/builder.rb:116:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:66:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:66:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:196:in `action_raw'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:173:in `block in action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:474:in `lock'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:161:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:161:in `action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
 INFO interface: error: Server not created. Error is: undefined method `each' for nil:NilClass
Server not created. Error is: undefined method `each' for nil:NilClass
 INFO interface: Machine: error-exit ["VagrantPlugins::WinAzure::Errors::ServerNotCreated", "Server not created. Error is: undefined method `each' for nil:NilClass"]

Certificate management

If Iaunch vagrant up --provider=azure using PFX cert as azure.mgmt_certificate I get this error:
C:\Users\olopez\vagrant_getting_started>vagrant up --provider=azure
Bringing machine 'default' up with 'azure' provider...
C:/Users/olopez/.vagrant.d/gems/gems/azure-0.6.3/lib/azure/base_management/base_
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

If I export this certificate with openssl pkcs12 -in vagrant.pfx -out a.pem (with passphrase) it work, but it ask for the passphrase in everycommand submited to Azure (a little bit anoying) if I export the certificate with openssl pkcs12 -in vagrant.pfx -out c.pem -nodes it works.

In the documentation azure.mgmt_certificate is not clear defined, you dont know if you have to fill it with the pem content or with the path to it.

Thanks, good work guys.

warning: already initialized constant VAGRANTFILE_API_VERSION

I keep getting these errors every time I run a vagrant command that interacts with an Azure machine:

/$HOME/.vagrant.d/boxes/azure/0/azure/Vagrantfile:5: warning: already initialized constant VAGRANTFILE_API_VERSION
/$HOME/repos/cornerstone/Vagrantfile:1: warning: previous definition of VAGRANTFILE_API_VERSION was here

It seems to come from the following declaration:
https://github.com/MSOpenTech/vagrant-azure/blob/master/dummy.box#L8

I tried editing the file locally, but it breaks the binary file. I'm also unsure how I would test this locally.

I did, however, confirm that removing line 5 from .vagrant.d/boxes/azure/0/azure/Vagrantfile allowed my vagrant commands to work as intended.

If you were hoping to force version 2, perhaps add a check instead?

Allow specification of virtual network structure (virtual networks and subnets)

#47 requests the ability to specify the virtual network name, but there is also a need to specify subnets as well. The azure ruby sdk supports these operations, but they are not implemented in this project.

We need to think about what it means if the network structures don't already exist and need to be created and if they already exist and have existing resources residing within them.

Please release new version with already added features

We are currently using this plugin heavily and had requested the virtual network addition (thanks for adding that). We were wondering if you could release a new version of this plugin so we could use this feature?

Machine name needs to be lowercase

Vagrant-azure crashes with 'run_instance.rb:104:in call': undefined methodvm_name' for nil:NilClass (NoMethodError)' The VM and cloud service seem to be created, but not useable by vagrant afterward (vagrant status shows the instance as 'not created')

Relevant output and call stack:




INFO interface: info: Add Role? - false
 INFO interface: info: ==> default: Add Role? - false
==> default: Add Role? - false
Creating deploymnent...
Creating cloud service [redacted cloudservicename].
Storage Account [redacted storagegroupname] already exists. Skipped...
Deployment in progress...
# # # # # # succeeded (200)
ERROR warden: Error occurred: undefined method `vm_name' for nil:NilClass
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: undefined method `vm_name' for nil:NilClass
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: undefined method `vm_name' for nil:NilClass
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x7b4e540>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x4c3b288>
C:/Users/username/.vagrant.d/gems/gems/vagrant-azure-1.0.4/lib/vagrant-azure/action/run_instance.rb:104:in `call': undefined method `vm_name' for nil:NilClass (NoMethodError)
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/runner.rb:69:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/runner.rb:69:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/call.rb:51:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/Users/username/.vagrant.d/gems/gems/vagrant-azure-1.0.4/lib/vagrant-azure/action/connect_azure.rb:35:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/Users/username/.vagrant.d/gems/gems/vagrant-berkshelf-2.0.0.rc3/lib/berkshelf/vagrant/action/configure_chef.rb:22:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/Users/username/.vagrant.d/gems/gems/vagrant-berkshelf-2.0.0.rc3/lib/berkshelf/vagrant/action/load_shelf.rb:27:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/Users/username/.vagrant.d/gems/gems/vagrant-berkshelf-2.0.0.rc3/lib/berkshelf/vagrant/action/set_ui.rb:11:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/env_set.rb:19:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/handle_box_url.rb:9:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/runner.rb:69:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/runner.rb:69:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/machine.rb:157:in `action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/batch_action.rb:72:in `block (2 levels) in run'
        from C:/Users/username/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
        from C:/Users/username/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'

vagrant destoy deletes everything it has access to

Hi, when doing a vagrant destroy command to delete the VMs created with vagrant up, what actually happends is that the whole cluster is deleted. This includes other VMs not created by the plugin, cloud services, virt net, and any other linked resource.

It should only delete resources created in the vagrant up command.

Provision with puppet is broken

I use puppet as provision tool and it failed in reference to
lib/vagrant-azure/action/provision.rb that the constant VagrantPlugins::WinAzure::Provisioner is undefined.
I hot patch it local with a simple
require 'vagrant-azure/provisioner/puppet.rb' at the beginning of this file.

I believe following commit could be the reason for this
aca8112#commitcomment-9741851

Could somebody confirm this issue?

cannot rdp into second role with add role enabled

In the current implementation add role works and I could see 2 vms under same cloudservice with a caveat that it cannot rdp into second vm due to the following reason.
We do not allow rdp on the second role on a different port no because of the port conflict with the 1st role if we try to specify 3389 as tcp endpoint for the 2nd role.
image
Proposed solution : We could solve this by allowing rdp on a different port for second role
Another issue inline to this scenario is current implementation errors out and do not allow to add role if we try to change the deployment name as shown in below screenshot.
image

vagrant reload fails when role is deallocated

  1. Do a vagrant up -> create a vm
  2. Do a vagrant halt -> created vm would shutdown and the role becomes deallocated
  3. Try vagrant reload -> command errors out stating operation not allowed on a role that is deallocated.

image

Work around : Do a vagrant up to restart the role.
Expected behavior : vm should restart and the role should be in ready state during reload.

Runs using the same bucket will fail if ran within 1 min from each other

Hello,

When multiple vagrant runs are started within the same minute, all but the first are bound to fail because of how azure names VHDs by default.

The error is:

BadRequest: A lease conflict occurred with the blob http://foo.blob.core.windows.net/vhds/disk_2014_09_04_08_19.vhd.Server not created. Error is: BadRequest: A lease conflict occurred with the blob http://foo.blob.core.windows.net/vhds/disk_2014_09_04_08_19.vhd.

As the generated name differentiates by timestamp with a minute only precision, it's virtually impossible to run multiple vagrant azure instances at the same time.

Is there anything that can be done to work it around?

Release Provisioner Exception Bug Fixes

Hello,

First off, thanks for writing this plugin for Vagrant. It was the deciding factor to start using Azure. 👍

I am using the Chef provisioner from Vagrant, but it is throwing the following exception:

.vagrant.d/gems/gems/vagrant-azure-1.1.1/lib/vagrant-azure/action/provision.rb:28:in run_provisioner': uninitialized constant VagrantPlugins::WinAzure::Provisioner (NameError)`

I looked around the commit history and found a PR that appears to fix this issue. It looks like these commits didn't make into the last release in February.

Would you mind cutting a new release that includes the commits for this bug fix? I am sure you guys already have a plan for the next release, but I just thought I'd give you a nudge. ;)

Thanks again for the great plugin!

How to fill azure.mgmt_certificate var

I am trying to manage the vagrant Azure provider from windows, but in the example isn´t clear what type of certificate is needed (CRT,PFX,CER) and If have to fill azure.mgmt_certificate = 'YOUR AZURE MANAGEMENT CERTIFICATE' var with the path to the certificate o with the cert file content.

Please, can you clarify it?
And can be usefull if you describe into the doc how to make the cert with windows, linux and OSX (this is into this forum)
Thanks :)

chef solo provisioner seems to ignore winrm credentials

chef solo provisioner seems to ignore winrm credentials. Despite having config.winrm,username and password in the Vagrantfile, vagrant provision died:

Cannot bind argument to parameter 'String' because it is an empty string.
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x7711ec0>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x340b0f0>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<VagrantPlugins::HyperV::Errors::PowerShellError: An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: C:\Users\user\.vagrant.d\gems\gems\vagrant-azure-1.0.4\lib\vagrant-azure\scripts\upload_file.ps1
Error:

Cannot bind argument to parameter 'String' because it is an empty string.>
ERROR vagrant: An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please

setting config.ssh.username and password seem to work though.

Upgrade Vagrant Dependency

Current bundler version is 1.7.12 and Vagrant 1.6 has a fix limit to 1.7.0

Building fails:

$ bundle install
Your Gemfile lists the gem vagrant-azure (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Fetching git://github.com/mitchellh/vagrant.git
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    vagrant (>= 0) ruby depends on
      bundler (< 1.7.0, >= 1.5.2) ruby

  Current Bundler version:
    bundler (1.7.12)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.