vagrant-azure 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +19 -15
  3. data/CHANGELOG.md +24 -24
  4. data/Gemfile +20 -15
  5. data/LICENSE +4 -4
  6. data/README.md +189 -125
  7. data/Rakefile +15 -14
  8. data/lib/vagrant-azure.rb +31 -33
  9. data/lib/vagrant-azure/action.rb +267 -243
  10. data/lib/vagrant-azure/action/connect_azure.rb +49 -46
  11. data/lib/vagrant-azure/action/os_type.rb +34 -0
  12. data/lib/vagrant-azure/action/powershell_run.rb +28 -0
  13. data/lib/vagrant-azure/action/provision.rb +42 -49
  14. data/lib/vagrant-azure/action/rdp.rb +63 -62
  15. data/lib/vagrant-azure/action/read_ssh_info.rb +54 -51
  16. data/lib/vagrant-azure/action/read_state.rb +47 -46
  17. data/lib/vagrant-azure/action/read_winrm_info.rb +57 -0
  18. data/lib/vagrant-azure/action/restart_vm.rb +28 -27
  19. data/lib/vagrant-azure/action/run_instance.rb +123 -115
  20. data/lib/vagrant-azure/action/start_instance.rb +35 -35
  21. data/lib/vagrant-azure/action/stop_instance.rb +42 -38
  22. data/lib/vagrant-azure/action/sync_folders.rb +64 -63
  23. data/lib/vagrant-azure/action/terminate_instance.rb +34 -34
  24. data/lib/vagrant-azure/action/vagrant_azure_service.rb +44 -43
  25. data/lib/vagrant-azure/action/wait_for_communicate.rb +39 -38
  26. data/lib/vagrant-azure/action/wait_for_state.rb +50 -49
  27. data/lib/vagrant-azure/capabilities/winrm.rb +12 -0
  28. data/lib/vagrant-azure/command/powershell.rb +43 -0
  29. data/lib/vagrant-azure/command/rdp.rb +24 -0
  30. data/lib/vagrant-azure/config.rb +158 -147
  31. data/lib/vagrant-azure/driver.rb +48 -84
  32. data/lib/vagrant-azure/errors.rb +28 -27
  33. data/lib/vagrant-azure/monkey_patch/azure.rb +46 -0
  34. data/lib/vagrant-azure/monkey_patch/winrm.rb +77 -0
  35. data/lib/vagrant-azure/plugin.rb +102 -91
  36. data/lib/vagrant-azure/provider.rb +74 -70
  37. data/lib/vagrant-azure/provisioner/chef-solo.rb +178 -177
  38. data/lib/vagrant-azure/provisioner/puppet.rb +116 -115
  39. data/lib/vagrant-azure/version.rb +11 -10
  40. data/locales/en.yml +37 -37
  41. data/templates/provisioners/chef-solo/solo.erb +51 -51
  42. data/vagrant-azure.gemspec +59 -58
  43. metadata +48 -38
  44. data/lib/vagrant-azure/command/rdp/command.rb +0 -21
  45. data/lib/vagrant-azure/communication/powershell.rb +0 -41
  46. data/lib/vagrant-azure/monkey_patch/machine.rb +0 -22
  47. data/lib/vagrant-azure/provisioner/shell.rb +0 -83
  48. data/lib/vagrant-azure/scripts/check_winrm.ps1 +0 -47
  49. data/lib/vagrant-azure/scripts/export_vm.ps1 +0 -31
  50. data/lib/vagrant-azure/scripts/file_sync.ps1 +0 -145
  51. data/lib/vagrant-azure/scripts/host_info.ps1 +0 -25
  52. data/lib/vagrant-azure/scripts/hyperv_manager.ps1 +0 -36
  53. data/lib/vagrant-azure/scripts/run_in_remote.ps1 +0 -32
  54. data/lib/vagrant-azure/scripts/upload_file.ps1 +0 -95
  55. data/lib/vagrant-azure/scripts/utils/create_session.ps1 +0 -34
  56. data/lib/vagrant-azure/scripts/utils/write_messages.ps1 +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ff18ded26dfcf360b2196fefb6bd6bb1087d31c
4
- data.tar.gz: 8c4370e04cef532293974872031134782d7982ad
3
+ metadata.gz: 207488c4092037d099cca2c2a6acf3613fac936f
4
+ data.tar.gz: 6f59f1b3f44b4a85efff3054008d3d76a1acf44e
5
5
  SHA512:
6
- metadata.gz: 6e7ab67815f88b544c06adf06e628ee8b313d3b56d59485e37715ead164d1e46e623116f5e5652beb2f97f99a7b11ee7c5b1641bbb7e8d78b3a4b1745c7847e0
7
- data.tar.gz: 0c81f4fd18ca74603c2763ca42befb69538ddc323da48f09fb103f0764b12192de434d1d099926d0eada06259fff8ed2bc8752cd7e207213d1e20026080f81a5
6
+ metadata.gz: 7289b26be798fb6f5224d9bafc907e9b74e016394f118395aefa3e23b644fd65c9e608126fe972e1df298305433e36fb084a4b3e8cce617af80388630a154430
7
+ data.tar.gz: 91de13628bb726493b4b087c7f96d01c2e364660b1eb3a1ed087dc6dd8fffec4e1ce7f137277c076e5edd2417be6499256b37a9ec109b80a8b8ecc0dce1400cf
data/.gitignore CHANGED
@@ -1,15 +1,19 @@
1
- id
2
- .DS_Store
3
- Gemfile.lock
4
- azure.box
5
- Vagrantfile
6
- !example_box/Vagrantfile
7
- !example_box/README.md
8
- babu
9
- example_box/
10
- *.rdp
11
- pkg/*
12
- gem/
13
- manifests/
14
- modules/
15
- .vagrant/
1
+ id
2
+ .DS_Store
3
+ Gemfile.lock
4
+ azure.box
5
+ Vagrantfile
6
+ !example_box/Vagrantfile
7
+ !example_box/README.md
8
+ babu
9
+ example_box/
10
+ *.rdp
11
+ pkg/*
12
+ gem/
13
+ manifests/
14
+ modules/
15
+ .vagrant/
16
+ .idea/
17
+ *.pem
18
+ .ruby-version
19
+ *.ps1
data/CHANGELOG.md CHANGED
@@ -1,24 +1,24 @@
1
- ## 1.0.5 (Unreleased)
2
-
3
- FEATURES
4
-
5
- - Provision for windows VM.
6
- - Windows VM has to be specifically mentioned in the Vagrantfile with
7
- `config.vm.guest = :windows`
8
- - Chef, Puppet and Shell provision for Linux and Windows VM.
9
- - **SyncedFolders**
10
- - Linux VM uses `rsync` and has be mentioned in the VagrantFile.
11
- - Windows VM will default to use PowerShell to copy files.
12
-
13
- IMPROVEMENTS
14
-
15
- - Better exception handling when VM fails to get created in cloud.
16
- - Better exception handling for WinRM session errors.
17
-
18
- BUGFIXES
19
-
20
- - Cleaned up few typo in README
21
- - Compatible with Vagrant 1.6 [GH-15]
22
-
23
- ## Previous
24
- See git commits
1
+ ## 1.0.5 (09 May 2014)
2
+
3
+ FEATURES
4
+
5
+ - Provision for windows VM.
6
+ - Windows VM has to be specifically mentioned in the Vagrantfile with
7
+ `config.vm.guest = :windows`
8
+ - Chef, Puppet and Shell provision for Linux and Windows VM.
9
+ - **SyncedFolders**
10
+ - Linux VM uses `rsync` and has be mentioned in the VagrantFile.
11
+ - Windows VM will default to use PowerShell to copy files.
12
+
13
+ IMPROVEMENTS
14
+
15
+ - Better exception handling when VM fails to get created in cloud.
16
+ - Better exception handling for WinRM session errors.
17
+
18
+ BUGFIXES
19
+
20
+ - Cleaned up few typo in README
21
+ - Compatible with Vagrant 1.6 [GH-15]
22
+
23
+ ## Previous
24
+ See git commits
data/Gemfile CHANGED
@@ -1,15 +1,20 @@
1
- #--------------------------------------------------------------------------
2
- # Copyright (c) Microsoft Open Technologies, Inc.
3
- # All Rights Reserved. Licensed under the Apache 2.0 License.
4
- #--------------------------------------------------------------------------
5
-
6
- source 'https://rubygems.org'
7
-
8
- gemspec
9
-
10
- group :development do
11
- # We depend on Vagrant for development, but we don't add it as a
12
- # gem dependency because we expect to be installed within the
13
- # Vagrant environment itself using `vagrant plugin`.
14
- gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
15
- end
1
+ #--------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache License, Version 2.0.
4
+ # See License.txt in the project root for license information.
5
+ #--------------------------------------------------------------------------
6
+
7
+ source 'https://rubygems.org'
8
+
9
+ gemspec
10
+
11
+ group :development do
12
+ # We depend on Vagrant for development, but we don't add it as a
13
+ # gem dependency because we expect to be installed within the
14
+ # Vagrant environment itself using `vagrant plugin`.
15
+ gem 'vagrant', git: 'git://github.com/mitchellh/vagrant.git', tag: 'v1.6.0'
16
+ end
17
+
18
+ group :plugins do
19
+ gem 'vagrant-azure', path: '.'
20
+ end
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
2
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at
3
- http://www.apache.org/licenses/LICENSE-2.0
4
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
1
+ Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
2
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at
3
+ http://www.apache.org/licenses/LICENSE-2.0
4
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
data/README.md CHANGED
@@ -1,125 +1,189 @@
1
- # Vagrant Azure Provider
2
-
3
- ![Gem Version](https://badge.fury.io/rb/vagrant-azure.png)
4
-
5
- This is a [Vagrant](http://www.vagrantup.com) 1.5.2+ plugin that adds [Windows Azure](https://www.windowsazure.com)
6
- provider to Vagrant, allowing Vagrant to control and provision machines in Windows Azure.
7
-
8
- **NOTE:** This plugin requires Vagrant 1.5.2+,
9
-
10
- ## Usage
11
-
12
- Install Vagrant 1.5.2 or higher - [Download Vagrant](http://www.vagrantup.com/downloads.html)
13
-
14
- Install the vagrant-azure plugin using the standard Vagrant 1.1+ installation methods. After installing the plugin, you can you can ```vagrant up``` and use ```azure``` provider. For example:
15
-
16
- ```
17
- C:\> vagrant plugin install vagrant-azure
18
- ...
19
- C:\> vagrant up --provider=azure
20
- ...
21
- ```
22
-
23
- You'll need an ```azure``` box before you can do ```vagrant up``` though.
24
-
25
- ## Quick Start
26
-
27
- You can use the dummy box and specify all the required details manually in the ```config.vm.provider``` block in your ```Vagrantfile```. Add the dummy box with the name you want:
28
-
29
- ```
30
- C:\> vagrant box add azure https://github.com/msopentech/vagrant-azure/raw/master/dummy.box
31
- ...
32
- ```
33
-
34
- Now edit your ```Vagrantfile``` as shown below and provide all the values as explained.
35
-
36
- ```ruby
37
- Vagrant.configure('2') do |config|
38
- config.vm.box = 'azure'
39
-
40
- config.vm.provider :azure do |azure|
41
- azure.mgmt_certificate = 'YOUR AZURE MANAGEMENT CERTIFICATE'
42
- azure.mgmt_endpoint = 'https://management.core.windows.net'
43
- azure.subscription_id = 'YOUR AZURE SUBSCRIPTION ID'
44
- azure.storage_acct_name = 'NAME OF YOUR STORAGE ACCOUNT' # optional. A new one will be generated if not provided.
45
-
46
- azure.vm_image = 'NAME OF THE IMAGE TO USE'
47
- azure.vm_user = 'PROVIDE A USERNAME' # defaults to 'vagrant' if not provided
48
- azure.vm_password = 'PROVIDE A VALID PASSWORD' # min 8 characters. should contain a lower case letter, an uppercase letter, a number and a special character
49
-
50
- azure.vm_name = 'PROVIDE A NAME FOR YOUR VIRTUAL MACHINE' # max 15 characters. contains letters, number and hyphens. can start with letters and can end with letters and numbers
51
- azure.cloud_service_name = 'PROVIDE A NAME FOR YOUR CLOUD SERVICE' # same as vm_name. leave blank to auto-generate
52
- azure.deployment_name = 'PROVIDE A NAME FOR YOUR DEPLOYMENT' # defaults to cloud_service_name
53
- azure.vm_location = 'PROVIDE A LOCATION FOR VM' # e.g., West US
54
- azure.ssh_private_key_file = 'PATH TO YOUR KEY FILE'
55
- azure.ssh_certificate_file = 'PATH TO YOUR CERTIFICATE FILE'
56
-
57
- # Provide the following values if creating a *Nix VM
58
- azure.ssh_port = 'A VALID PUBLIC PORT'
59
-
60
- # Provide the following values if creating a Windows VM
61
- azure.winrm_transport = [ 'http', 'https' ] # this will open up winrm ports on both http (5985) and http (5986) ports
62
- azure.winrm_https_port = 'A VALID PUBLIC PORT' # customize the winrm https port, instead of 5986
63
- azure.winrm_http_port = 'A VALID PUBLIC PORT' # customize the winrm http port, insted of 5985
64
-
65
- 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.
66
- end
67
-
68
- config.ssh.username = 'YOUR USERNAME' # the one used to create the VM
69
- config.ssh.password = 'YOUR PASSWORD' # the one used to create the VM
70
- end
71
- ```
72
-
73
- Now you can run
74
-
75
- ```
76
- C:\> vagrant up --provider=azure
77
- ```
78
-
79
- This will bring up an Azure VM as per the configuration options set above.
80
-
81
- You can now either SSH (if its a *Nix VM) using ```vagrant ssh```, or RDP (if its a Windows VM) using ```vagrant rdp```.
82
-
83
- Normally, a lot of this options, e.g., ```vm_image```, 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.
84
-
85
- ## Azure Boxes
86
-
87
- The vagrant-azure plugin provides the ability to use ```azure``` boxes with Vagrant. Please see the example box provided in [example_box/ directory](https://github.com/msopentech/vagrant-azure/tree/master/example_box) and follow the instructions there to build an ```azure``` box.
88
-
89
- Please see [Vagrant Docs](http://docs.vagrantup.com/v2/) for more details.
90
-
91
- ## Configuration
92
-
93
- The vagrant-azure provide exposes a few Azure specific configration options:
94
-
95
- * `mgmt_certificate` - Your Azure Management certificate which has been uploaded to the Azure portal for your account.
96
- * `mgmt_endpoint` - Azure Management endpoint. `https://management.core.windows.net`
97
- * `subscription_id` - Your Azure Subscription ID.
98
- * `storage_acct_name` - The Storage account to use when creating VMs.
99
- * `vm_user` - The username to create the VM with. Defaults to `vagrant`.
100
- * `vm_password` - The password to set for the user created with the VM.
101
- * `vm_image` - The name of the image to be used when creating the VM.
102
- * `vm_name` - The name of the created VM.
103
- * `vm_size` - The size of the created VM.
104
- * `cloud_service_name` - The name of the cloud service under which to create the VM.
105
- * `deployment_name` - The name to give the deployment in the cloud service and add the VM to.
106
- * `vm_location` - The location to create the cloud service, storage account.
107
- * `ssh_private_key_file` - The private key file to use for SSH and if WinRM is enabled over HTTP/S.
108
- * `ssh_certificate_file` - The certificate file to use for SSH and if WinRM is enabled over HTTP/S.
109
- * `ssh_port` - To map the internal SSH port 22 to a different public port.
110
- * `winrm_transport` - Enables or disables WinRm. Allowed values are `http` and `https`.
111
- * `winrm_https_port` To map the internal WinRM https port 5986 to a different public port.
112
- * `winrm_http_port` To map the internal WinRM http port 5985 to a different public port.
113
- * `tcp_endpoints` - To open any additional ports. E.g., `80` opens port `80` and `80,3389:53389` opens port `80` and `3389`. Also maps the interal port `3389` to public port `53389`
114
- *
115
-
116
- ## New Commands for `azure` provider
117
-
118
- The `azure` provider introduces the following new `vagrant` commands.
119
-
120
- * `rdp` - To connect to a Windows VM using RDP. E.g.,
121
- ```
122
- C:\> vagrant up --provider=azure
123
- ...
124
- C:\> vagrant rdp
125
- ```
1
+ # Vagrant Azure Provider
2
+
3
+ ![Gem Version](https://badge.fury.io/rb/vagrant-azure.png)
4
+
5
+ This is a [Vagrant](http://www.vagrantup.com) 1.6.0+ plugin that adds [Microsoft Azure](https://azure.microsoft.com)
6
+ provider to Vagrant, allowing Vagrant to control and provision machines in Microsoft Azure.
7
+
8
+ ## Usage
9
+
10
+ Install Vagrant 1.6.0 or higher - [Download Vagrant](http://www.vagrantup.com/downloads.html)
11
+
12
+ 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:
13
+
14
+ ```
15
+ C:\> vagrant plugin install vagrant-azure
16
+ ...
17
+ C:\> vagrant up --provider=azure
18
+ ...
19
+ ```
20
+
21
+ You'll need an ```azure``` box before you can do ```vagrant up``` though.
22
+
23
+ ## Quick Start
24
+
25
+ You can use the dummy box and specify all the required details manually in the ```config.vm.provider``` block in your ```Vagrantfile```. Add the dummy box with the name you want:
26
+
27
+ ```
28
+ C:\> vagrant box add azure https://github.com/msopentech/vagrant-azure/raw/master/dummy.box
29
+ ...
30
+ ```
31
+
32
+ Now edit your ```Vagrantfile``` as shown below and provide all the values as explained.
33
+
34
+ ```ruby
35
+ Vagrant.configure('2') do |config|
36
+ config.vm.box = 'azure'
37
+
38
+ config.vm.provider :azure do |azure|
39
+ azure.mgmt_certificate = 'YOUR AZURE MANAGEMENT CERTIFICATE'
40
+ azure.mgmt_endpoint = 'https://management.core.windows.net'
41
+ azure.subscription_id = 'YOUR AZURE SUBSCRIPTION ID'
42
+ azure.storage_acct_name = 'NAME OF YOUR STORAGE ACCOUNT' # optional. A new one will be generated if not provided.
43
+
44
+ azure.vm_image = 'NAME OF THE IMAGE TO USE'
45
+ azure.vm_user = 'PROVIDE A USERNAME' # defaults to 'vagrant' if not provided
46
+ azure.vm_password = 'PROVIDE A VALID PASSWORD' # min 8 characters. should contain a lower case letter, an uppercase letter, a number and a special character
47
+
48
+ azure.vm_name = 'PROVIDE A NAME FOR YOUR VIRTUAL MACHINE' # max 15 characters. contains letters, number and hyphens. can start with letters and can end with letters and numbers
49
+ azure.cloud_service_name = 'PROVIDE A NAME FOR YOUR CLOUD SERVICE' # same as vm_name. leave blank to auto-generate
50
+ azure.deployment_name = 'PROVIDE A NAME FOR YOUR DEPLOYMENT' # defaults to cloud_service_name
51
+ azure.vm_location = 'PROVIDE A LOCATION FOR VM' # e.g., West US
52
+ azure.private_key_file = 'PATH TO YOUR KEY FILE'
53
+ azure.certificate_file = 'PATH TO YOUR CERTIFICATE FILE'
54
+
55
+ # Provide the following values if creating a *Nix VM
56
+ azure.ssh_port = 'A VALID PUBLIC PORT'
57
+
58
+ # Provide the following values if creating a Windows VM
59
+ azure.winrm_transport = [ 'http', 'https' ] # this will open up winrm ports on both http (5985) and http (5986) ports
60
+ azure.winrm_https_port = 'A VALID PUBLIC PORT' # customize the winrm https port, instead of 5986
61
+ azure.winrm_http_port = 'A VALID PUBLIC PORT' # customize the winrm http port, insted of 5985
62
+
63
+ 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.
64
+ end
65
+
66
+ config.ssh.username = 'YOUR USERNAME' # the one used to create the VM
67
+ config.ssh.password = 'YOUR PASSWORD' # the one used to create the VM
68
+ end
69
+ ```
70
+
71
+ Now you can run
72
+
73
+ ```
74
+ C:\> vagrant up --provider=azure
75
+ ```
76
+
77
+ This will bring up an Azure VM as per the configuration options set above.
78
+
79
+ 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```.
80
+
81
+ Normally, a lot of this options, e.g., ```vm_image```, 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.
82
+
83
+ ## Azure Boxes
84
+
85
+ The vagrant-azure plugin provides the ability to use ```azure``` boxes with Vagrant. Please see the example box provided in [example_box/ directory](https://github.com/msopentech/vagrant-azure/tree/master/example_box) and follow the instructions there to build an ```azure``` box.
86
+
87
+ Please see [Vagrant Docs](http://docs.vagrantup.com/v2/) for more details.
88
+
89
+ ## Configuration
90
+
91
+ The vagrant-azure provide exposes a few Azure specific configration options:
92
+
93
+ * `mgmt_certificate` - Your Azure Management certificate which has been uploaded to the Azure portal for your account.
94
+ * `mgmt_endpoint` - Azure Management endpoint. `https://management.core.windows.net`
95
+ * `subscription_id` - Your Azure Subscription ID.
96
+ * `storage_acct_name` - The Storage account to use when creating VMs.
97
+ * `vm_user` - The username to create the VM with. Defaults to `vagrant`.
98
+ * `vm_password` - The password to set for the user created with the VM.
99
+ * `vm_image` - The name of the image to be used when creating the VM.
100
+ * `vm_name` - The name of the created VM.
101
+ * `vm_size` - The size of the created VM.
102
+ * `vm_virtual_network_name` - The name of a virtual network to connect to
103
+ * `cloud_service_name` - The name of the cloud service under which to create the VM.
104
+ * `deployment_name` - The name to give the deployment in the cloud service and add the VM to.
105
+ * `vm_location` - The location to create the cloud service, storage account.
106
+ * `private_key_file` - The private key file to use for SSH and if WinRM is enabled over HTTP/S.
107
+ * `certificate_file` - The certificate file to use for SSH and if WinRM is enabled over HTTP/S.
108
+ * `ssh_port` - To map the internal SSH port 22 to a different public port.
109
+ * `winrm_transport` - Enables or disables WinRm. Allowed values are `http` and `https`.
110
+ * `winrm_https_port` To map the internal WinRM https port 5986 to a different public port.
111
+ * `winrm_http_port` To map the internal WinRM http port 5985 to a different public port.
112
+ * `tcp_endpoints` - To open any additional ports. E.g., `80` opens port `80` and `80,3389:53389` opens port `80` and `3389`. Also maps the interal port `3389` to public port `53389`
113
+ *
114
+
115
+ ## New Commands for `azure` provider
116
+
117
+ The `azure` provider introduces the following new `vagrant` commands.
118
+
119
+ * `rdp` - To connect to a Windows VM using RDP. E.g.,
120
+ ```
121
+ C:\> vagrant up --provider=azure
122
+ ...
123
+ C:\> vagrant rdp
124
+ ```
125
+
126
+
127
+ ## Multi Machine
128
+ The options for multi machines are similar to Vagrant, please refer to the vagrant doc at http://docs.vagrantup.com/v2/multi-machine/index.html
129
+
130
+ Example Multi Machine Vagrantfile (for building out 3 Windows Virtual Machines)
131
+
132
+ ```ruby
133
+
134
+ Vagrant.configure('2') do |config|
135
+ config.vm.box = 'azure'
136
+ config.vm.boot_timeout = 1000
137
+
138
+ do_common_azure_stuff = Proc.new do |azure|
139
+ azure.mgmt_certificate = 'YOUR AZURE MANAGEMENT CERTIFICATE'
140
+ azure.mgmt_endpoint = 'https://management.core.windows.net'
141
+ azure.subscription_id = 'YOUR AZURE SUBSCRIPTION ID'
142
+ azure.storage_acct_name = 'NAME OF YOUR STORAGE ACCOUNT' # optional. A new one will be generated if not provided.
143
+
144
+ azure.vm_image = 'NAME OF THE IMAGE TO USE'
145
+ azure.vm_user = 'PROVIDE A USERNAME' # defaults to 'vagrant' if not provided
146
+ azure.vm_password = 'PROVIDE A VALID PASSWORD' # min 8 characters. should contain a lower case letter, an uppercase letter, a number and a special character
147
+
148
+ azure.vm_name = 'PROVIDE A NAME FOR YOUR VIRTUAL MACHINE' # max 15 characters. contains letters, number and hyphens. can start with letters and can end with letters and numbers
149
+ azure.cloud_service_name = 'PROVIDE A NAME FOR YOUR CLOUD SERVICE' # same as vm_name. leave blank to auto-generate
150
+ azure.deployment_name = 'PROVIDE A NAME FOR YOUR DEPLOYMENT' # defaults to cloud_service_name
151
+ azure.vm_location = 'PROVIDE A LOCATION FOR VM' # e.g., West US
152
+
153
+ azure.winrm_transport = %w(https)
154
+ end
155
+
156
+ config.vm.define 'first' do |cfg|
157
+ config.vm.provider :azure do |azure|
158
+ azure.vm_name = 'PROVIDE A NAME FOR YOUR VIRTUAL MACHINE'
159
+ 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.
160
+ azure.winrm_https_port = 5986
161
+ do_common_azure_stuff.call azure
162
+ end
163
+ end
164
+
165
+ config.vm.define 'second' do |cfg|
166
+ cfg.vm.provider :azure do |azure|
167
+ azure.vm_name = 'PROVIDE A NAME FOR YOUR VIRTUAL MACHINE'
168
+ azure.tcp_endpoints = '3389:53390'
169
+ azure.winrm_https_port = 5987
170
+ do_common_azure_stuff.call azure
171
+ end
172
+ end
173
+
174
+ config.vm.define 'third' do |cfg|
175
+ cfg.vm.provider :azure do |azure|
176
+ azure.vm_name = 'PROVIDE A NAME FOR YOUR VIRTUAL MACHINE'
177
+ azure.tcp_endpoints = '3389:53391'
178
+ azure.winrm_https_port = 5988
179
+ do_common_azure_stuff.call azure
180
+ end
181
+ end
182
+
183
+ # Executes powershell on the remote machine and returns the hostname
184
+ config.vm.provision 'shell', inline: 'hostname'
185
+
186
+ end
187
+
188
+ ```
189
+