Successfully reported this slideshow.
Your SlideShare is downloading. ×

Bare Metal to OpenStack with Razor and Chef

Ad

Bare Metal to OpenStack
with Razor and Chef
Egle Sigler, Rackspace
Matt Ray, Opscode

Ad

Agenda


Razor Introduction and Overview

Razor demonstration

OpenStack cookbook walkthrough

Ad

Get Razor Appliance


USB keys (thanks to eNovance, Suse, and Piston)

Wireless network: razor5 and razor24 (thank you Rac...

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Upcoming SlideShare
The state of the swarm
The state of the swarm
Loading in …3
×

Check these out next

1 of 71 Ad
1 of 71 Ad

Bare Metal to OpenStack with Razor and Chef

Download to read offline

Slides from the OpenStack Spring 2013 Summit workshop presented by Egle Sigler (@eglute) and Matt Ray (@mattray) from Rackspace and Opscode respectively. Please refer to http://anystacker.com/ for additional content.

Slides from the OpenStack Spring 2013 Summit workshop presented by Egle Sigler (@eglute) and Matt Ray (@mattray) from Rackspace and Opscode respectively. Please refer to http://anystacker.com/ for additional content.

More Related Content

Bare Metal to OpenStack with Razor and Chef

  1. 1. Bare Metal to OpenStack with Razor and Chef Egle Sigler, Rackspace Matt Ray, Opscode
  2. 2. Agenda Razor Introduction and Overview Razor demonstration OpenStack cookbook walkthrough
  3. 3. Get Razor Appliance USB keys (thanks to eNovance, Suse, and Piston) Wireless network: razor5 and razor24 (thank you Rackers!) Start downloading/copying http://192.168.1.3:8080/examples/razor.tar
  4. 4. Setting up Razor Appliance in Virtual Box Must have extension pack installed. Get it here: https://www.virtualbox.org/wiki/Downloads Verify extension pack is installed: VBoxManage list extpacks File/Import Appliance... Default options for everything
  5. 5. Setting up Razor Appliance in VMware Fusion File/Import: select ovf file, ignore warnings. File/Import Appliance... Set up two nics for the VM, second one internal Make sure the DHCP for internal nic is turned off, under VMware Fusion/Preferences.../Network
  6. 6. Fusion Network 1
  7. 7. Fusion Network 2
  8. 8. Fusion Network 2 Preferences
  9. 9. Razor Appliance Built on Ubuntu Server, 12.04, for this tutorial Must have two nics, one for external, one for internal traffic Comes with: Razor TFTP service DHCP service MongoDB Chef Server Rackspace Private Cloud Cookbooks MicroKernel and Ubuntu Server ISO
  10. 10. Logging In User name: anystacker Password: razor Login, and switch to root. Verify razor is running: root@razor:~# /opt/razor/bin/razor_daemon.rb status If not: root@razor:~# /opt/razor/bin/razor_daemon.rb start
  11. 11. About Razor Provisioning solution for hardware Initially developed by EMC and Puppet Open sourced as a Puppet Labs project Install using Puppet, Chef, or manual
  12. 12. About Razor Auto-Discovered Real-Time Inventory Data Dynamic Image Selection Model-Based Provisioning APIs and Plug-in Architecture Metal-to-Cloud Application Lifecycle Management
  13. 13. Razor State of Things
  14. 14. Razor State of Things Razor is awesome! Still not a 1.* release MongoDB may cause concurrency issues Policy limit counts may not be enforced Some other issues
  15. 15. Bright and Shiny Future v1.0 release focus on stability and scalability: Beta version in Q3 support concurrency scale well easy to install, upgrade, and test
  16. 16. Bright and Shiny Future After v1.0: Windows support maybe AIX and Solaris support
  17. 17. Connecting to Razor VM VirtualBox: ssh -p 2223 localhost VMware Fusion: get IP and ssh to it
  18. 18. Hands On Razor User name: anystacker Password: razor Switch to root.
  19. 19. Verify Status Verify razor is running: root@razor:~# /opt/razor/bin/razor_daemon.rb status If not: root@razor:~# /opt/razor/bin/razor_daemon.rb start Check networks
  20. 20. ifconfig root@razor:~# ifconfig eth1 Link encap:Ethernet HWaddr 00:0c:29:aa:f9:65 inet addr:172.16.16.1 Bcast:172.16.16.255 Mask: 255.255.255.0 inet6 addr: fe80::20c:29ff:feaa:f965/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:7525 errors:0 dropped:0 overruns:0 frame:0 TX packets:19 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:677489 (677.4 KB) TX bytes:2362 (2.3 KB)
  21. 21. Razor Commands add MikroKernel add Image add Model add Policy add Broker
  22. 22. MicroKernel Variant of Tiny Core Linux Found here: https://github.com/puppetlabs/razor- microkernel/downloads Need to add it once: razor image add -t mk -p ./rz_mk_prod-image.0.9.3.0.iso
  23. 23. Add Image razor image add -t os -p ./ubuntu-12.04.2- server-amd64.iso -n ubuntu_precise_server -v 12.04.2 Attempting to add, please wait... New image added successfully
  24. 24. Added Image: UUID => 36Lrq9JMiRwvrw5rSruSjg Type => OS Install ISO Filename => ubuntu-12.04.2-server- amd64.iso Path => /opt/razor/image/os/ 36Lrq9JMiRwvrw5rSruSjg Status => Valid OS Name => ubuntu_precise_server OS Version => 12.04.2
  25. 25. Model Map image to built-in template razor model add template -t ubuntu_precise - l install_precise_server -i 36Lrq9JMiRwvrw5rSruSjg
  26. 26. Current Templates ROOT@RAZOR:~# RAZOR MODEL TEMPLATE MODEL TEMPLATES: TEMPLATE NAME DESCRIPTION DEBIAN_WHEEZY DEBIAN WHEEZY MODEL OPENSUSE_12 OPENSUSE SUSE 12 MODEL REDHAT_6 REDHAT 6 MODEL SLES_11 SLES 11 MODEL UBUNTU_ONEIRIC UBUNTU ONEIRIC MODEL UBUNTU_PRECISE UBUNTU PRECISE MODEL UBUNTU_PRECISE_IP_POOL UBUNTU PRECISE MODEL (IP POOL) VMWARE_ESXI_5 VMWARE ESXI 5 DEPLOYMENT CENTOS_6 CENTOS 6 MODEL ORACLELINUX_6 ORACLE LINUX 6 MODEL
  27. 27. razor model add template -t ubuntu_precise -l install_precise_server -i 36Lrq9JMiRwvrw5rSruSjg --- Building Model (ubuntu_precise): Please enter node hostname prefix (will append node number) (example: node) default: node (QUIT to cancel) > Please enter local domain name (will be used in /etc/ hosts file) (example: example.com) default: localdomain (QUIT to cancel) > Please enter root password (> 8 characters) (example: P@ssword!) default: test1234 (QUIT to cancel) >
  28. 28. Model Model created Label => install_precise_server Template => linux_deploy Description => Ubuntu Precise Model UUID => 5VShcTIkmqrCXGUBM3UwLI Image UUID => 36Lrq9JMiRwvrw5rSruSjg
  29. 29. Policy Map model to a node razor policy add -p linux_deploy -l precise_server -m 5VShcTIkmqrCXGUBM3UwLI -t nics_1 --enabled true Policy created UUID => 6BtPna2OuYDcFPZr7ec1XU Line Number => 0 Label => precise_server Enabled => true Template => linux_deploy Description => Policy for deploying a Linux-based operating system. Tags => [nics_1] Model Label => install_precise_server Broker Target => none Currently Bound => 0 Maximum Bound => 0 Bound Counter => 0
  30. 30. Razor Brokers Puppet Chef Script
  31. 31. Brokers root@razor:~# razor broker plugin Available Broker Plugins: Plugin Description chef Opscode Chef puppet PuppetLabs PuppetMaster
  32. 32. Puppet Broker If you use Puppet, use it. Puppet Master hostname Puppet version
  33. 33. Chef Broker Bootstrap install URL for Chef Server, https:hostname Chef version validation.pem file validation client name Chef environment Omnibus installer script alternative path for chef-client binary run list
  34. 34. Script Broker Very new, not on Razor appliance Runs scripts on the newly installed node Soon, will gain special powers: pre and post scripts run on Razor server for full integration with tools (signing Puppet certificate, etc)
  35. 35. Add Broker razor broker add -p chef -n allinone -d openstack_allinone --- Building Broker (chef): ... lots of stuff
  36. 36. Add Broker to Policy razor policy add -p linux_deploy -l precise_server -m 5VShcTIkmqrCXGUBM3UwLI - t nics_2 --enabled true
  37. 37. razor policy update 28kDQSkIVWtp9DFOuQdAgK -b 4uiuMcQVoePYmKOc3QLeRE UUID => 28kDQSkIVWtp9DFOuQdAgK Line Number => 1 Label => precise_server Enabled => true Template => linux_deploy Description => Policy for deploying a Linux- based operating system. Tags => [nics_2] Model Label => install_precise_server Broker Target => allinone Currently Bound => 0 Maximum Bound => 0 Bound Counter => 0
  38. 38. Boot VM Create new VM Make sure it has 2 nics, both on private network 2 GB memory 80 GB disk on VirtualBox, set boot order Connect to real internets, otherwise chef client will not install
  39. 39. anystacker.com
  40. 40. All in one OpenStack on your VM If all goes well, OpenStack should be running or your new VM Try setting up additional policies, and deploy different VMs
  41. 41. Agenda Razor Introduction and Overview Razor demonstration OpenStack cookbook walkthrough
  42. 42. Agenda Razor Introduction and Overview Razor demonstration OpenStack cookbook walkthrough
  43. 43. Rackspace Private Cloud currently Folsom release (v3.0.1) open source Chef 11 server embedded http://www.rackspace.com/cloud/private/ https://github.com/rcbops https://github.com/rcbops-cookbooks/
  44. 44. Rackspace Private Cloud
  45. 45. Rackspace Private Cloud github.com/rcbops/chef-cookbooks/tree/v3.0.1 roles/ environments/ cookbooks/
  46. 46. cookbooks/ apache2/ monit/ apt/ monitoring/ aws/ mysql/ build-essential/ mysql-openstack/ cinder/ nova/ collectd/ nova-network/ collectd-graphite/ ntp/ collectd-plugins/ openssh/ corosync/ openssl/ database/ openstack-ha/ dsh/ osops-utils/ erlang/ postgresql/ exerstack/ rabbitmq/ glance/ rabbitmq-openstack/ graphite/ rsyslog/ haproxy/ runit/ hardware/ selinux/ horizon/ sosreport/ keepalived/ swift/ keystone/ sysctl/ kong/ xfs/ memcached/ yum/ modules/
  47. 47. environments/example.json { "name": "example_environment", "description": "Chef-server example environment", "cookbook_versions": { }, "json_class": "Chef::Environment", "chef_type": "environment", "default_attributes": { }, "override_attributes": { "developer_mode": false, "monitoring" : { "metric_provider" : "collectd", "procmon_provider" : "monit" }, "glance": { "image_upload": true, "images": ["cirros", "precise"] },
  48. 48. environments/example.json "nova": { "ratelimit" : { "api" : { "enabled" : true }, "volume" : { "enabled" : true } }, "libvirt": { "virt_type": "qemu" }, "networks": [ { "label": "public", "ipv4_cidr": "10.10.100.0/24", "num_networks": "1", "network_size": "255", "bridge": "br100", "bridge_dev": "eth0.100", "dns1": "8.8.8.8", "dns2": "8.8.4.4" }, { "label": "private", "ipv4_cidr": "172.16.101.0/24", "num_networks": "1", "network_size": "255", "bridge": "br101", "bridge_dev": "eth0.101", "dns1": "8.8.8.8", "dns2": "8.8.4.4" } ] },
  49. 49. environments/example.json "mysql": { "allow_remote_root": true, "root_network_acl": "%" }, "osops_networks": { "nova": "192.168.1.0/24", "public": "192.168.1.0/24", "management": "192.168.1.0/24" }, "package_component": "folsom" } }
  50. 50. roles/ allinone.rb nova-api-ec2.rb base.rb nova-api-os-compute.rb cinder-all.rb nova-api.rb cinder-api.rb nova-cert.rb cinder-scheduler.rb nova-controller.rb cinder-setup.rb nova-misc-services.rb cinder-volume.rb nova-network-compute.rb collectd-client.rb nova-network-controller.rb collectd-server.rb nova-network.rb glance-api.rb nova-scheduler.rb glance-registry.rb nova-setup.rb glance-setup.rb nova-vncproxy.rb glance.rb nova-volume.rb graphite.rb openstack-ha.rb ha-controller1.rb quantum-network-manager.rb ha-controller2.rb rabbitmq-server.rb haproxy.rb rsyslog-client.rb horizon-server.rb rsyslog-server.rb jenkins-allinone.rb single-compute.rb jenkins-compute.rb single-controller.rb jenkins-controller.rb swift-account-server.rb jenkins-glance.rb swift-all-in-one.rb jenkins-mysql-master.rb swift-container-server.rb jenkins-nova-api.rb swift-management-server.rb keystone-api.rb swift-object-server.rb keystone.rb swift-proxy-server.rb mysql-master.rb swift-setup.rb
  51. 51. roles/allinone.rb name "allinone" description "This will create an all-in- one Openstack cluster" run_list( "role[single-controller]", "role[single-compute]" )
  52. 52. expanded run list osops-utils::packages, openssh, ntp, sosreport, rsyslog::default, hardware, osops- utils::default, mysql-openstack::server, erlang::default, rabbitmq-openstack::server, keystone::server, keystone::keystone-api, glance::setup, glance::registry, glance::api, nova::nova-setup, nova-network::nova-controller, nova::scheduler, nova::api-ec2, nova::api-os- compute, nova::volume, nova::nova-cert, nova::vncproxy, mysql::client, mysql::ruby, horizon::server, nova-network::nova-compute, nova::compute
  53. 53. roles/single-controller name "single-controller" description "Nova Controller (non-HA)" run_list( "role[base]", "role[mysql-master]", "role[rabbitmq-server]", "role[keystone]", "role[glance-setup]", "role[glance-registry]", "role[glance-api]", "role[nova-setup]", "role[nova-network-controller]", "role[nova-scheduler]", "role[nova-api-ec2]", "role[nova-api-os-compute]", "role[nova-volume]", "role[nova-cert]", "role[nova-vncproxy]", "role[horizon-server]" )
  54. 54. roles/base name "base" description "Base role for a server" run_list( "recipe[osops-utils::packages]", "recipe[openssh]", "recipe[ntp]", "recipe[sosreport]", "recipe[rsyslog::default]", "recipe[hardware]", "recipe[osops-utils::default]" ) default_attributes( "ntp" => { "servers" => ["0.pool.ntp.org", "1.pool.ntp.org", "2.pool.ntp.org"] } )
  55. 55. roles/mysql-master name "mysql-master" description "Installs mysql and sets up replication (if 2 nodes with role)" run_list( "role[base]", "recipe[mysql-openstack::server]" )
  56. 56. roles/rabbitmq-server name "rabbitmq-server" description "RabbitMQ Server (non-ha)" run_list( "role[base]", "recipe[erlang::default]", "recipe[rabbitmq-openstack::server]" )
  57. 57. roles/keystone name "keystone" description "Keystone server" run_list( "role[base]", "recipe[keystone::server]", "role[keystone-api]" )
  58. 58. roles/glance-setup name "glance-setup" description "sets up glance registry db and passwords" run_list( "role[base]", "recipe[glance::setup]" )
  59. 59. roles/glance-registry name "glance-registry" description "Glance Registry server" run_list( "role[base]", "recipe[glance::registry]" )
  60. 60. roles/glance-api name "glance-api" description "Glance API server" run_list( "role[base]", "recipe[glance::api]" )
  61. 61. roles/nova-setup name "nova-setup" description "Where the setup operations for nova get run" run_list( "recipe[nova::nova-setup]" )
  62. 62. /nova-network-controller name "nova-network-controller" description "Setup nova-networking for controller node" run_list( "recipe[nova-network::nova- controller]" )
  63. 63. roles/nova-scheduler name "nova-scheduler" description "Nova scheduler" run_list( "role[base]", "recipe[nova::scheduler]" )
  64. 64. roles/nova-api-ec2 name "nova-api-ec2" description "Nova API EC2" run_list( "role[base]", "recipe[nova::api-ec2]" )
  65. 65. /nova-api-os-compute name "nova-api-os-compute" description "Nova API for Compute" run_list( "role[base]", "recipe[nova::api-os-compute]" )
  66. 66. roles/nova-volume name "nova-volume" description "Nova Volume Service" run_list( "role[base]", "recipe[nova::volume]" )
  67. 67. roles/nova-cert name "nova-cert" description "Nova Certificate Service" run_list( "role[base]", "recipe[nova::nova-cert]" )
  68. 68. roles/nova-vncproxy name "nova-vncproxy" description "Nova VNC Proxy" run_list( "role[base]", "recipe[nova::vncproxy]" )
  69. 69. roles/horizon-server name "horizon-server" description "Horizon server" run_list( "role[base]", "recipe[mysql::client]", "recipe[mysql::ruby]", "recipe[horizon::server]" )
  70. 70. roles/single-compute name "single-compute" description "Nova compute (with non-HA Controller)" run_list( "role[base]", "role[nova-network-compute]", "recipe[nova::compute]" )
  71. 71. Thanks! Egle Sigler egle.sigler@rackspace.com Matt Ray matt@opscode.com

×