<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Sysadmin Head</title>
    <link rel="alternate" type="text/html" href="http://www.sysadminhead.com/" />
    <link rel="self" type="application/atom+xml" href="http://www.sysadminhead.com/atom.xml" />
    <id>tag:www.sysadminhead.com,2009-11-22://1</id>
    <updated>2009-12-15T06:16:59Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.32-en</generator>

<entry>
    <title>SPICE - remote desktop protocol on steroids</title>
    <link rel="alternate" type="text/html" href="http://www.sysadminhead.com/2009/12/#000005" />
    <id>tag:www.sysadminhead.com,2009://1.5</id>

    <published>2009-12-14T03:27:40Z</published>
    <updated>2009-12-15T06:16:59Z</updated>

    <summary>Red Hat has opened sourced their SPICE remote desktop protocol. For sysadmins, this could potentially be the push needed to implement virtual desktops. I, for one, am one of those who will be taking another look at desktop virtualization. Below...</summary>
    <author>
        <name>Bret Palsson</name>
        
    </author>
    
    <category term="desktopvirtualization" label="Desktop virtualization" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="kernelbasedvirtualmachine" label="Kernel-based Virtual Machine" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="kvm" label="KVM" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="Linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="opensource" label="Open source" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="operatingsystem" label="Operating system" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="redhat" label="Red Hat" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="remotedesktopservices" label="Remote Desktop Services" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="remotedesktopsoftware" label="Remote desktop software" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="server" label="Server" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="spice" label="SPICE" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="virtualmachine" label="Virtual Machine" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.sysadminhead.com/">
        <![CDATA[Red Hat has opened sourced their SPICE remote desktop protocol. For sysadmins, this could potentially be the push needed to implement virtual desktops. I, for one, am one of those who will be taking another look at desktop virtualization. Below are some highlights of why I am excited about this protocol.&nbsp;<div><br /></div><div>Finally a replacement for terminal services (ie. windows remote desktop). SPICE brings most of what terminal services offers and more!&nbsp;</div><div><ul><li>Multiple displays (Only limited by RAM on the server and&nbsp;capabilities&nbsp;of the client that is running the guest.)</li><li>Two way audio. I see this being useful to record demos and such.</li><li>Live migration. Yes! I can do maintenance on hardware while a client is still using the desktop! No more waiting until after-hours or telling the client that they will need to take an extra long lunch.</li><li>Open source. I don't have to pay for licensing. I can contribute. I can improve.&nbsp;</li><li>KVM. Kernel-based Virtual Machine. This is another article to come.</li></ul><div>I have yet to experiment, but will probably setup a test environment over Christmas and New Years to play with. Stay tunned...</div></div><div class="zemanta-pixie" style="margin-top:10px;height:15px"><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        
    </content>
</entry>

<entry>
    <title>Citrix XenServer network bonding</title>
    <link rel="alternate" type="text/html" href="http://www.sysadminhead.com/2009/11/#000004" />
    <id>tag:www.sysadminhead.com,2009://1.4</id>

    <published>2009-11-25T23:28:54Z</published>
    <updated>2010-03-19T20:20:57Z</updated>

    <summary>Image via WikipediaEarlier this month I was experiencing problems with my servers. The symptom was all VoIP traffic was choppy. Turns out that the traffic was being sent just fine, it was delayed and when a phone receives delayed packets...</summary>
    <author>
        <name>Bret Palsson</name>
        
    </author>
    
    <category term="citrixsystems" label="Citrix Systems" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="failover" label="Failover" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iscsi" label="ISCSI" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="loadbalancing" label="Load balancing" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="networkcard" label="Network card" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nic" label="NIC" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="voiceoverinternetprotocol" label="Voice over Internet Protocol" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.sysadminhead.com/">
        <![CDATA[<div class="zemanta-img mt-image-right" style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; display: block; float: right; width: 310px; "><a href="http://en.wikipedia.org/wiki/Image:Xen_Logo.png"><img src="http://upload.wikimedia.org/wikipedia/en/thumb/3/38/Xen_Logo.png/300px-Xen_Logo.png" alt="Xen Logo" width="300" height="263"></a><p class="zemanta-img-attribution" style="font-size:0.8em">Image via <a href="http://en.wikipedia.org/wiki/Image:Xen_Logo.png">Wikipedia</a></p></div>Earlier this month I was experiencing problems with my servers. The symptom was all <a class="zem_slink" href="http://en.wikipedia.org/wiki/Voice_over_Internet_Protocol" title="Voice over Internet Protocol" rel="wikipedia">VoIP</a> traffic was choppy. Turns out that the traffic was being sent just fine, it was delayed and when a phone receives delayed packets (or packets that are out of order) it drops that traffic so you don't hear garble.

<p>This was a less than pleasant problem to figure out. However should you experience these problems, let this be one more place to look.</p>

<p>I decided it was time to take my VoIP servers and make them redundant. I only had two NICs on each machine, using one for private traffic and the other for public. Since <a class="zem_slink" href="http://www.citrix.com" title="Citrix Systems" rel="homepage">Citrix</a> <a class="zem_slink" href="http://www.xen.org/" title="Xen" rel="homepage">XenServer</a> supports the bonding of nics and <a class="zem_slink" href="http://en.wikipedia.org/wiki/IEEE_802.1Q" title="IEEE 802.1Q" rel="wikipedia">802.1q</a> vlan tagging, I thought that this would make a good combination for HA, in the event of a NIC or switch failure.</p>

<p>So away I went. Bonding is fairly simple in Citrix XenCenter. You just tell it you want to create a bond, select the nics and in a few seconds you have a bond. Great, just create the networks and vlan then life is all peachy.</p>

<p>I thought I was all good until the next day I started to receive calls that voice was choppy. Let me preface this with, the bonding wasn't the only thing I changed, but were focusing on it so I'll only make reference to it. After many packet captures and testing I found that packets were not being lost, they were being delayed by about three seconds.</p>

<p>At this point I started to investigate how citrix xenserver bonds their networks. It turns out they use the standard <a class="zem_slink" href="http://www.kernel.org/" title="Linux kernel" rel="homepage">linux kernel</a> modules to do the bonding. This is very good. The bad part is, they choose to only support 'balance-slb' which isn't well documented at all. (If you find documentation on this type of <a class="zem_slink" href="http://en.wikipedia.org/wiki/Load_balancing_%28computing%29" title="Load balancing (computing)" rel="wikipedia">load balancing</a>, please comment below.) The main idea with this type of load balancing is to share the load over both links. They do this by changing what interface is used ever 10-30 seconds. (I can't get a strait answer from Citrix on the time. One engineer said 10 the other said 30 seconds) Well that sounds all fine and dandy until you checkout the default settings for the bond:</p>

<pre class='brush: plain'>
# /opt/xensource/libexec/interface-reconfigure
# Line 862
bond_options = {
&quot;mode&quot;: &quot;balance-slb&quot;,
&quot;miimon&quot;: &quot;100&quot;,
&quot;downdelay&quot;: &quot;200&quot;,
&quot;updelay&quot;: &quot;31000&quot;,
&quot;use_carrier&quot;: &quot;1&quot;,
}
</pre>

<p>Ouch! Yes that is a 31000ms up-delay you see there, translated into seconds, thats 3.1 seconds. There it was, my 3 second delay. While the interface was coming up, the kernel was queuing all the packets, as soon as the interface was up it would send all the packets as fast as it could. The ICMP ping packets arrived out of order and the audio was dropped on phones. </p>

<p>Great now that I have identified the problem, how do I fix it? Back in my vmware days, yes I am a VI3 vmware certified professional (VCP), I learned about NIC teaming also known as <a class="zem_slink" href="http://en.wikipedia.org/wiki/Link_aggregation" title="Link aggregation" rel="wikipedia">802.3ad</a> Link aggregation. There are two types of link aggregation, link and dynamic. Dynamic is the best as it uses both links equally at the same time and provides frameless failover.</p>

<p>Great so now I decided to use a tried and true protocol how do I implement it? No problem. I use <a class="zem_slink" href="http://www.brocade.com/sites/dotcom/products-solutions/products/ethernet-switches-routers/enterprise-mobility/product-details/fastiron-cx-series/index.page" title="Brocade Fastiron CX Series" rel="brocade">Brocade Fastiron CX</a> switches, which are amazing. To use 802.3ad one must have a switch that supports the protocol. I logged into the switch found the two ports that were to be used and typed in <pre class='brush: plain'> link-agg active </pre> thats all I had to do on the switch side. No worry you PXE booters, the switch can detect if the server is trying to bond or if it's using a single link to communicate.</p>

<p>Now the last step is to get xenserver to use 802.3ad. After I read about the different methods to bond in linux http://sourceforge.net/projects/bonding/ I was off to modify citrix xenservers default config. They however want you to use a special method to configure the device, but I find this way the most painless and scriptable. Here it is:</p>

<pre class='brush: plain'>
# /opt/xensource/libexec/interface-reconfigure
# Line 862
# The bond option defaults
bond_options = {
&quot;mode&quot;: &quot;802.3ad&quot;,
&quot;lacp_rate&quot;: &quot;1&quot;,
&quot;miimon&quot;: &quot;100&quot;,
&quot;downdelay&quot;: &quot;200&quot;,
&quot;use_carrier&quot;: &quot;1&quot;,
}
</pre>

<p>After I saved the modification, I rebooted the servers and viola, 802.3ad Dynamic Link Aggregation up and working. I didn't even have to reconfigure my bonds. I ran some tests and of course this fixed the choppiness and everyone was happy again.</p>

<p>This will allow me to have true fail-over and the added bonus is, I can use the full 2gigs of bandwidth at any time, which on some of my other servers has come in handy since I'm using <a class="zem_slink" href="http://en.wikipedia.org/wiki/ISCSI" title="ISCSI" rel="wikipedia">iSCSI</a>, I'll talk about that in a future post.</p>

<p><strong>UPDATE</strong></p>

<p>There is a better way of doing this so it won't break any of your updates and you don't have to maintain custom code. You need set a parameter on your bond interface.</p>

<pre class='brush: plain'>
# Find the network name
xe network-list 
uuid ( RO)                : 22d8b51f-ec0c-16a8-47c7-5a42093bef37
          name-label ( RW): Public
    name-description ( RW): 
              bridge ( RO): xapi3
uuid ( RO)                : 1621b2ec-b549-cc8b-6a4c-839b5017a58d
          name-label ( RW): Guest installer network
    name-description ( RW): Network on which guests will get assigned a private local IP address
              bridge ( RO): xapi0
uuid ( RO)                : aa0dec75-2f96-9de2-4517-ef21bedacc79
          name-label ( RW): iSCSI (bond)
    name-description ( RW):
              bridge ( RO): xapi4
uuid ( RO)                : 237cdc19-3b84-0c97-7a98-842a97aa63e7
          name-label ( RW): Internal
    name-description ( RW):
              bridge ( RO): xapi5
uuid ( RO)                : 0e7530ad-7506-00bb-5d69-8975e4ecaf32
          name-label ( RW): iSCSI B
    name-description ( RW):
              bridge ( RO): xenbr3
uuid ( RO)                : 6316a5ea-be2c-c425-bf8c-20909c9c5aa7
          name-label ( RW): Main Network
    name-description ( RW): 
              bridge ( RO): xapi2
uuid ( RO)                : bf731568-91f5-1109-a6e8-f56d2b1a2ba9
          name-label ( RW): Pool-wide network associated with eth1
    name-description ( RW): 
              bridge ( RO): xenbr1
uuid ( RO)                : f10bb18a-d444-4a76-4aa7-8c36376c7d99
          name-label ( RW): Pool-wide network associated with eth0
    name-description ( RW): 
              bridge ( RO): xenbr0
uuid ( RO)                : e6ce997b-0011-798d-3aa1-6e8ea9c12762
          name-label ( RW): iSCSI A
    name-description ( RW):
              bridge ( RO): xenbr2
uuid ( RO)                : 409a8ee6-93ec-e858-5343-e80237156605
          name-label ( RW): Main Network (Bond)
    name-description ( RW):
              bridge ( RO): xapi1
</pre>

<p>You can see that the iSCSI (Bond) and Main Network (Bond) are the pif's that I am looking for:<br />
iSCSI (Bond):  aa0dec75-2f96-9de2-4517-ef21bedacc79<br />
Main Network (Bond): 409a8ee6-93ec-e858-5343-e80237156605</p>

<pre class='brush: plain'>
# Find the physical interface (a bond is considered physical)
xe pif-list host-name-label=servername
uuid ( RO)                  : 6c9200d5-1830-d072-671a-e462691a8ff4
                device ( RO): bond0
    currently-attached ( RO): false
                  VLAN ( RO): 112
          network-uuid ( RO): 22d8b51f-ec0c-16a8-47c7-5a42093bef37
uuid ( RO)                  : da276895-3868-0f71-600e-29588bd90f81
                device ( RO): eth3
    currently-attached ( RO): false
                  VLAN ( RO): -1
          network-uuid ( RO): 0e7530ad-7506-00bb-5d69-8975e4ecaf32
uuid ( RO)                  : 752cd4b8-1ce1-71df-d95e-43690f88496d
                device ( RO): eth2
    currently-attached ( RO): false
                  VLAN ( RO): -1
          network-uuid ( RO): e6ce997b-0011-798d-3aa1-6e8ea9c12762
uuid ( RO)                  : 3ed85977-2ca1-336e-9283-c66f45393c23
                device ( RO): eth0
    currently-attached ( RO): false
                  VLAN ( RO): -1
          network-uuid ( RO): f10bb18a-d444-4a76-4aa7-8c36376c7d99
uuid ( RO)                  : b94e8e38-7ba1-7d0b-4c5a-9ada852afb3e
                device ( RO): bond1
    currently-attached ( RO): true
                  VLAN ( RO): -1
          network-uuid ( RO): aa0dec75-2f96-9de2-4517-ef21bedacc79
uuid ( RO)                  : 68dc47bb-bed0-8b4a-fbe9-d975c53849ee
                device ( RO): bond0
    currently-attached ( RO): false
                  VLAN ( RO): 12
          network-uuid ( RO): 237cdc19-3b84-0c97-7a98-842a97aa63e7
uuid ( RO)                  : 34cee247-2175-3bf6-99cb-f001ca124022
                device ( RO): bond0
    currently-attached ( RO): true
                  VLAN ( RO): -1
          network-uuid ( RO): 409a8ee6-93ec-e858-5343-e80237156605
uuid ( RO)                  : 465f824a-43ab-9f58-cc15-5edaaaf9bcd4
                device ( RO): eth1
    currently-attached ( RO): false
                  VLAN ( RO): -1
          network-uuid ( RO): bf731568-91f5-1109-a6e8-f56d2b1a2ba9
</pre>

<p>Now find the networks in the pif-list:<br />
bond0: 34cee247-2175-3bf6-99cb-f001ca124022<br />
bond1: b94e8e38-7ba1-7d0b-4c5a-9ada852afb3e</p>

<p>Once you have the physical bond interfaces you need to add the parameter to use link-aggregation. The other-config needs to be in the order listed below because of how the xenserver's python script applies the configuration when setting up the interface. If it's done in the opposite order the /etc/sysconfig/network-scripts/ifcfg-bond0 will be all out of whack and the interface will not come up properly.</p>

<pre class='brush: plain'>
xe pif-param-set other-config:bond-use_carrier=1 other-config:bond-downdelay=200 other-config:bond-updelay=200 other-config:bond-miimon=100 other-config:bond-lacp_rate=1 other-config:bond-mode=&quot;802.3ad&quot; uuid=34cee247-2175-3bf6-99cb-f001ca124022
xe pif-param-set other-config:bond-use_carrier=1 other-config:bond-downdelay=200 other-config:bond-updelay=200 other-config:bond-miimon=100 other-config:bond-lacp_rate=1 other-config:bond-mode=&quot;802.3ad&quot; uuid=b94e8e38-7ba1-7d0b-4c5a-9ada852afb3e
</pre>

<p>There you have it. The way I add the bonds, currently until there is official support in xenserver is to add the management interface to the normal bond while the switch ports are still not configured for link-agg. As soon as the management interface is using the bond0 I then run the xe pif-param-set on the bonds, then I reboot the server. As the server is rebooted I set the ports to link-agg. Then the servers come up properly.</p>]]>
        
    </content>
</entry>

<entry>
    <title>rpm mixed architecture blues</title>
    <link rel="alternate" type="text/html" href="http://www.sysadminhead.com/2009/11/#000003" />
    <id>tag:sysadminhead.com,2009://1.3</id>

    <published>2009-11-25T02:47:36Z</published>
    <updated>2009-11-25T05:03:24Z</updated>

    <summary>Image via WikipediaMy server of choice is CentOS. When I first began using this flavor of Red Hat, I ran into some weirdness that I wasn&apos;t expecting. One of the weirdness I experienced was that when I installed centos using...</summary>
    <author>
        <name>Bret Palsson</name>
        
    </author>
    
    <category term="64bit" label="64-bit" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="architecture" label="Architecture" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="centos" label="CentOS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="i386" label="i386" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="installation" label="Installation" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="Linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="operatingsystem" label="Operating system" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="redhat" label="Red Hat" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="server" label="Server" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="x86_64" label="x86_64" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.sysadminhead.com/">
        <![CDATA[<div class="zemanta-img mt-image-right" style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; display: block; float: right; width: 100px; "><a href="http://en.wikipedia.org/wiki/Image:Centos_logo.png"><img src="http://upload.wikimedia.org/wikipedia/en/5/55/Centos_logo.png" alt="CentOS" width="90" height="84"></a><p class="zemanta-img-attribution" style="font-size:0.8em">Image via <a href="http://en.wikipedia.org/wiki/Image:Centos_logo.png">Wikipedia</a></p></div><div style="text-align: left;">My server of choice is <a class="zem_slink" href="http://www.centos.org/" title="CentOS" rel="homepage">CentOS</a>. When I first began using this flavor of Red Hat, I ran into some weirdness that I wasn't expecting. One of the weirdness I experienced was that when I installed centos using their default installer over http (I rarely ever use real media) I would get a mixture of library and program architectures installed.</div><br>

<div style="text-align: left;">This bothered me because I run 64bit machines and expect to have x86_64 bit packages installed, not a mixture of both i386 and x86_64.</div><br>

<div style="text-align: left;">If you are having the mixed architecture blues read on to find a fix that works for you.</div><br>

<div style="text-align: left;"><strong>Option 1:</strong><br>
Create a local repo that contains only x86_64 packages. I prefer this method so that I can control the content that is deployed across the hundreds of machines that I manage.</div><br>

<div style="text-align: left;"><strong>Option 2:</strong><br>
If you have already installed the operating system and don't want to reinstall then this is the option for you.</div><br>
<div style="text-align: left;">1. As root run:
<pre class='brush: plain'>
rpm -qa --queryformat='%{n}-%{v}-%{r}.%{arch}\n' | grep '\.i[3456]86$' | xargs rpm -ev 
</pre></div>
<br>
<div style="text-align: left;">2.  In your yum.conf add the following line:
<pre class='brush: plain'>
# /etc/yum.conf
exclude=*.i386 *.i586 *.i686
</pre></div>
<br>
<div style="text-align: left;">3. Finally clean the yum database:
<pre class='brush: plain'>
yum clean all
</pre></div>
<br>
That should get you going. If you have other methods or need to correct mine, please leave a comment.]]>
        
    </content>
</entry>

<entry>
    <title>Hello, world!</title>
    <link rel="alternate" type="text/html" href="http://www.sysadminhead.com/2009/11/#000002" />
    <id>tag:sysadminhead.com,2009://1.2</id>

    <published>2009-11-22T23:57:01Z</published>
    <updated>2009-11-23T00:26:09Z</updated>

    <summary><![CDATA[Welcome to a new and exciting blog where you will be able to look into the head of a Sysadmin.&nbsp;I decided to create a blog where I could share the many tricks and tips I learn. Also you will get...]]></summary>
    <author>
        <name>Bret Palsson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-US" xml:base="http://www.sysadminhead.com/">
        <![CDATA[Welcome to a new and exciting blog where you will be able to look into the head of a Sysadmin.&nbsp;<div><br /></div><div>I decided to create a blog where I could share the many tricks and tips I learn. Also you will get to hear intriguing stories that sysadmins usually keep quiet about.</div><div><br /></div><div>Enjoy your time here. Add this blog to your google reader or your favorite RSS aggregator and enjoy.</div><div><br /></div><div>-Bret</div>]]>
        
    </content>
</entry>

</feed>
