<?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>jansipke.nl</title>
	<atom:link href="http://www.jansipke.nl/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jansipke.nl</link>
	<description>Technology Blog</description>
	<lastBuildDate>Tue, 10 Jan 2012 09:20:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Solar application on Android</title>
		<link>http://www.jansipke.nl/solar-application-on-android</link>
		<comments>http://www.jansipke.nl/solar-application-on-android#comments</comments>
		<pubDate>Mon, 09 Jan 2012 17:47:10 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Energy]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Solar]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1287</guid>
		<description><![CDATA[The past couple of weeks I&#8217;ve been working on an Android application to look at the solar panel production. The following screenshots show what this has lead to. The left picture shows the start-up screen, with a photograph of the actual panels and six buttons for each of the screens. The middle picture shows the [...]]]></description>
			<content:encoded><![CDATA[<p>The past couple of weeks I&#8217;ve been working on an Android application to look at the solar panel production. The following screenshots show what this has lead to.</p>
<p>The left picture shows the start-up screen, with a photograph of the actual panels and six buttons for each of the screens. The middle picture shows the production in tabular form. The red coloring is for the 10% worst production days overall, the green coloring for the 10% best days overall. The grey background is for Saturdays and Sundays. The right picture shows the temperature of the inverter and the booster. It seems that the inverter tries to keep the temperature of the booster below 50 degrees. It does something &#8211; I don&#8217;t know what yet &#8211; until the temperature reaches 40 degrees:<br />
<a href="http://www.jansipke.nl/wp-content/uploads/2012/01/aurora-android1.png"><img class="alignnone size-full wp-image-1292" title="aurora-android1" src="http://www.jansipke.nl/wp-content/uploads/2012/01/aurora-android1.png" alt="" width="800" height="400" /></a>The application works in both portrait mode and landscape mode. The left picture shows the production for each day from installation until the current day. The right picture shows the production on a single day, with buttons to select the day:<br />
<a href="http://www.jansipke.nl/wp-content/uploads/2012/01/aurora-android2.png"><img class="alignnone size-full wp-image-1289" title="aurora-android2" src="http://www.jansipke.nl/wp-content/uploads/2012/01/aurora-android2.png" alt="" width="840" height="240" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/solar-application-on-android/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A sunny day with three clouds</title>
		<link>http://www.jansipke.nl/a-sunny-day-with-three-clouds</link>
		<comments>http://www.jansipke.nl/a-sunny-day-with-three-clouds#comments</comments>
		<pubDate>Mon, 19 Dec 2011 19:04:07 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Energy]]></category>
		<category><![CDATA[Solar]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1282</guid>
		<description><![CDATA[The 19th of December 2011 was a good day for solar panels. The production that day was about 3.5 kWh and you can clearly see that the inverter got enough power to awake at around 9:00, being at peak around noon and going back to sleep at around 15:00. This looks hopeful for the summer, [...]]]></description>
			<content:encoded><![CDATA[<p>The 19th of December 2011 was a good day for solar panels. The production that day was about 3.5 kWh and you can clearly see that the inverter got enough power to awake at around 9:00, being at peak around noon and going back to sleep at around 15:00. This looks hopeful for the summer, probably showing similar graphs with higher tops and wider bottoms.<br />
<a href="http://www.jansipke.nl/wp-content/uploads/2012/01/aurora-power-good.png"><img class="alignnone size-full wp-image-1283" title="aurora-power-good" src="http://www.jansipke.nl/wp-content/uploads/2012/01/aurora-power-good.png" alt="" width="567" height="322" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/a-sunny-day-with-three-clouds/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solar panel graphs</title>
		<link>http://www.jansipke.nl/solar-panel-graphs</link>
		<comments>http://www.jansipke.nl/solar-panel-graphs#comments</comments>
		<pubDate>Fri, 16 Dec 2011 20:23:16 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Energy]]></category>
		<category><![CDATA[Solar]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1263</guid>
		<description><![CDATA[The last couple of weeks I&#8217;ve been running monitoring software that is connected to the Aurora inverter and receives measurements from it. The setup is as follows: A lot of measurements are available, such as voltage, current and power of both inputs (solar panel strings) and the grid, temperature of the inverter and its booster, [...]]]></description>
			<content:encoded><![CDATA[<p>The last couple of weeks I&#8217;ve been running monitoring software that is connected to the Aurora inverter and receives measurements from it. The setup is as follows:</p>
<p><img class="alignnone size-full wp-image-1269" title="aurora-flow" src="http://www.jansipke.nl/wp-content/uploads/2011/12/aurora-flow.png" alt="" width="738" height="107" /></p>
<p>A lot of measurements are available, such as voltage, current and power of both inputs (solar panel strings) and the grid, temperature of the inverter and its booster, etc. The most interesting graphs are shown below. The first one shows the energy produced on each day since the solar panels were installed.</p>
<p><img class="alignnone size-full wp-image-1265" title="aurora-energy" src="http://www.jansipke.nl/wp-content/uploads/2011/12/aurora-energy.png" alt="" width="417" height="327" />The second one shows the power of a single day, from both the input (solar panel string) and the grid. There is a difference in these two readings, because the inverter is not one hundred percent efficient in transforming DC input into AC output.</p>
<p><img class="alignnone size-full wp-image-1267" title="aurora-power" src="http://www.jansipke.nl/wp-content/uploads/2011/12/aurora-power.png" alt="" width="570" height="324" />The third one shows the voltage outputs of the solar panels. Although not perfectly stable, it tries to keep quite constant at about 200V.</p>
<p><img class="alignnone size-full wp-image-1272" title="aurora-voltage" src="http://www.jansipke.nl/wp-content/uploads/2011/12/aurora-voltage.png" alt="" width="583" height="336" /></p>
<p>The fourth one shows the current outputs of the solar panels. This is what matters for the production of the panels.</p>
<p><img class="alignnone size-full wp-image-1273" title="aurora-current" src="http://www.jansipke.nl/wp-content/uploads/2011/12/aurora-current.png" alt="" width="580" height="336" />The fifth one shows the temperature of the inverter itself and its booster. It seems that the inverter tries to keep the temperature of the booster below 50 degrees. As soon as it hits 50 degrees, it cools down to 40 degrees and rises again.</p>
<p><img class="alignnone size-full wp-image-1274" title="aurora-temperature" src="http://www.jansipke.nl/wp-content/uploads/2011/12/aurora-temperature.png" alt="" width="582" height="336" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/solar-panel-graphs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solar inverter readout</title>
		<link>http://www.jansipke.nl/solar-inverter-readout</link>
		<comments>http://www.jansipke.nl/solar-inverter-readout#comments</comments>
		<pubDate>Sun, 27 Nov 2011 10:30:03 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Energy]]></category>
		<category><![CDATA[Solar]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1241</guid>
		<description><![CDATA[I hooked up the Aurora Uno PVI-2000 solar inverter to a laptop with an RS-232 serial cable. Note that we need an RS-232 cable with a male connector on one end and a female connector on the other end. It also needs to be a straight connection, i.e. no cross between RX and TX. If [...]]]></description>
			<content:encoded><![CDATA[<p>I hooked up the <a href="http://www.power-one.com/renewable-energy/products/solar/string-inverters/aurora-uno/pvi-2000-pvi-3600/series">Aurora Uno PVI-2000</a> solar inverter to a laptop with an RS-232 serial cable. Note that we need an RS-232 cable with a male connector on one end and a female connector on the other end. It also needs to be a straight connection, i.e. no cross between RX and TX. If you don&#8217;t have such as cable handy, you might link two cross cables to acquire a straight cable.</p>
<p><img class="alignnone size-full wp-image-1242" title="pvi-2000-3600" src="http://www.jansipke.nl/wp-content/uploads/2011/11/pvi-2000-3600.jpg" alt="" width="177" height="200" /><br />
<a href="http://www.curtronics.com/Solar/AuroraData.html">Curt Blank</a> has made an open source Linux program called aurora that uses this connection to get readouts from the inverter. The program is included in the Ubuntu packages since 10.04 LTS, so it is really easy to install:</p>
<blockquote>
<pre>sudo apt-get install aurora</pre>
</blockquote>
<p>The serial connection on my laptop is called <em>/dev/ttyS0</em> by Linux, so this is what we use as one of the parameters. Another required parameter is the address of the inverter. Several inverters might be present in a solar installation, so an address is needed to target a specific one. Note that this is only relevant if they are linked together with RS-485 cables. In my case there is only one and the inverter has address 2.</p>
<p>Let&#8217;s start with the energy in the last 10 seconds:</p>
<blockquote>
<pre># aurora -a 2 -j /dev/ttyS0

Energy in the last 10 seconds (Joules) :    1948.365882</pre>
</blockquote>
<p>More interesting is the energy produced for today, weekly, monthly, yearly and since the inverter was installed:</p>
<blockquote>
<pre># aurora -a 2 -e /dev/ttyS0

Daily Energy               =       0.094 KWh
Weekly Energy              =       0.094 KWh
Monthly Energy             =      12.447 KWh
Yearly Energy              =      12.471 KWh
Total Energy               =      12.469 KWh
Partial Energy             =      12.444 KWh</pre>
</blockquote>
<p>There are also readings about voltage and current. To be honest, I don&#8217;t understand the input 2 readings because there is nothing connected there.</p>
<blockquote>
<pre># aurora -a 2 -d /dev/ttyS0

Input 1 Voltage            =  184.667801 V
Input 1 Current            =    2.804785 A
Input 1 Power              =  517.953552 W

Input 2 Voltage            =    0.650100 V
Input 2 Current            =    1.859635 A
Input 2 Power              =    1.208949 W

Grid Voltage Reading       =  225.644196 V
Grid Current Reading       =    1.965952 A
Grid Power Reading         =  458.323853 W
Frequency Reading          =   49.991001 Hz.

DC/AC Coversion Efficiency =        88.3 %
Inverter Temperature       =   38.024002 C
Booster Temperature        =   35.868004 C</pre>
</blockquote>
<p>There is also a Windows program made by <a href="http://www.power-one.com/">Power One</a> that shows current and historical readings called <a href="http://www.power-one.it/digilab/Digi.aspx?Code=15" class="broken_link">Aurora Communicator</a>. A partial screenshot is shown below with some values when the sun shines brightly (for a November day that is).</p>
<p><a href="http://www.jansipke.nl/wp-content/uploads/2011/11/aurora-communicator.png"><img class="alignnone size-full wp-image-1254" title="aurora-communicator" src="http://www.jansipke.nl/wp-content/uploads/2011/11/aurora-communicator.png" alt="" width="601" height="229" /></a></p>
<p>The screenshot below shows the readings for a complete day. The lower graph shows the Watts (W) produced at each timestamp and the upper graph shows the accumulated Watt hours (Wh) values.</p>
<p><a href="http://www.jansipke.nl/wp-content/uploads/2011/11/aurora-complete.png"><img class="alignnone size-full wp-image-1259" title="aurora-complete" src="http://www.jansipke.nl/wp-content/uploads/2011/11/aurora-complete.png" alt="" width="640" height="388" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/solar-inverter-readout/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solar panel installation</title>
		<link>http://www.jansipke.nl/solar-panel-installation</link>
		<comments>http://www.jansipke.nl/solar-panel-installation#comments</comments>
		<pubDate>Wed, 23 Nov 2011 18:37:07 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Energy]]></category>
		<category><![CDATA[Solar]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1215</guid>
		<description><![CDATA[On Wednesday the 16th of November 2011 we installed some solar panels on our roof. The panels are from Trina Solar. Each panel produces 235 Watt peak (Wp), which means that the panels produce at most 235 Watt at any moment in time. If the light conditions are less favorable, the production will be less. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jansipke.nl/wp-content/uploads/2011/11/trina_solar_power_one.png"><img class="alignnone size-full wp-image-1228" title="trina_solar_power_one" src="http://www.jansipke.nl/wp-content/uploads/2011/11/trina_solar_power_one.png" alt="" width="400" height="76" /></a>On Wednesday the 16th of November 2011 we installed some solar panels on our roof. The panels are from <a href="http://www.trinasolar.com/">Trina Solar</a>. Each panel produces 235 Watt peak (Wp), which means that the panels produce at most 235 Watt at any moment in time. If the light conditions are less favorable, the production will be less.</p>
<p style="text-align: left;">An inverter was also installed inside the house. The inverter is made by <a href="http://www.power-one.com/">Power One</a> and is called <a href="http://www.power-one.com/renewable-energy/products/solar/string-inverters/aurora-uno/pvi-2000-pvi-3600/series">Aurora Uno PVI-2000</a>. The inverter transforms the DC from the solar panels into AC that is fed straight into the mains of our house.</p>
<p>Unfortunately, the last week has seen unprecedented levels of mist, which means that our energy production was far lower than expected. Ah well, enough time left as the lifetime expectancy of the panels is around 30 years, while the inverter should last around 15 years.</p>
<p>I&#8217;ve been tinkering with the inverter a bit and got the monitoring software working on both Windows and Linux. More about that in the next post.</p>
<p><a href="http://www.jansipke.nl/wp-content/uploads/2011/11/solar_panels1.jpg"><img class="alignleft size-full wp-image-1232" title="solar_panels1" src="http://www.jansipke.nl/wp-content/uploads/2011/11/solar_panels1.jpg" alt="" width="185" height="276" /></a><a href="http://www.jansipke.nl/wp-content/uploads/2011/11/solar_panels2.jpg"><img class="alignleft size-full wp-image-1233" title="solar_panels2" src="http://www.jansipke.nl/wp-content/uploads/2011/11/solar_panels2.jpg" alt="" width="185" height="276" /></a><a href="http://www.jansipke.nl/wp-content/uploads/2011/11/solar_panels3.jpg"><img class="alignleft size-full wp-image-1237" title="solar_panels3" src="http://www.jansipke.nl/wp-content/uploads/2011/11/solar_panels3.jpg" alt="" width="185" height="276" /></a><a href="http://www.jansipke.nl/wp-content/uploads/2011/11/solar_panels4.jpg"><img class="alignleft size-full wp-image-1235" title="solar_panels4" src="http://www.jansipke.nl/wp-content/uploads/2011/11/solar_panels4.jpg" alt="" width="185" height="276" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/solar-panel-installation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS Cassandra init (start / stop) script</title>
		<link>http://www.jansipke.nl/centos-cassandra-init-start-stop-script</link>
		<comments>http://www.jansipke.nl/centos-cassandra-init-start-stop-script#comments</comments>
		<pubDate>Thu, 21 Jul 2011 09:19:58 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Cloud computing]]></category>
		<category><![CDATA[Cassandra]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1200</guid>
		<description><![CDATA[For CentOS I created an init script to start it at boot time and shut it down for rebooting or power off. If you want to use this init script for your own machine please look through the script and change the necessary parameters, e.g. CASSANDRA_HOME. Please also note that in the stop function it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jansipke.nl/wp-content/uploads/2011/07/cassandra_logo.png"><img class="alignnone size-full wp-image-1204" title="cassandra_logo" src="http://www.jansipke.nl/wp-content/uploads/2011/07/cassandra_logo.png" alt="" width="300" height="60" /></a>For CentOS I created an init script to start it at boot time and shut it down for rebooting or power off. If you want to use this init script for your own machine please look through the script and change the necessary parameters, e.g. <em>CASSANDRA_HOME</em>.</p>
<p>Please also note that in the stop function it decommissions the node from the cluster. This is probably not what you want in production environments.</p>
<blockquote>
<pre>#!/bin/bash
# chkconfig: 2345 99 01
# description: Cassandra

. /etc/rc.d/init.d/functions

CASSANDRA_HOME=/opt/apache-cassandra-0.7.4
CASSANDRA_BIN=$CASSANDRA_HOME/bin/cassandra
CASSANDRA_NODETOOL=$CASSANDRA_HOME/bin/nodetool
CASSANDRA_LOG=$CASSANDRA_HOME/log/cassandra.log
CASSANDRA_PID=/var/run/cassandra.pid
CASSANDRA_LOCK=/var/lock/subsys/cassandra
PROGRAM="cassandra"

if [ ! -f $CASSANDRA_BIN ]; then
  echo "File not found: $CASSANDRA_BIN"
  exit 1
fi

RETVAL=0

start() {
  if [ -f $CASSANDRA_PID ] &amp;&amp; checkpid `cat $CASSANDRA_PID`; then
    echo "Cassandra is already running."
    exit 0
  fi
  echo -n $"Starting $PROGRAM: "
  daemon $CASSANDRA_BIN -p $CASSANDRA_PID &gt;&gt; $CASSANDRA_LOG 2&gt;&amp;1
  usleep 500000
  RETVAL=$?
  if [ $RETVAL -eq 0 ]; then
    touch $CASSANDRA_LOCK
    echo_success
  else
    echo_failure
  fi
  echo
  return $RETVAL
}

stop() {
  if [ ! -f $CASSANDRA_PID ]; then
    echo "Cassandra is already stopped."
    exit 0
  fi
  echo -n $"Stopping $PROGRAM: "
  $CASSANDRA_NODETOOL -h 127.0.0.1 decommission
  if kill `cat $CASSANDRA_PID`; then
    RETVAL=0
    rm -f $CASSANDRA_LOCK
    echo_success
  else
    RETVAL=1
    echo_failure
  fi
  echo
  [ $RETVAL = 0 ]
}

status_fn() {
  if [ -f $CASSANDRA_PID ] &amp;&amp; checkpid `cat $CASSANDRA_PID`; then
    echo "Cassandra is running."
    exit 0
  else
    echo "Cassandra is stopped."
    exit 1
  fi
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  status)
    status_fn
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo $"Usage: $PROGRAM {start|stop|restart|status}"
    RETVAL=3
esac

exit $RETVAL</pre>
</blockquote>
<p>If all looks alright, name the script <em>cassandra</em> and place it in <em>/etc/init.d/</em><br />
After that run the following commands:</p>
<blockquote>
<pre>mkdir /opt/apache-cassandra-0.7.4/log
chmod +x /etc/init.d/cassandra
chkconfig --add cassandra
service cassandra start</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/centos-cassandra-init-start-stop-script/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Grep lines before and after matched line</title>
		<link>http://www.jansipke.nl/grep-lines-before-and-after-matched-line</link>
		<comments>http://www.jansipke.nl/grep-lines-before-and-after-matched-line#comments</comments>
		<pubDate>Thu, 21 Jul 2011 08:26:48 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Grep]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1193</guid>
		<description><![CDATA[The command grep is really useful for finding matches of a certain word in files or streams. However, until recently I didn&#8217;t know how to display lines before and after the matched line(s). Let&#8217;s say we have a file named test.txt that contains the following content: ALICE was beginning to get very tired of sitting [...]]]></description>
			<content:encoded><![CDATA[<p>The command <em>grep</em> is really useful for finding matches of a certain word in files or streams. However, until recently I didn&#8217;t know how to display lines before and after the matched line(s).</p>
<p>Let&#8217;s say we have a file named <em>test.txt</em> that contains the following content:</p>
<blockquote>
<pre>ALICE was beginning to get
very tired of sitting by
her sister on the bank
and of having nothing to do:
once or twice she had peeped
into the book her sister was reading,
but it had no pictures or conversations in it,
"and what is the use of a book," thought Alice,
"without pictures or conversations?'</pre>
</blockquote>
<p>If we use <em>grep</em> to find lines matching &#8220;bank&#8221;, we write:</p>
<blockquote>
<pre>grep bank test.txt</pre>
</blockquote>
<p>and get:</p>
<blockquote>
<pre>her sister on the bank</pre>
</blockquote>
<p>If we want to list some line(s) before the matched line, we write:</p>
<blockquote>
<pre>grep -B1 bank test.txt</pre>
</blockquote>
<p>where the 1 denotes the number of lines to list, and get:</p>
<blockquote>
<pre>very tired of sitting by
her sister on the bank</pre>
</blockquote>
<p>If we want to list some line(s) after the matched line, we write:</p>
<blockquote>
<pre>grep -A2 bank test.txt</pre>
</blockquote>
<p>where the 2 denotes the number of lines to list, and get:</p>
<blockquote>
<pre>her sister on the bank
and of having nothing to do:
once or twice she had peeped</pre>
</blockquote>
<p>The two options can be combined as well, but I leave that as an exercise to the reader <img src='http://www.jansipke.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/grep-lines-before-and-after-matched-line/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deleting XenServer templates</title>
		<link>http://www.jansipke.nl/deleting-xenserver-templates</link>
		<comments>http://www.jansipke.nl/deleting-xenserver-templates#comments</comments>
		<pubDate>Wed, 29 Jun 2011 08:12:53 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Cloud computing]]></category>
		<category><![CDATA[XenServer]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1186</guid>
		<description><![CDATA[Sometimes XenServer doesn&#8217;t allow you to delete templates from the XenCenter GUI or even the CLI. Here is how to delete templates from the CLI in three steps: Tell XenServer the template is not a default template Convert the template to a VM Delete the VM xe template-param-set other-config:default_template=false uuid=[uuid] xe template-param-set is-a-template=false uuid=[uuid] xe [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="XenServer" src="/wp-content/uploads/xenserver.png" alt="" width="327" height="61" /><br />
Sometimes XenServer doesn&#8217;t allow you to delete templates from the XenCenter GUI or even the CLI. Here is how to delete templates from the CLI in three steps:</p>
<ul>
<li>Tell XenServer the template is not a default template</li>
<li>Convert the template to a VM</li>
<li>Delete the VM</li>
</ul>
<blockquote>
<pre>xe template-param-set other-config:default_template=false uuid=[uuid]
xe template-param-set is-a-template=false uuid=[uuid]
xe vm-destroy uuid=[uuid]</pre>
</blockquote>
<p>where [uuid] is the UUID of the template you want to delete.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/deleting-xenserver-templates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating backups of running VMs in XenServer</title>
		<link>http://www.jansipke.nl/creating-backups-of-running-vms-in-xenserver</link>
		<comments>http://www.jansipke.nl/creating-backups-of-running-vms-in-xenserver#comments</comments>
		<pubDate>Mon, 06 Dec 2010 19:17:06 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Cloud computing]]></category>
		<category><![CDATA[XenServer]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1181</guid>
		<description><![CDATA[With XenServer it is possible to create backups of VMs, even if they are running. The process is as follows: Search for the uuid of the VMs to backup Create a snapshot of each (running) VM Save the snapshot to file Remove the created snapshot First look for the uuid of the VMs to backup. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jansipke.nl/wp-content/uploads/xenserver.png"><img class="alignnone size-full wp-image-940" title="xenserver" src="http://www.jansipke.nl/wp-content/uploads/xenserver.png" alt="" width="327" height="61" /></a></p>
<p>With XenServer it is possible to create backups of VMs, even if they are running. The process is as follows:</p>
<ul>
<li>Search for the uuid of the VMs to backup</li>
<li>Create a snapshot of each (running) VM</li>
<li>Save the snapshot to file</li>
<li>Remove the created snapshot</li>
</ul>
<p>First look for the <em>uuid</em> of the VMs to backup. We don&#8217;t want to backup the control domain itself, so we add <em>is-control-domain=false</em> to the <em>vm-list</em> command:</p>
<blockquote>
<pre>xe vm-list is-control-domain=false
</pre>
</blockquote>
<p>Now we create a snapshot of the VMs we want to backup, replacing the <em>uuid</em> one by one with the ones we found with the previous command. Also replace the name of the snapshot if desired:</p>
<blockquote>
<pre>xe vm-snapshot uuid=d61bfc1a-33b2-5406-7ea5-76e4f7113220 new-name-label=snapshotname
</pre>
</blockquote>
<p>This command has a return value: the <em>uuid</em> of the created snapshot. Then we transform the snapshot into a VM to be able to save it to a file, replacing <em>uuid</em> with the return value of the previous command:</p>
<blockquote>
<pre>xe template-param-set is-a-template=false ha-always-run=false uuid=b759625c-eab5-4e0f-be5e-a05bcbad869a
</pre>
</blockquote>
<p>In the next step we save the snapshot to a file, replacing <em>uuid</em> with the snapshot <em>uuid</em> and providing a meaningful <em>filename</em>:</p>
<blockquote>
<pre>xe vm-export vm=b759625c-eab5-4e0f-be5e-a05bcbad869a filename=filename.xva
</pre>
</blockquote>
<p>In the final step we delete the snapshot:</p>
<blockquote>
<pre>xe vm-uninstall uuid=b759625c-eab5-4e0f-be5e-a05bcbad869a force=true
</pre>
</blockquote>
<p>Python is installed by default on XenServer hosts, so the following script will work out of the box. <a href="/res/xenserver/backup-vms.txt">Download the script from this location</a> to save it to your XenServer host, replacing the <em>.txt</em> extension with <em>.py</em>.</p>
<blockquote>
<pre>#!/usr/bin/python

import commands, time

def get_backup_vms():
   result = []

   cmd = "xe vm-list is-control-domain=false"
   output = commands.getoutput(cmd)

   for vm in output.split("nnn"):
      lines = vm.split("n")
      uuid = lines[0].split(":")[1][1:]
      name = lines[1].split(":")[1][1:]
      result += [(uuid, name)]

   return result

def backup_vm(uuid, filename, timestamp):
   cmd = "xe vm-snapshot uuid=" + uuid + " new-name-label=" + timestamp
   snapshot_uuid = commands.getoutput(cmd)

   cmd = "xe template-param-set is-a-template=false ha-always-run=false uuid=" +
   snapshot_uuid
   commands.getoutput(cmd)

   filename = filename.replace(" ", " ")
   filename = filename.replace("(", "(")
   filename = filename.replace(")", ")")
   cmd = "xe vm-export vm=" + snapshot_uuid + " filename=" + filename
   commands.getoutput(cmd)

   cmd = "xe vm-uninstall uuid=" + snapshot_uuid + " force=true"
   commands.getoutput(cmd)

for (uuid, name) in get_backup_vms():
   timestamp = time.strftime("%Y%m%d-%H%M", time.gmtime())
   print timestamp, uuid, name
   filename = timestamp + " " + name + ".xva"
   backup_vm(uuid, filename, timestamp)
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/creating-backups-of-running-vms-in-xenserver/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Assigning more than 8 virtual CPUs in XenServer</title>
		<link>http://www.jansipke.nl/assigning-more-than-8-virtual-cpus-in-xenserver</link>
		<comments>http://www.jansipke.nl/assigning-more-than-8-virtual-cpus-in-xenserver#comments</comments>
		<pubDate>Tue, 30 Nov 2010 15:31:20 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Cloud computing]]></category>
		<category><![CDATA[XenServer]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1168</guid>
		<description><![CDATA[With the XenServer Windows client called XenCenter it is possible to manage multiple XenServer hosts, create virtual machines, watch the console of virtual machines, etc. One of the limitations I recently ran into (this is a luxury problem, I know) is that it doesn&#8217;t allow you to assign more than 8 virtual CPUs (vCPUs) to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jansipke.nl/wp-content/uploads/xenserver.png"><img class="alignnone size-full wp-image-940" title="xenserver" src="http://www.jansipke.nl/wp-content/uploads/xenserver.png" alt="" width="327" height="61" /></a><br />
With the XenServer Windows client called XenCenter it is possible to manage multiple XenServer hosts, create virtual machines, watch the console of virtual machines, etc. One of the limitations I recently ran into (this is a luxury problem, I know) is that it doesn&#8217;t allow you to assign more than 8 virtual CPUs (vCPUs) to a single VM.</p>
<p><a href="http://www.jansipke.nl/wp-content/uploads/xencenter-vcpu-mem.png"><img class="alignnone size-full wp-image-1174" title="xencenter-vcpu-mem" src="http://www.jansipke.nl/wp-content/uploads/xencenter-vcpu-mem.png" alt="" width="295" height="112" /></a>However, on the command line you can increase this value to 32 for Linux VMs. First, let&#8217;s see which <em>uuid</em> is assigned to the VM we want to give more than 8 vCPUs:</p>
<blockquote>
<pre>xe vm-list
</pre>
</blockquote>
<p>Now make sure that the VM is halted and then use this <em>uuid</em> in the following commands:</p>
<blockquote>
<pre>xe vm-param-set VCPUs-max=32 uuid=replace_with_uuid
xe vm-param-set VCPUs-at-startup=32 uuid=replace_with_uuid
</pre>
</blockquote>
<p>If you want to increase the memory size beyond 16GB as well, e.g. to 32GB, add the following commands:</p>
<blockquote>
<pre>
xe vm-param-set memory-static-max=34359738368 uuid=replace_with_uuid
xe vm-param-set memory-dynamic-max=34359738368 uuid=replace_with_uuid
xe vm-param-set memory-dynamic-min=34359738368 uuid=replace_with_uuid
xe vm-param-set memory-static-min=34359738368 uuid=replace_with_uuid
</pre>
</blockquote>
<p>Restart the VM and enjoy! For a quick look if everything worked out, watch the output of this command inside the VM:</p>
<blockquote>
<pre>cat /proc/cpuinfo | grep processor | wc -l
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/assigning-more-than-8-virtual-cpus-in-xenserver/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

