Bare Metal to OpenStack with Razor and Chef

  • 4,709 views
Uploaded on

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.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
4,709
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
87
Comments
1
Likes
9

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Bare Metal to OpenStackwith Razor and ChefEgle Sigler, RackspaceMatt Ray, Opscode
  • 2. AgendaRazor Introduction and OverviewRazor demonstrationOpenStack cookbook walkthrough
  • 3. 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
  • 4. 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
  • 5. 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
  • 6. Fusion Network 1
  • 7. Fusion Network 2
  • 8. Fusion Network 2 Preferences
  • 9. 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
  • 10. 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
  • 11. About RazorProvisioning solution for hardwareInitially developed by EMC and PuppetOpen sourced as a Puppet Labs projectInstall using Puppet, Chef, or manual
  • 12. About RazorAuto-Discovered Real-Time Inventory DataDynamic Image SelectionModel-Based ProvisioningAPIs and Plug-in ArchitectureMetal-to-Cloud Application Lifecycle Management
  • 13. Razor State of Things
  • 14. Razor State of ThingsRazor is awesome!Still not a 1.* releaseMongoDB may cause concurrency issuesPolicy limit counts may not be enforcedSome other issues
  • 15. 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
  • 16. Bright and Shiny FutureAfter v1.0: Windows support maybe AIX and Solaris support
  • 17. Connecting to Razor VMVirtualBox: ssh -p 2223 localhostVMware Fusion: get IP and ssh to it
  • 18. Hands On RazorUser name: anystackerPassword: razorSwitch to root.
  • 19. 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
  • 20. 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)
  • 21. Razor Commandsadd MikroKerneladd Imageadd Modeladd Policyadd Broker
  • 22. 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
  • 23. 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
  • 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. Model Map image to built-in templaterazor model add template -t ubuntu_precise -l install_precise_server -i36Lrq9JMiRwvrw5rSruSjg
  • 26. 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
  • 27. 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) >
  • 28. ModelModel created Label => install_precise_server Template => linux_deploy Description => Ubuntu Precise Model UUID => 5VShcTIkmqrCXGUBM3UwLI Image UUID => 36Lrq9JMiRwvrw5rSruSjg
  • 29. 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
  • 30. Razor BrokersPuppetChefScript
  • 31. Brokersroot@razor:~# razor broker pluginAvailable Broker Plugins:Plugin Descriptionchef Opscode Chefpuppet PuppetLabs PuppetMaster
  • 32. Puppet BrokerIf you use Puppet, use it.Puppet Master hostnamePuppet version
  • 33. Chef BrokerBootstrap installURL for Chef Server, https:hostnameChef versionvalidation.pem filevalidation client nameChef environmentOmnibus installer scriptalternative path for chef-client binaryrun list
  • 34. 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)
  • 35. Add Brokerrazor broker add -p chef -n allinone -dopenstack_allinone--- Building Broker (chef):... lots of stuff
  • 36. Add Broker to Policyrazor policy add -p linux_deploy -lprecise_server -m 5VShcTIkmqrCXGUBM3UwLI -t nics_2 --enabled true
  • 37. 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
  • 38. 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
  • 39. anystacker.com
  • 40. All in one OpenStack onyour VMIf all goes well, OpenStack should be running oryour new VMTry setting up additional policies, and deploydifferent VMs
  • 41. AgendaRazor Introduction and OverviewRazor demonstrationOpenStack cookbook walkthrough
  • 42. AgendaRazor Introduction and OverviewRazor demonstrationOpenStack cookbook walkthrough
  • 43. 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/
  • 44. Rackspace Private Cloud
  • 45. Rackspace Private Cloudgithub.com/rcbops/chef-cookbooks/tree/v3.0.1roles/environments/cookbooks/
  • 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. 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. 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. 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. 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
  • 51. roles/allinone.rbname "allinone"description "This will create an all-in-one Openstack cluster"run_list( "role[single-controller]", "role[single-compute]")
  • 52. 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
  • 53. 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]")
  • 54. 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"] })
  • 55. roles/mysql-mastername "mysql-master"description "Installs mysql and sets upreplication (if 2 nodes with role)"run_list( "role[base]", "recipe[mysql-openstack::server]")
  • 56. roles/rabbitmq-servername "rabbitmq-server"description "RabbitMQ Server (non-ha)"run_list( "role[base]", "recipe[erlang::default]", "recipe[rabbitmq-openstack::server]")
  • 57. roles/keystonename "keystone"description "Keystone server"run_list( "role[base]", "recipe[keystone::server]", "role[keystone-api]")
  • 58. roles/glance-setupname "glance-setup"description "sets up glance registry dband passwords"run_list( "role[base]", "recipe[glance::setup]")
  • 59. roles/glance-registryname "glance-registry"description "Glance Registry server"run_list( "role[base]", "recipe[glance::registry]")
  • 60. roles/glance-apiname "glance-api"description "Glance API server"run_list( "role[base]", "recipe[glance::api]")
  • 61. roles/nova-setupname "nova-setup"description "Where the setup operationsfor nova get run"run_list( "recipe[nova::nova-setup]")
  • 62. /nova-network-controllername "nova-network-controller"description "Setup nova-networking forcontroller node"run_list( "recipe[nova-network::nova-controller]")
  • 63. roles/nova-schedulername "nova-scheduler"description "Nova scheduler"run_list( "role[base]", "recipe[nova::scheduler]")
  • 64. roles/nova-api-ec2name "nova-api-ec2"description "Nova API EC2"run_list( "role[base]", "recipe[nova::api-ec2]")
  • 65. /nova-api-os-computename "nova-api-os-compute"description "Nova API for Compute"run_list( "role[base]", "recipe[nova::api-os-compute]")
  • 66. roles/nova-volumename "nova-volume"description "Nova Volume Service"run_list( "role[base]", "recipe[nova::volume]")
  • 67. roles/nova-certname "nova-cert"description "Nova Certificate Service"run_list( "role[base]", "recipe[nova::nova-cert]")
  • 68. roles/nova-vncproxyname "nova-vncproxy"description "Nova VNC Proxy"run_list( "role[base]", "recipe[nova::vncproxy]")
  • 69. roles/horizon-servername "horizon-server"description "Horizon server"run_list( "role[base]", "recipe[mysql::client]", "recipe[mysql::ruby]", "recipe[horizon::server]")
  • 70. roles/single-computename "single-compute"description "Nova compute (with non-HAController)"run_list( "role[base]", "role[nova-network-compute]", "recipe[nova::compute]")
  • 71. Thanks!Egle Sigleregle.sigler@rackspace.comMatt Raymatt@opscode.com