Knife-azure to create VM on Microsoft Azure


In the last article, we discussed about Creating Cookbook
In this post we will create Virtual machine by using knife-azure command:
–azure-publish-settings-file Path to publishsettingsfile
–azure-service-location Location at which new virtual machine needs to be created
–azure-source-image Image ID for Source Window Image
–winrm-user – Username for Windows Virtual Machine
–winrm-password Password for Windows Virtual Machine


Execute following command to create a Windows VM on Microsoft Azure.

[root@unknown000c293f635e cookbooks]# knife azure server create –azure-dns-name ‘msdemochef’ –azure-vm-name ‘msserver01’ –azure-vm-size ‘Small’ –azure-storage-account ‘dtcloud’ –bootstrap-protocol ‘cloud-api’ –azure-source-image ‘a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201505.01-en.us-127GB.vhd’ –azure-service-location ‘East US’ –winrm-user azureuser –winrm-password ‘myPassword123’ –tcp-endpoints 80,3389 –r ‘recipe[webserver]’

 

Observer different state of VM on Terminal
49.1 chef knife-azure vm state

 

49.2 chef knife-azure vm state2
Execution of knife command completed successfully.
Verify Azure Dashboard
49.3 Microsoft Azure Dashboard

Verify extensions: Chef Service Enabled.

49.4 Microsoft Azure Dashboard-Chef extension

Verify Cloud Services on Microsoft Azure Portal and Note URL. We will use it to verify whether IIS Server and Web page is working properly or not.

49.5 Microsoft Azure Dashboard-cloud services

Verify Storage

49.6 Microsoft Azure Dashboard-storage

Use noted URL from Cloud Services.

49.7 Microsoft Azure Dashboard-web application

Let’s verify Hosted Chef Dashboard. Verify newly created/ bootstrapped node is available in the Nodes section. Verify Run list.

49.8 Hosted Chef Dashboard

Verify Attributes on the Attributes Tab.

49.9 Hosted Chef Dashboard-Attributes

Verify Reports

49.10 Hosted Chef Dashboard-Reports

Connect to newly provisioned VM on Windows Azure with RDP using its DNS Name

Verify the dashboard.

49.11 RDP Microsoft Azure

Right click on the Windows icon and select run.

49.12 RDP Microsoft Azure-Server Manager
Open command prompt.
49.14 RDP Microsoft Azure-Run

Verify Chef client version

 49.15 RDP Microsoft Azure-Chef Version
Done!

Leave a comment

Your email address will not be published. Required fields are marked *