<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[f00bar.com]]></title>
  <link href="http://spheromak.github.com/atom.xml" rel="self"/>
  <link href="http://spheromak.github.com/"/>
  <updated>2012-04-02T15:14:25+09:00</updated>
  <id>http://spheromak.github.com/</id>
  <author>
    <name><![CDATA[Jesse Nelson]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Knife-XAPI: Chef and Xenserver]]></title>
    <link href="http://spheromak.github.com/blog/2012/04/02/knife-xapi-chef-and-xenserver/"/>
    <updated>2012-04-02T14:14:00+09:00</updated>
    <id>http://spheromak.github.com/blog/2012/04/02/knife-xapi-chef-and-xenserver</id>
    <content type="html"><![CDATA[<h2>Knife-XAPI</h2>

<p>Just finished making a knife plugin (my first)  and gem (also my first) that enables knife xapi support. Right now it is only supporting guest create, but I plan on adding more commands in the near future.</p>

<p>you can install it with gem</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>gem install knife-xapi</span></code></pre></td></tr></table></div></figure>


<p>Now you can spin up a guest on a Xen API host with knife. This is basic usage</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>knife xapi guest create "NewBox" "public"  \
</span><span class='line'>  --xapi-vm-template "MyBaseBox" \
</span><span class='line'>  --host http://sandbox/</span></code></pre></td></tr></table></div></figure>


<p>The &#8220;NewBox&#8221; is the hosts name-label, and &#8220;public&#8221; would be the network name label you want to attach eth0 too. You can specify more networks as well:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>knife xapi guest create "router" "public" "dmz" "private"  \
</span><span class='line'>  --xapi-vm-template "MyBaseBox"  \
</span><span class='line'>  --host http://sandbox/</span></code></pre></td></tr></table></div></figure>


<p>This would build out a box basedon MyBaseBox template, and add 3 interfaces eth0/1/2 that are connected to those networks in the order specified.</p>

<p>The way I am using this now is to boot centos boxes and kickstart them at will. Using this more elaborate comandline:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>knife xapi guest create "MySpiffyBox" "pub_network" \
</span><span class='line'> -B "dns=8.8.8.8 ks=http://192.168.6.4/repo/ks/default.ks ip=192.168.6.7 netmask=255.255.255.0 gateway=192.168.6.1" \
</span><span class='line'> -R http://192.168.6.5/repo/centos/5/os/x86_64 \
</span><span class='line'> -C 4 -M 4g -D 5g \
</span><span class='line'> -T "CentOS 5 (64-bit)" --host http://sandbox/</span></code></pre></td></tr></table></div></figure>


<p>Here I am using the default xenserver 5 template to install a cent5 based vm with -T.  Setting the VM Boot Arguments with -B that are instructing anaconda where to get the kickstart and how to setup the netinstalls networking.
The -C switch is setting up 4 cpu&#8217;s on the guest. The -M is allocating 4 gigs of mem and -D is creating the root disk (xvda)  as a 5GB box. This particular kickstart
is a minimal centos install.  This kicks off my kickstart install and in ~3 minutes i have a fresh machine installed via knife.</p>

<h2>TODO</h2>

<p>This is the stuff i want to add into this plugin:</p>

<ul>
<li>Fix SSL issues</li>
<li>Guest Destroy</li>
<li>Guest List</li>
<li>Network List</li>
<li>Network Create</li>
<li>Network Destroy</li>
<li>SR Management</li>
</ul>


<p>I may or may not include this in the knife command:</p>

<ul>
<li>VM Metrics</li>
<li>Host Metrics</li>
<li>VIF/VBD Metrics</li>
</ul>


<h2>Bugs</h2>

<p>Right now the big one is that the XML::RPC client gem is not supporting a way for me to ignore SSL Self signed certs that xenservers ship with. So https:// will only work on properly signed api endpoints.</p>

<h2>Source</h2>

<p>You can grab poke/comment and help me make this better!
Codes up on <a href="https://github.com/spheromak/knife-xapi">github</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[sysctl LWRP for chef]]></title>
    <link href="http://spheromak.github.com/blog/2012/02/28/sysctl-lwrp-for-chef/"/>
    <updated>2012-02-28T18:25:00+09:00</updated>
    <id>http://spheromak.github.com/blog/2012/02/28/sysctl-lwrp-for-chef</id>
    <content type="html"><![CDATA[<p>About 2 years ago i wrote a hacky ohai plugin to push all sysctl values into node data, and then a crappy recipe that would run an exec if they didn&#8217;t match values in node-data. A few months back i re-wrote all this to just use an lwrp that would just set these value, and a recipe that would pull them from attributes. So if you want to be able to see what nodes have huge pages enabled or whatnot.</p>

<p>Today I took some time to clean up the readme and release that code for others to hopefully find useful.</p>

<ul>
<li>On github <a href="https://github.com/spheromak/cookbooks/tree/master/sysctl">sysctl lwrp cookbook</a></li>
<li>On the community site <a href="http://community.opscode.com/cookbooks/jn_sysctl">jn_sysctl</a></li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Octopressed]]></title>
    <link href="http://spheromak.github.com/blog/2011/12/10/octopressed/"/>
    <updated>2011-12-10T17:43:00+09:00</updated>
    <id>http://spheromak.github.com/blog/2011/12/10/octopressed</id>
    <content type="html"><![CDATA[<p> Posterous just doesn&#8217;t support markdown very well, and every time I felt like writing a blog entry I would get frustrated. So after a couple people have expressed their pleasure with tools like <a href="http://jekyllrb.com/">jekyll</a> using github pages.  I decided to give it a go.</p>

<p>I love this setup. I tried jumping in with <a href="http://octopress.org/">octopress</a> without the rtfm. Having never setup github pages before i mucked up by creating a project site vs a user site, but once I fixed that (by creating a spheromak.github.com repo) everything clicked in.</p>

<p>Pulling old posterous posts down into <a href="http://jekyllrb.com/">jekyll</a> was simple, and now im off and running with real markdown blog. Backed by git, and I am happier for it.</p>

<p>So thanks <a href="http://github.com">github</a>, <a href="http://jekyllrb.com/">jekyll</a>,  and <a href="http://octopress.org/">octopress</a>  for cool software that works</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[XenServer and shadow passwords]]></title>
    <link href="http://spheromak.github.com/blog/2011/11/02/xenserver-and-shadow-passwords/"/>
    <updated>2011-11-02T00:00:00+09:00</updated>
    <id>http://spheromak.github.com/blog/2011/11/02/xenserver-and-shadow-passwords</id>
    <content type="html"><![CDATA[<p>Why doesn&#8217;t XenServer enable shadow passwords or authconfig.&nbsp; What year is this&nbsp; 1996 ? My guess is so that it can readd the hashed root without privs for things like xencenter to be able to edit the passwd via xapi. Tho i don&#8217;t see any password manipulation api hooks.&nbsp; I am really curious why this isnt set.</p>
<p>I have been manually (well chef does it)&nbsp; setting the dom0 passwords to shadow by detecting if its a xenserver and running pwconv. There hasn&#8217;t been any repercussions in the last 3 years.</p>
<p>Untill now.</p>
<p>Now moving up to xen6 in my test pool im running into all sortsa auth isues requireing me to single user my upgraded Hosts and pwconv and passwd them. Blargh.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Hosts File LWRP for chef]]></title>
    <link href="http://spheromak.github.com/blog/2011/10/11/hosts-file-lwrp-for-chef/"/>
    <updated>2011-10-11T00:00:00+09:00</updated>
    <id>http://spheromak.github.com/blog/2011/10/11/hosts-file-lwrp-for-chef</id>
    <content type="html"><![CDATA[<p>Just finished making a simple LWRP for managing /etc/hosts with chef check it out on github: <a href="https://github.com/spheromak/cookbooks/tree/master/hosts">https://github.com/spheromak/cookbooks/tree/master/hosts</a></p>
<p>pretty simple/easy to use to manage individual entries in hosts files.&nbsp;</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Arch Linux Developer Vagrant Box]]></title>
    <link href="http://spheromak.github.com/blog/2011/09/21/arch-linux-developer-vagrant-box/"/>
    <updated>2011-09-21T00:00:00+09:00</updated>
    <id>http://spheromak.github.com/blog/2011/09/21/arch-linux-developer-vagrant-box</id>
    <content type="html"><![CDATA[<p><a href="http://vagrantup.com/" title="Vagrant">Vagrant</a> is sweet!, but there wasn&#8217;t a lot of <a href="http://archlinux.org/" title="Arch Linux">arch</a> boxes out there that i could find. So heres my <a href="http://pipe.f00bar.com/Vagrantfile" title="arch_dev Vagrant File">Vagrantfile</a>.</p>

<p>if you don&#8217;t already use <a href="http://vagrantup.com/" title="Vagrant">Vagrant</a> you should. If you are doing any dev you should use it! if your an ops person then you should use it, and tell your developers about it. If you are a nerd you should use <a href="http://vagrantup.com/" title="Vagrant">Vagrant</a>. Nuf said.</p>

<p><a href="http://archlinux.org/" title="Arch Linux">Arch</a> is also pretty sweet. <a href="http://archlinux.org/" title="Arch Linux">Arch Linux</a> has a system approach that rings totally right with me (I feel another post about arch in here someplace). Mainly Arch lets you do what you want how you want which is awesome!</p>

<p>Anyhow I have a little pet project that originally I was gonna do an LFS build up on, but realized arch already had a lot of what I needed. <a href="http://www.freedesktop.org/wiki/Software/systemd" title="ohai systemd">systemd</a> support, and an not ancient/screwed up ruby install.</p>

<ul>
<li><a href="http://pipe.f00bar.com/Vagrantfile" title="arch_dev Vagrant File">My build</a> deviates from base arch in these ways:

<ul>
<li>It&#8217;s running 3.0.4 Kernel</li>
<li>Using <a href="http://www.freedesktop.org/wiki/Software/systemd" title="ohai systemd">systemd</a> (with option to boot sysv)</li>
<li>full developer toolchain.</li>
<li><a href="" title="https://wiki.archlinux.org/index.php/Arch_Build_System">ABS</a> the source build system for Arch.</li>
<li>Its big! ~1.2GB for a base box is pretty big, but its cause of all the build crap + kernel source</li>
</ul>
</li>
</ul>


<p>Lastly heres the links to the <a href="http://pipe.f00bar.com/arch_dev-x86_64.box" title="arch_dev Base Box">base box</a> if you don&#8217;t want to get it via the vagrantfile.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Simple robust OS detection in bash using $OSTYPE]]></title>
    <link href="http://spheromak.github.com/blog/2011/07/09/simple-robust-os-detection-in-bash-using-ostype/"/>
    <updated>2011-07-09T00:00:00+09:00</updated>
    <id>http://spheromak.github.com/blog/2011/07/09/simple-robust-os-detection-in-bash-using-ostype</id>
    <content type="html"><![CDATA[<p>I was using lazyweb to solve this problem. Google&rsquo;s results had solutions where people were calling all sorts of commands and parsing different files to detect system types. I didn&rsquo;t want to do a syscall. I wanted this solution to be as platform independant as possible. I only needed to know if it was linux/solaris/osx/bsd etc etc.  Not version or somehting special. SImple enough. 1 minute of RTFM&#8217;n the bash manual turned up $OSTYPE and $HOSTTYPE</p>

<p><script src="https://gist.github.com/1074195.js"></script></p>

<p>Man I love simple solutions!</p>

<p>P.S. First post!</p>

<p>P.P.S  posterious&rsquo;s syntax support sucks. took longer to figure out than this post did to write.</p>

<p>edit: converted to markdown  used gist for code highlight</p>
]]></content>
  </entry>
  
</feed>

