Wednesday, October 30, 2013

Log into the Horizon Dashboard

If you had any errors and chef-client terminated, just try re-running the chef-client on the nodes. Sometimes due to network latency or other issues during installation of all the packages, the chef-client encounters errors.

Once the chef-client has successfully completed on all the nodes, then do the following step. Run the following command on the network and compute nodes to connect the nodes to the physical network ph-eth1 that is created by the Rackspace cookbooks.

# ovs-vsctl add-port br-eth1 eth1

Connect to the Horizon Dashboard. Point to the Eth0 IP address of the Controller Node. You should see the Horizon Dashboard. The default administrator account is:

Username: admin
Password: secrete

Sunday, October 27, 2013

Run chef-client on the nodes

Check the configuration of the nodes:


# knife node show setup1-controller
Node Name:   setup1-controller
Environment: grizzly-quantum-1
FQDN:        setup1-controller
IP:          10.112.252.244
Run List:    role[single-controller]
Roles:
Recipes:
Platform:    ubuntu 12.04
Tags:



# knife node show setup1-network
Node Name:   setup1-network
Environment: grizzly-quantum-1
FQDN:
IP:          10.112.252.245
Run List:    role[single-network-node]
Roles:
Recipes:
Platform:    ubuntu 12.04
Tags:



# knife node show setup1-compute
Node Name:   setup1-compute
Environment: grizzly-quantum-1
FQDN:
IP:          10.112.252.246
Run List:    role[single-compute]
Roles:
Recipes:
Platform:    ubuntu 12.04
Tags:



Now we are all ready to run "chef-client" command on the nodes. Run the "chef-client" command on the controller, network and compute nodes one-by-one in that order.

Add the roles to the Chef nodes runlist and assign the nodes to the environment

Use the "knife node run_list add" command to add the role to each of the Chef nodes:

# knife node run_list add setup1-controller 'role[single-controller]'
# knife node run_list add setup1-network 'role[single-network-node]'
# knife node run_list add setup1-compute 'role[single-compute]'



Use the "knife node show" command to see the node configuration:

# knife node show setup1-controller
Node Name:   setup1-controller
Environment: _default
FQDN:        setup1-controller
IP:          10.112.252.244
Run List:    role[single-controller]
Roles:
Recipes:
Platform:    ubuntu 12.04
Tags:



We see that the Environment is "_default". We need to change it to "grizzly-quantum-1" environment we created before.

Use the "knife node edit" command to edit the node configuration and change the environment from "_default" to "grizzly-quantum-1".

The node configuration will be in environment "_default" as here:

{
  "name": "setup1-controller",
  "chef_environment": "_default",
  "normal": {
    "tags": [

    ]
  },
  "run_list": [
    "role[single-controller]"
  ]
}



We need to replace "_default" with "grizzly-quantum-1". As here:

{
  "name": "setup1-controller",
  "chef_environment": "grizzly-quantum-1",
  "normal": {
    "tags": [

    ]
  },
  "run_list": [
    "role[single-controller]"
  ]
}



The same needs to be done for the other two nodes: setup1-network and setup1-compute.

Setup the Chef Environment

Under chef-cookbooks/environments directory setup the environment json file. For example create a grizzly-quantum-1.json file with the following contents:

{
  "name": "grizzly-quantum-1",
  "description": "Chef-server Grizzly Quantum Multinode environment",
  "json_class": "Chef::Environment",
  "chef_type": "environment",
  "override_attributes": {
    "nova": {
      "libvirt": { "virt_type": "qemu" },
      "network": {
        "provider": "quantum"
      }
    },
    "mysql": {
      "allow_remote_root": true,
      "root_network_acl": "%",
      "server_root_password": "fr3sca",
      "server_debian_password": "fr3sca"
    },
    "osops_networks": {
      "nova": "10.112.252.0/24",
      "public": "10.112.252.0/24",
      "management": "10.112.252.0/24"
    }
  }
}



You need to mention the Network you are using on your eth0 as the "nova", "public" and "management" attributes. Change these attributes to the network address you are using:

"osops_networks": {
"nova": "10.112.252.0/24",
"public": "10.112.252.0/24",
"management": "10.112.252.0/24"
}


Upload the environment to the Chef Server as below:

# knife environment from file grizzly-quantum-1.json


You can verify that the environment file has been uploaded to Chef Server using the following command:

# knife environment list
_default
grizzly-quantum-1

Nodes networking setup and Chef bootstrapping

Nodes Networking Setup

Use Ubuntu 12.04 LTS 64 bit.

Setup the nodes networking such that the eth0 of Controller, Compute and Network nodes are all on the same network as the Chef Workstation and this network is able to reach the Hosted Chef Server across the Internet.

The out-of-band eth0 management interfaces are where the primary IP address of the node is located, and is not controlled by OpenStack Networking.

Important: We are using Quantum networking. This is specified in the Chef environment file by using "network": { "provider": "quantum"}. The Rackspace Private Cloud cookbooks will use VLAN based networking by default. So, all eth1 interfaces should be connected to a switch using Trunk Ports. Multiple VLANs will be used to segregate the private networks that will be created using Quantum.

The eth1 physical provider interfaces have no IP addresses and must be configured to be "up" on boot. For example, to accomplish this in Ubuntu, the following configuration would need to be added to/etc/network/interfaces:

auto eth1
iface eth1 inet manual
  up ip link set $IFACE up
  down ip link set $IFACE down



The /etc/network/interfaces of controller node is as below:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

auto eth0
iface eth0 inet static
address 10.112.252.244
netmask 255.255.255.0
gateway 10.112.252.253
dns-nameservers 10.112.116.138 10.112.116.139 10.112.64.1

auto eth1
iface eth1 inet manual
  up ip link set $IFACE up
  down ip link set $IFACE down



Bootstrapping the nodes to Chef Server

On the Chef Workstation we can run the following knife bootstrap commands to bootstrap the nodes to the Chef Server.

# knife bootstrap 10.112.252.244 -x root -P password -N "setup1-controller"
# knife bootstrap 10.112.252.245 -x root -P password -N "setup1-network"
# knife bootstrap 10.112.252.246 -x root -P password -N "setup1-compute"



Verify that the nodes are bootstrapped using 'knife node list' command:

# knife node list
setup1-compute
setup1-controller
setup1-network

Saturday, October 26, 2013

Setting up your Chef Environment with Rackspace Private Cloud cookbooks

Step 1: Log into your Chef workstation
Step 2: Use git clone to download the Rackspace Private Cloud cookbooks
Step 3: cd into the chef-cookbooks directory
Step 4: Checkout the grizzly version of the cookbooks
# git checkout grizzly
# git submodule init
# git submodule sync
# git submodule update
Step 5: Upload the cookbooks to the Chef Server
# knife cookbook upload -a -o cookbooks
Step 6: Apply the updated roles
# knife role from file roles/*rb

Your chef cookbooks are now up to date.

Tuesday, October 22, 2013

Setting up the Chef Server

We can use the Opscode Hosted Chef Server itself.

Sign-up for Hosted Chef

Setup the Chef Server account on Opscode Hosted Chef Server. Go To https://manage.opscode.com and Sign up.


Save your Opscode User Private Key

Opscode User Private Key will be shown to you once you finish the signup. Save the key in ~/.chef/YOUR-USERNAME.pem



Create an Organization

Once you are done with the above steps, go to https://manage.opscode.com again and then login with the user account you just created. Then you will have to create an Organization first. Organization short name should be globally unique.


Provide the Organization name and select the free plan.


Download the Validation Key and Knife config


Copy the Validation Key and Knife config to your .chef directory


Verify Knife using the "knife --version" and "knife client list" commands.


We are done with setting up the Chef Workstation and the Chef Server.

Monday, October 21, 2013

Friday, October 18, 2013

Introduction to Chef

Chef Server: The server acts as a hub for all of the data needed by the chef-client while it configures a node.
 
Chef Workstation: A workstation is a computer that is configured to run Knife, to synchronize with the chef-repo, and interact with a single server. The workstation is the location from which most users will do most of their work.
 
Chef Nodes: A node is any physical, virtual, or cloud machine that is configured to be maintained by a chef-client.
 

Goal: Installing Openstack using Chef