{"id":8112,"date":"2019-01-13T18:25:37","date_gmt":"2019-01-13T18:25:37","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=8112"},"modified":"2019-01-23T23:17:51","modified_gmt":"2019-01-23T23:17:51","slug":"openstack-deployment-using-devstack-on-centos-7-and-rhel7","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/13\/openstack-deployment-using-devstack-on-centos-7-and-rhel7\/","title":{"rendered":"OpenStack Deployment using Devstack on CentOS 7 and RHEL7"},"content":{"rendered":"<p><strong>Devstack<\/strong>\u00a0is a collection of scripts which deploy the latest version of openstack environment on virtual machine, personal laptop or a desktop. As the name suggests it is used for\u00a0<strong>development environment<\/strong>\u00a0and can be used for Openstack Project\u2019s functional testing and sometime openstack environment deployed by devstack can also be used for demonstrations purpose and for some basic PoC.<\/p>\n<p>In this article I will demonstrate how to install Openstack on CentOS 7 \/ RHEL 7 System using Devstack. Following are the minimum system requirements,<\/p>\n<ul>\n<li>Dual Core Processor<\/li>\n<li>Minimum 8 GB RAM<\/li>\n<li>60 GB Hard Disk<\/li>\n<li>Internet Connection<\/li>\n<\/ul>\n<p>Following are \u00a0the details of my Lab Setup for Openstack deployment using devstack<\/p>\n<ul>\n<li>Minimal Installed CentOS 7 \/ RHEL 7 (VM)<\/li>\n<li>Hostname \u2013 devstack-linuxtechi<\/li>\n<li>IP Address \u2013 169.144.104.230<\/li>\n<li>10 vCPU<\/li>\n<li>14 GB RAM<\/li>\n<li>60 GB Hard disk<\/li>\n<\/ul>\n<p>Let\u2019s start deployment steps, login to your CentOS 7 or RHEL 7 System<\/p>\n<h4>Step:1 Update Your System and Set Hostname<\/h4>\n<p>Run the following yum command to apply latest updates to system and then take a reboot. Also after reboot set the hostname<\/p>\n<pre>~]# yum update -y &amp;&amp; reboot\r\n~]# hostnamectl set-hostname \"devstack-linuxtechi\"\r\n~]# exec bash<\/pre>\n<h4>Step:2) Create a Stack user and assign sudo rights to it<\/h4>\n<p>All the installations steps are to be carried out by a user name \u201c<strong>stack<\/strong>\u201c, refer the below commands to create and assign sudo rights .<\/p>\n<pre>[root@devstack-linuxtechi ~]# useradd -s \/bin\/bash -d \/opt\/stack -m stack\r\n[root@devstack-linuxtechi ~]# echo \"stack ALL=(ALL) NOPASSWD: ALL\" | sudo tee \/etc\/sudoers.d\/stack\r\nstack ALL=(ALL) NOPASSWD: ALL\r\n[root@devstack-linuxtechi ~]#<\/pre>\n<h4>Step:3) Install git and download devstack<\/h4>\n<p>Switch to stack user and install git package using yum command<\/p>\n<pre>[root@devstack-linuxtechi ~]# su - stack\r\n[stack@devstack-linuxtechi ~]$ sudo yum install git -y<\/pre>\n<p>Download devstack using below git command,<\/p>\n<pre>[stack@devstack-linuxtechi ~]$ git clone https:\/\/git.openstack.org\/openstack-dev\/devstack\r\nCloning into 'devstack'...\r\nremote: Counting objects: 42729, done.\r\nremote: Compressing objects: 100% (21438\/21438), done.\r\nremote: Total 42729 (delta 30283), reused 32549 (delta 20625)\r\nReceiving objects: 100% (42729\/42729), 8.93 MiB | 3.77 MiB\/s, done.\r\nResolving deltas: 100% (30283\/30283), done.\r\n[stack@devstack-linuxtechi ~]$<\/pre>\n<h4>Step:4) Create local.conf file and start openstack installation<\/h4>\n<p>To start openstack installation using devstack script (stack.sh), first we need to prepare local.conf file that suits to our setup.<\/p>\n<p>Change to devstack folder and create local.conf file with below contents<\/p>\n<pre>[stack@devstack-linuxtechi ~]$ cd devstack\/\r\n[stack@devstack-linuxtechi devstack]$ vi local.conf\r\n[[local|localrc]]\r\n#Specify the IP Address of your VM \/ Server in front of HOST_IP Parameter\r\nHOST_IP=169.144.104.230\r\n\r\n#Specify the name of interface of your Server or VM in front of FLAT_INTERFACE\r\nFLAT_INTERFACE=eth0\r\n\r\n#Specify the Tenants Private Network and its Size\r\nFIXED_RANGE=10.4.128.0\/20\r\nFIXED_NETWORK_SIZE=4096\r\n\r\n#Specify the range of external IPs that will be used in Openstack for floating IPs\r\nFLOATING_RANGE=172.24.10.0\/24\r\n\r\n#Number Host on which Openstack will be deployed\r\nMULTI_HOST=1\r\n\r\n#Installation Logs file\r\nLOGFILE=\/opt\/stack\/logs\/stack.sh.log\r\n\r\n#KeyStone Admin Password \/ Database \/ RabbitMQ \/ Service Password\r\nADMIN_PASSWORD=openstack\r\nDATABASE_PASSWORD=db-secret\r\nRABBIT_PASSWORD=rb-secret\r\nSERVICE_PASSWORD=sr-secret\r\n\r\n#Additionally installing Heat Service\r\nenable_plugin heat https:\/\/git.openstack.org\/openstack\/heat master\r\nenable_service h-eng h-api h-api-cfn h-api-cw<\/pre>\n<p>Save and exit the file.<\/p>\n<p>Now start the deployment or installation by executing the script (stack.sh)<\/p>\n<pre>[stack@devstack-linuxtechi devstack]$ .\/stack.sh<\/pre>\n<p>It will take between 30 to 45 minutes depending upon your internet connection.<\/p>\n<p>While running the above command, if you got the below errors<\/p>\n<pre>+functions-common:git_timed:607\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 timeout -s SIGINT 0 git clone git:\/\/git.openstack.org\/openstack\/requirements.git \/opt\/stack\/requirements --branch master\r\nfatal: unable to connect to git.openstack.org:\r\ngit.openstack.org[0: 104.130.246.85]: errno=Connection timed out\r\ngit.openstack.org[1: 2001:4800:7819:103:be76:4eff:fe04:77e6]: errno=Network is unreachable\r\nCloning into '\/opt\/stack\/requirements'...\r\n+functions-common:git_timed:610\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [[ 128 -ne 124 ]]\r\n+functions-common:git_timed:611\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 die 611 'git call failed: [git clone' git:\/\/git.openstack.org\/openstack\/requirements.git \/opt\/stack\/requirements --branch 'master]'\r\n+functions-common:die:195\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 local exitcode=0\r\n[Call Trace]\r\n.\/stack.sh:758:git_clone\r\n\/opt\/stack\/devstack\/functions-common:547:git_timed\r\n\/opt\/stack\/devstack\/functions-common:611:die\r\n[ERROR] \/opt\/stack\/devstack\/functions-common:611 git call failed: [git clone git:\/\/git.openstack.org\/openstack\/requirements.git \/opt\/stack\/requirements --branch master]\r\nError on exit\r\n\/bin\/sh: brctl: command not found\r\n[stack@devstack-linuxtechi devstack]$<\/pre>\n<p>To Resolve these errors, perform the following steps<\/p>\n<p>Install\u00a0<strong>bridge-utils<\/strong>\u00a0package and change parameter from \u201c<strong>GIT_BASE=${GIT_BASE:-git:\/\/git.openstack.org}<\/strong>\u201d to \u201c<strong>GIT_BASE=${GIT_BASE:-https:\/\/www.github.com}<\/strong>\u201d in stackrc file<\/p>\n<pre>[stack@devstack-linuxtechi devstack]$ sudo yum install bridge-utils -y\r\n[stack@devstack-linuxtechi devstack]$ vi stackrc\r\n\u2026\u2026\r\n#GIT_BASE=${GIT_BASE:-git:\/\/git.openstack.org}\r\nGIT_BASE=${GIT_BASE:-https:\/\/www.github.com}\r\n\u2026\u2026<\/pre>\n<p>Now re-run the stack.sh script,<\/p>\n<pre>[stack@devstack-linuxtechi devstack]$ .\/stack.sh<\/pre>\n<p>Once the script is executed successfully, we will get the output something like below,<\/p>\n<p><a title=\"\" href=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Stack-Command-output-CentOS7.jpg\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8157\" src=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Stack-Command-output-CentOS7.jpg\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" srcset=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Stack-Command-output-CentOS7.jpg 969w, https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Stack-Command-output-CentOS7-300x181.jpg 300w, https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Stack-Command-output-CentOS7-768x464.jpg 768w\" alt=\"Stack-Command-output-CentOS7\" width=\"969\" height=\"586\" \/><\/a><\/p>\n<p>This confirms that openstack has been deployed successfully,<\/p>\n<h4>Step:5 Access OpenStack either via Openstack CLI or Horizon Dashboard<\/h4>\n<p>if you want to perform any task from openstack cli, then you have to firsr source openrc file, which contain admin credentials.<\/p>\n<pre>[stack@devstack-linuxtechi devstack]$ source openrc\r\nWARNING: setting legacy OS_TENANT_NAME to support cli tools.\r\n[stack@devstack-linuxtechi devstack]$ openstack network list\r\n+--------------------------------------+---------+----------------------------------------------------------------------------+\r\n| ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Name\u00a0\u00a0\u00a0 | Subnets\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n+--------------------------------------+---------+----------------------------------------------------------------------------+\r\n| 5ae5a9e3-01ac-4cd2-86e3-83d079753457 | private | 9caa54cc-f5a4-4763-a79e-6927999db1a1, a5028df6-4208-45f3-8044-a7476c6cf3e7 |\r\n| f9354f80-4d38-42fc-a51e-d3e6386b0c4c | public\u00a0 | 0202c2f3-f6fd-4eae-8aa6-9bd784f7b27d, 18050a8c-41e5-4bae-8ab8-b500bc694f0c |\r\n+--------------------------------------+---------+----------------------------------------------------------------------------+\r\n[stack@devstack-linuxtechi devstack]$ openstack image list\r\n+--------------------------------------+--------------------------+--------+\r\n| ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Status |\r\n+--------------------------------------+--------------------------+--------+\r\n| 5197ed8e-39d2-4eca-b36a-d38381b57adc | cirros-0.3.6-x86_64-disk | active |\r\n+--------------------------------------+--------------------------+--------+\r\n[stack@devstack-linuxtechi devstack]$<\/pre>\n<p>Now Try accessing the Horizon Dashboard, URL details and Credentials are already there in stack command output.<\/p>\n<p>http:\/\/{Your-Server-IP-Address}\/dashboard<\/p>\n<p><a title=\"\" href=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Login-OpenStack-Dashboard-DevStack-CentOS7.jpg\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-8156\" src=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Login-OpenStack-Dashboard-DevStack-CentOS7-1024x546.jpg\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Login-OpenStack-Dashboard-DevStack-CentOS7-1024x546.jpg 1024w, https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Login-OpenStack-Dashboard-DevStack-CentOS7-300x160.jpg 300w, https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Login-OpenStack-Dashboard-DevStack-CentOS7-768x409.jpg 768w, https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Login-OpenStack-Dashboard-DevStack-CentOS7.jpg 1366w\" alt=\"Login-OpenStack-Dashboard-DevStack-CentOS7\" width=\"1024\" height=\"546\" \/><\/a><\/p>\n<p><a title=\"\" href=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Horizon-Dashboard-DevStack-CentOS7.jpg\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-8155\" src=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Horizon-Dashboard-DevStack-CentOS7-1024x576.jpg\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Horizon-Dashboard-DevStack-CentOS7-1024x576.jpg 1024w, https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Horizon-Dashboard-DevStack-CentOS7-300x169.jpg 300w, https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Horizon-Dashboard-DevStack-CentOS7-768x432.jpg 768w, https:\/\/www.linuxtechi.com\/wp-content\/uploads\/2019\/01\/Horizon-Dashboard-DevStack-CentOS7.jpg 1229w\" alt=\"Horizon-Dashboard-DevStack-CentOS7\" width=\"1024\" height=\"576\" \/><\/a><\/p>\n<h3>Remove\/ Uninstall OpenStack using devstack scripts<\/h3>\n<p>If are done with testing and demonstration and want to remove openstack from your system then run the followings scripts via Stack user,<\/p>\n<pre>[stack@devstack-linuxtechi ~]$ cd devstack\r\n[stack@devstack-linuxtechi devstack]$ .\/clean.sh\r\n[stack@devstack-linuxtechi devstack]$ .\/unstack.sh\r\n[stack@devstack-linuxtechi devstack]$ rm -rf \/opt\/stack\/\r\n[stack@devstack-linuxtechi ~]$ sudo rm -rf devstack\r\n[stack@devstack-linuxtechi ~]$ sudo rm -rf \/usr\/local\/bin\/<\/pre>\n<p>That\u2019s all from this tutorial, if you like the steps, please do share your valuable feedback and comments.<\/p>\n<p><a href=\"https:\/\/www.linuxtechi.com\/openstack-deployment-devstack-centos-7-rhel-7\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Devstack\u00a0is a collection of scripts which deploy the latest version of openstack environment on virtual machine, personal laptop or a desktop. As the name suggests it is used for\u00a0development environment\u00a0and can be used for Openstack Project\u2019s functional testing and sometime openstack environment deployed by devstack can also be used for demonstrations purpose and for some &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/13\/openstack-deployment-using-devstack-on-centos-7-and-rhel7\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;OpenStack Deployment using Devstack on CentOS 7 and RHEL7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8112","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/8112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=8112"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/8112\/revisions"}],"predecessor-version":[{"id":8571,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/8112\/revisions\/8571"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=8112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=8112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=8112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}