<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ryan Lane's Blog</title>
	
	<link>http://ryandlane.com/blog</link>
	<description />
	<lastBuildDate>Fri, 06 Jan 2012 02:13:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/RyanLanesBlog" /><feedburner:info uri="ryanlanesblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://superfeedr.com/hubbub" /><item>
		<title>Fixing a very broken instance live migration manually</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/Tyn69kmTxY8/</link>
		<comments>http://ryandlane.com/blog/2012/01/06/fixing-a-very-broken-instance-live-migration-manually/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 02:13:57 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[OpenStack]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=502</guid>
		<description><![CDATA[I had a situation recently where a number of live migrations failed in a truly nasty way. The live migration failed part way through, but didn&#8217;t properly back-out the changes. This left the instance running nowhere, but in a &#8220;migrate&#8221; state in the database. I tried to reboot the instance, which then left the instance [...]]]></description>
			<content:encoded><![CDATA[<p>I had a situation recently where a number of live migrations failed in a truly nasty way. The live migration failed part way through, but didn&#8217;t properly back-out the changes. This left the instance running nowhere, but in a &#8220;migrate&#8221; state in the database. I tried to reboot the instance, which then left the instance in the &#8220;running&#8221; state.</p>
<p>Of course, the instance wasn&#8217;t actually running anywhere and the reboot command wouldn&#8217;t start the instance, because it thought it was running. The logs complained that the instance wasn&#8217;t running whether I tried to restart the migration, or reboot. What a full of fail situation.</p>
<p>So, to fix this, I needed to make the instance actually start. In this situation, the database thought the instance was running on host virt2, but the instance&#8217;s libvirt files were on virt4. I copied the nwfilter file across to /etc/libvirt/nwfilter, then the domain file across to /etc/libvirt/qemu. I then created the nwfilter, then the domain:</p>
<pre style="padding-left: 30px;">virsh nwfilter-define /etc/libvirt/nwfilter/&lt;instance-nwfilter&gt;.xml
virsh create /etc/libvirt/qemu/&lt;instance-domain&gt;.xml</pre>
<p>Once the instance was started, I re-migrated the instance and all was good.</p>
<p>As a side note, I think what caused the migration failure was that I tried to migrate too many instances at the same time from a host that was already slightly overloaded. Of course, this is no excuse for nova to fail.</p>
<img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/Tyn69kmTxY8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2012/01/06/fixing-a-very-broken-instance-live-migration-manually/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2012/01/06/fixing-a-very-broken-instance-live-migration-manually/</feedburner:origLink></item>
		<item>
		<title>OpenStackManager version 1.3 released</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/qkNJ9ys_LRE/</link>
		<comments>http://ryandlane.com/blog/2011/12/22/openstackmanager-version-1-3-released/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 15:30:10 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[LDAP]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[OpenStack]]></category>
		<category><![CDATA[Semantic MediaWiki]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Wikimedia]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=499</guid>
		<description><![CDATA[The OpenStackManager extension is a web interface for OpenStack, and a manager for a fully integrated test and development network being written primarily for Wikimedia Foundation use. I&#8217;ve been busy enough lately working on our OpenStack infrastructure that I haven&#8217;t made an OpenStackManager release in a while. Over the past seven months I&#8217;ve continued to [...]
Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/03/14/openstackmanager-version-1-2-released/' rel='bookmark' title='OpenStackManager version 1.2 released'>OpenStackManager version 1.2 released</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/30/openstackmanager-version-1-1-released/' rel='bookmark' title='OpenStackManager version 1.1 released'>OpenStackManager version 1.1 released</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/24/announcing-openstackmanager-extension-for-mediawiki/' rel='bookmark' title='Announcing OpenStackManager extension for MediaWiki'>Announcing OpenStackManager extension for MediaWiki</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><em>The <a href="http://www.mediawiki.org/wiki/Extension:OpenStackManager">OpenStackManager extension</a> is a web interface for <a href="http://www.openstack.org/">OpenStack</a>, and a manager for a fully integrated test and development network being <a href="../2011/01/02/building-a-test-and-development-infrastructure-using-openstack/">written primarily for Wikimedia Foundation use</a>.</em></p>
<p>I&#8217;ve been busy enough lately working on our OpenStack infrastructure that I haven&#8217;t made an OpenStackManager release in a while. Over the past seven months I&#8217;ve continued to make small changes to the software, and the past few weeks I&#8217;ve added features I feel deserve another release.</p>
<p>This is a bugfix and features release. Major changes include compatibility for cactus and diablo releases of nova, and 1.18 compatibility for MediaWiki. The changes in this release focused mainly on making workflow easier. Here&#8217;s a complete list of changes:</p>
<ul>
<li>Added a reboot action for instances</li>
<li>Made compatibility changes for cactus and diablo nova releases</li>
<li>Made compatibility changes for MediaWiki 1.18</li>
<li>Added support for configurable naming attributes</li>
<li>Added support for adding objectclasses and attributes for users that are missing them</li>
<ul>
<li>It&#8217;s now possible for MediaWiki to no longer have to create users, only update select user attributes and objectclasses</li>
</ul>
<li>Made a bunch of bugfixes regarding security groups</li>
<li>Added support for wildcard DNS entries</li>
<li>Added realm and instancename variables to puppet default variables, so that they can be used in puppet runs</li>
<li>Added support for wiki page creation for Projects</li>
<li>Added support for configuring default images for instances</li>
<li>Added support for creating server admin logs per project</li>
<li>Added support for default security group rules on project creation</li>
<li>Added dialog to project creation for adding members to projects and roles upon creation</li>
<li>Added support for managing puppet classes and variables through the interface, rather than LocalSettings.php</li>
<li>Made a usability change to instance creation: the default security group will always be selected by default</li>
<li>Added support for including the ssh key fingerprint of an instance in the &#8220;your instance is ready&#8221; emails</li>
<li>Made a usability change to only show actions to users if they can perform them</li>
<li>Lots of other minor bug fixes</li>
<li>Bugfixes from John Du Hart, Sam Reed and Mark Hershberger</li>
</ul>
<p>If you&#8217;d like to help develop this extension, I&#8217;ve created a development environment in a project in Wikimedia Labs. Find me on #wikimedia-labs on Freenode or email me to get a labs account and access to the project.</p>
<p>Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/03/14/openstackmanager-version-1-2-released/' rel='bookmark' title='OpenStackManager version 1.2 released'>OpenStackManager version 1.2 released</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/30/openstackmanager-version-1-1-released/' rel='bookmark' title='OpenStackManager version 1.1 released'>OpenStackManager version 1.1 released</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/24/announcing-openstackmanager-extension-for-mediawiki/' rel='bookmark' title='Announcing OpenStackManager extension for MediaWiki'>Announcing OpenStackManager extension for MediaWiki</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/qkNJ9ys_LRE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/12/22/openstackmanager-version-1-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/12/22/openstackmanager-version-1-3-released/</feedburner:origLink></item>
		<item>
		<title>A process for puppetization of a service using Nova</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/eiQj_iZX-70/</link>
		<comments>http://ryandlane.com/blog/2011/11/02/a-process-for-puppetization-of-a-service-using-nova/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 01:20:46 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[OpenStack]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Wikimedia]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=490</guid>
		<description><![CDATA[For the proper automation of a service using puppet, it&#8217;s necessary to ensure the service can be installed repeatedly, and that the service is fully up and ready when it is built. To ensure this, I&#8217;m using the following process, using nova: Create an instance and use it to do experimentation with the service. Document [...]
Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/11/01/sharing-home-directories-to-instances-within-a-project-using-puppet-ldap-autofs-and-nova/' rel='bookmark' title='Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova'>Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/24/announcing-openstackmanager-extension-for-mediawiki/' rel='bookmark' title='Announcing OpenStackManager extension for MediaWiki'>Announcing OpenStackManager extension for MediaWiki</a></li>
<li><a href='http://ryandlane.com/blog/2011/12/22/openstackmanager-version-1-3-released/' rel='bookmark' title='OpenStackManager version 1.3 released'>OpenStackManager version 1.3 released</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For the proper automation of a service using puppet, it&#8217;s necessary to ensure the service can be installed repeatedly, and that the service is fully up and ready when it is built. To ensure this, I&#8217;m using the following process, using nova:</p>
<ol>
<li>Create an instance and use it to do experimentation with the service.</li>
<li>Document the service, along with the installation process on <a href="http://wikitech.wikimedia.org/view/Main_Page">wikitech</a>, after ensuring the service is working properly.</li>
<li>Create a second instance. Following the documentation written, puppetize the service.</li>
<li>Create a third instance. Ensure the puppetized service runs properly when initialized from scratch.</li>
<li>Kill all three instances, and replace the instances in the test cluster.</li>
</ol>
<p>When a service changes in puppet, follow the above cycle as well.</p>
<p>Using this process, I can be assured the puppet manifests, as written, will allow me to repeatedly install this service.</p>
<p>Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/11/01/sharing-home-directories-to-instances-within-a-project-using-puppet-ldap-autofs-and-nova/' rel='bookmark' title='Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova'>Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/24/announcing-openstackmanager-extension-for-mediawiki/' rel='bookmark' title='Announcing OpenStackManager extension for MediaWiki'>Announcing OpenStackManager extension for MediaWiki</a></li>
<li><a href='http://ryandlane.com/blog/2011/12/22/openstackmanager-version-1-3-released/' rel='bookmark' title='OpenStackManager version 1.3 released'>OpenStackManager version 1.3 released</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/eiQj_iZX-70" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/11/02/a-process-for-puppetization-of-a-service-using-nova/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/11/02/a-process-for-puppetization-of-a-service-using-nova/</feedburner:origLink></item>
		<item>
		<title>Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/tHbm2TZT6kw/</link>
		<comments>http://ryandlane.com/blog/2011/11/01/sharing-home-directories-to-instances-within-a-project-using-puppet-ldap-autofs-and-nova/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 17:49:13 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[LDAP]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[OpenStack]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Wikimedia]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=482</guid>
		<description><![CDATA[As mentioned in an older post, I&#8217;m building a test and development environment using OpenStack. The environment is intended to be fairly integrated. Part of this integration is a consistent working environment between instances in a project. Providing home directories via NFS is the easiest way of ensuring this consistent working environment. The problem with [...]
Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/04/09/why-i-chose-mediawiki-for-my-openstack-manager-project/' rel='bookmark' title='Why I chose MediaWiki for my OpenStack Manager project'>Why I chose MediaWiki for my OpenStack Manager project</a></li>
<li><a href='http://ryandlane.com/blog/2011/11/02/a-process-for-puppetization-of-a-service-using-nova/' rel='bookmark' title='A process for puppetization of a service using Nova'>A process for puppetization of a service using Nova</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/24/announcing-openstackmanager-extension-for-mediawiki/' rel='bookmark' title='Announcing OpenStackManager extension for MediaWiki'>Announcing OpenStackManager extension for MediaWiki</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://ryandlane.com/blog/2011/01/02/building-a-test-and-development-infrastructure-using-openstack/">mentioned in an older post</a>, I&#8217;m building a test and development environment using OpenStack. The environment is intended to be fairly integrated. Part of this integration is a consistent working environment between instances in a project. Providing home directories via NFS is the easiest way of ensuring this consistent working environment.</p>
<p>The problem with NFS home directories, however, is that they are fairly insecure. They can be used between instances to escalate privileges. In our environment, this isn&#8217;t a problem for instances within a project. If a user is a member of a project, they have shell on all instances. If they are given sudo access in a project, they are given sudo access on all instances. Between projects, however, is a problem. user-A with root on instance-A in project-A could su to to user-B on instance-A, modify the user&#8217;s <em>authorized_keys</em> file, and then have access to project-B if home directories are shared across projects.</p>
<p>To avoid cross-project escalation, each project needs its own set of home directories. This means we can&#8217;t simply export <em>/home</em> to the instance&#8217;s private network and be done with it. We&#8217;ll need to create an <em>exports</em> file, and share different directory trees with specific instances. We&#8217;ll also need to mount home directories differently on the instances, depending on the project they belong to.</p>
<p>To do so, we&#8217;ll use a combination of puppet, LDAP, autofs, and Nova.</p>
<h2>Creating the exports file</h2>
<p>To create the exports file we need three things:</p>
<ol>
<li>A list of projects</li>
<li>A list of instances within each project</li>
<li>A list of home directory locations for each project</li>
</ol>
<p>The first two can be found via LDAP. The query for a list of projects is: <em>&#8216;(&amp;(objectclass=groupofnames)(owner=*))&#8217;</em>. The query for a list of instances within each project is:<em> &#8216;(puppervar=instanceproject=&lt;project&gt;)&#8217;</em>. Of course, this approach is only usable for people using the <a href="http://www.mediawiki.org/wiki/Extension:OpenStackManager">OpenStackManager extension for MediaWiki</a>; I&#8217;ll mention more portable ways to get this information later in the post.</p>
<p>The third we can extrapolate, we just need a base directory. I chose to use <em>/export/home/&lt;project&gt;</em> for the locations.</p>
<p>I wrote a <a href="http://svn.wikimedia.org/viewvc/mediawiki/trunk/tools/subversion/user-management/manage-exports?view=markup">python script</a> that will pull this information, and create an exports file that looks like this:</p>
<pre style="padding-left: 30px;">/export/home/&lt;project1&gt; &lt;project1-instance1&gt;(rw,no_subtree_check) &lt;project-instance2&gt;(rw,no_subtree_check) &lt;project_instance...&gt;(rw,no_subtree_check)
/export/home/&lt;project2&gt; &lt;project2-instance1&gt;(rw,no_subtree_check) &lt;project2-instance2&gt;(rw,no_subtree_check) &lt;project2_instance...&gt;(rw,no_subtree_check)</pre>
<h2>Mounting the shares from the instances</h2>
<p>Each instance needs to mount the share, depending on its project. There&#8217;s a number of ways we can do this, but I like the flexibility of using autofs and LDAP to manage NFS mounts. To add slightly more flexibility we&#8217;ll involve the help of puppet as well.</p>
<p>In LDAP, we can create autofs entries by <a href="http://wikitech.wikimedia.org/view/Ldap#NisMap_entries_.28autofs.29">making maps and objects</a>. The following objects add support for <em>/home</em>:</p>
<pre style="padding-left: 30px;">dn: nisMapName=auto.master,&lt;basedn&gt;
objectClass: top
objectClass: nisMap
nisMapName: auto.master

dn: nisMapName=auto.home,&lt;basedn&gt;
objectClass: top
objectClass: nisMap
nisMapName: auto.home</pre>
<pre style="padding-left: 30px;">dn: nisMapName=/home,nisMapName=auto.master,&lt;basedn&gt;
objectClass: top
objectClass: nisObject
cn: /home
nisMapEntry: ldap:nisMapName=auto.home,&lt;basedn&gt;
nisMapName: auto.master</pre>
<p>We also need to add entries for the specific home directories. Here we are going to invoke a <a title="LDAP automount entry interoperability between Red Hat Enterprise Linux and Solaris for NFSv4" href="http://ryandlane.com/blog/2010/02/09/ldap-automount-entry-interoperability-between-red-hat-enterprise-linux/">little awesome magic that autofs has</a>: variables. Here&#8217;s the entry we are using for all home directories in all projects:</p>
<pre style="padding-left: 30px;">dn: cn=*,nisMapName=auto.home,&lt;basedn&gt;
changetype: add
nisMapEntry: ${SERVNAME}:${HOMEDIRLOC}/&amp;
objectClass: nisObject
objectClass: top
nisMapName: auto.home
cn: *</pre>
<p>We only need the one entry, which saves us from having to create and delete entries on creation and deletion of projects. Using this, however, means we need to set the variables. This is where puppet comes in. First, though, let&#8217;s look at the node in LDAP:</p>
<pre style="padding-left: 30px;">dn: dc=i-0000005c,dc=pmtpa,ou=hosts,dc=wikimedia,dc=org
objectClass: domainrelatedobject
objectClass: dnsdomain
objectClass: domain
objectClass: puppetclient
objectClass: dcobject
objectClass: top
puppetVar: realm=labs
puppetVar: writable=false
puppetVar: db_cluster=s1
puppetVar: instancecreator_email=rlane@wikimedia.org
puppetVar: instancecreator_username=Ryan Lane
puppetVar: instancecreator_lang=en
puppetVar: instanceproject=testlabs
puppetClass: base
puppetClass: ldap::client::wmf-test-cluster
puppetClass: exim::simple-mail-sender
puppetClass: db::core
puppetClass: mysql::mysqluser
puppetClass: mysql::datadirs
puppetClass: mysql::conf
l: pmtpa
associatedDomain: i-0000005c.pmtpa.wmflabs
associatedDomain: labs-db2.pmtpa.wmflabs
dc: i-0000005c
aRecord: 10.4.0.12</pre>
<p>All the above <em>objectclasses</em> and <em>attributes</em> are available for use in puppet. The really important one here is <em>instanceproject=testlabs</em>.</p>
<p>We can set the <em>autofs</em> variables via the <em><em>OPTIONS</em> </em>variable in the<em> /etc/default/autofs</em> file<em></em>:</p>
<p style="padding-left: 30px;">OPTIONS=&#8221;-DSERVNAME=&lt;%= nfs_server_name %&gt; -DHOMEDIRLOC=&lt;%= homedir_location %&gt;&#8221;</p>
<p>Here <em>SERVNAME</em> and <em>HOMEDIRLOC</em> <em>autofs</em> variables are being set. <em>nfs_server_name</em> and <em>homedir_location</em> are being set <a href="https://gerrit.wikimedia.org/r/gitweb?p=operations/puppet.git;a=blob;f=templates/ldap/autofs.default.erb;h=f54b3b8d2d57fa3c2c5e67f210119b677d043d27;hb=HEAD">via a puppet template</a>. Both are being determined <a href="https://gerrit.wikimedia.org/r/gitweb?p=operations/puppet.git;a=blob;f=manifests/ldap.pp;h=826145bc5cc98c301ba22d52e2f3bc5b9f122c4f;hb=HEAD">via a manifest</a>:</p>
<pre style="padding-left: 30px;">$homedir_location = "/export/home/${instanceproject}"</pre>
<p><em>nfs_server_name</em> is a hash, based on the project:</p>
<pre style="padding-left: 30px;">$nfs_server_name = $instanceproject ? {
	default =&gt; "labs-nfs1",
}</pre>
<p>I chose to use a hash based on project so that I can choose to separate the server based on project as well, if needed for performance, or extra security.</p>
<h2>Managing user home directories</h2>
<p>Everything up to this point is just creating the shares. However, we must maintain the users&#8217; home directories as well. For this, we need to know which users are in which projects, and we need to manage their home directories per project.</p>
<p>I <a href="http://svn.wikimedia.org/viewvc/mediawiki/trunk/tools/subversion/user-management/homedirectorymanager.py?view=markup">wrote a script</a> to search for users, based on a group (the project), that selectively creates/deletes/renames home directories and <em>authorized_keys</em> files. I should note here that I don&#8217;t use nova&#8217;s mechanisms for SSH key management, as it isn&#8217;t portable between applications. I instead store the keys in the user&#8217;s LDAP entry.</p>
<p>There&#8217;s a security issue with management of home directories. If a user is added to a project and we create a home directory, with a populated <em>authorized_keys</em> file, then remove the user from the project, but don&#8217;t remove their home directory, the user will still have access to the project&#8217;s instances. There&#8217;s two ways I go about solving this issue:</p>
<ol>
<li>Ensure the user only has access to the instance if they are in the project, <a href="https://gerrit.wikimedia.org/r/gitweb?p=operations/puppet.git;a=blob;f=templates/ldap/access.conf.erb;h=94263ea4382e0c86643a8aaf1c4d31745116cfaf;hb=HEAD">using <em>access.conf</em></a>. In my architecture, when projects are added, they are also made a <em>posixgroup</em>, with a <em>gid</em>. Thanks to this, we can treat the project as a system group in all instances. In <em>access.conf</em> we limit access to the project group.</li>
<li>User&#8217;s home directories are moved from <em>/export/home/&lt;project&gt;/&lt;user&gt;</em> to <em>/export/home/&lt;project&gt;/SAVE/&lt;user&gt;</em> when they are removed from the project.</li>
</ol>
<h2>Problems with this solution, and future improvements to make</h2>
<p>The major shortcoming of this solution is that it isn&#8217;t terribly portable. It is dependent on using LDAP, and storing specific information in the LDAP directory. Using the nova tools, or having nova manage the exports on instance creation/deletion would make this a much more portable solution.</p>
<p>Another shortcoming is that it isn&#8217;t terribly scalable. The exports file is being created from scratch every single script run (which needs to happen fairly frequently). Ideally, nova would write to a queue, and the NFS instance would add/remove instances from the exports as instances are created/deleted.</p>
<p>Thankfully, I didn&#8217;t have a shortage of ideas about how to accomplish this, <a href="http://www.mediawiki.org/wiki/WMF_Projects/Wikimedia_Labs/Shared_home_directories_per_project">as shown in my proposal</a>. I decided upon the quick and dirty approach, opting to do one of the more reusable approaches later. I&#8217;ll likely add support to nova for this at some time in the future.</p>
<p>Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/04/09/why-i-chose-mediawiki-for-my-openstack-manager-project/' rel='bookmark' title='Why I chose MediaWiki for my OpenStack Manager project'>Why I chose MediaWiki for my OpenStack Manager project</a></li>
<li><a href='http://ryandlane.com/blog/2011/11/02/a-process-for-puppetization-of-a-service-using-nova/' rel='bookmark' title='A process for puppetization of a service using Nova'>A process for puppetization of a service using Nova</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/24/announcing-openstackmanager-extension-for-mediawiki/' rel='bookmark' title='Announcing OpenStackManager extension for MediaWiki'>Announcing OpenStackManager extension for MediaWiki</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/tHbm2TZT6kw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/11/01/sharing-home-directories-to-instances-within-a-project-using-puppet-ldap-autofs-and-nova/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/11/01/sharing-home-directories-to-instances-within-a-project-using-puppet-ldap-autofs-and-nova/</feedburner:origLink></item>
		<item>
		<title>Thoughts on OpenStack Foundation</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/Ss-5atGH4JA/</link>
		<comments>http://ryandlane.com/blog/2011/10/10/thoughts-on-openstack-foundation/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 17:38:53 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[OpenStack]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=477</guid>
		<description><![CDATA[The last day of the OpenStack Design Summit and Conference it was announced that OpenStack would now be run as a foundation, rather than as a corporate subsidiary of Rackspace. I believe this is an important step in the growth and stability of this project, and am very excited about the plans. The day of [...]
Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/09/19/ive-been-with-the-wikimedia-foundation-for-a-year-have-i-met-my-goals/' rel='bookmark' title='I&#8217;ve been with the Wikimedia Foundation for a year. Have I met my goals?'>I&#8217;ve been with the Wikimedia Foundation for a year. Have I met my goals?</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/02/building-a-test-and-development-infrastructure-using-openstack/' rel='bookmark' title='Building a test and development infrastructure using OpenStack'>Building a test and development infrastructure using OpenStack</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The last day of the OpenStack Design Summit and Conference it was announced that OpenStack would now be run as a foundation, rather than as a corporate subsidiary of Rackspace. I believe this is an important step in the growth and stability of this project, and am very excited about the plans.</p>
<p>The day of the announcement there was also a governance town hall meeting. The meeting was conducted with attendees sitting in a circle, discussing the foundation formation as a group. It felt the way a community discussion should feel: warm, open, but with a little bit of critical questioning on occasion as well. During this meeting a number of good ideas were put forward about who we should be getting advice from, possible structures, and most importantly, how we&#8217;ll create the foundation as a community over the next year. I think this discussion was a great starting point for the rest of the process.</p>
<p>In the next couple weeks we&#8217;ll hear how to actively participate in the creation of the foundation. I&#8217;m sure however the process works, that it&#8217;ll be transparent and fair. I also have a strong feeling that the outcome of this process will be a foundation that can not easily be coerced by a single vendor.</p>
<p>A few topics that I brought up during the town hall discussion concerned the possibility of the foundation being controlled by a single vendor. The first topic was about how roles in the foundation would be filled. Would the foundation employ all of the roles, or would they be appointed from community members? In the latter case, a single vendor can control the foundation by being the one that continuously occupies all of the positions. In the former case, the foundation would control the roles, but would require far more money to operate. My second topic was regarding control and money. How would donations be handled? Would it be possible for one vendor to control the foundation through being the primary sponsor? My third topic regarded the current situation with community roles. Nearly every role is currently filled by Rackspace. Should we limit the number of appointments any one specific organization can have?</p>
<p>I was very happy with the responses to my questions. Initial thoughts about employees vs appointments were that appointments will likely lead to a stronger community and it&#8217;s likely best to not have a sprawling foundation. The money question likely comes down to how much can legally be donated. Lastly, the thoughts on limiting appointments was that it is likely unnecessary and that it may hinder community involvement. Limiting appointments was initially tried on the software development policy side of things and no one liked it. It was also mentioned that we should be encouraging participation from every vendor in a way that is ongoing, rather than one-off.</p>
<p>My questions revolved around control. The project is, and will likely still be mostly lead and controlled by Rackspace for the near future. Of course, these questions are also purely theoretical. Rackspace has done an amazing job leading this project and encouraging participation and growth so far, and they haven&#8217;t used the project to benefit themselves over other community members. They just happen to currently be the organization that has the largest commitment to the project, since the project is still so young. That&#8217;s a great thing. I&#8217;m hoping to see the same level of commitment, if not even more from Rackspace after the foundation is formed. I&#8217;m also hoping to see much greater participation from other members of the community. I think that diversity will naturally occur over time as more community members add resources from their organizations.</p>
<p>I&#8217;d like to thank Rackspace for forming the foundation, and I&#8217;d like to thank in advance all the community members that are going to be working together to make this happen. Let&#8217;s make the project strong together!</p>
<p>Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/09/19/ive-been-with-the-wikimedia-foundation-for-a-year-have-i-met-my-goals/' rel='bookmark' title='I&#8217;ve been with the Wikimedia Foundation for a year. Have I met my goals?'>I&#8217;ve been with the Wikimedia Foundation for a year. Have I met my goals?</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/02/building-a-test-and-development-infrastructure-using-openstack/' rel='bookmark' title='Building a test and development infrastructure using OpenStack'>Building a test and development infrastructure using OpenStack</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/Ss-5atGH4JA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/10/10/thoughts-on-openstack-foundation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/10/10/thoughts-on-openstack-foundation/</feedburner:origLink></item>
		<item>
		<title>Configuring a local environment for dealing with git</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/g0Zo3fK5GmE/</link>
		<comments>http://ryandlane.com/blog/2011/09/23/configuring-a-local-environment-for-dealing-with-git/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 22:52:46 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[Wikimedia]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=453</guid>
		<description><![CDATA[I recently added a Gerrit instance at Wikimedia for doing code review and git repository management for our puppet repository. Since I&#8217;m using a new tool, I need a new working environment to go with it. Our puppet configuration is broken into two environments (production and labs), each environment having a public and private repository. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently added a <a href="https://gerrit.wikimedia.org">Gerrit instance at Wikimedia</a> for doing code review and git repository management for our puppet repository. Since I&#8217;m using a new tool, I need a new working environment to go with it.</p>
<p>Our puppet configuration is broken into two environments (production and labs), each environment having a public and private repository. Inside of these repositories our configuration is broken into three main directories: files, templates, manifests. I often jump between repositories, directories within repositories, and branches within different screen windows.</p>
<p>The information I need to know is this:</p>
<ul>
<li>The current working directory in each screen window</li>
<li>When inside a repository, which branch is active</li>
<li>Whether the branch has modifications or not</li>
</ul>
<p>Using a combination of screen and bash configuration, I display the current working directory as the title for each screen window. Here&#8217;s the bash configuration for this (in .bashrc):</p>
<pre>export PROMPT_COMMAND='
if [ $TERM = "screen" ]; then
 MYPWD="${PWD/#$HOME/~}"
 [ ${#MYPWD} -gt 20 ] &amp;&amp; MYPWD=..${MYPWD:${#MYPWD}-18}
 echo -n -e "\033k$MYPWD\033\\"
fi
'</pre>
<p>Here&#8217;s the screen configuration for this (in .screenrc):</p>
<pre>hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %1`%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "</pre>
<p>Thanks to <a href="https://gist.github.com/1237345">Vishvanada Ishava</a>, I can tell which branch is active, and whether or not there are modifications in the repository I&#8217;m in. Here&#8217;s the bash configuration for this (in .bashrc):</p>
<pre>function git_branch {
  git branch --no-color 2&gt; /dev/null | egrep '^\*' | sed -e 's/^* //'
}
function git_dirty {
  # only tracks modifications, not unknown files needing adds
    if [ -z "`git status -s | awk '{print $1}' | grep '[ADMTU]'`" ] ; then
        return 1
    else
        return 0
    fi
}

function dirty_git_prompt {
    branch=`git_branch`
    if [ -z "${branch}" ] ; then
        return
    fi
    git_dirty &amp;&amp; echo " (${branch})"
}

function clean_git_prompt {
    branch=`git_branch`
    if [ -z "${branch}" ] ; then
        return
    fi
    git_dirty || echo " (${branch})"
}

export PS1='\n\e[1m\u\e[m@\e[4m\h\e[m:\e[7m\w\e[m\[\033[01;31m\]$(dirty_git_prompt)\[\033[01;32m\]$(clean_git_prompt)\[\033[00m\]\n\# \$&gt; '</pre>
<p>Here&#8217;s a screenshot of what it looks like (and, yes, the name of my laptop is Free-Public-Wifi :D):</p>
<p style="text-align: center;"><a href="http://ryandlane.com/blog/2011/09/23/configuring-a-local-environment-for-dealing-with-git/screen-and-bash-screenshot/" rel="attachment wp-att-454"><img class="aligncenter size-full wp-image-454" title="screen-and-bash-screenshot" src="http://ryandlane.com/blog/wp-content/uploads/2011/09/screen-and-bash-screenshot.png" alt="" width="431" height="215" /></a></p>
<img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/g0Zo3fK5GmE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/09/23/configuring-a-local-environment-for-dealing-with-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/09/23/configuring-a-local-environment-for-dealing-with-git/</feedburner:origLink></item>
		<item>
		<title>I’ve been with the Wikimedia Foundation for a year. Have I met my goals?</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/blonEMtQgxc/</link>
		<comments>http://ryandlane.com/blog/2011/09/19/ive-been-with-the-wikimedia-foundation-for-a-year-have-i-met-my-goals/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 22:41:59 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[Wikimedia]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=449</guid>
		<description><![CDATA[Really, I&#8217;ve been with the foundation for a year and a month, so this post is a little late. My first post on this was also a month late; so, at least this is an update of what I did for the past year. Question is, did I meet the goals I set for last [...]
Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2010/09/27/now-full-time-operations-engineer-for-wikimedia-foundation/' rel='bookmark' title='Now full time Operations Engineer for Wikimedia Foundation'>Now full time Operations Engineer for Wikimedia Foundation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Really, I&#8217;ve been with the foundation for a year and a month, so this post is a little late. My <a href="http://ryandlane.com/blog/2010/09/27/now-full-time-operations-engineer-for-wikimedia-foundation/">first post on this</a> was also a month late; so, at least this is an update of what I did for the past year.</p>
<p>Question is, did I meet the goals I set for last year? Here&#8217;s my goals from last year with the results:</p>
<ol>
<li>Learn how to deal with Wikimedia infrastructure during an emergency situation, so that we don’t have to constantly wake up the same folks</li>
<ul>
<li>Success. I handled a number of outages without needing to page anyone.</li>
</ul>
<li>Build a virtualization cluster for test, development, and volunteer evaluation; this includes migrating virtual machines away from the currently proprietary ESXi based <a href="http://wikitech.wikimedia.org/view/Tesla">Tesla</a> <a href="../../wiki/Category:Servers">infrastructure</a> I built while working on the Wikipedia Usability Initiative as a contractor</li>
<ul>
<li>Partially complete. Tesla still exists and is still running a number of virtual machines that we use for test and development. A replacement is not up yet. That said, the scope of this goal changed dramatically as I started thinking of what we really needed. The plans for this are far more ambitious now, and so far it&#8217;s going well. The architecture is mostly up, we&#8217;re starting to give people accounts, and by mid-October it should be fully ready for use. We are having a hack-a-thon in New Orleans that will be primarily focused on this project. Ubuntu Ensemble will be working with us inside of this environment, and so will OpenStreetMap. I gave a keynote about the architecture of this environment at the OpenStack Design Summit and Conference, and a gave a talk at Wikimania about the future of development and operations at Wikimedia Foundation using this environment. I recently set up Gerrit, imported our puppet repository, and <a href="http://blog.wikimedia.org/2011/09/19/ever-wondered-how-the-wikimedia-servers-are-configured/">released it to the public</a>, as a first major step in the opening of the Labs project.</li>
</ul>
<li>Centralize authentication for cluster resources and integrate other sys-admin based resources to eliminate multiple sets of credentials</li>
<ul>
<li>Partially complete. The Labs project needed a fair amount of services, and their authentication needed to be integrated. Subversion user accounts were already being stored in LDAP, so I integrated all Labs services with Subversion LDAP. I switched our puppet repo from Subversion to Git (in Gerrit), so ops code review now  has integrated authentication.</li>
</ul>
<li>Improve (or replace) Central Auth to include OpenID (as a provider and consumer) and oAuth at a minimum</li>
<ul>
<li>Skipped. This was one of my ambitious goals that was an &#8220;if I got time for it&#8221; goals. I didn&#8217;t get time for it. This is something we need for Labs, so it&#8217;s still on my plate, and will likely be a major goal of next year. We will be discussing this at the New Orleans hack-a-thon.</li>
</ul>
<li>Add more environments to the <a href="http://grid.tesla.usability.wikimedia.org:4444/console">Selenium cluster I built</a> as part of the Wikipedia Usability initiative, and continue to work with the group <a href="http://www.mediawiki.org/wiki/Selenium/Deployment">creating</a> a <a href="http://www.mediawiki.org/wiki/Selenium">Selenium</a> <a href="http://www.mediawiki.org/wiki/SeleniumFramework">testing framework</a> for MediaWiki</li>
<ul>
<li>Dropped. Support for Selenium from the Wikimedia Foundation was dropped a few months ago. We were focusing on unit tests. We were writing very few Selenium tests, and the overhead of maintaining this cluster was basically wasted effort. Because of that we decided to scrap it and support other things instead.</li>
</ul>
<li>Foster and work towards an environment capable of easily integrating volunteer sys-admins</li>
<ul>
<li>Success. This is exactly why the scope of the virtualization project expanded so greatly. I think the goals of Labs address this very well. The entire environment is built around the idea of volunteer ops. Also, with the move of the puppet repository into a public Git repository, we can easily take changes from volunteers.</li>
</ul>
<li>Do whatever I’m told to do ;)</li>
<ul>
<li>I always do so poorly with this one :D. Overall I&#8217;d say this goal has been completed.</li>
</ul>
</ol>
<p>What did I do that was outside of these goals?</p>
<ol>
<li>Created an HTTPS cluster and enabled HTTPS in experimental mode on a couple of our larger sites.</li>
<li>Moved, upgraded, and puppetized our Subversion set up. I moved it in the middle of a hack-a-thon too ;).</li>
<li>Added backups for our miscellaneous database servers</li>
<li>Daemonized and puppetized a bunch of things that were being started in screen sessions</li>
<li>Packaged a bunch of things that were either being installed unpackaged, or new things we needed that weren&#8217;t packaged yet</li>
<li>A ton of other small tasks &#8211; see our <a href="http://wikitech.wikimedia.org/view/Server_admin_log">Server Admin Log</a> for this information.</li>
</ol>
<p>What are my goals for next year?</p>
<ol>
<li>Continue with the Labs project. Finish set up of test/dev Labs, and begin work and make major progress on tool Labs.</li>
<li>Hire a devops contractor for work on Labs</li>
<li>Build a devops community around the Wikimedia architecture</li>
<li>Finish the HTTPS project. This will hopefully be complete from the ops perspective by the end of this year.</li>
<li>On-board new employees</li>
<li>Enable OpenID as a provider and oAuth on Wikimedia (this goal still needs consensus)</li>
</ol>
<p>Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2010/09/27/now-full-time-operations-engineer-for-wikimedia-foundation/' rel='bookmark' title='Now full time Operations Engineer for Wikimedia Foundation'>Now full time Operations Engineer for Wikimedia Foundation</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/blonEMtQgxc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/09/19/ive-been-with-the-wikimedia-foundation-for-a-year-have-i-met-my-goals/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/09/19/ive-been-with-the-wikimedia-foundation-for-a-year-have-i-met-my-goals/</feedburner:origLink></item>
		<item>
		<title>Canonical, please open source Landscape; Fedora, help us with Spacewalk</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/uiMdJBjMO0E/</link>
		<comments>http://ryandlane.com/blog/2011/05/02/canonical-please-open-source-landscape-fedora-help-us-with-spacewalk/#comments</comments>
		<pubDate>Mon, 02 May 2011 20:48:47 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=444</guid>
		<description><![CDATA[There&#8217;s something major missing in the Debian and Ubuntu world, and that&#8217;s a decent package management system. Yes, I&#8217;m going to get responses to this like &#8220;Why don&#8217;t you use Chef, or Puppet to do package management&#8221;, and I&#8217;ll give you the quick response for this: Though Chef and Puppet do configuration management well, they [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s something major missing in the Debian and Ubuntu world, and that&#8217;s a decent package management system. Yes, I&#8217;m going to get responses to this like &#8220;Why don&#8217;t you use Chef, or Puppet to do package management&#8221;, and I&#8217;ll give you the quick response for this: Though Chef and Puppet do configuration management well, they do not do package management well.</p>
<p>Package management is more than just saying &#8220;I want this package to be this specific version on these sets of systems&#8221;; package management gives you an overall view of your system in a number of ways. One view is the security profile and compliance of your entire network of systems. I should be able to quickly determine the CVE compliance of my systems. I want to be able to match a vulnerability to a package, quickly, and ensure all systems are patched for that. I should also have a view of which packages are installed on which systems, and be able to group them into system groups for easy reporting or actions.</p>
<p>Additionally, I want to be able to quickly and easily test packages before deploying them everywhere. I want to have a testing group of systems, a staging set of production systems, and the rest of the systems grouped, so that I can deploy packages in a sane way. I want to be able to stage package updates on a schedule so that I can do rolling package updates.</p>
<p>These two things are possible with Chef and Puppet, but aren&#8217;t easy (not even close to easy). These tools aren&#8217;t built for things like this. Landscape has a least a minimum set of these features. Spacewalk has all of these features.</p>
<p>Unfortunately, Landscape is proprietary, and Spacewalk doesn&#8217;t fully support Debian and Ubuntu.</p>
<h2>Canonical, please open source Landscape</h2>
<p>I understand that you need to make money somehow, but it&#8217;s somewhat hypocritical to run an open source company based on the profits of proprietary software. Red Hat seems to do pretty well without proprietary software, I&#8217;m sure you can as well. Red Hat even goes one step further and buys proprietary software just to open source it (see Fedora Directory Server, Dogtag, RHEV-M, etc.).</p>
<p>Don&#8217;t take this the wrong way, I&#8217;m happy with your open source offerings. The release schedule for Ubuntu, and Ubuntu server is essentially perfect for running Linux networks, and the LTS offering is great from the stability vs bleeding edge point of view; however, the lack of decent package management makes your offering excruciatingly painful to use on any large set of systems.</p>
<h2>Fedora, help us with Spacewalk</h2>
<p>Spacewalk is a great product. The functionality it offers for Fedora and CentOS (and RHEL via Satellite Server) is essentially perfect. It is by far one of the best management tools around. Please help expand this tool to Debian and Ubuntu.</p>
<p>Spacewalk version 1.4 greatly helps bring this support, but there is still a lot left to do. Of course, as I ask for the help of the Fedora community, I also hope the Debian and Ubuntu communities help with this as well.</p>
<img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/uiMdJBjMO0E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/05/02/canonical-please-open-source-landscape-fedora-help-us-with-spacewalk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/05/02/canonical-please-open-source-landscape-fedora-help-us-with-spacewalk/</feedburner:origLink></item>
		<item>
		<title>Why I chose MediaWiki for my OpenStack Manager project</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/u1gIjDCPWug/</link>
		<comments>http://ryandlane.com/blog/2011/04/09/why-i-chose-mediawiki-for-my-openstack-manager-project/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 00:46:52 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[LDAP]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[OpenStack]]></category>
		<category><![CDATA[Semantic MediaWiki]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Wikimedia]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=427</guid>
		<description><![CDATA[As mentioned before, I&#8217;m building a test and development environment for the Wikimedia Foundation using OpenStack and MediaWiki. I wrote a MediaWiki extension for this project, and have added basic Semantic MediaWiki support to this extension. People have asked me a number of times why I chose to use MediaWiki to build the OpenStack manager, [...]
Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/11/01/sharing-home-directories-to-instances-within-a-project-using-puppet-ldap-autofs-and-nova/' rel='bookmark' title='Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova'>Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova</a></li>
<li><a href='http://ryandlane.com/blog/2011/12/22/openstackmanager-version-1-3-released/' rel='bookmark' title='OpenStackManager version 1.3 released'>OpenStackManager version 1.3 released</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/02/building-a-test-and-development-infrastructure-using-openstack/' rel='bookmark' title='Building a test and development infrastructure using OpenStack'>Building a test and development infrastructure using OpenStack</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a title="Building a test and development infrastructure using OpenStack" href="http://ryandlane.com/blog/2011/01/02/building-a-test-and-development-infrastructure-using-openstack/">As mentioned before</a>, I&#8217;m building a test and development environment for the Wikimedia Foundation using OpenStack and MediaWiki. I wrote a <a href="http://www.mediawiki.org/wiki/Extension:OpenStackManager">MediaWiki extension for this project</a>, and have added basic <a href="http://semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> support to this extension. People have asked me a number of times why I chose to use MediaWiki to build the OpenStack manager, and this post will be an example of why I went this route.</p>
<h2>The self documenting architecture</h2>
<p>Server documentation is always out of date, and it annoys me. Sure, in a virtualized environment you can query the controller to get information about systems, but that&#8217;s only good to a point. Usually most controllers aren&#8217;t well suited to do documentation, and it kind of sucks to have to query a system to get that documentation. I like to do system documentation in a wiki. I can organize it how I want, and add any additional information that I want; this may not be supported by a controller. I also want to be able to link to my other documentation from my resource pages, or link from other documentation to my resource pages. This means I usually end up documenting my architecture in a wiki and as normal it&#8217;s all out of date.</p>
<p>No more! Since the OpenStackManager extension is managing all of the LDAP and OpenStack Nova resources, it can also add documentation for the resources while it&#8217;s at it. The extension will take all of the information and add it to a page based on the resource&#8217;s ID. The content of the page will be a mediawiki template (Nova Resource), with arguments and values for each piece of data. Here&#8217;s the current format of the template:</p>
<pre>{{Nova Resource
|Resource Type=instance
|Instance Name=%s
|Reservation Id=%s
|Instance Id={{PAGENAME}}
|Private IP=%s
|Public IP=%s
|Instance State=%s
|Instance Host=%s
|Instance Type=%s
|RAM Size=%s
|Number of CPUs=%s
|Amount of Storage=%s
|Image Id=%s
|Project=%s
|Availability Zone=%s
|Region=%s
|Security Group=%s
|Launch Time=%s
|FQDN=%s
|Puppet Class=%s
|Puppet Var=%s}}</pre>
<p>These pages are created in the Nova Resource namespace, so that it&#8217;s possible to restrict write access to that namespace. The pages will be updated whenever certain resources are added, configured, or deleted (currently only instances are supported).</p>
<h2>An architecture with queryable semantic data</h2>
<p>The OpenStackManager extension enables semantic support for the Nova Resource namespace, if Semantic MediaWiki is available. This allows you to add semantic annotations to the Nova Resource template.</p>
<p>By making semantic annotations for all of the resource data, you can then use those annotations in interesting ways. I have some <a href="http://nova-controller.tesla.usability.wikimedia.org/trunk.1/Resource_query_examples">example queries at the reference implementation</a>.</p>
<h2>An example use case of this semantic data</h2>
<p>Semantic MediaWiki has a bunch of output formats. One really interesting output format is JSON. The first thing that came to mind when I noticed this format was available was: how can I use this on the instances?</p>
<p>I fairly often need to run commands on a number of systems. I use dsh for this, and don&#8217;t necessarily like it. I don&#8217;t like it because I need to keep the dsh groups updated. This is like documentation. It&#8217;s a manual process, and as such, it&#8217;s always out of date. Well, since the wiki is documenting the instances as they are created, deleted, and re-configured, then it&#8217;s always up to date. Since we have all the instance data semantically annotated, we can also pull that information, and since there is a json export, I can use the json data in scripts on the command line.</p>
<p>As an example, <a href="http://pastebin.com/sLtSEuVQ">here&#8217;s a simple dsh written in python</a> using system groups pulled via semantic queries. First, <a href="http://nova-controller.tesla.usability.wikimedia.org/t-1/index.php?title=Special:Ask&amp;offset=0&amp;limit=20&amp;q=[[Resource+Type%3A%3Ainstance]]&amp;p=format%3Dbroadtable&amp;po=%3FInstance+Name%0A%3FInstance+Type%0A%3FImage+Id%0A%3FFQDN%0A%3FPublic+IP%0A%3FPrivate+IP%0A%3FLaunch+Time%0A%3FPuppet+Class%0A%3FModification+date%0A&amp;sort=Modification%20date&amp;order=DESC&amp;eq=no">take a look at the instances</a> we&#8217;ll be running this against. Now, let&#8217;s take a look at the output:</p>
<pre>laner@nova-controller:~$ python ddsh.py -p ganglia "echo hello"
Running "echo hello" on instance "i-00000010.sdtpa.tesla.wmnet"
hello
Running "echo hello" on instance "i-00000011.sdtpa.tesla.wmnet"
hello</pre>
<h2>Ideas?</h2>
<p>This is just a proof of concept of what can be done. I probably won&#8217;t actually use this script. I can keep my dsh groups up to date with puppet and likely will. I&#8217;m sure I&#8217;ll find some really great uses for the semantic data though.</p>
<p>Have any ideas on how to use a system like this? Let me know in the comments!</p>
<p>Related posts:<ol>
<li><a href='http://ryandlane.com/blog/2011/11/01/sharing-home-directories-to-instances-within-a-project-using-puppet-ldap-autofs-and-nova/' rel='bookmark' title='Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova'>Sharing home directories to instances within a project using puppet, LDAP, autofs, and Nova</a></li>
<li><a href='http://ryandlane.com/blog/2011/12/22/openstackmanager-version-1-3-released/' rel='bookmark' title='OpenStackManager version 1.3 released'>OpenStackManager version 1.3 released</a></li>
<li><a href='http://ryandlane.com/blog/2011/01/02/building-a-test-and-development-infrastructure-using-openstack/' rel='bookmark' title='Building a test and development infrastructure using OpenStack'>Building a test and development infrastructure using OpenStack</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/u1gIjDCPWug" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/04/09/why-i-chose-mediawiki-for-my-openstack-manager-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/04/09/why-i-chose-mediawiki-for-my-openstack-manager-project/</feedburner:origLink></item>
		<item>
		<title>Screen with SSH on a Shell Server</title>
		<link>http://feedproxy.google.com/~r/RyanLanesBlog/~3/fZN0MgolHrg/</link>
		<comments>http://ryandlane.com/blog/2011/03/23/screen-with-ssh-on-a-shell-server/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 19:51:30 +0000</pubDate>
		<dc:creator>Ryan Lane</dc:creator>
				<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://ryandlane.com/blog/?p=422</guid>
		<description><![CDATA[Most environments I use restrict login to shell servers. This makes a lot of sense, from the perspective of limiting attack surface areas. I&#8217;ve adjusted my working environment over time to take advantage of this type of environment. The basics First of all, security in an environment like this is important. I restrict my login [...]]]></description>
			<content:encoded><![CDATA[<p>Most environments I use restrict login to shell servers. This makes a lot of sense, from the perspective of limiting attack surface areas. I&#8217;ve adjusted my working environment over time to take advantage of this type of environment.</p>
<h2>The basics</h2>
<p>First of all, security in an environment like this is important. I restrict my login to key based login. I protect my key with a password. I don&#8217;t put my key on removable media. I keep a strong password on my key. I use full disk encryption for the system my key is on. I keep an encrypted backup of my key in a safe, located somewhere my computer isn&#8217;t kept.</p>
<p>In this environment I always want my working state to be kept. If I&#8217;m logged into 10 systems, I want to still be logged into 10 systems when I leave the office, and go home, or when I&#8217;m in an airport. I don&#8217;t want to have to deal with reconnecting my ssh-agent. I want my agent to always require the key on my computer (it shouldn&#8217;t be stored on the shell server). I want my environment to tell me which systems I&#8217;m logged into.</p>
<h2>Using screen</h2>
<p>Using screen handles a lot of the requirements. If you start a screen session on your shell server, you can always reconnect to the same working state you left behind. I like to know which system I&#8217;m currently on inside of a screen window, which shell server I&#8217;m on, and the date and time in UTC; to do so, set the following in <em>.screenrc</em>:</p>
<pre>hardstatus alwayslastline                                                                              
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "</pre>
<p>The above isn&#8217;t really enough to always show you which system you are ssh&#8217;d into past the shell server, though. You can use bash to do this; add the following into your <em>.bashrc</em>:</p>
<pre>setscreentitletohost() {                                                                               
  if [ "$TERM" == "screen" ]                                                                     
     then                                                                                           
     echo -ne "\033k$HOSTNAME$\033\\"                                                       
  fi                                                                                             
}                                                                                                       

setscreentitletohost                                                                                    

ssh() {                                                                                                
  inargs="$@"                                                                                    
  if [ "$TERM" == "screen" ]                                                                     
  then                                                                                           
     host="${inargs#*@}"                                                                    
     host="${host% *}"                                                                      
     user="${inargs%@*}"                                                                    
     user="${user#* }"                                                                      
     if [ "$user" == "root" ]                                                               
     then                                                                                   
         host="$host#"                                                                  
     else                                                                                   
         host="$host$"                                                                  
     fi                                                                                     
     echo -ne "\033k$host\033\\"                                                            
  fi                                                                                             
  /usr/bin/ssh -A $inargs                                                                        
  setscreentitletohost                                                                           
}</pre>
<p>I&#8217;d like to be able to detach while still having access to my current ssh agent, for this you need to deal with your ssh agent.</p>
<h2>Handling the agent</h2>
<p>This is fairly easy. You can use a symlink in bash to point to your current agent (credit for this particular implementation to a <a href="http://www.blindedbytech.com/2009/09/15/reconnect-ssh-agent-in-screen/">Blinded by Tech post</a>):</p>
<p>In <em>.bashrc</em>:</p>
<pre>if test $SSH_AUTH_SOCK &amp;&amp; [ $SSH_AUTH_SOCK != "/tmp/ssh-agent-$USER-screen" ]                          
then                                                                                                   
    rm -f /tmp/ssh-agent-$USER-screen                                                              
    ln -sf "$SSH_AUTH_SOCK" "/tmp/ssh-agent-$USER-screen"                                          
fi</pre>
<p>Now configure screen to always point to this socket. In your <em>.screenrc</em>:</p>
<pre>setenv SSH_AUTH_SOCK "/tmp/ssh-agent-$USER-screen"</pre>
<h2>Summary</h2>
<p>Now whenever you ssh into your shell server (while forwarding your agent), you will be able to connect to your shell session, keep your working state, connected to your current agent, and you&#8217;ll be able to see which systems you are currently logged into.</p>
<img src="http://feeds.feedburner.com/~r/RyanLanesBlog/~4/fZN0MgolHrg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ryandlane.com/blog/2011/03/23/screen-with-ssh-on-a-shell-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ryandlane.com/blog/2011/03/23/screen-with-ssh-on-a-shell-server/</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 12/100 queries in 0.031 seconds using memcached
Object Caching 2489/2608 objects using memcached

Served from: ryandlane.com @ 2012-01-20 13:22:58 -->

