{"id":564,"date":"2012-07-02T08:09:14","date_gmt":"2012-07-02T08:09:14","guid":{"rendered":"http:\/\/www.cloudcomp.ch\/?p=564"},"modified":"2012-07-02T08:09:14","modified_gmt":"2012-07-02T08:09:14","slug":"puppet-and-openstack-part-one","status":"publish","type":"post","link":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/","title":{"rendered":"Puppet and OpenStack: Part One"},"content":{"rendered":"<p>In this guide we&#8217;ll explain how you can setup a simple OpenStack all in one installation using puppet. In this guide we&#8217;ll be using a virtual machine to simulate the hardware. We&#8217;ll use the same network configration as was used [in the article on Foreman](http:\/\/www.cloudcomp.ch\/2012\/06\/automating-the-icclab-part-one\/). We&#8217;ll also be using Ubuntu 12.04.<\/p>\n<p>By default, nameserver and domain settings are automatically managed by `resolvconf` (this is due to the primary adapter being managed by DHCP). As puppet relies on the fully qualified host name of nodes its installed on, you should, if not using other means, configure `resolvconf` so that it does not overwrite your domain and nameserver settings. To do this edit `\/etc\/resolvconf\/resolv.conf.d\/head` and place the following content:<\/p>\n<p>[gist id=3029170]<\/p>\n<p>Of course feel free to use what ever other values you like to use. Performing this configuration will ensure that resolvconf always generates settings with your values.<\/p>\n<p>If you are not using your own managed DNS server then you should place IP-host aliases in your `\/etc\/hosts` file. Here&#8217;s the relevant file entries used in this article:<\/p>\n<p>[gist id=3029172]<\/p>\n<p>Once you have the virtual machine installed, it might help you if you take a snapshot of the it at this stage so that you can roll-back to a fresh state.<\/p>\n<p>## Install Puppet<\/p>\n<p>Execute the following:<\/p>\n<p>[gist id=3029174]<\/p>\n<p>## Configure Puppet<br \/>\nIn order to deploy OpenStack, we will be using puppet in both agent and master mode.<\/p>\n<p>### Agent Configuration<br \/>\nConfigure puppet agent. Edit `\/etc\/puppet\/puppet.conf` so that it the `[agent]` section has the set values of:<\/p>\n<p>[gist id=3029176]<\/p>\n<p>### Master Configuration<br \/>\nConfigure puppet master. Edit `\/etc\/puppet\/puppet.conf` so that it the `[master]` section has the set values of:<\/p>\n<p>[gist id=3029177]<\/p>\n<p>***Note*** that this particular configuration will change when we integrate with Foreman in the article describing Foreman, puppet and OpenStack integration.<\/p>\n<p>## Select Puppet Modules<\/p>\n<p>We&#8217;ll use the [official Puppetlabs OpenStack modules](https:\/\/github.com\/puppetlabs\/puppetlabs-openstack). Install the prerequisites and checkout the OpenStack modules from Github:<\/p>\n<p>[gist id=3029179]<\/p>\n<p>Once done you&#8217;ll need to follow the setup instructions (they&#8217;re repeated here for completeness):<\/p>\n<p>[gist id=3029180]<\/p>\n<p>After executing these steps, the rake script will have placed other required puppet modules in `\/etc\/puppet\/modules\/`<\/p>\n<p>## Assign the OpenStack Role<br \/>\nWe now have to tell puppet that the current VM is to run as a complete OpenStack instance. To do this copy the example `site.pp` file to `\/etc\/puppet\/manifests\/` and then edit so that:<\/p>\n<p>1. the node definition for the VM reads as `node \/controller.cloudcomplab.ch\/ {`<br \/>\n2. `libvirt_type` is set to `qemu`<br \/>\n3. if you want further logging information to help you, then set `$verbose` to `true`<br \/>\n4. you might want to specify a floating (i.e. static) IP range. For this setup you can add and set `floating_range` to `&#8217;192.168.56.128\/25&#8217;`<\/p>\n<p>Once done, wait! This setup will run perfectly fine until you attempt to invoke the services of `nova-volume`. `nova-volume` is not fully setup as there is no LVM group (`nova-volumes`) setup. To set this up manually execute these steps as root:<\/p>\n<p> 1. `truncate -s 2052M \/root\/nova-vol-file`<br \/>\n 2. Find the loop-back device associated with `nova-vol-fil`:<\/p>\n<p>    `losetup -f &#8211;show \/root\/nova-vol-file`<\/p>\n<p>    In this setup the value is `\/dev\/loop1`<\/p>\n<p> 3. Now, finally, create the LVM volume group:<\/p>\n<p>    `vgcreate nova-volumes \/dev\/loop1`<\/p>\n<p>    You may need to install the LVM tools: `apt-get -y install lvm2`<\/p>\n<p>**Note** that this LVM mapping is reset on reboot. <\/p>\n<p>Now that you have setup LVM and puppet to install OpenStack, do just that! Execute:<\/p>\n<p>`puppet agent &#8211;no-daemonize &#8211;verbose`<\/p>\n<p>You&#8217;ll see alot of output as puppet installs OpenStack but at the end of the process you will be able to access your OpenStack installation at `http:\/\/192.168.56.2`<\/p>\n<p>## Using OpenStack<br \/>\nNow that you&#8217;ve seen the shiny UI of OpenStack you will have noticed that there are no VM images to run. To get a VM image into OpenStack do the following:<\/p>\n<p> 1. Import the authentication credentials into your shell (puppet was kind enough to create these for you)<\/p>\n<p>    `source \/root\/openrc`<\/p>\n<p> 2. Download a VM image, CirrOS in this case:<\/p>\n<p>    `wget https:\/\/launchpad.net\/cirros\/trunk\/0.3.0\/+download\/cirros-0.3.0-x86_64-disk.img`<\/p>\n<p> 3. Import the CirrOS image into glance:<\/p>\n<p>    `glance add name=&#8221;CirrOS 0.3 VM Image&#8221; disk_format=qcow2 container_format=ovf &lt; cirros-0.3.0-x86_64-disk.img`<\/p>\n<p> 4. Go back to your web user interface and you will see that there is now a VM image to instantiate and execute.<\/p>\n<p>By the way, the puppetlabs OpenStack github repository [has some decent documentation](https:\/\/github.com\/puppetlabs\/puppetlabs-openstack).<\/p>\n<p># Next up<br \/>\nWe&#039;ve now successfully installed an &quot;all-in-one&quot; OpenStack using puppet. In the next article we&#039;ll look at expanding this to a multi-node scenario. Stay tuned!<\/p>\n<div class=\"pt-sm\">Schlagw\u00f6rter: <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/automation\/\">automation<\/a>, <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/deploy\/\">deploy<\/a>, <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/install\/\">install<\/a>, <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/openstack\/\">openstack<\/a>, <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/puppet\/\">puppet<\/a><br><\/div>","protected":false},"excerpt":{"rendered":"<p>In this guide we&#8217;ll explain how you can setup a simple OpenStack all in one installation using puppet. In this guide we&#8217;ll be using a virtual machine to simulate the hardware and the official puppetlabs&#8217; OpenStack module.<\/p>\n","protected":false},"author":72,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[5],"tags":[51,110,195,240,271],"features":[],"class_list":["post-564","post","type-post","status-publish","format-standard","hentry","category-articles","tag-automation","tag-deploy","tag-install","tag-openstack","tag-puppet"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Puppet and OpenStack: Part One - Service Engineering (ICCLab &amp; SPLab)<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Puppet and OpenStack: Part One\" \/>\n<meta property=\"og:description\" content=\"In this guide we&#039;ll explain how you can setup a simple OpenStack all in one installation using puppet. In this guide we&#039;ll be using a virtual machine to simulate the hardware and the official puppetlabs&#039; OpenStack module.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/\" \/>\n<meta property=\"og:site_name\" content=\"Service Engineering (ICCLab &amp; SPLab)\" \/>\n<meta property=\"article:published_time\" content=\"2012-07-02T08:09:14+00:00\" \/>\n<meta name=\"author\" content=\"Andy Edmonds\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andy Edmonds\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/\"},\"author\":{\"name\":\"Andy Edmonds\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/a62f7b702361e11d635f4e59446e8684\"},\"headline\":\"Puppet and OpenStack: Part One\",\"datePublished\":\"2012-07-02T08:09:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/\"},\"wordCount\":788,\"commentCount\":2,\"keywords\":[\"automation\",\"deploy\",\"install\",\"openstack\",\"puppet\"],\"articleSection\":[\"Articles\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/\",\"url\":\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/\",\"name\":\"Puppet and OpenStack: Part One - Service Engineering (ICCLab &amp; SPLab)\",\"isPartOf\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#website\"},\"datePublished\":\"2012-07-02T08:09:14+00:00\",\"author\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/a62f7b702361e11d635f4e59446e8684\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\/\/blog.zhaw.ch\/icclab\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Puppet and OpenStack: Part One\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#website\",\"url\":\"https:\/\/blog.zhaw.ch\/icclab\/\",\"name\":\"Service Engineering (ICCLab &amp; SPLab)\",\"description\":\"A Blog of the ZHAW Zurich University of Applied Sciences\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.zhaw.ch\/icclab\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/a62f7b702361e11d635f4e59446e8684\",\"name\":\"Andy Edmonds\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/564b17a1126a2ed30e20d4c65842164e32a6cf798a8175e88bcf5b352ebd60c8?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/564b17a1126a2ed30e20d4c65842164e32a6cf798a8175e88bcf5b352ebd60c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/564b17a1126a2ed30e20d4c65842164e32a6cf798a8175e88bcf5b352ebd60c8?s=96&d=mm&r=g\",\"caption\":\"Andy Edmonds\"},\"sameAs\":[\"http:\/\/andy.edmonds.be\"],\"url\":\"https:\/\/blog.zhaw.ch\/icclab\/author\/edmo\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Puppet and OpenStack: Part One - Service Engineering (ICCLab &amp; SPLab)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/","og_locale":"en_US","og_type":"article","og_title":"Puppet and OpenStack: Part One","og_description":"In this guide we'll explain how you can setup a simple OpenStack all in one installation using puppet. In this guide we'll be using a virtual machine to simulate the hardware and the official puppetlabs' OpenStack module.","og_url":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/","og_site_name":"Service Engineering (ICCLab &amp; SPLab)","article_published_time":"2012-07-02T08:09:14+00:00","author":"Andy Edmonds","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andy Edmonds","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/#article","isPartOf":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/"},"author":{"name":"Andy Edmonds","@id":"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/a62f7b702361e11d635f4e59446e8684"},"headline":"Puppet and OpenStack: Part One","datePublished":"2012-07-02T08:09:14+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/"},"wordCount":788,"commentCount":2,"keywords":["automation","deploy","install","openstack","puppet"],"articleSection":["Articles"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/","url":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/","name":"Puppet and OpenStack: Part One - Service Engineering (ICCLab &amp; SPLab)","isPartOf":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/#website"},"datePublished":"2012-07-02T08:09:14+00:00","author":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/a62f7b702361e11d635f4e59446e8684"},"breadcrumb":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.zhaw.ch\/icclab\/puppet-and-openstack-part-one\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/blog.zhaw.ch\/icclab\/"},{"@type":"ListItem","position":2,"name":"Puppet and OpenStack: Part One"}]},{"@type":"WebSite","@id":"https:\/\/blog.zhaw.ch\/icclab\/#website","url":"https:\/\/blog.zhaw.ch\/icclab\/","name":"Service Engineering (ICCLab &amp; SPLab)","description":"A Blog of the ZHAW Zurich University of Applied Sciences","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.zhaw.ch\/icclab\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/a62f7b702361e11d635f4e59446e8684","name":"Andy Edmonds","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/564b17a1126a2ed30e20d4c65842164e32a6cf798a8175e88bcf5b352ebd60c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/564b17a1126a2ed30e20d4c65842164e32a6cf798a8175e88bcf5b352ebd60c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/564b17a1126a2ed30e20d4c65842164e32a6cf798a8175e88bcf5b352ebd60c8?s=96&d=mm&r=g","caption":"Andy Edmonds"},"sameAs":["http:\/\/andy.edmonds.be"],"url":"https:\/\/blog.zhaw.ch\/icclab\/author\/edmo\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/posts\/564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/users\/72"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/comments?post=564"}],"version-history":[{"count":0,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/posts\/564\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/media?parent=564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/categories?post=564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/tags?post=564"},{"taxonomy":"features","embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/features?post=564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}