Setup Chef Server on Microsoft Azure

This is the second post in the Chef and Microsoft Azure blog series. You can read the first blog in this series at https://manesh.me/2015/10/17/setup-chef-workstation-on-microsoft-azure/

In this blog, I am exploring how to setup a Chef Server on Microsoft Azure. For most part, I followed the steps suggested in https://docs.chef.io/azure_portal.html

Prerequisites

  • Microsoft Azure Subscription

Setup Sequence

  • Create Virtual Machine
  • Set DNS Name Label for virtual machine
  • Configure Chef Server
  • Create Organization
  • Establish Connectivity from Workstation

Create Virtual Machine

Navigate to https://portal.azure.com and login using your credentials.

Click New, then Compute, then Marketplace

Search for Chef Server, then select Chef Server 12, BYOL.

Note: Chef provides a fully functional Chef server that can be launched from the Azure Marketplace. This server is preconfigured with Chef Server, the Chef Management console, Chef reporting, and Chef Analytics. This configuration is free to use for deployments under 25 nodes, and can be licensed for deployments beyond 25 nodes.

Choose Resource Manager as the deployment model and click Create

Provide basic settings and click OK.

Click Size, then A5 Standard, then Select

Click Settings and then OK. Choose the default options, unless you want to change something.

Click Summary, review summary and click OK

Click Buy on left menu, review offer details and click Buy button

Wait for the newly created server to be in Running state.

Set DNS Name Label for virtual machine

Click Virtual machines, then mme-chef-server

Click on IP Address

Click on Settings, then Configuration

Update DNS name label and click Save

DNS name for the virtual machine in this case is ‘mme-chef-server.southcentralus.cloudapp.azure.com’. Wait for 5 minutes and check if you are able to ssh to the server using ‘ssh chefadmin@mme-chef-server.southcentralus.cloudapp.azure.com

Configure Chef Server

Open Git Bash and run the following commands.

# Here chefadmin is the admin user created during virtual machine creation.

# Provide DNS name label of the virtual machine

ssh chefadmin@mme-chef-server.southcentralus.cloudapp.azure.com

#sudo chef-setup -u <username> -p <password> -d <fqdn>

#Here username is a new user, which will be created in this process.

# You will use this username to connect form portal

sudo chef-setup -u admin -p Demo@Pass1 –d mme-chef-server.southcentralus.cloudapp.azure.com

Create Organization

Browse https://mme-chef-server.southcentralus.cloudapp.azure.com

Enter Username (specified during chef-setup), Password (specified during chef-setup) and click Sign In

Click Create New Organization

Provide Full Name, Short Name, then click Create Organization

Click on Administration, then Organizations, then contoso

Click Starter Kit, then Download Starter Kit

Click Proceed

Save chef-starter.zip locally. In my machine (Windows Laptop), it saved by default in the Downloads folder.

Establish Connectivity from Workstation

Copy the downloaded chef-starter.zip from local machine to Chef Workstation (I am copying it to workstation, I created as per the first blog in this series). I used the following command to copy the file from Git Bash. You might have to change according to your environment.

scp Downloads/chef-starter.zip azureuser@mme-chef-ws.cloudapp.net:/home/azureuser

SSH into workstation

ssh azureuser@mme-chef-ws.cloudapp.net

Execute following commands to get SSL keys and test connection to Chef Server

# move to home directory of azureuser

cd

# install unzip utility

sudo apt-get install unzip

# unzip the starter kit

unzip chef-starter.zip

# move to chef-repo directory

cd chef-repo

# retrieve SSL keys from server

knife ssl fetch

# test connection to server, we should see contoso-validator

knife client list

Next Blog

Next, I will try out adding a Chef Node to the organization and running cookbooks.

About Manesh

Manesh is a software consultant and solutions architect specializing in cloud, data, Linux and devops in the azure realm with key focus on hybrid workloads. He has been working on Azure technologies since its inception and has helped many enterprises to onboard and adapt to Azure cloud, build solutions for datacenter scale / high consumer applications and services. Currently, he is Microsoft certified for Developing Microsoft Azure Solutions (70-532), Implementing Microsoft Azure Infrastructure Solutions(70-533) and Architecting Microsoft Azure Solutions (70-534).

Posted on 2015/10/19, in DevOps, Microsoft Azure and tagged , , , , . Bookmark the permalink. 3 Comments.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

hyper-v.nu

My views on technology

yungchou

witnessing a clear cloudy day

Virtualization and some coffee

My views on technology

Thomas Maurer

Cloud and Virtualization

Cloud Administrator

Begin Your Journey to the Cloud with the Cloud Administrator

%d bloggers like this: