<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Malcolm Jones on Medium]]></title>
        <description><![CDATA[Stories by Malcolm Jones on Medium]]></description>
        <link>https://medium.com/@bossjones?source=rss-b58b991fd0f7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*JbNFLPKHCqXt-hpl.jpeg</url>
            <title>Stories by Malcolm Jones on Medium</title>
            <link>https://medium.com/@bossjones?source=rss-b58b991fd0f7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 30 May 2026 05:38:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bossjones/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[How I setup a Raspberry Pi 3 Cluster Using The New Docker Swarm Mode In 29 Minutes]]></title>
            <link>https://medium.com/@bossjones/how-i-setup-a-raspberry-pi-3-cluster-using-the-new-docker-swarm-mode-in-29-minutes-aa0e4f3b1768?source=rss-b58b991fd0f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa0e4f3b1768</guid>
            <category><![CDATA[hypriot]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Malcolm Jones]]></dc:creator>
            <pubDate>Sun, 10 Jul 2016 20:26:43 GMT</pubDate>
            <atom:updated>2016-07-26T18:32:15.411Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lc64RHyEkIVuE_Ld-BEz7w.jpeg" /></figure><p><strong>Helllooooo</strong>, everyone! I know it’s been a little while since I wrote about anything on here. I’ve been on vacation from work for the past week, and finally had the time to mess around with a couple of things I’ve wanted to work on for a while! Today I want to tell you about my journey to deploy a cluster management solution to four <a href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/"><strong>Raspberry Pi 3</strong></a>’s I had sitting around my apartment. If you have been <a href="http://imgur.com/zXsd4J7"><strong>hiding under a rock</strong></a> for the past year or two, open-source cluster management has become a huge thing in the tech world allowing teams to provide efficient resource isolation and sharing across distributed applications/frameworks. At work, I have been playing with <a href="http://mesos.apache.org/"><strong>Mesos</strong></a> (and <a href="https://mesosphere.github.io/marathon/"><strong>Marathon</strong></a>) for a number of projects, so I took this as an opportunity, at first, to try out <a href="http://kubernetes.io/"><strong>Kubernetes</strong></a>. There are a large number of great blog posts out there detailing how others managed to bring up their clusters from scratch. In particular, I looked at the following posts/projects:</p><p>A. <a href="https://github.com/luxas/kubernetes-on-arm"><strong>https://github.com/luxas/kubernetes-on-arm</strong></a><br>B.<strong> </strong><a href="http://blog.kubernetes.io/2015/11/creating-a-Raspberry-Pi-cluster-running-Kubernetes-the-shopping-list-Part-1.html"><strong>http://blog.kubernetes.io/2015/11/creating-a-Raspberry-Pi-cluster-running-Kubernetes-the-shopping-list-Part-1.html</strong></a><br>C. <a href="http://blog.kubernetes.io/2015/12/creating-raspberry-pi-cluster-running.html"><strong>http://blog.kubernetes.io/2015/12/creating-raspberry-pi-cluster-running.html</strong></a><br>D. <a href="https://medium.com/google-cloud/everything-you-need-to-know-about-the-kubernetes-raspberry-pi-cluster-2a2413bfa0fa#.9k4t8rusk"><strong>https://medium.com/google-cloud/everything-you-need-to-know-about-the-kubernetes-raspberry-pi-cluster-2a2413bfa0fa#.9k4t8rusk</strong></a><br>E. <a href="https://github.com/Project31/ansible-kubernetes-openshift-pi3/tree/hypriot"><strong>https://github.com/Project31/ansible-kubernetes-openshift-pi3/tree/hypriot</strong></a></p><p>Each solution is well documented and simple to follow, but I came across problems, most likely because I was attempting to use up-to-date hardware/software and NOT the old locked versions mentioned in the blog posts. Anyone who has played with these bleeding edge technologies knows that things can change drastically in a week, let alone a year. I wanted to use my RPi3’s (not the Raspberry Pi 2), and <a href="http://blog.hypriot.com/post/hypriotos-barbossa-for-raspberry-pi-3/"><strong>Hypriot v0.8.0 Barbossa</strong></a> (so many excellent new features and updated core packages). Also, Hypriot v0.8.0 Barbossa running on a Raspberry Pi 3 seems to be an incredibly powerful combination according to the community, and I did not want to miss out on any of that especially when I only have a week to hack on things before being swamped at work again. At some point, I touched base with <a href="http://twitter.com/Quintus23M"><strong>@Quintus23M</strong></a> AKA Dieter Reuter (Docker Pirate at <a href="http://twitter.com/HypriotTweets"><strong>@HypriotTweets</strong></a>) and he told me about some of the magic the lovely people have been cooking up over at <a href="https://www.docker.com/"><strong>Docker</strong></a> with v1.12.0. The following is my experience setting up my cluster with the new <a href="https://docs.docker.com/engine/swarm/"><strong>Docker Swarm Mode</strong></a>!</p><h3>My setup: Hardware</h3><p>In case you want to follow my exact steps, here is my exact setup:</p><pre>- 4 x Raspberry Pi 3 Model B<br>- 4 x Samsung EVO 32GB Class 10 Micro SDHC Card with Adapter (NOTE: 32GB not required, I just wanted extra space)<br>- 4 x Micro-USB cables<br>- 1 x Manhattan 7-Port USB 2.0 Ultra Hub<br>- 1 x NETGEAR 5-Port Gigabit Ethernet 10/100/1000Mbps Switch (GS205)<br>- 4 x Ethernet Cat-5 cables<br>- 1 x Sabrent Premium 3 Port Aluminum USB 3.0 Hub with Multi-In-1 Card Reader (12&quot; cable)<br>- 1 x GeauxRobot Raspberry Pi 3 Model B 4-layer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8tf2RPe_tyf-s9PfW0uZQ.jpeg" /></figure><h3>5:36pm EDT: Preparation Step — Flash Micro SD Cards With Hypriot v0.8.0</h3><p>First things first, I needed to download the Hypriot v0.8.0 image. Since I’m using OS X, I was able to leverage the Flash CLI tool developed by the Hypriot team (<a href="https://github.com/hypriot/flash">https://github.com/hypriot/flash</a>). This little guy takes care of image customization very efficiently before the Raspberry Pi is even turned on. Here you can predefine a proper hostname, WIFI settings, and more. On top of that, it has error handling built into it, handles unmounting the SD card for writing, and prompts you when everything is done. Must have tool. For each SD card, I ran the command below with the following host names, <strong>scarlett-kub-master</strong>, <strong>scarlett-kub-slave1</strong>, <strong>scarlett-kub-slave2</strong>, <strong>scarlett-kub-slave3</strong>. (NOTE: Hostnames remain the same as when I was working on <a href="http://kubernetes.io/"><strong>k8s</strong></a>).</p><pre># NOTE: ignore the $ signs, they represent your bash prompt</pre><pre>$ flash --hostname scarlett-kub-master --config device-init.yaml <a href="https://github.com/hypriot/image-builder-rpi/releases/download/v0.8.0/hypriotos-rpi-v0.8.0.img.zip">https://github.com/hypriot/image-builder-rpi/releases/download/v0.8.0/hypriotos-rpi-v0.8.0.img.zip</a><br></pre><p>Ready to go!</p><h3>5:45pm EDT: Preparation Step — Set Up Password-less SSH Access</h3><p>When dealing w/ multiple nodes and SSH Access, using SSH keys to connect to remote machines is a must. You do not want to have to type in your password every single time you interact with one of your remote servers; that’s madness. To set up passwordless authentication I did the following (NOTE: This assumes that you have a private key created already; if you don’t, see this guide on how to get setup <a href="http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/"><strong>http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/</strong></a>):</p><p>A. First, you need to obtain the IP addresses of each of the Raspberry Pi’s running on your LAN. If you’re savvy on the command line, you can use something like <a href="http://linux.die.net/man/1/arp-scan"><strong>arp-scan</strong></a>. If you prefer a GUI, try <a href="https://itunes.apple.com/us/app/lanscan-pro/id562184107?mt=12"><strong>LanScan Pro</strong></a>. I used Hypriot’s custom bash function to do a lookup against the <a href="http://avahi.org/download/avahi-daemon.8.xml"><strong>Avahi-daemon</strong></a> configured on each Raspberry Pi:</p><pre><br># NOTE: Default password for the “pirate” user is “hypriot”</pre><pre>$ function getip() { (traceroute $1 2&gt;&amp;1 | head -n 1 | cut -d\( -f 2 | cut -d\) -f 1) }</pre><pre>$ export MASTER=$(getip scarlett-kub-master.local)</pre><pre>$ echo $MASTER</pre><pre>$ export SLAVE_1=$(getip scarlett-kub-slave.local)</pre><pre>$ echo $SLAVE_1</pre><pre>$ export SLAVE_1=$(getip scarlett-kub-slave1.local)</pre><pre>$ echo $SLAVE_1</pre><pre>$ export SLAVE_2=$(getip scarlett-kub-slave2.local)</pre><pre>$ echo $SLAVE_2</pre><pre>$ export SLAVE_3=$(getip scarlett-kub-slave3.local)</pre><pre>$ echo $SLAVE_3</pre><pre>$ ssh-copy-id -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no pirate@$SLAVE_1</pre><pre>$ ssh-copy-id -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no pirate@$SLAVE_2</pre><pre>$ ssh-copy-id -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no pirate@$SLAVE_3<br></pre><p>B. Now to test that everything works, I ran:</p><pre>$ ssh pirate@scarlett-kub-master.local</pre><p>NICE!</p><h3>5:47pm EDT: (Optional) Set up SSH Autocomplete</h3><p>A. Open up <strong>~/.ssh/config</strong> and add an entry that looks like the following:</p><pre><br>HOST scarlett-kub-master<br> HostName scarlett-kub-master.local<br> Port 22<br> User pirate<br> IdentityFile ~/.ssh/id_rsa_ssh<br> ServerAliveInterval 60<br> ServerAliveCountMax 2<br> ForwardX11 yes<br> PasswordAuthentication no<br> IdentitiesOnly yes<br> LogLevel FATAL<br> ForwardAgent yes<br></pre><p>B. Add this line to your <strong>~/.bash_profile</strong> then run <strong>source ~/.bash_profile</strong>:</p><pre><br># Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards</pre><pre>[[ -e “$HOME/.ssh/config” ]] &amp;&amp; complete -o “default” -o “nospace” -W “$(grep “^Host” ~/.ssh/config | grep -v “[?*]” | cut -d “ “ -f2 | tr ‘ ‘ ‘\n’)” scp sftp ssh<br></pre><p>C. Reload your shell, type <strong>scarlett-kub-[TAB]</strong> and it should work. Repeat for each of the other RPi’s.</p><h3>5:50pm EDT: Installation Of Docker 1.12.0-rc3 On Each Node</h3><p>As of today, 7/8/2016 Docker 1.12.0 is a release candidate, rc3 to be exact. Luckily, <a href="http://twitter.com/Quintus23M"><strong>@Quintus23M</strong></a> was able to hook me up with a custom compiled <strong>.deb</strong> package built from upstream! Here were the steps to install it:</p><p>A. Grab the binary then <strong>scp</strong> it to each machine:</p><pre><br>$ wget <a href="https://jenkins.hypriot.com/job/armhf-docker/15/artifact/bundles/latest/build-deb/raspbian-jessie/docker-engine_1.12.0%7Erc3-0%7Ejessie_armhf.deb">https://jenkins.hypriot.com/job/armhf-docker/15/artifact/bundles/latest/build-deb/raspbian-jessie/docker-engine_1.12.0%7Erc3-0%7Ejessie_armhf.deb</a></pre><pre>$ scp docker-engine_1.12.0~rc3–0~jessie_armhf.deb pirate@scarlett-kub-master.local:.</pre><pre>$ scp docker-engine_1.12.0~rc3–0~jessie_armhf.deb pirate@scarlett-kub-slave1.local:.</pre><pre>$ scp docker-engine_1.12.0~rc3–0~jessie_armhf.deb pirate@scarlett-kub-slave2.local:.</pre><pre>$ scp docker-engine_1.12.0~rc3–0~jessie_armhf.deb pirate@scarlett-kub-slave3.local:.<br></pre><p>B. Remove the old <strong>docker-hypriot</strong> that is currently installed, and install rc3 (Repeat for each machine):</p><pre><br>$ ssh pirate@scarlett-kub-master.local sudo apt-get purge -y docker-hypriot</pre><pre>$ ssh pirate@scarlett-kub-master.local sudo dpkg -i docker-engine_1.12.0~rc3–0~jessie_armhf.deb<br></pre><p>C. SSH to machine, run <strong>docker version</strong> and you should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*Vk1ROyG1doiFe-r5FEF8oQ.png" /></figure><p><strong>LOOKING GOOD.</strong></p><h3><strong>5:56pm EDT: Bootstrap The Master!</strong></h3><p>Believe it or not, this only takes one command. Run the following:</p><pre><br>$ ssh pirate@scarlett-kub-master.local docker swarm init<br>Swarm initialized: current node (1njlvzi9rk2syv3xojw217o0g) is now a manager.<br></pre><p>Yes …. That’s it. Verify that everything worked by running the following ( ssh to master node first ):</p><pre>$ docker node ls<br>ID HOSTNAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS<br>al55dh1yjho2wojhagzksdqwu * scarlett-kub-master Accepted Ready Active Leader</pre><p>Amazing.</p><h3>5:58pm EDT: Time To Bootstrap Some Nodes!</h3><p>Just when you thought it couldn’t get any easier… Run this from OS X( NOTE: Assume bash variable <strong>$MASTER</strong> is the ip address of your master node):</p><pre>$ function getip() { (traceroute $1 2&gt;&amp;1 | head -n 1 | cut -d\( -f 2 | cut -d\) -f 1) }</pre><pre>$ export MASTER=$(getip scarlett-kub-master.local)</pre><pre>$ ssh pirate@scarlett-kub-slave1.local docker swarm join $MASTER:2377</pre><pre>$ ssh pirate@scarlett-kub-slave2.local docker swarm join $MASTER:2377</pre><pre>$ ssh pirate@scarlett-kub-slave3.local docker swarm join $MASTER:2377<br></pre><p>BOOM. Run that verification command again and you should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_dIjorVDu6mFi6Yt2_BVA.png" /></figure><p>Can’t believe it yet? Well, we are not done yet! Time to bring up some containers.</p><p><strong>6:00pm EDT: Let’s bring up a container that simply pings google’s DNS server:</strong></p><pre># run this from the master</pre><pre>$ docker service create --name ping hypriot/rpi-alpine-scratch ping 8.8.8.8<br>0ktotb58pbi0xp9op6anrdmkp</pre><pre># verify the task was created</pre><pre>$ docker service tasks ping<br>ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE<br>706fyhabjxfxgtcwesobkkokz ping.1 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-master<br>Hypriot/armv7: pirate@scarlett-kub-master in ~<br>$</pre><p>WOOT!</p><h3><strong>6:02pm EDT: Scale up the number of tasks running! How about 10 of these bad boys? No problem, let’s run this:</strong></h3><pre># update to 10</pre><pre>$ docker service update ping --replicas 10<br>ping<br>Hypriot/armv7: pirate@scarlett-kub-master in ~<br>$</pre><pre># verify</pre><pre>$ docker service tasks ping<br>ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE<br>706fyhabjxfxgtcwesobkkokz ping.1 ping hypriot/rpi-alpine-scratch Running About a minute Running scarlett-kub-master<br>9lsto7r7qt1n2bua9ltirgll4 ping.2 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-slave1<br>4t0mpw823usq0jbm1lymh5ga2 ping.3 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-slave2<br>0vc51yzpe29qfzrz9uk3ffkx3 ping.4 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-master<br>2s01xvf4sjb7k558a7ga3b7hs ping.5 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-slave3<br>by7osvlr4wb7474brrlouv9ad ping.6 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-slave3<br>17uxtvgqa29hul6kuqs8penv3 ping.7 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-slave2<br>b6q27d3hmohr70f2odjuycyln ping.8 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-slave1<br>7rri99dki0fyj012cbenzi3o1 ping.9 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-slave2<br>1zmgn86bqtxj68ohxxo5226id ping.10 ping hypriot/rpi-alpine-scratch Running 14 seconds Running scarlett-kub-slave1<br>Hypriot/armv7: pirate@scarlett-kub-master in ~<br>$</pre><pre># Alternative approach to scaling:</pre><pre>$ docker service scale ping=10<br>ping scaled to 10<br></pre><p>Andddd, we’re done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NoQh_lZaeBgRSUJrc7WDg.png" /></figure><h3>6:05pm EDT: Sit Back In Awe.</h3><p>It’s that simple. Bravo to Hypriot and Docker. You guys just made my whole week! <strong>The craziest part is, this is my first time using HypriotOS and Docker together! 29Minutes start-to-finish. Madness.</strong></p><p>Thanks for following the journey, please don’t hesitate to contact me or drop a comment if this was useful for you!</p><h3>Further reading:</h3><p>1. <a href="http://blog.hypriot.com/post/swarm-machines-or-having-fun-with-docker-machine-and-the-new-docker-swarm-orchestration/"><strong>http://blog.hypriot.com/post/swarm-machines-or-having-fun-with-docker-machine-and-the-new-docker-swarm-orchestration/</strong></a></p><p>2. <a href="http://blog.hypriot.com/"><strong>http://blog.hypriot.com/</strong></a> (In general)</p><p>3. Read up more about Docker Swarm Mode coming out in 1.12.0 here: <a href="https://docs.docker.com/engine/swarm/"><strong>https://docs.docker.com/engine/swarm/</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa0e4f3b1768" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BAKING RACKSPACE PUBLIC CLOUD AND PRIVATE OPENSTACK IMAGES]]></title>
            <link>https://medium.com/@bossjones/baking-rackspace-public-cloud-and-private-openstack-images-c57a1616d136?source=rss-b58b991fd0f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c57a1616d136</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Malcolm Jones]]></dc:creator>
            <pubDate>Wed, 05 Aug 2015 15:00:04 GMT</pubDate>
            <atom:updated>2015-08-05T15:00:04.621Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Hi friends!</strong></h3><p>Today’s blog post has to do with every sysadmin’s favorite task, <a href="http://devopsreactions.tumblr.com/post/116543345354/when-something-that-you-do-all-the-time-stops">baking</a> images (<em>insert sarcasm</em>). In particular we’re going to talk about how to use <a href="https://www.packer.io/">Packer</a> to bake images for Rackspace Public Cloud, and Private <a href="https://www.openstack.org/">Openstack</a> Cloud.</p><p><strong>NOTE: Assume we are using Packer version v0.7.5</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLWIIbG_Gk0CPyro6hI90g.png" /></figure><h3>Baking Rackspace Public Cloud Images</h3><p>The common issue I discovered with baking openstack images is that it is super easy to set MORE environment variables than needed. Setting too many can cause packer builds to fail with strange error messages. For example, as noted in this packer git <a href="https://github.com/mitchellh/packer/issues/1755">issue</a>:</p><pre>source: <a href="https://github.com/mitchellh/packer/issues/1755">https://github.com/mitchellh/packer/issues/1755</a><br>I’ve been trying with no success to use Packer to build an image with Rackspace. Currently here is my config:</pre><pre><strong>{ <br>    “variables”: { <br>      “rackspace_username”: “”, <br>      “rackspace_password”: “” <br>  }, <br>  “builders”: [ <br>    { <br>      “type”: “openstack”, <br>      “username”: “{{user rackspace_username}}”, <br>      “password”: “{{user rackspace_password}}”, <br>      “provider”: “rackspace-us”, <br>      “region”: “IAD”, <br>      “ssh_username”: “root”, <br>      “image_name”: “Test image {{timestamp}}”, <br>      “source_image”: “ea98e34c-7a25–4670–9e2a-7fa9815f6c9f”,<br>      “flavor”: “2” <br>    } <br>  ], <br>  “provisioners”: [ <br>  { <br>    “type”: “shell”, <br>    “inline”: [ <br>      “sleep 30”, <br>      “sudo apt-get update”, <br>      “sudo apt-get upgrade -y” <br>      ] <br>    } <br>  ] <br>}</strong> </pre><pre>But when I run:</pre><pre><strong>packer build -var “rackspace_username=foo” -var “rackspace_password=bar” test.json</strong> </pre><pre>I get:</pre><pre>openstack output will be in this color.</pre><pre>Build ‘openstack’ errored: Auth failed. Bad credentials.</pre><pre><strong>==&gt; Some builds didn’t complete successfully and had errors: <br>--&gt; openstack: Auth failed. Bad credentials.<br>==&gt; Builds finished but no artifacts were created. </strong></pre><pre>Any ideas? </pre><p>If you look closely at the packer <a href="https://www.packer.io/docs/builders/openstack.html">documentation</a>, you’ll notice that both the OS_* and SDK_* env variables have different <strong>“weights”</strong> associated with them, meaning if you set too many at the same time, they can override each other. <strong>Rule of thumb is SDK_* has more precedence than OS_*.</strong></p><p>I put the following into a small script full of environment variable named <strong>local-public.sh</strong> with contents:</p><pre>export SDK_USERNAME=”BLAH” <br>export SDK_PASSWORD=’BLAH’ <br>export SDK_API_KEY=’BLAH’ <br>export SDK_PROVIDER=”rackspace-us” <br>export SDK_REGION=”DFW”</pre><p><strong>NOTE: Notice for Rackspace Public Cloud I used only SDK_* environment variables.</strong></p><p>Then in a new bash shell I ran source <strong>./local-public.sh</strong></p><p>Following that, I created a template that looks something like this:</p><pre>{ <br>“variables”: { <br>  “SSH_PASSWORD”: “”, <br>  “REGION”: “us-east-1”, <br>  “INSTANCE_TYPE”: “m3.large”, <br>  “SSH_USERNAME”: “centos”, <br>  “SSH_TIMEOUT”: “5m” <br>  }, <br>  “builders”: [ <br>    { <br>      “type”: “openstack”, <br>      “name”: “rackspace-public”, <br>      “username”: “”, <br>      “password”: “”, <br>      “api_key”: “”, <br>      “provider”: “rackspace-us”, <br>      “openstack_provider”: “rackspace”, <br>      “region”: “DFW”, <br>      “ssh_username”: “root”, <br>      “insecure”: “false”, <br>      “image_name”: “centos66-{{timestamp}}”, <br>      “source_image”: “blah”, <br>      “flavor”: “performance1–1” <br>    },</pre><pre>.....</pre><p><strong>NOTE: Notice I did not set any password/etc in the actual template. Packer reads in directly from your environment and populates everything accordingly.</strong></p><p>Now <strong>packer build -only=rackspace-public openstack-centos66.json</strong> And boom! Good to go!</p><h3>Baking Private Openstack Cloud</h3><p>The steps for creating a private Openstack cloud image are very similar, but might require a little bit more information on your Openstack setup. Make sure you know how to query it for what you need!</p><p>I put the following into a small script named <strong>local-private.sh</strong> with contents:</p><pre># Source: <a href="https://www.packer.io/docs/builders/openstack.html">https://www.packer.io/docs/builders/openstack.html</a></pre><pre>export OS_AUTH_URL=”http://OPENSTACK_AUTH_IP_ADDRESS:PORT/v2.0&quot; export OS_USERNAME=”BLAH” <br>export OS_PASSWORD=”BLAH” <br>export OS_TENANT_ID=”BLAH”</pre><pre># should be the same as OS_USERNAME<br>export OS_TENANT_NAME=”BLAH” <br>export OS_AUTH_STRATEGY=”keystone”</pre><p><strong>NOTE: Notice for private openstack I used only OS_* environment variables.</strong></p><p>Then in a new bash shell I ran source <strong>./local-private.sh</strong>, make sure you don’t have any <strong>SDK_*</strong> variables set!!!!</p><p>Following that, I created a template that looks something like this:</p><pre>{ <br>  “variables”: { <br>    “SSH_PASSWORD”: “”, <br>    “REGION”: “us-east-1”, <br>    “INSTANCE_TYPE”: “m3.large”, <br>    “SSH_USERNAME”: “centos”, <br>    “SSH_TIMEOUT”: “5m” <br>    }, <br>    “builders”: [ <br>      { <br>        “type”: “openstack”, <br>        “name”: “rackspace-private”, <br>        “insecure”: true, <br>        “networks”: “gfhjghfjgfhjhgf-gfjgfhjgh-fghj”, <br>        “ssh_username”: “{{user SSH_USERNAME}}”, <br>        “image_name”: “centos66-{{timestamp}}”, <br>        “source_image”: “gfhgfh-ghfhfg-4ac4-aghgfh74c-6575677”,<br>        “flavor”: “2” <br>      } <br>],</pre><pre>.......</pre><p>Now <strong>packer build -only=rackspace-private openstack-centos66.json</strong> and boom, private openstack image! Hope this helps someone! Feel free to tweet me if you have any questions / suggestions!</p><p><em>Originally published at </em><a href="http://behancetech.net/2015/08/05/baking-rackspace-public-cloud-and-openstack-images/"><em>Medium.com/BehanceTech</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c57a1616d136" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>