Bare Metal to OpenStack with Razor and Chef
Upcoming SlideShare
Loading in...5
×
 

Bare Metal to OpenStack with Razor and Chef

on

  • 5,042 views

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 ...

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.

Statistics

Views

Total Views
5,042
Views on SlideShare
4,902
Embed Views
140

Actions

Likes
8
Downloads
83
Comments
1

3 Embeds 140

http://www.scoop.it 97
https://twitter.com 42
https://abs.twimg.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Bare Metal to OpenStack with Razor and Chef Bare Metal to OpenStack with Razor and Chef Presentation Transcript

  • Bare Metal to OpenStackwith Razor and ChefEgle Sigler, RackspaceMatt Ray, Opscode
  • AgendaRazor Introduction and OverviewRazor demonstrationOpenStack cookbook walkthrough
  • Get Razor ApplianceUSB keys (thanks to eNovance, Suse, and Piston)Wireless network: razor5 and razor24 (thank you Rackers!)Start downloading/copyinghttp://192.168.1.3:8080/examples/razor.tar
  • Setting up Razor Appliance in Virtual BoxMust have extension pack installed. Get it here:https://www.virtualbox.org/wiki/Downloads Verify extension pack is installed: VBoxManage list extpacksFile/Import Appliance...Default options for everything
  • Setting up Razor Appliance inVMware 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
  • Fusion Network 1
  • Fusion Network 2
  • Fusion Network 2 Preferences
  • Razor ApplianceBuilt on Ubuntu Server, 12.04, for this tutorialMust have two nics, one for external, one for internal trafficComes with: Razor TFTP service DHCP service MongoDB Chef Server Rackspace Private Cloud Cookbooks MicroKernel and Ubuntu Server ISO
  • Logging InUser name: anystackerPassword: razorLogin, and switch to root.Verify razor is running:root@razor:~# /opt/razor/bin/razor_daemon.rb statusIf not:root@razor:~# /opt/razor/bin/razor_daemon.rb start
  • About RazorProvisioning solution for hardwareInitially developed by EMC and PuppetOpen sourced as a Puppet Labs projectInstall using Puppet, Chef, or manual
  • About RazorAuto-Discovered Real-Time Inventory DataDynamic Image SelectionModel-Based ProvisioningAPIs and Plug-in ArchitectureMetal-to-Cloud Application Lifecycle Management
  • Razor State of Things
  • Razor State of ThingsRazor is awesome!Still not a 1.* releaseMongoDB may cause concurrency issuesPolicy limit counts may not be enforcedSome other issues
  • Bright and Shiny Futurev1.0 release focus on stability and scalability: Beta version in Q3 support concurrency scale well easy to install, upgrade, and test
  • Bright and Shiny FutureAfter v1.0: Windows support maybe AIX and Solaris support
  • Connecting to Razor VMVirtualBox: ssh -p 2223 localhostVMware Fusion: get IP and ssh to it
  • Hands On RazorUser name: anystackerPassword: razorSwitch to root.
  • Verify StatusVerify razor is running:root@razor:~# /opt/razor/bin/razor_daemon.rb statusIf not:root@razor:~# /opt/razor/bin/razor_daemon.rb startCheck networks
  • ifconfigroot@razor:~# ifconfigeth1 Link encap:Ethernet HWaddr 00:0c:29:aa:f9:65inet addr:172.16.16.1 Bcast:172.16.16.255 Mask:255.255.255.0inet6 addr: fe80::20c:29ff:feaa:f965/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500Metric:1RX packets:7525 errors:0 dropped:0 overruns:0 frame:0TX packets:19 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:677489 (677.4 KB) TX bytes:2362 (2.3 KB)
  • Razor Commandsadd MikroKerneladd Imageadd Modeladd Policyadd Broker
  • MicroKernelVariant of Tiny Core LinuxFound here: https://github.com/puppetlabs/razor-microkernel/downloadsNeed to add it once:razor image add -t mk -p ./rz_mk_prod-image.0.9.3.0.iso
  • Add Image razor image add -t os -p ./ubuntu-12.04.2- server-amd64.iso -n ubuntu_precise_server -v 12.04.2Attempting to add, please wait...New image added successfully
  • 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
  • Model Map image to built-in templaterazor model add template -t ubuntu_precise -l install_precise_server -i36Lrq9JMiRwvrw5rSruSjg
  • Current TemplatesROOT@RAZOR:~# RAZOR MODEL TEMPLATEMODEL TEMPLATES: TEMPLATE NAME DESCRIPTIONDEBIAN_WHEEZY DEBIAN WHEEZY MODELOPENSUSE_12 OPENSUSE SUSE 12 MODELREDHAT_6 REDHAT 6 MODELSLES_11 SLES 11 MODELUBUNTU_ONEIRIC UBUNTU ONEIRIC MODELUBUNTU_PRECISE UBUNTU PRECISE MODELUBUNTU_PRECISE_IP_POOL UBUNTU PRECISE MODEL (IPPOOL)VMWARE_ESXI_5 VMWARE ESXI 5 DEPLOYMENTCENTOS_6 CENTOS 6 MODELORACLELINUX_6 ORACLE LINUX 6 MODEL
  • razor model add template -t ubuntu_precise -linstall_precise_server -i 36Lrq9JMiRwvrw5rSruSjg--- Building Model (ubuntu_precise):Please enter node hostname prefix (will append nodenumber) (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) >
  • ModelModel created Label => install_precise_server Template => linux_deploy Description => Ubuntu Precise Model UUID => 5VShcTIkmqrCXGUBM3UwLI Image UUID => 36Lrq9JMiRwvrw5rSruSjg
  • Policy Map model to a noderazor policy add -p linux_deploy -l precise_server -m5VShcTIkmqrCXGUBM3UwLI -t nics_1 --enabled truePolicy created UUID => 6BtPna2OuYDcFPZr7ec1XU Line Number => 0 Label => precise_server Enabled => true Template => linux_deploy Description => Policy for deploying a Linux-based operatingsystem. Tags => [nics_1] Model Label => install_precise_server Broker Target => none Currently Bound => 0 Maximum Bound => 0 Bound Counter => 0
  • Razor BrokersPuppetChefScript
  • Brokersroot@razor:~# razor broker pluginAvailable Broker Plugins:Plugin Descriptionchef Opscode Chefpuppet PuppetLabs PuppetMaster
  • Puppet BrokerIf you use Puppet, use it.Puppet Master hostnamePuppet version
  • Chef BrokerBootstrap installURL for Chef Server, https:hostnameChef versionvalidation.pem filevalidation client nameChef environmentOmnibus installer scriptalternative path for chef-client binaryrun list
  • Script BrokerVery new, not on Razor applianceRuns scripts on the newly installed nodeSoon, will gain special powers: pre and post scripts run on Razor server for full integration with tools (signing Puppet certificate, etc)
  • Add Brokerrazor broker add -p chef -n allinone -dopenstack_allinone--- Building Broker (chef):... lots of stuff
  • Add Broker to Policyrazor policy add -p linux_deploy -lprecise_server -m 5VShcTIkmqrCXGUBM3UwLI -t nics_2 --enabled true
  • razor policy update 28kDQSkIVWtp9DFOuQdAgK -b4uiuMcQVoePYmKOc3QLeRE 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
  • Boot VMCreate new VMMake sure it has 2 nics, both on private network2 GB memory80 GB diskon VirtualBox, set boot orderConnect to real internets, otherwise chef client will notinstall
  • anystacker.com
  • All in one OpenStack onyour VMIf all goes well, OpenStack should be running oryour new VMTry setting up additional policies, and deploydifferent VMs
  • AgendaRazor Introduction and OverviewRazor demonstrationOpenStack cookbook walkthrough
  • AgendaRazor Introduction and OverviewRazor demonstrationOpenStack cookbook walkthrough
  • Rackspace Private Cloudcurrently Folsom release (v3.0.1)open source Chef 11 server embeddedhttp://www.rackspace.com/cloud/private/https://github.com/rcbopshttps://github.com/rcbops-cookbooks/
  • Rackspace Private Cloud
  • Rackspace Private Cloudgithub.com/rcbops/chef-cookbooks/tree/v3.0.1roles/environments/cookbooks/
  • 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/
  • 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"] },
  • 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" } ]},
  • 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" }}
  • roles/allinone.rb nova-api-ec2.rbbase.rb nova-api-os-compute.rbcinder-all.rb nova-api.rbcinder-api.rb nova-cert.rbcinder-scheduler.rb nova-controller.rbcinder-setup.rb nova-misc-services.rbcinder-volume.rb nova-network-compute.rbcollectd-client.rb nova-network-controller.rbcollectd-server.rb nova-network.rbglance-api.rb nova-scheduler.rbglance-registry.rb nova-setup.rbglance-setup.rb nova-vncproxy.rbglance.rb nova-volume.rbgraphite.rb openstack-ha.rbha-controller1.rb quantum-network-manager.rbha-controller2.rb rabbitmq-server.rbhaproxy.rb rsyslog-client.rbhorizon-server.rb rsyslog-server.rbjenkins-allinone.rb single-compute.rbjenkins-compute.rb single-controller.rbjenkins-controller.rb swift-account-server.rbjenkins-glance.rb swift-all-in-one.rbjenkins-mysql-master.rb swift-container-server.rbjenkins-nova-api.rb swift-management-server.rbkeystone-api.rb swift-object-server.rbkeystone.rb swift-proxy-server.rbmysql-master.rb swift-setup.rb
  • roles/allinone.rbname "allinone"description "This will create an all-in-one Openstack cluster"run_list( "role[single-controller]", "role[single-compute]")
  • expanded run listosops-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
  • roles/single-controllername "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]")
  • roles/basename "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"] })
  • roles/mysql-mastername "mysql-master"description "Installs mysql and sets upreplication (if 2 nodes with role)"run_list( "role[base]", "recipe[mysql-openstack::server]")
  • roles/rabbitmq-servername "rabbitmq-server"description "RabbitMQ Server (non-ha)"run_list( "role[base]", "recipe[erlang::default]", "recipe[rabbitmq-openstack::server]")
  • roles/keystonename "keystone"description "Keystone server"run_list( "role[base]", "recipe[keystone::server]", "role[keystone-api]")
  • roles/glance-setupname "glance-setup"description "sets up glance registry dband passwords"run_list( "role[base]", "recipe[glance::setup]")
  • roles/glance-registryname "glance-registry"description "Glance Registry server"run_list( "role[base]", "recipe[glance::registry]")
  • roles/glance-apiname "glance-api"description "Glance API server"run_list( "role[base]", "recipe[glance::api]")
  • roles/nova-setupname "nova-setup"description "Where the setup operationsfor nova get run"run_list( "recipe[nova::nova-setup]")
  • /nova-network-controllername "nova-network-controller"description "Setup nova-networking forcontroller node"run_list( "recipe[nova-network::nova-controller]")
  • roles/nova-schedulername "nova-scheduler"description "Nova scheduler"run_list( "role[base]", "recipe[nova::scheduler]")
  • roles/nova-api-ec2name "nova-api-ec2"description "Nova API EC2"run_list( "role[base]", "recipe[nova::api-ec2]")
  • /nova-api-os-computename "nova-api-os-compute"description "Nova API for Compute"run_list( "role[base]", "recipe[nova::api-os-compute]")
  • roles/nova-volumename "nova-volume"description "Nova Volume Service"run_list( "role[base]", "recipe[nova::volume]")
  • roles/nova-certname "nova-cert"description "Nova Certificate Service"run_list( "role[base]", "recipe[nova::nova-cert]")
  • roles/nova-vncproxyname "nova-vncproxy"description "Nova VNC Proxy"run_list( "role[base]", "recipe[nova::vncproxy]")
  • roles/horizon-servername "horizon-server"description "Horizon server"run_list( "role[base]", "recipe[mysql::client]", "recipe[mysql::ruby]", "recipe[horizon::server]")
  • roles/single-computename "single-compute"description "Nova compute (with non-HAController)"run_list( "role[base]", "role[nova-network-compute]", "recipe[nova::compute]")
  • Thanks!Egle Sigleregle.sigler@rackspace.comMatt Raymatt@opscode.com