<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/templates/default/atom.css" type="text/css" ?>

<feed version="0.3" 
   xmlns="http://purl.org/atom/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://www.markround.com/rss.php?version=atom0.3" rel="service.feed" title="Mark's blog" type="application/x.atom+xml" />
    <link href="http://www.markround.com/"                        rel="alternate"    title="Mark's blog" type="text/html" />
    <link href="http://www.markround.com/rss.php?version=2.0"     rel="alternate"    title="Mark's blog" type="application/rss+xml" />
    <title mode="escaped" type="text/html">Mark's blog</title>
    <tagline mode="escaped" type="text/html">Solaris, Linux, BSD and other techie things...</tagline>
    <id>http://www.markround.com/</id>
    <modified>2010-08-17T13:52:55Z</modified>
    <generator url="http://www.s9y.org/" version="1.5.1">Serendipity 1.5.1 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>
    <info mode="xml" type="text/html">
        <div xmlns="http://www.w3.org/1999/xhtml">You are viewing an ATOM formatted XML site feed. Usually this file is inteded to be viewed in an aggregator or syndication software. If you want to know more about ATOM, please visist <a href="http://atomenabled.org/">Atomenabled.org</a></div>
    </info>

    <entry>
        <link href="http://www.markround.com/archives/61-Xenserver-snapshot-and-template-based-backup-script.html" rel="alternate" title="Xenserver snapshot and template based backup script" type="text/html" />
        <author>
            <name>Mark Round</name>
                    </author>
    
        <issued>2010-08-17T13:24:14Z</issued>
        <created>2010-08-17T13:24:14Z</created>
        <modified>2010-08-17T13:52:55Z</modified>
        <wfw:comment>http://www.markround.com/wfwcomment.php?cid=61</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.markround.com/rss.php?version=atom0.3&amp;type=comments&amp;cid=61</wfw:commentRss>
    
        <id>http://www.markround.com/archives/61-guid.html</id>
        <title mode="escaped" type="text/html">Xenserver snapshot and template based backup script</title>
        <content type="application/xhtml+xml" xml:base="http://www.markround.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                We have recently started using <a title="Citrix Xenserver" href="http://www.citrix.com/English/ps2/products/product.asp?contentID=683148">Citrix Xenserver</a> in production at work (fantastic product, I must do a write-up soon!) and needed a simple backup solution. Our VMs run from an iSCSI SAN and are backed up daily through various methods - e.g. <a title="Bacula backup system" href="http://www.bacula.org/en/">Bacula</a> for the Unix/Linux systems. However, we wanted the ability to quickly roll back to a previous VM snapshot, and get up and running quickly if our SAN failed for whatever reason. Our solution was to create a large shared NFS storage repository, and periodically snapshot VMs and copy the templates over to this SR. Doing this means that if the SAN fails, we can create a new VM quickly from this NFS store (using the Xenserver's local disks, or even the NFS SR itself as storage). Once up and running, we can bring VMs back up to date by restoring the latest backup to them. <br /><br />In order to automate this, I wrote a quick script which I thought may prove useful to someone else, so decided to post it here : <a title="Xenserver snapshot and template backup script" href="http://www.markround.com/static/snapback.sh">snapback.sh</a>.<br /><br />It is very simple, and although it may serve well as your only backup solution, it's really intended as an image-level compliment to your primary file-system based backup system such as Bacula, Amanda, Netbackup etc. It also has not had much testing, and I fully appreciate the scripting is pretty rudimentary and could do with some optimisation - there's no error checking, for instance. I kept it pretty verbose on purpose though, so you can get a good idea of exactly what it's doing at each step; it may be better to think of this as a template you can base your own scripts off!<br /> 
<h2>Overview</h2>The script creates a snapshot of a running VM on a configurable schedule, and then creates a template from this snapshot. It will copy all these backup templates over to a configurable storage repository, and then clean up any old backups according to a specified retention policy. These backups are full backups, so if you have a 10GB VM and keep 7 previous copies you will need a total of 80GB disk space on your backup VM. Non-running VMs, and those not configured (as detailed below) will be skipped.<br /> 
<h2>Installation and usage</h2>First, copy the script to your Xenserver pool master, and make it executable. A good location for this is /usr/local/bin/snapback.sh.<br /><br />Next, create a cron entry for the script - to make it run daily just after 1AM, you'd create /etc/cron.d/backup with the following contents :<br /> 
<pre>2 1 * * * root /usr/local/bin/snapback.sh &gt; /var/log/snapback.log 2&gt;&amp;1</pre> 
<p>This will also record a log of it's actions to /var/log/snapback.log. You now need to edit the script and change the <strong>DEST_SR</strong> variable to the UUID of your backup storage repository. You can find this value by clicking on the SR in Xencenter; the UUID will be displayed as a value like &quot;2c01dc26-f525-70d6-dedf-00baaec76645&quot;.<br /><br />Lastly, you need to configure your backup and retention policy for your VMs. In Xencenter, right click your VM, and select &quot;Properties&quot;. Click on &quot;Custom Fields&quot;, and then &quot;Edit Custom Fields&quot;. You should add two text fields :<br /></p> 
<ul> 
<li><strong>backup</strong> : Can be one of &quot;daily&quot;, &quot;weekly&quot;, or &quot;monthly&quot;. If it is set to weekly, it will be default run on a Sunday, and if it set to monthly, it will run on the first Sunday of the month. This day can be changed at the top of the script - see the <strong>WEEKLY_ON</strong> and <strong>MONTHLY_ON</strong> variables.</li> 
<li><strong>retain</strong> : How many previous backups (in addition to the currently running backup) to keep. So, setting this to a value of &quot;2&quot; would mean that after a backup has run, you would end up with 3 backups in total.</li> 
</ul> 
<p> </p> 
<div style="width: 321px;" class="serendipity_imageComment_center"> 
<div class="serendipity_imageComment_img"><!-- s9ymdb:76 --><img width="321" height="289" alt="Adding a custom field" title="Adding a custom field" src="http://www.markround.com/uploads/uploads/newfield.png" class="serendipity_image_center" /></div> 
<div class="serendipity_imageComment_txt">Adding a custom field</div> 
</div> 
<p>The script will look for these fields when it is run, and will skip any VM that doesn't have them set. You can also see them in the Xencenter summary and properties for the VM :  </p> 
<p> </p> 
<div style="width: 220px;" class="serendipity_imageComment_center"> 
<div class="serendipity_imageComment_img"><a href="http://www.markround.com/uploads/uploads/summary.png" title="VM summary showing the custom fields" class="serendipity_image_link"><!-- s9ymdb:78 --><img width="220" height="105" alt="VM summary showing the custom fields" title="VM summary showing the custom fields" src="http://www.markround.com/uploads/uploads/summary.serendipityThumb.png" class="serendipity_image_center" /></a></div> 
<div class="serendipity_imageComment_txt">VM summary showing the custom fields</div> 
</div> 
<p> </p> 
<p> </p> 
<p>You can now either run the script manually, or wait until the cron job kicks off. It will produce a detailed log to the console (or log file if run through cron), and when it's finished, you'll see your template backup VMs listed in Xencenter, similar to this :</p> 
<p> </p> 
<div style="width: 187px;" class="serendipity_imageComment_center"> 
<div class="serendipity_imageComment_img"><!-- s9ymdb:77 --><img width="187" height="37" alt="Backups listed in Xencenter" title="Backups listed in Xencenter" src="http://www.markround.com/uploads/uploads/backups.png" class="serendipity_image_center" /></div> 
<div class="serendipity_imageComment_txt">Backups listed in Xencenter</div> 
</div><br />If you find that this clutters up the Xencenter view a little, you can always hide them (View-&gt;Server View-&gt;Custom Templates). To restore a VM from a backup, just right click, and choose &quot;New template from backup&quot;. Anyway, I hope this helps someone else!<br /><br /> 
            </div>
        </content>

        
    </entry>
    <entry>
        <link href="http://www.markround.com/archives/48-Linux,-Solaris-and-FreeBSD-iostat-monitoring-with-Cacti.html" rel="alternate" title="Linux, Solaris and FreeBSD iostat monitoring with Cacti" type="text/html" />
        <author>
            <name>Mark Round</name>
                    </author>
    
        <issued>2008-10-15T10:02:31Z</issued>
        <created>2008-10-15T10:02:31Z</created>
        <modified>2010-08-17T09:46:49Z</modified>
        <wfw:comment>http://www.markround.com/wfwcomment.php?cid=48</wfw:comment>
        <slash:comments>59</slash:comments>
        <wfw:commentRss>http://www.markround.com/rss.php?version=atom0.3&amp;type=comments&amp;cid=48</wfw:commentRss>
    
        <id>http://www.markround.com/archives/48-guid.html</id>
        <title mode="escaped" type="text/html">Linux, Solaris and FreeBSD iostat monitoring with Cacti</title>
        <content type="application/xhtml+xml" xml:base="http://www.markround.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I've been looking for ages for a tool to parse the output from &quot;iostat&quot; on Linux, and graph it in <a href="http://www.cacti.net" title="Cacti monitoring tool">Cacti</a>. I found a few scripts and templates that did some of what I was looking for (disk I/O etc.), but nothing that gave me the full set of statistics such as queue length, utilisation, service time etc. I finally got round to writing my own set of templates and a data gathering script to provide this information, and it seems to work very well. So that others can benefit, I've posted the package archive and a brief description over on the <a href="http://forums.cacti.net/viewtopic.php?t=29426" title="iostat cacti templates">Cacti forums</a> (click <a href="http://www.markround.com/archives/48-Linux-iostat-monitoring-with-Cacti.html#extended">Continue Reading</a> for a download link to an updated version - the one on the Cacti forums has a bug so that it won't work with all versions of sysstat). Below are a couple of sample graphs to give you an idea of what it can do - there's also a few more samples posted in the Cacti forums thread :<!-- s9ymdb:49 --></p> 
<div class="serendipity_imageComment_center" style="width: 595px;"> 
<div class="serendipity_imageComment_img"><!-- s9ymdb:49 --><img width="595" height="245" src="http://www.markround.com/uploads/bytes_sec.png" class="serendipity_image_center" /></div> 
<div class="serendipity_imageComment_txt">Displaying iostat's kB/s data source.</div> 
</div> 
<div class="serendipity_imageComment_center" style="width: 595px;"> 
<div class="serendipity_imageComment_img"><!-- s9ymdb:50 --><img width="595" height="233" src="http://www.markround.com/uploads/times.png" class="serendipity_image_center" /></div> 
<div class="serendipity_imageComment_txt">Timing information from iostat (average wait and service time)</div> 
</div> 
<p> </p> 
<p>Installation is a simple matter of creating a cron job to gather iostat data, extending your snmpd.conf to call the included iostat.pl script, and then importing the templates. Full instructions are included in the README within the archive (click the <a href="http://www.markround.com/archives/48-Linux-iostat-monitoring-with-Cacti.html#extended" title="Linux iostat monitoring with Cacti - README">Continue Reading</a> link to see them), but if you have any comments, suggestions or problems please let me know! </p> 
<p> </p> 
<p> </p> <br /><a href="http://www.markround.com/archives/48-Linux,-Solaris-and-FreeBSD-iostat-monitoring-with-Cacti.html#extended">Continue reading "Linux, Solaris and FreeBSD iostat monitoring with Cacti"</a>
            </div>
        </content>

        
    </entry>
    <entry>
        <link href="http://www.markround.com/archives/60-The-setting-sun.html" rel="alternate" title="The setting sun" type="text/html" />
        <author>
            <name>Mark Round</name>
                    </author>
    
        <issued>2010-07-16T07:54:58Z</issued>
        <created>2010-07-16T07:54:58Z</created>
        <modified>2010-08-17T09:33:01Z</modified>
        <wfw:comment>http://www.markround.com/wfwcomment.php?cid=60</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.markround.com/rss.php?version=atom0.3&amp;type=comments&amp;cid=60</wfw:commentRss>
    
        <id>http://www.markround.com/archives/60-guid.html</id>
        <title mode="escaped" type="text/html">The setting sun</title>
        <content type="application/xhtml+xml" xml:base="http://www.markround.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>
Well, that's that, then. Solaris as we knew it is pretty much dead. I've suspected for a while now that Oracle's intentions regarding Solaris were not what the community, or us &quot;old-school&quot; Solaris sysadmins wanted or had hoped for.  </p> 
<p>In the last few months, Oracle have completely alienated and 
scared off the community around OpenSolaris, killed any lines of 
communication by clamping down on employee blogs and have ignored open 
letters from highly influential and important community members begging 
for <em>any</em> kind of information. Theyve forbidden Sun/Oracle employees 
from heading up the Solaris user groups and booted the meetings out of 
their buildings; turned Solaris 10 into a 90-day trial, and pushed back 
the 2010.x release of OpenSolaris with no word as to its planned 
release date, or even if it is being continued as a product. And now, in a final act of desperation, the OGB has essentially threatened to &quot;<a href="http://ptribble.blogspot.com/2010/07/moving-opensolaris-forward.html">shoot itself in the head</a>&quot;. </p> 
<div class="commentBody"> 
<div id="comment_body_32901998"> 
<p>Even ignoring the OpenSolaris project, It's not at all rosy in &quot;real&quot; Solaris land, either. Requests for information and clarification are going unanswered, and I know 
of several managers who have had hardware quotes and support tickets 
ignored - there's a near total blackout of information from Oracle. People are fleeing Solaris in droves, and migrating to anything they can: Linux, FreeBSD (Dtrace and ZFS), AIX - hell, even HP-UX looks like a safer bet at the moment. And I never thought I'd find myself saying that!<br /></p> 
<p>It certainly appears that Oracle
 are doing a superb job of killing Solaris. But why would they do this, having paid all that money for Sun and announcing that they will increase
 spending on Solaris development ?&#160; <br /></p> 
<p>Well,  <a href="http://developers.slashdot.org/comments.pl?sid=1719254&amp;cid=32903400" title="Oracle engineer confirms plans for Solaris">this
 post</a> on Slashdot (allegedly from a Sun/Oracle employee) confirms my
 suspicions as to why they may be doing this. Oracle just really doesn't care about Solaris as a general 
purpose data centre OS any more. There's just no money in it, and although I 
personally find it tragic it does make sense. It's probably also why they're killing all 
their OEM deals - why help a competitor sell hardware, when all you'll see from it is a possible support contract for the OS ? Oracle's overall aim is to have 
Solaris relegated to the role of running as the bottom layer in an 
Oracle &quot;database machine&quot;, Java appserver bundle or inside a &quot;<a href="http://blogs.sun.com/bmc/entry/fishworks_now_it_can_be">Fishworks</a>&quot; storage appliance.</p> 
<p>It excels at 
these tasks, and it would obviously fit into Oracle's stated goal of 
being a one stop shop, where if you want to run Oracle, they'll sell you
 the bundle - hardware, storage, OS and software. If they no longer want Solaris to be a dominant general purpose OS, then their approach 
makes sense. They don't need a &quot;community&quot; around the product, they 
don't need open source developers porting applications to it, and they 
certainly don't need the overhead of running and managing a community 
portal any more. Unless you are running (and paying for) Oracle applications on Solaris, you're probably more of an annoyance to them at the moment and I get the very strong idea that they'd rather you just quietly went elsewhere. </p> 
<p>I just wish that if this was their plan, they'd make some sort of statement about it; rather than ignoring the Solaris community in the hopes that they'll eventually get frustrated and leave without Oracle having to spell it out for them. I think the way they are going about it 
reprehensible and it's a tragic end for such a historic and innovative 
OS. Sadly though, Larry is all about the bottom line and the old, altruistic Sun approach 
just wasn't bringing in the big bucks. As the Slashdot poster said : &quot;Profit is king here.  Anything else is overhead, and overhead eats into 
Larry's yacht fund.&quot;</p>
<p><strong>Edit:</strong> Now it's official : <a href="http://www.theregister.co.uk/2010/08/13/opensolaris_is_dead/" title="OpenSolaris is dead">http://www.theregister.co.uk/2010/08/13/opensolaris_is_dead/ </a><br /></p> 
</div> 
</div> 
            </div>
        </content>

        
    </entry>
</feed>