<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Mike Renfro's Blog &#187; Xen</title>
	<atom:link href="http://blogs.cae.tntech.edu/mwr/category/xen/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.cae.tntech.edu/mwr</link>
	<description>A partial repository of whatever comes to mind</description>
	<lastBuildDate>Sat, 31 Oct 2009 23:02:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>I Killed the Mail Server Today</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/07/09/i-killed-the-mail-server-today/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/07/09/i-killed-the-mail-server-today/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 03:00:57 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Stupid!]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2008/07/09/i-killed-the-mail-server-today-2/</guid>
		<description><![CDATA[
It all started so simply: I was going to set up a little Xen instance to be my next cluster submit host, and needed a spare address for it:

I started setting up an instance for ch208i.cae.tntech.edu, since it was no longer on the Xen host like it was several months ago. Crap, the reason it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div><a href="http://icanhascheezburger.com/2008/07/07/funny-pictures-i-have-the-dumb/"><img class="mine_1410833" src="http://icanhascheezburger.wordpress.com/files/2008/07/funny-pictures-cat-cannot-brain-today.jpg" alt="cat" /></a></div>
<p>It all started so simply: I was going to set up a little Xen instance to be my next cluster submit host, and needed a spare address for it:</p>
<ol>
<li>I started setting up an instance for ch208i.cae.tntech.edu, since it was no longer on the Xen host like it was several months ago. Crap, the reason it&#8217;s no longer on the Xen instance is because I moved it to its own dedicated hardware &#8212; it&#8217;s still my main ftp/mirror server. Ctrl-C that one.</li>
<li>Hmm, what&#8217;s available from old Xen instances? mail2.cae.tntech.edu.cfg from when I was testing out a new mail server setup last fall &#8212; doesn&#8217;t ping, doesn&#8217;t show up in <code>xm list</code>, no problem.
<pre>xen-create-image --hostname=mail2.cae.tntech.edu --ip=149.149.254.23 \
    --gateway=149.149.254.4 --netmask=255.255.255.0 --size=10Gb --memory=256Mb \
    --swap=1Gb --debootstrap --force</pre>
<p>A few minutes later, my instance is debootstrapped and ready to go.</li>
<li>Oh, crap. Why am I getting an error on <code>xm create</code> that says my LVM is already in use on a domU somewhere?</li>
<li>Further crap. Looking in <code>/etc/xen/mail.cae.tntech.edu.cfg</code> for the production mail server, it apparently uses the old mail2.cae.tntech.edu LVMs. Wonderful. <code>ssh mail</code>? It works since sshd was already memory-resident, but <code>/root/.profile</code> doesn&#8217;t exist. And neither does much of anything else.</li>
<li>Great. I&#8217;ve just killed the mail server. Off to the Amanda server to do a quick restore of its data. What? I never put mail.cae.tntech.edu into the backup list? Not normally the end of the world, since the mail stores are held accessed over NFS from the main file server, but what about my dovecot and postfix configurations?</li>
<li>Oh, well. Time to see how good my puppet manifests are for the mail server.</li>
</ol>
<p>Not too bad, as it turns out. Total downtime was only a couple hours, including having to redo the postfix and dovecot configurations (which were then copied off to the puppetmaster). I still have a few more things to fix, but mail delivery is up, and imap is running. TLS support for my sending mail from home isn&#8217;t up yet, but it&#8217;ll be fixed shortly.</p>
<p>I still need to fix that submit host, though. Next time, I think I&#8217;ll use an IP address reserved for my office.</p>
<p><strong>Update:</strong> after getting a partial TLS/SASL setup going late Wednesday night, I went to sleep without realizing I&#8217;d killed mail delivery again. Finally got it straightened out Thursday morning.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/07/09/i-killed-the-mail-server-today/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Time Synchronization</title>
		<link>http://blogs.cae.tntech.edu/mwr/2007/05/13/time-synchronization/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2007/05/13/time-synchronization/#comments</comments>
		<pubDate>Sun, 13 May 2007 13:17:54 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2007/05/13/time-synchronization/</guid>
		<description><![CDATA[Time synchronization makes lots of things work better, including:

make
Kerberos
tar
syslog

We&#8217;ve got a central NTP server on campus, and I&#8217;m using that to sync from. Puppet handles ntp and ntpdate configuration on the managed systems. Components of that setup:

ntp.pp and ntpdate.pp classes imported from puppet/classes
Virtualization-detecting facter recipe (originally from here, but also included below since it&#8217;s short [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.infrastructures.org/bootstrap/time.shtml">Time synchronization</a> makes lots of things work better, including:</p>
<ul>
<li>make</li>
<li>Kerberos</li>
<li>tar</li>
<li>syslog</li>
</ul>
<p>We&#8217;ve got a central NTP server on campus, and I&#8217;m using that to sync from. Puppet handles ntp and ntpdate configuration on the managed systems. Components of that setup:</p>
<ul>
<li>ntp.pp and ntpdate.pp classes imported from puppet/classes</li>
<li>Virtualization-detecting facter recipe (<a href="http://reductivelabs.com/trac/puppet/wiki/VirtualRecipe">originally from here</a>, but also included below since it&#8217;s short and in case the original gets moved). This does two things: first, Xen <a href="http://wiki.xensource.com/xenwiki/DomU">domU</a>s get their time from the <a href="http://wiki.xensource.com/xenwiki/Dom0">dom0</a> by default. They won&#8217;t fail running ntp, but if dom0 has the wrong time, you&#8217;ll have a hard time getting any of the domUs to ever get the right time. So we&#8217;ll make sure ntp isn&#8217;t running there, as a reminder. Second, according to the virtualization recipe&#8217;s author, VMWare guests can&#8217;t run ntp at all. So we&#8217;ll disable it there, too.</li>
</ul>
<p>/etc/puppet/facts/virtual.rb</p>
<pre>
Facter.add("virtual") do
  confine :kernel =&gt; :linux
  result = "physical"
  setcode do
    lspciexists = system "which lspci &gt;&amp;/dev/null"
    if $?.exitstatus == 0
      output = %x{lspci}
      output.each {|p|
        # --- look for the vmware video card to determine
        # if it is virtual =&gt; vmware.
        # ---     00:0f.0 VGA compatible controller: VMware ...
        result = "vmware" if p =~ /VMware/
        }
    end
    # VMware server 1.0.3 rpm places vmware-vmx in this place,
    # other versions or platforms may not.
    if FileTest.exists?("/usr/lib/vmware/bin/vmware-vmx")
      result = "vmware_server"
    end
    if FileTest.exists?("/proc/sys/xen/independent_wallclock")
      result = "xenu"
    elsif FileTest.exists?("/proc/xen/capabilities")
      txt = File.read("/proc/xen/capabilities")
      if txt =~ /control_d/i
        result = "xen0"
      end
    end
    result
  end
end
</pre>
<p>/etc/puppet/manifests/classes/ntp.pp</p>
<pre>
class ntp {
  $ntppackage = $operatingsystem ? {
      Solaris =&gt; "SUNWntpu",
      default =&gt; "ntp"
  }
  package { $ntppackage:
      ensure =&gt; installed,
      provider =&gt; $operatingsystem ? {
          Solaris =&gt; "sun",
          default =&gt; "apt"
      }
  }

  file { ntpconf:
    path =&gt; $operatingsystem ? {
      Solaris =&gt; "/etc/inet/ntp.conf",
      default =&gt; "/etc/ntp.conf"
    },
    owner =&gt; root, group =&gt; root, mode =&gt; 644,
    source =&gt; "puppet://REDACTED/ntp.conf",
    require =&gt; Package[$ntppackage],
  }

  service { ntp:
    ensure =&gt; $virtual ? {
      vmware =&gt; stopped,
      xenu =&gt; stopped,
      default =&gt; running
    },
    enable =&gt; $virtual ? {
      vmware =&gt; false,
      xenu =&gt; false,
      default =&gt; true
    },
    subscribe =&gt; [Package[$ntppackage], File[ntpconf]]
  }
}
</pre>
<p>/etc/puppet/manifests/classes/ntpdate.pp</p>
<pre>
class ntpdate {
  package { ntpdate: ensure =&gt; installed }
}
</pre>
<p>and one entry from /etc/puppet/manifests/site.pp:</p>
<pre>
node ch405l {
  include ntp, ntpdate
}
</pre>
<p>Minor annoyances or deviations from the way things used to be configured: as of Debian 4.0, ntpdate is run when network interfaces are brought up, rather than at a user-defined time via the SysV init system. So if a system was installed with a bad time (most commonly on our dual-boot systems)  and you want to avoid reboots, you&#8217;ll have to run <code>ntpdate-debian</code> once to get the clock in sync with the NTP server before ntpd will do anything right.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2007/05/13/time-synchronization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
