<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>xen &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/xen/</link>
	<description>Feed of posts on WordPress.com tagged "xen"</description>
	<pubDate>Sat, 28 Nov 2009 10:41:04 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Birth of a data center cloud, part 1]]></title>
<link>http://vburke.wordpress.com/2009/11/24/birth-of-a-data-center-cloud-part-1/</link>
<pubDate>Tue, 24 Nov 2009 03:27:29 +0000</pubDate>
<dc:creator>vburke</dc:creator>
<guid>http://vburke.wordpress.com/2009/11/24/birth-of-a-data-center-cloud-part-1/</guid>
<description><![CDATA[Welcome to part 1 of my blog series, &#8220;Birth of a cloud&#8221; (and you thought these came from]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Welcome to part 1 of my blog series, &#8220;Birth of a cloud&#8221; (and you thought these came from the cabbage patch!). In these posts, I&#8217;ll be taking you from the inception and planning of the data center cloud to an important  mature component of the green data center.</p>
<p>For some time now, we&#8217;ve operated internal use and customer virtual machines using the excellent <a href="http://www.xen.org">Xen hypervisor</a>. As good as the standalone virtualization has been, it&#8217;s time to step it up a notch and take advantage of all the capabilities of a cloud, so we&#8217;re using the new Xen Cloud Platform as a good foundation.</p>
<p>For this project, we&#8217;re using Rackable Systems servers with 2x AMD Opteron 275 dual core CPUs, 8Gb memory, and 2GbE ports. These aren&#8217;t state of the art by any means, but they&#8217;ve been doing yeoman duty as standalone hosts and they&#8217;re rock solid hardware (we only use Linux virtual machines so there&#8217;s no need for hardware virtualization support). </p>
<p>We&#8217;re starting off with 6 cloud hosts but we&#8217;ve laid out the network for the full 16 cloud hosts that the Xen Cloud Platform we&#8217;re using is capable of (figuring 6 core Opterons, that&#8217;s 96 cores). The network uses a single switch, split in two networks, one for data traffic (all port 1s) and one for storage traffic (all port 2s).</p>
<p>Storage for the cloud is a common NFS server. This allows us to take advantage of XCPs workload balancer and the ability to shift live virtual machines between cloud hosts seamlessly.</p>
<p>The cloud is also integrated into the data center DC power distribution. Cloud hosts are split between separate DC power feeds which, with. the addition of XCPs work load balancer, will insure maximum reliability. </p>
<p>This is a basic overview of the hardware infrastructure to support a virtual machine cloud. In part 2, I&#8217;ll talk about establishing the cloud and bringing it up under manual control. In part 3, I&#8217;ll talk about using the work load balancer for automatic control of the cloud and finally, in part 4, I&#8217;ll talk about advanced projects that provide the ultimate in green results, such as the effort to allow the cloud to power down unneeded machines when demand is low. Stay tuned!</p>
<p>Vern, SwiftWater Telecom</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Find VM's older than N days to free disk space]]></title>
<link>http://blog.sharevm.com/2009/11/23/find-vms-older-than-n-days-to-free-disk-space/</link>
<pubDate>Mon, 23 Nov 2009 08:35:08 +0000</pubDate>
<dc:creator>paule1s</dc:creator>
<guid>http://blog.sharevm.com/2009/11/23/find-vms-older-than-n-days-to-free-disk-space/</guid>
<description><![CDATA[I wrote a Python 2.6 script to find and list VM&#8217;s older than 90 days on my Windows workstation]]></description>
<content:encoded><![CDATA[I wrote a Python 2.6 script to find and list VM&#8217;s older than 90 days on my Windows workstation]]></content:encoded>
</item>
<item>
<title><![CDATA[Running Asterisk on Xen]]></title>
<link>http://leeconomics.wordpress.com/2009/11/17/running-asterisk-on-xen/</link>
<pubDate>Tue, 17 Nov 2009 16:23:39 +0000</pubDate>
<dc:creator>kenleland</dc:creator>
<guid>http://leeconomics.wordpress.com/2009/11/17/running-asterisk-on-xen/</guid>
<description><![CDATA[We are migrating our Asterisk test environment from VMware to Xen.  We always used the free VMware (]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h1 style="text-align:center;"><a href="http://www.asterisk.org"><img class="wp-image-222" title="asterisk_logo" src="http://leeconomics.wordpress.com/files/2009/11/asterisk_logo.jpg" alt="asterisk_logo" width="138" height="79" /></a> <a href="http://www.centos.org"><img class="wp-image-232" title="centos_icon_60" src="http://leeconomics.wordpress.com/files/2009/11/centos_icon_601.png" alt="" width="63" height="60" /></a><a href="http://www.xen.org"><img class="wp-image-223" title="xen_logo" src="http://leeconomics.wordpress.com/files/2009/11/xen_logo.gif" alt="xen_logo" width="149" height="67" /></a></h1>
<p>We are migrating our Asterisk test environment from VMware to Xen.  We always used the free VMware (<a href="http://www.vmware.com/products/server/">VMware Server</a>) which worked fine other than one huge limitation: There was no way for our virtual machines to access telephony cards (eg: Sangoma or Digium T1 pci cards).  Xen provides that feature and more by allowing your virtual machines to access pretty much any device you can access from within a regular linux installation.</p>
<p>Here are the steps I took to add Xen to my CentOS test server and fire up my first asterisk guest complete with its own digium pri card.  For my first asterisk guest i created a server with all the latest and greatest asterisk software and appropriately named it <em>bleeder</em>.</p>
<p>1. Install Xen &#8211; This step turns your current server into the Dom0, or &#8220;the special privileged domain that is used to administer normal guest domains&#8221;</p>
<pre>yum install xen kernel-xen
modify /boot/grub/grub.conf to boot the xen kernel by default
reboot
</pre>
<p>2. Download a 1G partition image that contains an ext3 filesystem with the linux kernel and a minimal set of CentOS packages and extend it to 4G.  <a href="http://stacklet.com">Stacklet.com</a> is a great resource for these.  I found the CentOS image i was looking for <a href="http://stacklet.com/downloads/images/centos/5.4">here</a>.  This comes with the partition image and two example config files.  I copied the partition image to a directory i could remember where i had sufficient space and extended it using the following commands.  The first command (dd) extends the actual file.  This is analogous to extending a partition on a disk.</p>
<pre>[root@fsdev images]# dd bs=1k seek=4096k count=1 if=/dev/zero of=centos.5.3.x86.img
</pre>
<p>Note that this command produces a &#8220;sparse&#8221; file.  That means that though the file can grow up to a total size of 4GB, it only takes up the space on disk that it is actually using.  Here&#8217;s the proof:</p>
<pre>[root@fsdev images]# ls -lh
total 2.1G
-rw-r--r-- 1 k3leland k3leland  4.1G Nov 15 19:33 centos.5-3.x86.img
[root@fsdev images]# du -h centos.5-3.x86.img
1.1G  centos.5-3.x86.img</pre>
<p>The rest of the commands are to resize the actual ext3 filesystem.  Find the first available loopback device and assign our partition image to it:</p>
<pre>[root@fsdev images]# losetup -f
/dev/loop0
[root@fsdev images]# losetup /dev/loop0 centos.5-3.x86.img
</pre>
<p>Now Resize!</p>
<pre>[root@fsdev images]# resize2fs /dev/loop0
resize2fs 1.39 (29-May-2006)
Please run 'e2fsck -f /dev/loop0' first.

[root@fsdev images]# e2fsck -f /dev/loop0
...output omitted...
[root@fsdev images]# resize2fs /dev/loop0 4G
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/loop0 to 1048576 (4k) blocks.
The filesystem on /dev/loop0 is now 1048576 blocks long.
</pre>
<p>Lastly unassign our file to the loopback device:</p>
<pre>[root@fsdev images]# losetup -d /dev/loop0
</pre>
<p>Here is an extra command that may come in handy when dealing with partition images.  This allows you to mount the image and explore the contents:</p>
<pre>[root@fsdev images]# mount -o loop -t ext3 centos.5-3.x86.img /mnt
[root@fsdev images]# ls /mnt/
bin   dev  home  lost+found  mnt  poweroff  root  selinux  sys  usr
boot  etc  lib   media       opt  proc      sbin  srv      tmp  var
</pre>
<p>3. Copy the pygrub config to /etc/xen/bleeder and make some slight modifcations to it.  I gave it its very own ip address and indicated i wanted it bridged at the ethernet level by adding this line:</p>
<pre>vif = [ 'ip=xx.xx.xx.xx, bridge=xenbr0' ]</pre>
<p>I updated the disk directive to reflect the new location that i moved the image to:</p>
<pre>disk = ['file:/var/asterisk/xen/images/centos.5-3.x86.img,sda1,w']</pre>
<p>And lastly I assigned the virtual machine the digium T1 card using the pci directive.  Note: I found the pci identifier in the output of lspci.</p>
<pre>pci=['0a:01.0']
</pre>
<p>4. Unbind the pri card from my Dom0 so that i will be able to boot my bleeder guest by loading the pciback kernel module with the hide option:</p>
<pre>modprobe pciback 'hide=(0a:01.0)'
</pre>
<p>If this worked you will see some messages in dmesg:</p>
<pre>pciback 0000:0a:01.0: seizing device
PCI: Enabling device 0000:0a:01.0 (0310 -&#62; 0313)
ACPI: PCI Interrupt 0000:0a:01.0[A] -&#62; GSI 20 (level, low) -&#62; IRQ 21
ACPI: PCI interrupt for device 0000:0a:01.0 disabled
</pre>
<p>If this command doesn&#8217;t work it will not give any indication other than you will not see those messages in dmesg.  This command will not work if you currently have a driver loaded that is binded to that device.  That means you may have to:</p>
<pre>service zaptel/dahdi stop
</pre>
<p>and try again:</p>
<pre>rmmod pciback
modprobe pciback 'hide=(0a:01.0)'
</pre>
<p>5. Now we are ready to boot our guest for the first time using the xm command.  The -c option indicates we want a console on the new vm, and the name of the vm, <em>bleeder</em>, corresponds to the name of the config file in /etc/xen.  If everything works you will eventually get a login prompt (root/password by default)</p>
<pre>[root@fsdev ~]# xm create -c bleeder
Using config file "/etc/xen/bleeder".
</pre>
<p>One error that prevented booting for the first time was:</p>
<pre>Error: pci: improper device assignment specified: pci: 0000:0f:00.0 must be co-assigned to the same guest with 0000:0f:06.0, but it is not owned by pciback.
</pre>
<p>I resolved this by moving my pci card to a different slot in the system.  I believe this is a limitation in Xen but if you have the flexibility to move your card it beats waiting for a bug fix;)  Here is the output of lspci and lspci -t before and after the move:</p>
<pre>[k3leland@Dom0 ~]$ lspci &#124; grep Digium
0f:06.0 Ethernet controller: Digium, Inc. Wildcard TE120P single-span T1/E1/J1 card (rev 11)
[k3leland@Dom0 ~]$ lspci -t
-[0000:00]-+-00.0
           +-01.0-[0000:01]--
           +-1c.0-[0000:09-0a]--+-00.0-[0000:0a]--
           &#124;                    \-00.1
           +-1c.4-[0000:0d]----00.0
           +-1c.5-[0000:0e]----00.0
           +-1d.0
           +-1d.1
           +-1d.2
           +-1d.3
           +-1d.7
           +-1e.0-[0000:0f]--+-00.0
           &#124;                 \-06.0
           +-1f.0
           +-1f.1
           +-1f.2
           \-1f.3

[k3leland@Dom0 ~]$ lspci &#124; grep Digium
0a:01.0 Ethernet controller: Digium, Inc. Wildcard TE120P single-span T1/E1/J1 card (rev 11)
[k3leland@fsdev ~]$ lspci -t
-[0000:00]-+-00.0
           +-01.0-[0000:01]--
           +-1c.0-[0000:09-0a]--+-00.0-[0000:0a]----01.0
           &#124;                    \-00.1
           +-1c.4-[0000:0d]----00.0
           +-1c.5-[0000:0e]----00.0
           +-1d.0
           +-1d.1
           +-1d.2
           +-1d.3
           +-1d.7
           +-1e.0-[0000:0f]----00.0
           +-1f.0
           +-1f.1
           \-1f.3</pre>
<p>6. Now we can proceed to configure and install software on our new virtual guest as it was a physical server.  The output of lspci in the guest should produce a single line with our digium T1 card.  The system we got from Stacklet.com provides the bare minimum so the first step is to bring it up to date and install the prerequisite tools:</p>
<pre>yum update
yum install vim-enhanced gcc gcc-c++ subversion make kernel-xen-devel libtermcap-devel
</pre>
<p><a href="http://www.asterisk.org/developer/resources/svn">Checkout Asterisk and Friends from svn and make and make install asterisk, dahdi-linux, dahdi-tools, libpri.</a></p>
<p>Deviations from boring &#8216;configure;make;make install&#8217; routine included a couple of things:</p>
<p>When configuring asterisk i chose to disable xmldoc:</p>
<p>./configure &#8211;disable-xmldoc</p>
<p>After making and installing dahdi-linux be sure to modify /etc/dahdi/* to your needs, or use dahdi_genconf.</p>
<h3>TODO in Future:</h3>
<ul>
<li>test performance of virtualized asterisk</li>
<li>install asterisk and dahdi-linux on vm from binaries using asterisk xen pacakges at <a href="http://packages.asterisk.org">packages.asterisk.org</a>.</li>
<li>install thirdlane, trixbox, and asterisknow a xen guests</li>
</ul>
<p>Recommended book and primary reference for this project:</p>
<p><a href="http://runningxen.com"><img class="size-thumbnail wp-image-224 alignleft" title="running_xen_cover" src="http://leeconomics.wordpress.com/files/2009/11/running_xen_cover.png?w=50" alt="running_xen_cover" width="50" height="66" /></a></p>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:274px;width:1px;height:1px;">before you can resize the filesystem formatted on top of the partition</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[virt-df on Xen]]></title>
<link>http://rwmj.wordpress.com/2009/11/17/virt-df-on-xen/</link>
<pubDate>Tue, 17 Nov 2009 11:57:52 +0000</pubDate>
<dc:creator>rich</dc:creator>
<guid>http://rwmj.wordpress.com/2009/11/17/virt-df-on-xen/</guid>
<description><![CDATA[Virt-df works on Xen so you can display free disk space in a Xen VM. # virt-df -h 2&gt;&amp;1 | grep]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://libguestfs.org/virt-df.1.html">Virt-df</a> works on <a href="http://xen.org/">Xen</a> so you can display free disk space in a Xen VM.</p>
<pre style="background-color:#fcfcfc;border-left:6px solid #f0f0f0;margin-left:1em;font-size:120%;padding:5px;">
# virt-df -h 2&#62;&#38;1 &#124; grep -v '/dev/kqemu'
Domain-0 seems to have no disk devices
Filesystem                                Size       Used  Available  Use%
RHEL39FV64:/dev/hda1                     98.7M      13.5M      80.1M 18.8%
RHEL39FV64:/dev/hda2                      6.8G       1.8G       4.7G 31.0%
RHEL39FV64:/dev/hdb1                     30.4M       1.0M      27.8M  8.5%
RHEL39FV32:/dev/hda1                     98.7M      14.5M      79.1M 19.9%
RHEL39FV32:/dev/hda2                      6.8G       1.5G       4.9G 27.8%
RHEL39FV32:/dev/hdb1                     30.4M       1.0M      27.8M  8.5%
RHEL53PV64:/dev/VolGroup00/LogVol00       6.6G       2.1G       4.2G 37.3%
RHEL53PV64:/dev/hda1                     98.7M      13.1M      80.5M 18.5%
RHEL48PV64:/dev/VolGroup00/LogVol00       6.7G       2.1G       4.3G 36.6%
RHEL48PV64:/dev/hda1                     98.7M       9.2M      84.4M 14.5%
RHEL52PV32:/dev/VolGroup00/LogVol00       6.6G       2.5G       3.7G 43.5%
RHEL52PV32:/dev/hda1                     98.7M      12.7M      80.9M 18.0%
RHEL53PV32:/dev/VolGroup00/LogVol00       6.6G       1.9G       4.4G 34.1%
RHEL53PV32:/dev/hda1                     98.7M      12.8M      80.8M 18.2%
RHEL52FV32:/dev/VolGroup00/LogVol00       6.7G       2.6G       3.8G 43.5%
RHEL52FV32:/dev/hda1                     98.7M      14.5M      79.1M 19.8%
RHEL52FV32:/dev/hdb1                     30.3M       1.4M      27.4M  9.7%
RHEL48PV32:/dev/VolGroup00/LogVol00       6.7G       1.8G       4.6G 31.7%
RHEL48PV32:/dev/hda1                     98.7M       8.6M      85.0M 13.9%
RHEL47FV32:/dev/VolGroup00/LogVol00       6.7G       1.9G       4.5G 32.6%
RHEL47FV32:/dev/hda1                     98.7M      13.9M      79.7M 19.2%
RHEL47PV32:/dev/VolGroup00/LogVol00       6.7G       1.8G       4.6G 31.3%
RHEL47PV32:/dev/hda1                     98.7M       8.6M      85.0M 13.9%
</pre>
<p>It&#8217;s a bit noisy giving a warning about opening /dev/kqemu for each guest.  I&#8217;ve grepped out the warnings above.  The &#8220;Domain-0 seems to have no disk devices&#8221; warning is <a href="https://bugzilla.redhat.com/show_bug.cgi?id=538041">bug 538041</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[A year in review: What are our readers looking for?]]></title>
<link>http://blog.sharevm.com/2009/11/16/a-year-in-review-what-are-our-readers-looking-for/</link>
<pubDate>Tue, 17 Nov 2009 05:41:00 +0000</pubDate>
<dc:creator>paule1s</dc:creator>
<guid>http://blog.sharevm.com/2009/11/16/a-year-in-review-what-are-our-readers-looking-for/</guid>
<description><![CDATA[Our readers are primarily asking questions like: How can I free disk space, on Windows, and on ext4,]]></description>
<content:encoded><![CDATA[Our readers are primarily asking questions like: How can I free disk space, on Windows, and on ext4,]]></content:encoded>
</item>
<item>
<title><![CDATA[Desktop Virtualization using Sun's VirtualBox]]></title>
<link>http://michaeld1.wordpress.com/2009/11/07/desktop-virtualization-using-suns-virtualbox/</link>
<pubDate>Sat, 07 Nov 2009 14:56:17 +0000</pubDate>
<dc:creator>michaeld1</dc:creator>
<guid>http://michaeld1.wordpress.com/2009/11/07/desktop-virtualization-using-suns-virtualbox/</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[<div class='snap_preview'></div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Test di HugePages con XEN]]></title>
<link>http://cristiancudizio.wordpress.com/2009/11/05/test-di-hugepages-con-xen/</link>
<pubDate>Thu, 05 Nov 2009 12:07:26 +0000</pubDate>
<dc:creator>Cristian Cudizio</dc:creator>
<guid>http://cristiancudizio.wordpress.com/2009/11/05/test-di-hugepages-con-xen/</guid>
<description><![CDATA[Ebbene, dopo essere riuscito ad ottenere una macchina para-virtualizzata con XEN con il supporto per]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Ebbene, dopo essere riuscito ad ottenere una macchina para-virtualizzata con XEN con il supporto per le Huge Pages come descritto nel <a href="http://cristiancudizio.wordpress.com/2009/11/03/ricompilare-il-kernel-con-xen-e-hugepages/">mio post precedente</a>, era arrivato il momento di verificare se effettivamente c&#8217;erano problemi con questa accoppiata.</p>
<p>Confesso che nella fretta come al solito ho voluto bruciare le tappe ed ho subito cercato di configurare le Huge pages e di provare a far partire il database Oracle (sempre l&#8217;istanza 11gR2). La fretta è stata una cattiva consigliera come il solito, perché ho litigato un po&#8217; con i parametri di configurazione della memoria di Oracle per far stare tutto nella RAM che ho a disposizione. Seguirò nella descrizione lo stesso ordine con cui ho eseguito le operazioni.</p>
<p><strong>Configurazione del sistema operativo</strong></p>
<p>Una volta &#8220;abilitato&#8221; il kernel all&#8217;utilizzo delle Huge Pages, bisogna configurare quanta parte di memoria debba essere dedicata  a queste pagine giganti, infatti andando a vedere il file /proc/meminfo si osserva:</p>
<blockquote><p>[root@oel53test11gR201 ~]# cat /proc/meminfo &#124;grep Huge<br />
HugePages_Total:      0<br />
HugePages_Free:       0<br />
HugePages_Rsvd:      0<br />
Hugepagesize:     2048 kB</p></blockquote>
<p>per farlo in modo definitivo (si può fare anche al volo, ma siccome le pagine devo essere contigue potrebbe essere necessario un reboot affinché il sistema trovi sufficente memoria contigua libera) si modifica il file /etc/sysctl.con aggiungendo le righe:</p>
<blockquote><p>vm.nr_hugepages = 420<br />
vm.hugetlb_shm_group = 505</p></blockquote>
<p>La prima riga corrisponde al numero di pagine, che moltiplicato per la dimensione della pagina (nel mio caso 2048K) la dimensione in byte della memoria che si vuole gestire in questo modo (in questo esempio 420*2048k=840M). La seconda riga è importante se si intende far utilizzare le Huge Pages ad oracle: indica il gruppo del sistema operativo che  può utilizzare le huge pages con le chiamate di sistema shmat/smget (Vedi <a href="http://lxr.linux.no/#linux+v2.6.18/Documentation/vm/hugetlbpage.txt">vm/hugetlbpage.txt</a>) Questo secondo la documentazione, ma vedremo dopo che a me questo non torna.</p>
<p>Secondo alcune note del Metalink Oracle, ad esempio la 560501.1, occorre modificare anche il file /etc/security/limits.conf aggiungendo le due righe:</p>
<blockquote><p>oracle soft memlock n<br />
oracle hard memlock n</p></blockquote>
<p>Dove n è il numero di KByte che si assegnerà alla SGA (immagino sia il caso di mettere un numero un po&#8217; più grande)</p>
<p>Modifcato i file si può fare un reboot e  dopo di ciò si ottiene:</p>
<blockquote><p>[root@oel53test11gR201 ~]# cat /proc/meminfo &#124;grep Huge<br />
HugePages_Total:   420<br />
HugePages_Free:    420<br />
HugePages_Rsvd:      0<br />
Hugepagesize:     2048 kB</p></blockquote>
<p><strong>Configurazione di Oracle</strong></p>
<p>Stando alla nota Oracle Metalink 749851.1 l&#8217;impostazione &#8220;Automatic Memory Management (AMM)&#8221; di Oracle 11g non è compatibile con l&#8217;uso delle HugePages, quindi occorre settare a 0 i parametri MEMORY_TARGET e MEMORY_MAX_TARGET .  Ho quindi impostato i vari parametri SGA_TARGET, SGA_MAX_SIZE PGA_AGGREGATE_TARGET, con qualche difficoltà. Non ho verificato se l&#8217;incompatibilità è certificata anche per la R2 di 11g, in ogni caso questa incompatibilità spiega il perché nei manuali ufficiali non viene incoraggiato l&#8217;utilizzo delle Huge Pages.</p>
<p>Dopo aver aggiustato in più fasi tutti i parametri Oracle sono arrivato finalmente ad un risultato. Ad un certo punto sono arrivato al livello che sembrava tutto a posto ma da /proc/meminfo risultavano ancora tutte le pagine libere, ad indicare che Oracle non le usava: era perché il numero di pagine che avevo riservato ancora non bastavano per tutta la SGA, infatti aumentandolo da 405 a 420 ho risolto.</p>
<p>&#8230; risolto poco, perché il risultato del tentativo di avvio dell&#8217;istanza Oracle è stato un reboot della macchina virtuale con la visualizzazione sulla console di XEN di un bel &#8220;kernel panic&#8221;.</p>
<p>A questo punto ho fatto quello che avrei dovuto fare subito, ho provato le hugepages con un programmino di test, precisamente quello descritto in <a href="http://linuxgazette.net/155/krishnakumar.html">questo bel articolo</a>.</p>
<p>Riporto quindi il messaggio in console:</p>
<blockquote><p>Unable to handle kernel paging request at ffff88005cc122f0 RIP:<br />
[&#60;ffffffff802cd3ec&#62;] hugetlb_no_page+0&#215;1e3/0&#215;27e<br />
PGD 13cd067 PUD 15cf067 PMD 16b6067 PTE 801000005cc12065<br />
Oops: 0003 [1] SMP<br />
last sysfs file: /block/dm-0/range<br />
CPU 0<br />
Modules linked in: autofs4(U) hidp(U) nfs(U) lockd(U) fscache(U) nfs_acl(U) rfcomm(U) l2cap(U) bluetooth(U) sunrpc(U) dm_multipath(U) scsi_dh(U) scsi_mod(U) ipv6(U) xfrm_nalgo(U) crypto_api(U) parport_pc(U) lp(U) parport(U) pcspkr(U) xennet(U) dm_raid45(U) dm_message(U) dm_region_hash(U) dm_mem_cache(U) dm_snapshot(U) dm_zero(U) dm_mirror(U) dm_log(U) dm_mod(U) xenblk(U) ext3(U) jbd(U) uhci_hcd(U) ohci_hcd(U) ehci_hcd(U)<br />
Pid: 3435, comm: oracle Tainted: G      2.6.18-2.6.18-164xenhugepages #1<br />
RIP: e030:[&#60;ffffffff802cd3ec&#62;]  [&#60;ffffffff802cd3ec&#62;] hugetlb_no_page+0&#215;1e3/0&#215;27e<br />
RSP: e02b:ffff880063017d18  EFLAGS: 00010246<br />
RAX: ffff88005cc122f0 RBX: 0000000048c0d0e7 RCX: 0000000048c0d027<br />
RDX: 0000000000000000 RSI: 0000000048c0d0e7 RDI: 000000008bdffe98<br />
RBP: 0000000000000000 R08: ffffffff804fbfc3 R09: 0000000000000908<br />
R10: 0000000000000000 R11: 0000000000000000 R12: ffff880002fe5000<br />
R13: ffff8800a12e4160 R14: 000000008bdffe98 R15: ffff88005fb5ce58<br />
FS:  00002abe89f78e60(0000) GS:ffffffff805ce000(0000) knlGS:0000000000000000<br />
CS:  e033 DS: 0000 ES: 0000<br />
Process oracle (pid: 3435, threadinfo ffff880063016000, task ffff880063ac87a0)<br />
Stack:  00000001804f62c0  ffff88005cc122f0  ffff880009a95b80  0000000000000000<br />
ffff88005cc122f0  ffff880009a95b80  000000008bdffe98  0000000000000001<br />
ffff88005fb5ce58  ffffffff802cd4dc<br />
Call Trace:<br />
[&#60;ffffffff802cd4dc&#62;] hugetlb_fault+0&#215;55/0xba<br />
[&#60;ffffffff80208b0c&#62;] __handle_mm_fault+0&#215;5c/0&#215;1354<br />
[&#60;ffffffff80241249&#62;] vma_prio_tree_insert+0&#215;20/0&#215;38<br />
[&#60;ffffffff8026766a&#62;] do_page_fault+0xf7b/0&#215;12e0<br />
[&#60;ffffffff8020e6fe&#62;] do_mmap_pgoff+0&#215;658/0&#215;7c3<br />
[&#60;ffffffff80264901&#62;] _spin_lock_irqsave+0&#215;9/0&#215;14<br />
[&#60;ffffffff80231992&#62;] __up_write+0&#215;27/0xf2<br />
[&#60;ffffffff8026082b&#62;] error_exit+0&#215;0/0&#215;6e</p>
<p>Code: 48 89 18 83 7c 24 04 00 74 23 41 f6 47 28 08 75 1c 48 8b 4c<br />
RIP  [&#60;ffffffff802cd3ec&#62;] hugetlb_no_page+0&#215;1e3/0&#215;27e<br />
RSP &#60;ffff880063017d18&#62;<br />
CR2: ffff88005cc122f0<br />
&#60;0&#62;Kernel panic &#8211; not syncing: Fatal exception</p></blockquote>
<p>Va detto, che l&#8217;errore non avviene nel momento in cui il programma alloca le pagine (con shmget) ma quando cerca di scriverci dentro. Ho anche provato ad eseguire il programmino di test dopo aver tolto dal file /etc/sysctl.conf la riga vm.hugetlb_shm_group = 505, in questo modo stando alla documentazione solo l&#8217;utente root dovrebbe essere in grado di utilizzare le Huge Pages, ma nel mio caso non è cambiato nulla, la macchina si riavviata con lo stesso errore.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Ricompilare il Kernel con XEN e HUGEPAGES]]></title>
<link>http://cristiancudizio.wordpress.com/2009/11/03/ricompilare-il-kernel-con-xen-e-hugepages/</link>
<pubDate>Tue, 03 Nov 2009 15:57:12 +0000</pubDate>
<dc:creator>Cristian Cudizio</dc:creator>
<guid>http://cristiancudizio.wordpress.com/2009/11/03/ricompilare-il-kernel-con-xen-e-hugepages/</guid>
<description><![CDATA[Dopo giorni (ma in realtà erano mesi che volevo farlo) sono riuscito a ricompilare il kernel su Orac]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Dopo giorni (ma in realtà erano mesi che volevo farlo) sono riuscito a ricompilare il kernel su Oracle Enterprise Linux 5.3. Si tratta di una installazione su una macchina virtuale XEN che ho fatto qualche settimana fa per installare e testare Oracle 11gR2. Una delle cose che ho notato gia tempo fa è che sia sulla macchina &#8220;ospitante&#8221; (Dom0 il linguaggio XEN) che sulle macchine para-virtualizzate linux non è configurato il supporto per le <a href="http://www.mjmwired.net/kernel/Documentation/vm/hugetlbpage.txt">HugePages</a>, mentre su una macchina fully-virtualised tale supporto è presente (la macchina fully virtualised mi era necessaria per installare un versione linux 32 bit, usata a suo tempo per testare 11gR1 quando la versione 64 bit non era ancora uscita).</p>
<p>Ho sempre pensato che se nel kernel compilato con il supporto XEN non c&#8217;era il supporto per le Huge Pages ci doveva essere un motivo ben preciso, qualche vincolo strutturale; purtroppo però a tutt&#8217;oggi non ho trovato una spiegazione di  cio&#8217;, non una nota dove si dica che le macchine virtuali non possono usare Huge Pages.</p>
<p>Un po&#8217; di tempo fa ho scoperto, grazie al <a href="http://blogs.oracle.com/sergio/2009/03/new_oracle_public_yum_server_1.html">blog di Sergio Leunissen</a>, che Oracle ha messo a disposizione un server <a href="http://public-yum.oracle.com/">YUM pubblico</a>. Si tratta di un server da cui è possibile scaricare e installare in modo quasi automatico i pacchetti rpm aggiornati, utilizzando una utility chiamata appunto YUM. Chiaramente in questi aggiornamenti non sono inclusi le patch di sicurezza che vengono fornite solo con il supporto <a href="https://linux.oracle.com">ULN</a>. Da qui ho scaricato il pacchetto RPM dei sorgenti del kernel. Gia questa fase è stata per me problematica, perché con YUM non sono stato capace di farlo, ho scaricato l&#8217;rpm con wget e l&#8217;ho installato con rpm.</p>
<p>Una volta installati i sorgenti del kernel sono passato alla difficoltà successiva: come compilare il kernel? I pacchetti rpm con in sorgenti vengono installati con una struttura particolare, che non conoscevo molto, francamente io quando smanettavo di più con linux ero una amante della distrubuzione Slackware e della sua organizzazione a pacchetti tar.gz. In ogni caso ho scoperto l&#8217;utility rpmbuild, sulla quale però non è che la documentazione abbondi.</p>
<p>Fra mille ricerche il link più utile che ho trovato è stato senz&#8217;altro <a href="http://www.howtoforge.com/kernel_compilation_fedora">questo</a>. In tutti però, compresi <a href="http://docs.fedoraproject.org/release-notes/fc6/it/sn-Kernel.html">questo </a>e <a href="http://fedoraproject.org/wiki/Docs/CustomKernel">questo </a>manca una informazione chiara su come funziona la configurazione. Infatti io continuavo a modificare a mano il file .config aggiungendo le righe:</p>
<blockquote><p>CONFIG_HUGETLBFS=y<br />
CONFIG_HUGETLB_PAGE=y</p></blockquote>
<p>Ma sistematicamente osservavo che il make me le &#8220;spianava&#8221;, cancellava le righe togliendo di fatto il supporto alle Huge Pages. Da sottolineare poi un&#8217;altra cosa che non capivo: facendo make menuconfig (e un paio di volte mi sono fatto anche il make config con l&#8217;interminabile sfilza di domande) non compariva nessuna voce relativa alle stesse huge pages. Solo grazie ad un errore nel file .config ho poi scoperto che a  &#8220;resettare&#8221; il mio file .config era l&#8217;istruzione:</p>
<blockquote><p>scripts/kconfig/conf -s arch/x86_64/Kconfig</p></blockquote>
<p>lanciata da make. Ulteriori indagini mi hanno portato al file fs/Kconfig dove ho trovato:</p>
<blockquote><p>config HUGETLBFS<br />
bool &#8220;HugeTLB file system support&#8221;<br />
depends X86 &#124;&#124; IA64 &#124;&#124; PPC64 &#124;&#124; SPARC64 &#124;&#124; SUPERH &#124;&#124; (S390 &#38;&#38; 64BIT) \<br />
&#124;&#124; BROKEN<br />
depends !XEN<br />
help<br />
hugetlbfs is a filesystem backing for HugeTLB pages, based on<br />
ramfs. For architectures that support it, say Y here and read<br />
&#60;file:Documentation/vm/hugetlbpage.txt&#62; for details.</p>
<p>If unsure, say N.</p></blockquote>
<p>Che in sostanza stabilisce che se è selezionato il supporto per XEN viene disabilitato quello per le Huge Pages. Ho verificato, con &#8220;make menuconfig&#8221; ma anche deselezionando la voce &#8220;XEN -&#62; Privileged Guest (domain 0)&#8221; sotto &#8220;File Systems -&#62; Pseudo filesystems&#8221; non compare la voce &#8220;HugeTLB file system support&#8221;. (Non sono solo io ad aver problemi su come scrivere &#8220;filesystem&#8221; se come una unica parola  o come due divise, visto che sul questo menu&#8217; compare scritto in entrambi i modi). Invece modificando il file fs/Kconfig così:</p>
<blockquote><p>config HUGETLBFS<br />
bool &#8220;HugeTLB file system support&#8221;<br />
depends X86 &#124;&#124; IA64 &#124;&#124; PPC64 &#124;&#124; SPARC64 &#124;&#124; SUPERH &#124;&#124; (S390 &#38;&#38; 64BIT) \<br />
&#124;&#124; BROKEN<br />
#depends !XEN<br />
default y<br />
help<br />
hugetlbfs is a filesystem backing for HugeTLB pages, based on<br />
ramfs. For architectures that support it, say Y here and read<br />
&#60;file:Documentation/vm/hugetlbpage.txt&#62; for details.</p>
<p>If unsure, say N.</p></blockquote>
<p>Magicamente la voce &#8220;HugeTLB file system support&#8221; compare sotto &#8220;HugeTLB file system support&#8221;</p>
<p>Quindi sono riuscito a ricompilare il kernel con il supporto a XEN e alle Huge Pages, vedremo cosa accadrà.</p>
<p>Questi in sintesi i passi che ho seguito:</p>
<ol>
<li>scaricato il pacchetto  kernel-2.6.18-164.el5.src.rpm da public-yum.oracle.com</li>
<li>aggiunto l&#8217;utente mockbuild con gruppo mockbuild (altrimenti non funziona l&#8217;installazione dell&#8217;rpm).</li>
<li>installato con rpm -i kernel-2.6.18-164.el5.src.rpm; in questo modo finisce tutto sotto /usr/src/redhat, con una struttura particolare</li>
<li>Secondo il consiglio visto da più parti, ad esempio anche <a href="http://www2.linux.com/community/blogs/Installing-kernel-source-on-CentOS-RedHat.html">qui</a>, ho copiato tutto il contenuto di /usr/src/redhat in un&#8217;altro posto (/var/tmp/rpmbuild) e creando il file  ~/.rpmmacros con la riga %_topdir /var/tmp/rpmbuild.</li>
<li>la radice per la compilazione dei sorgenti è diventata nel mio caso /var/tmp/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64/, ho modificato il file Makefile impostando la variabile EXTRAVERSION = -xenhuge2.6.18-164  (come saggiamente indicato <a href="http://www.howtoforge.com/kernel_compilation_fedora">qui</a>)</li>
<li>modificato il file fs/Kconfig come descritto sopra</li>
<li>lanciato il comando &#8220;make rpm &#8221; La compilazione non è durata giorni, mi sembra circa un&#8217;ora.</li>
<li>a questo punto sotto /var/tmp/rpmbuild/RPMS ho trovato il mio rpm che ho installato con rpm -i, piccola curiosità: sotto /boot mi sono trovato un file vmlinuz da 52 MB contro i 2 MB circa degli altri kernel.</li>
<li>Ho creato l&#8217;immagine del ramdisk con mkinitrd, sempre come indicato dalla guida di HowToForge e modificato il file /boot/grub/menu.lst</li>
</ol>
<p>Ho riavviato la macchina virtuale e selezionato dal menu di grup il nuovo kernel e incredibilmente è partita.  Curiosando sotto /var/tmp/rpmbuild/BUILD/kernel-2.6.18xenhuge2.6.18-164 ho visto un file vmlinuz da circa 2 MB, accanto a un file vmlinux da circa 52 MB (dimensione uguale al byte al file vmlinuz-2.6.18-xenhuge2.6.18-164 che rpm mi ha installato sotto /boot) allora ho provato a sostituire il file da 52 MB sotto boot con il file vmlinuz (opportunamente rinominato) ed ho riavviato. Anche così funziona. Evidentemente il file più piccolo è il kernel compresso ma al boot viene gestito in modo trasparente (indagherò su questo).</p>
<p><strong>Conclusione</strong></p>
<p>I motivi che mi hanno spinto a investire il mio tempo in queste ricerche ed esperimenti sono imperscrutabili. Un&#8217;operazione simile va contro il principio che cerco di adottare solitamente, ovvero seguire strade e metodi certificati. Solamente una morbosa curiosità, il fascino del lato oscuro di Linux giustificano cio&#8217; che ho fatto. Sono però soddisfatto, perché potrò adesso testare Oracle su Linux con le Huge Pages.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Install Ulang MikroTik RouterOS pada DOM]]></title>
<link>http://sujianto.wordpress.com/2009/11/03/install-ulang-mikrotik-routeros-pada-dom/</link>
<pubDate>Tue, 03 Nov 2009 07:45:35 +0000</pubDate>
<dc:creator>sujianto</dc:creator>
<guid>http://sujianto.wordpress.com/2009/11/03/install-ulang-mikrotik-routeros-pada-dom/</guid>
<description><![CDATA[Perkara install ulang memang gampang, tapi setting yang kita buat sebelum kita backup akan hilang, s]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="size-thumbnail wp-image-409 alignnone" title="mikrotik-logo" src="http://sujianto.wordpress.com/files/2009/11/mikrotik-logo.jpg?w=150" alt="mikrotik-logo" width="150" height="36" /></p>
<p>Perkara install ulang memang gampang, tapi setting yang kita buat sebelum kita backup akan hilang, sedih banget khan, makanya sebelum diapa-apain dan masih berjalan normal sebaiknya konfigurasi yang kita buat di backup dulu baik lisensi, backup router maupun backup script yang kita buat, caranya?</p>
<p>- Backup Konfigurasi router.</p>
<blockquote><p>[nama admin@nama router] /system backup save name=&#60;buat nama file backup&#62;</p></blockquote>
<p>- Export  konfigurasi yang kita buat,  dapat dilihat <a href="http://wiki.mikrotik.com/wiki/Virtualization" target="_blank">disini.</a></p>
<p>- Backup License ID Key.</p>
<p style="text-align:left;">Export License ID menggunakan console winbox masuk ke menu <strong>System &#62; License &#62; Export Key</strong>.<img class="aligncenter size-full wp-image-406" title="license-mikrotik-routeros" src="http://sujianto.wordpress.com/files/2009/11/license-mikrotik-routeros.jpg" alt="license-mikrotik-routeros" width="570" height="205" /></p>
<p>Lalu bagaimana jika router yg kita tiba2 hang (error) atau kita tak sengaja memasukkkan pake yang ternyata tidak sesuai dengan spesifikasi hardware yang kita miliki, banyak kasus yang terjadi, kita menambahkan atau mengupgrade router kita dengan memasukkan <a href="http://wiki.mikrotik.com/wiki/Virtualization" target="_blank">XEN</a>, ini menyebabkan router kita error dan harus di install ulang. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Berikut cara termudah yang harus dipersiapkan.</p>
<ol>
<li>Komputer/PC + CD-ROM</li>
<li>DOM (Disk on Module) yang akan kita install ulang dan sudah tercolok ke IDE atau SATA pada mainboard.</li>
<li>Download ISO file disitus <a href="http://www.mikrotik.com" target="_blank">mikrotik.com</a> atw <a href="http://www.mikrotik.co.id/" target="_blank">mikrotik.co.id</a>, ambil dan sesuaikan dengan komputer PC atau x86.</li>
<li>Kemudian burning ke cd kosong dan masukkan hasil burningan ke cd-rom komputer yg akan kita install dan atur pada bios cd-rom pada boot yang pertama.</li>
<li>Setelah masuk pada masuk instalasi pilih paket apa aja yg kita install, tekan &#8220;i&#8221; untuk proses instalasi dan DOM akan di hapus dan di install ulang. <img class="aligncenter size-full wp-image-408" title="install-menu-mikrotik" src="http://sujianto.wordpress.com/files/2009/11/install-menu-mikrotik.png" alt="install-menu-mikrotik" width="570" height="316" /></li>
<li>Setelah instalasi selesai dan tidak terjadi error masuk lagi ke menu <strong>System &#62; License</strong> dan import file lisensi yang kita backup tadi, kemudia kita juga dapat mengembalikan konfigurasi yang telah kita backup tadi.</li>
</ol>
<p>Kalau yang tidak di backup terpaksa di konfigurasi ulang router MikroTik anda.</p>
<p>Tautan situs : www.mikrotik.com, mikrotik.co.id</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[China gets horny]]></title>
<link>http://ajclark.wordpress.com/2009/11/01/china-gets-horny/</link>
<pubDate>Sun, 01 Nov 2009 17:06:55 +0000</pubDate>
<dc:creator>napta2k</dc:creator>
<guid>http://ajclark.wordpress.com/2009/11/01/china-gets-horny/</guid>
<description><![CDATA[Today I woke up to several alerts from Linode informing me that one of my VPS nodes was exceeding th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Today I woke up to several alerts from Linode informing me that one of my VPS nodes was exceeding the Disk I/O threshold that I had set. Curiously this VPS is used as a HTTP web proxy and whilst it gets about 300-400 visitors per day (mainly china) this morning I was seeing over 800 visitors in Google Analytics.</p>
<p>Attempting to ssh to the server failed with timeouts although the PHP web application was still responding to requests over HTTP fine. I suspect sshd was failing to reverse-lookup my IP address in any reasonable amount of time, or perhaps IP Tables &#8211; (Note to self: Look in to why that happened). Thankfully Linode provide out of band / console access via SSH and AJax so all was not lost.</p>
<p>Looking at the Network rrdgraph it shows that the server was approaching 7Mbit/s of HTTP traffic and almost 50GB had been consumed today alone. Whilst the server seemed to handle the load without problem (minus ssh access) consuming 50GB+ per day would quickly max out my monthly data transfer allowance with Linode &#8211; this wasn&#8217;t acceptable. I modified the firewall to accept HTTP/HTTPS traffic from my IP only in order to investigate and the load suddenly stopped and SSH was alive again.</p>
<p><a href="http://ajclark.wordpress.com/files/2009/11/ehproxy-info.png"><img class="alignnone size-medium wp-image-188" title="ehproxy.info" src="http://ajclark.wordpress.com/files/2009/11/ehproxy-info.png?w=300" alt="ehproxy.info" width="300" height="136" /></a></p>
<p>Initially I had suspected that some sort of automated bot was using ehproxy.info to do automated scans and attacks but a closer inspection of the traffic showed an even number of distributed IPs (all from China &#8211; as Google Analytics confirms) all clicking various porn sites. I guess everyone in China was feeling horny this afternoon!</p>
<p><a href="http://ajclark.wordpress.com/files/2009/11/most-visited-sites.png"><img class="alignnone size-medium wp-image-189" title="most visited sites" src="http://ajclark.wordpress.com/files/2009/11/most-visited-sites.png?w=300" alt="most visited sites" width="300" height="67" /></a></p>
<p>Further analysis of the access.log shows that the server (Linode XenU VPS with 720MB of ram) was handling 62 hits sec (2428863/39600) and lighttpd was dealing with the load no problem. Pretty good considering this is a pure PHP application utilising php-cgi.</p>
<p>For the record, the top five IP addresses were:</p>
<p>Hits : IP address</p>
<div id="_mcePaste">13872 :222.242.182.169</div>
<div id="_mcePaste">14394 :123.152.129.107</div>
<div id="_mcePaste">16422 :123.11.41.255</div>
<div id="_mcePaste">18110 :113.65.146.126</div>
<div id="_mcePaste">26595 :124.134.24.218</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Virtualizzazione con XEN]]></title>
<link>http://cristiancudizio.wordpress.com/2009/10/29/virtualizzazione-con-xen/</link>
<pubDate>Thu, 29 Oct 2009 16:35:42 +0000</pubDate>
<dc:creator>Cristian Cudizio</dc:creator>
<guid>http://cristiancudizio.wordpress.com/2009/10/29/virtualizzazione-con-xen/</guid>
<description><![CDATA[Una serie di interessanti post recenti di Dizwell sulla virtualizzazione hanno risvegliato in me l]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Una serie di interessanti post recenti di <a href="http://diznix.com/">Dizwell </a>sulla virtualizzazione hanno risvegliato in me l&#8217;interesse per queste tecnologie. In particolare egli ha iniziato con un bel <a href="http://diznix.com/2009/10/06/virtualisation-bonanza/">post </a>in cui faceva una sorta di recensione di sistemi di virtualizzazione, in seguito egli si è concentrato su quello apparentemente più interessante XenServer di Citrix.  Apro qui una parentesi, il sito di citrix su XenServer è <a href="http://www.citrix.com/xenserver/">http://www.citrix.com/xenserver/</a> ma io lo trovo frequentemente giu, una cosa preoccupante direi. Chiusa la parentesi.</p>
<p>XenServer sembra un prodotto interessante, non molto diverso come base da Oracle VM, ovvero una distribuzione Linux minimale; la differenza la fa il &#8220;contorno&#8221;, a partire dagli strumenti di amministrazione per arrivare alle caratteristiche &#8220;enterprise&#8221;, che nel caso di XenServer sono quelle che si comprano, mentre la base è gratuita.</p>
<p>L&#8217;ultimo <a href="http://diznix.com/2009/10/27/a-virtual-virgin-writes/">post </a>di Dizwel, è un po&#8217; &#8220;amaro&#8221;, infatti egli ha incontrato dei limiti di XenServer che gli impediscono di  utilizzarlo in &#8220;produzione&#8221;, produzione tra virgolette perché il suo progetto è quello di consolidare gli ambienti di test. I suoi racconti mi hanno incuriosito e spinto a capire meglio come funziona Xen, a tale proposito voglio segnalare che fra i manuali di Red Hat ve ne è uno sulla virtualizzazione molto interessante, <a href="http://www.redhat.com/docs/manuals/enterprise/#RHEL5">qui</a>. Volevo segnalare questo manuale perché vi ho trovato cose che ho cercato anche tempo fa, come un metodo per<a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Virtualization_Guide/sect-Virtualization-Tips_and_tricks-Generating_a_new_unique_MAC_address.html"> generare nuovi mac-address</a> o il <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Virtualization_Guide/sect-Virtualization-Troubleshooting_Xen-Accessing_data_on_guest_disk_image.html">sistema per accedere ai file all&#8217;interno delle immagini dei dischi</a>.</p>
<p>Vi sono due dubbi che mi rimangono:</p>
<p>1) cosa sono i template di cui parla Dizwell; in effetti non mi è chiaro il meccanismo di creazione di una nuova VM, io utilizzo l&#8217;interfaccia grafica di virtual machine manager ma non ho ancora capito i meccanismi che stanno dietro. L&#8217;ultima VM che ho creata l&#8217;ho fatta con OEL 5.3 senza bisogno di &#8220;template&#8221;.</p>
<p>2)sulle vm che ho creato, di tipo &#8220;para-virtualised&#8221; il kernel xen non attivo il supporto per le HugePages, mi chiedo se questo sia dovuto al fatto che in questa configurazione non è possibile averle oppure se semplicemente è possibile ricompilare il kernel ed attivare tale supporto.</p>
<p>Sono convinto che conoscere a fondo i meccanismi di funzionamento di Xen possono aiutare a gestirlo e utilizzarlo al meglio, quindi farò di tutto per colmare le mie lacune.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[XenServer: Why? ]]></title>
<link>http://fawzi.wordpress.com/2009/10/28/xenserver-why/</link>
<pubDate>Wed, 28 Oct 2009 18:04:44 +0000</pubDate>
<dc:creator>Mohamed Fawzi</dc:creator>
<guid>http://fawzi.wordpress.com/2009/10/28/xenserver-why/</guid>
<description><![CDATA[There have been lots discussions lately about what&#8217;s happening around Citrix XenServer. Perhap]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>There have been lots discussions lately about what&#8217;s happening around Citrix XenServer. Perhaps too many. For what it is worth, I was one of the people discussing this on the net (Twitter, Blogs etc) with some other folks. I originally drafted a blog post when Citrix bought XenSource but it never made it (officially because I was busy, unofficially because I couldn&#8217;t figure out &#8220;why&#8221;).</p>
<p>I think that what it is happening is pretty clear at this point. The market landscape is being consolidated with Oracle acquiring VirtualIron as well as the &#8220;Sun Xen thing&#8221; within the overall grand plan of the acquisition (of the remaining) of Sun. All these solutions have hardly, in the past few years, managed to make a difference in the industry and their names were floating around more with the hope that VMware could feel more pressure and competition, and hence lower the prices. In the meanwhile, VMware increased their price which speaks for itself.</p>
<p>This is leaving (apparently) the x86 virtualization market with 3 relevant viable alternatives that are VMware, Microsoft and Citrix. I have always said this is going to be a two-horse race and I still stand behind this statement. The first horse is VMware and the second horse is what I call Microtrix &#8482;. There have been a nice Twitter discussion a few days ago on why Citrix bought XenSource and the future of it etc. This was my tweet in the discussion which, in a way, summarizes my thinking:</p>
<p><a href="http://it20.info/blogs/main/archive/2009/10/29/1422.aspx">Source</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Xen]]></title>
<link>http://heimantalat.wordpress.com/2009/10/27/xen/</link>
<pubDate>Tue, 27 Oct 2009 21:29:01 +0000</pubDate>
<dc:creator>heimantalat</dc:creator>
<guid>http://heimantalat.wordpress.com/2009/10/27/xen/</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[]]></content:encoded>
</item>
<item>
<title><![CDATA[Xen Cy Haven Prefab Available Now]]></title>
<link>http://xenstyle.wordpress.com/2009/10/20/xen-cy-haven-prefab-available-now/</link>
<pubDate>Tue, 20 Oct 2009 19:24:37 +0000</pubDate>
<dc:creator>xrevere</dc:creator>
<guid>http://xenstyle.wordpress.com/2009/10/20/xen-cy-haven-prefab-available-now/</guid>
<description><![CDATA[http://slurl.com/secondlife/Xeniversity/208/231/81]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:center;"><a href="http://slurl.com/secondlife/Xeniversity/208/231/81"><strong>http://slurl.com/secondlife/Xeniversity/208/231/81</strong></a></p>
<p><a href="http://www.flickr.com/photos/39327173@N07/4028906355/" title="Xen Cy Haven Prefab by Xen Style, on Flickr"><img src="http://farm3.static.flickr.com/2664/4028906355_f9b2fce36c_o.jpg" width="500" alt="Xen Cy Haven Prefab" /></a></p>
<p><a href="http://www.flickr.com/photos/39327173@N07/4028906229/" title="Xen Cy Haven Prefab Compact by Xen Style, on Flickr"><img src="http://farm3.static.flickr.com/2727/4028906229_c013777030_o.jpg" width="500" alt="Xen Cy Haven Prefab Compact" /></a></p>
<p><a href="http://www.flickr.com/photos/39327173@N07/4029659362/" title="Xen Cy Haven Prefab Details by Xen Style, on Flickr"><img src="http://farm3.static.flickr.com/2626/4029659362_813f7f8fcd_o.jpg" width="500" alt="Xen Cy Haven Prefab Details" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Falando de virtualização]]></title>
<link>http://brunosimioni.wordpress.com/2009/10/19/falando-de-virtualizacao/</link>
<pubDate>Tue, 20 Oct 2009 02:40:54 +0000</pubDate>
<dc:creator>Bruno Simioni</dc:creator>
<guid>http://brunosimioni.wordpress.com/2009/10/19/falando-de-virtualizacao/</guid>
<description><![CDATA[Este post faz referência sobre virtualização computacional, modelo de abstração de recursos computac]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">Este post faz referência sobre virtualização computacional, modelo de abstração de recursos computacionais, afim de prover redução de recursos necessários para consolidar diferentes arquiteturas, sob um único hardware básico (ou avançado, indo do gosto do freguês).</p>
<p style="text-align:justify;">Pretendo cobrir a parte sobre virtualização de sistemas operacionais (virtualização de plataformas), portanto, não falarei detalhadamentesobre as outras abordagens de virtualização. Apesar de ser um assunto relativamente novo, é um assunto, ao mesmo tempo, relativamente muito velho. Entendo por virtualização a grande invenção da <span style="text-decoration:underline;">memória virtual </span>(que abstrai um segundo dispositivo de armazenamento, como memória principal, e estende sobre esse o espaço de endereçamento de instruções), as <span style="text-decoration:underline;">interfaces virtuais de rede </span>(onde, por exemplo, dependendo das capacidades do dispositivo, pode-se criar diversas interfaces de rede virtuais, com diversos pontos de acesso em IP, por exemplo, sob um único dispositivo físico), as <span style="text-decoration:underline;">interfaces virtuais de armazenamento</span> (que podem ser, desde abstrações via rede, até um storage inteiro virtual), <span style="text-decoration:underline;">VPNs</span> (que nada mais são que redes inteiras virtuais),<span style="text-decoration:underline;"> virtualização de desktops</span> (como terminais burros, ou por exemplo, serviços de terminais remotos), <span style="text-decoration:underline;">virtualização e clustering de sistemas de gestão de bancos de dados</span>, e por aí vai!</p>
<p style="text-align:justify;"><strong> Falando sobre Hypervisor</strong></p>
<p style="text-align:justify;">Para entrar no tema que eu quero sobre virtualização, não dá pra começar sem falar de uma entidade chamada de <em>Hypervisor</em>. Este é o sujeito responsável por prover uma interface lógica entre o que vai prover um ambiente de virtualização (chamado comumente de <em>hospedeiro</em>) e o que vai ser virtualizado (chamado comumente de <em>convidado</em>). Técnicamente, é uma porção de código que é executado pelo software hospedeiro, e age como um controlador de hardware e monitor do sistema operacional do software convidado. Geralmente, nesses moldes, o sistema operacional convidado, executa sob um nível abaixo do nível do <em>Hypervisor</em>.</p>
<p style="text-align:justify;">A primeira figura exibe quais as camadas definidas na arquitetura de virtualização a qual estou me referindo.</p>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-57" title="figure1" src="http://brunosimioni.wordpress.com/files/2009/10/figure1.gif" alt="figure1" width="383" height="153" /></p>
<p style="text-align:center;"><em>Figura 1 &#8211; Arquitetura básica da virtualização provida pelo Hypervisor.</em></p>
<p style="text-align:center;">
<p style="text-align:justify;">Há dois principais modos de execução do Hypervisor. O modo nativo (portanto, <em>para virtualization</em>), e o modo abrigado (portanto, <em>full virtualization</em>).</p>
<p style="text-align:justify;">O primeiro modo de execução, chamado abrigado (com a palavrinha mágica &#8211; <em>hosted</em>), faz com que toda a plataforma de hardware disponível ao convidado seja totalmente virtualizada. Portanto, são implementados e aplicados gatilhos e tratadores nas chamadas de sistema e instruções de máquina (instruções nativas &#8211; sistema operacional convidado não sofre nenhuma modificação) enviadas pelo sistema operacional convidado, e convertidas para as instruções de máquina e chamadas de sistema do sistema operacional hospedeiro, portanto, executadas nativamente. O resultado de tais ações é novamente convertido para o formato de retorno do sistema operacional convertido, e tudo caminha nas mil maravilhas.</p>
<p style="text-align:justify;">A figura 2 mostra um modelo esquemático de aplicação do modelo 1 do Hypervisor.</p>
<p style="text-align:justify;"><img class="aligncenter size-full wp-image-58" title="figure2" src="http://brunosimioni.wordpress.com/files/2009/10/figure2.gif" alt="figure2" width="327" height="242" /></p>
<p style="text-align:center;"><em>Figura 2 &#8211; Arquitetura básica do modelo hospedado.</em></p>
<p style="text-align:justify;">Definem-se como vantagens dessa abordagem, o fato sistema operacional convidado não precisa ser modificado; para este, é uma máquina física como qualquer outra. Não há custos adicionais, nem modificação no software original, reservando as características originais do sistema operacional convidado. A grande desvantagem dessa abordagem é o desempenho comprometido (em relação ao desempenho original, o que não significa que fique lento &#8211; leia-se sem condições mínimas de emprego em um ambiente corporativo de produção). A queda do desempenho dá-se pela interpretação de todas as instruções disparadas pelo hardware virtual disponível para a máquina convidada. Além disso, claro, ainda há o escalonamento de processos do sistema operacional, através de um núcleo premptivo.</p>
<p style="text-align:justify;">O segundo modo de execução, chamado nativo (com a palavrinha mágica &#8211; <em>bare-metal</em>), cria um meio termo nas coisas. Através de um núcleo de chamadas de sistema (vulgo <em>Kernel</em>, no mundo *nix) modificado, torna o sistema operacional convidado, alguém que sabe que está sendo virtualizado, mas que consegue, através desse núcleo modificado, alcançar nativamente o hardware disponível na arquitetura do sistema hospedeiro. Mágico, não?</p>
<p style="text-align:justify;">Este novo núcleo, é então parte do <em>Hypervisor</em> (que agora é parte do sistema operacional convidado, e parte do sistema operacional hospedeiro), fazendo com que seja mais simples chegar ao hardware, e fazer algumas traduções das chamadas mais críticas do sistema.</p>
<p style="text-align:justify;">Como vantagens da técnica, está principalmente o desempenho, tornando as coisas mais fáceis, fazendo com que não haja tradução de instruções, nem emulação de hardware. Por exemplo, se você comprou sua nova Intel® PRO/1000 GT <em>Desktop</em> <em>Adapter</em>, ele vai ser Intel no sistema hospedeiro, e Intel no sistema convidado. Na primeira abordagem, ela seria Intel no sistema hoespedeiro, e <em>Network Virtual Driver</em>, no sistema convidado. A principal desvantagem é a modificação do núcleo do sistema convidado, aumentando a probabilidade do número de falhas (por sair da árvore principal de desenvolvimento do software, e ter dedos de terceiros), incompatibilidade de padrões, aumento de custo de manutenção, e blá blá blá.</p>
<p style="text-align:justify;">A figura 3 define um modelo esquemático de como aconteceria a implantação do segundo caso.</p>
<p style="text-align:justify;"><img class="aligncenter size-full wp-image-59" title="figure3" src="http://brunosimioni.wordpress.com/files/2009/10/figure3.gif" alt="figure3" width="334" height="257" /></p>
<p style="text-align:center;"><em>Figura 3 &#8211; Implantação do modelo nativo do Hypervisor.</em></p>
<p>Em relação ao modelo de virtualização de plataformas, com a presença de um <em>Hypervisor</em>, o assunto termina por aqui. Não há muito mais novidades na área.</p>
<p style="text-align:justify;">Continuando com o assunto de virtualização, é válido dizer que o hardware x86 é particularmente difícil de virtualizar. Com essa motivação, tanto a Intel, quanto a AMD, criaram tecnologias de virtualização diretamente embutidas no processador. A Intel a chamou de Intel-VT (VanderPool), e a AMD, AMD-V (Pacifica). Tais extensões são responsáveis por adicionar capacidades que são difíceis ou ineficientes de virtualizar via software, facilitando o trabalho do pessoal que desenvolve na área.</p>
<p style="text-align:justify;"><strong>Falando sobre implementações</strong></p>
<p style="text-align:justify;">Há diversos softwares comerciais e livres que implementam este modelo de monitor de máquinas virtuais, e com a idéia geral de virutalização de plataformas, dá pra nomear algumas categorias, de forma simplificada, e alguns softwares virtualizadores, que a implementam.</p>
<p style="text-align:justify;">No<strong> primeiro modelo</strong>,<strong> nativo</strong>, encaixam-se nomes como VMware ESX Server, IBM System z Hypervisor, Microsoft Hyper-V, Xen, Citrix XenServer, Oracle VM Server, Parallels Server, Sun&#8217;s Logical Domains Hypervisor, e finalmente, o Kernel-based Virtual Machine (KVM), disponível nas distribuições empresariais de Linux. Todos esses softwares permitem a virtualização do sistema operacional hospedeiro, bem como o sistema operacional convidado, exigindo a modificação de seu núcleo.</p>
<p style="text-align:justify;">Já no <strong>segundo modelo</strong>,<strong> hospedado</strong>, encaixam-se nomes como VMware Server, VMware Workstation, VMware Fusion, o projeto livre QEMU, Microsoft Virtual PC e Microsoft Virtual Server, Sun&#8217;s VirtualBox, Parallels Workstation e Parallels Desktop. Estes software virtualizam qualquer sistema opercional comum, sem a necessidade de sua modificação.</p>
<p style="text-align:justify;"><strong>Virtualização e instâncias de sistemas operacionais</strong></p>
<p style="text-align:justify;">Especificamente, o Sun Solaris e o BSD, implementam um outro modelo de virtualização de sistema operacional.</p>
<p style="text-align:justify;">O Sun Solaris (a partir de 2005) implementa Zones, definido como um abstração virtual do sistema operaciona, onde aplicações executam. Tais aplicações são protegidas e separadas umas das outras. Através de uma única instância principal do sistema operacional, pode-se gerencial diversas Zones (como instâncias do mesmo sistema).</p>
<p style="text-align:justify;">O uso do gerenciamento de recursos da arquitetura em questão, faz com que uma Zone seja chamada de Container, criando o conceito de Solaris Containers. A maioria das pessoas utilizam  os dois termos, sem fazer distinção entre eles.</p>
<p style="text-align:justify;">Existem dois tipos de Zones. As Zones nativas, criam instâncias do mesmo sistema operacional (Solaris), enquanto as Branded Zones, disponibilizam uma insfra estrutura virtual de hardware, para que seja possível criar instâncias de outros sistemas operacionais, como o Linux, por exemplo.</p>
<p style="text-align:justify;">Da mesma maneira, existem os Jails (que vieram antes dos Containers, em 1990, criados a partir do FreeBSD). Jail implementa o mesmo sentido de abstração do sistema operacional, criando instâncias desse, fazendo com que haja muito mais flexibilidade do uso do sistema operacional, em um ambiente de produção.</p>
<p style="text-align:justify;">Acredito que o uso de instâncias de sistema operacional, tenha tido como principal motivação, a flexibilidade de modelos de segurança que o *nix não conseguia prover, mas isso é um outro assunto.</p>
<p style="text-align:justify;">Para terminar o post, volto a dizer que virtualização pode ser vista de diversas formas, e existem diversos modelos e ferramentas para implementar. Vão desde abstrações de hardware de entrada e saída, até abstrações do sistema operacional. O que vale realmente realmente,  é estudar e medir as necessidades e as disponibilidades, para que seja feita a escolha certa.</p>
<p style="text-align:justify;">O modelo de cloud computing se encaixa em virtualizações. É um tema recente, poderoso, mas com a escolha errada, pode se tornar extremamente perigoso.</p>
<p style="text-align:justify;">Até a próxima!</p>
<p>Referências:</p>
<p style="text-align:justify;">http://en.wikipedia.org/wiki/Virtualization</p>
<p style="text-align:justify;">http://en.wikipedia.org/wiki/Hypervisor</p>
<p style="text-align:justify;">http://www.sun.com/servers/coolthreads/ldoms/index.jsp</p>
<p style="text-align:justify;">http://en.wikipedia.org/wiki/Paravirtualization</p>
<p style="text-align:justify;">http://www.ibm.com/developerworks/br/library/l-hypervisor/index.html</p>
<p style="text-align:justify;">http://blogs.technet.com/lpalma/archive/2008/10/01/paravirtualiza-o-emula-o-bare-metal.aspx</p>
<p style="text-align:justify;">http://www.intel.com/products/desktop/adapters/pro1000gt/pro1000gt-overview.htm</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Suse Linux System Admin]]></title>
<link>http://spillerlaszlo.wordpress.com/?p=2204</link>
<pubDate>Thu, 15 Oct 2009 07:32:27 +0000</pubDate>
<dc:creator>Spiller László</dc:creator>
<guid>http://spillerlaszlo.wordpress.com/?p=2204</guid>
<description><![CDATA[- Vállalati Linux (SUSE, RedHat) disztribúcióval rendszergazdai tapasztalat (min. 1-2 év) - XEN virt]]></description>
<content:encoded><![CDATA[- Vállalati Linux (SUSE, RedHat) disztribúcióval rendszergazdai tapasztalat (min. 1-2 év) - XEN virt]]></content:encoded>
</item>
<item>
<title><![CDATA[Nuevo documento "Introducción a la virtualización"]]></title>
<link>http://albertomolina.wordpress.com/2009/10/04/nuevo-documento-introduccion-a-la-virtualizacion/</link>
<pubDate>Sun, 04 Oct 2009 08:54:37 +0000</pubDate>
<dc:creator>albertomolina</dc:creator>
<guid>http://albertomolina.wordpress.com/2009/10/04/nuevo-documento-introduccion-a-la-virtualizacion/</guid>
<description><![CDATA[En la sección Manuales se ha incluido un nuevo documento con una introducción a la virtualización, d]]></description>
<content:encoded><![CDATA[En la sección Manuales se ha incluido un nuevo documento con una introducción a la virtualización, d]]></content:encoded>
</item>
<item>
<title><![CDATA[Private cloud setup]]></title>
<link>http://aakash19.wordpress.com/2009/09/30/private-cloud-setup/</link>
<pubDate>Wed, 30 Sep 2009 11:13:54 +0000</pubDate>
<dc:creator>aakash</dc:creator>
<guid>http://aakash19.wordpress.com/2009/09/30/private-cloud-setup/</guid>
<description><![CDATA[Setup a private cloud using open source eucalyptus on Ubuntu 9.04 jaunty OS. I used &#8216;xen 3.0]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Setup a private cloud using open source eucalyptus on Ubuntu 9.04 jaunty OS. I used &#8216;xen 3.0&#8242; instead of default package &#8216;kvm&#8217; for Ubuntu 9.04.<br />
This Private cloud setup uses &#8216;STATIC&#8217; mode and list of IPs and machine address are provided to the Eucalyptus installation to be used, because I was using the existing subnet and pick the available IPs from the subnet.</p>
<h3>Contents</h3>
<ul>
<li><a href="#setup_private_cloud">Cloud &#8211; setup private cloud</a></li>
<li><a href="#Technical_background">Technical background</a></li>
<li><a href="#Front_end_setup">Front end setup</a></li>
<li><a href="#Back_end_setup">Back end setup</a></li>
<li><a href="#Cloud_integration">Cloud integration</a></li>
<li><a href="#euca2ools_setup">ec2  or euca2ools setup</a></li>
<li><a href="#Create_guest_machine">Create guest machine</a></li>
<li><a href="#Creating_EMIs">Creating EMIs</a></li>
<li><a href="#Run_instance">Run instance</a></li>
<li><a href="#Troubleshoot">Troubleshoot</a></li>
<li><a href="#Useful_Commands">Useful Commands</a></li>
</ul>
<hr size="2" /><a name="setup_private_cloud"></a></p>
<h2>Cloud &#8211; setup private cloud</h2>
<p>My interest in cloud computing started when I worked on a project in <a href="http://impetus.com/">Impetus Infotech</a>. Project was to deploy application on Amazon cloud and setup the clusters for MySql, Apache and other technologies to load balance. While working on Amazon cloud I got some insights of the cloud computing and various underlying technologies.</p>
<p>Here I am going to illustrate all the steps that I have followed to setup cloud. I will be describing the cloud packages, how to setup front end and back end setup, cloud implementation, ec2  or euca2ools setup, creating xen-supported guest machine, creating EMIs for eucalyptus, run/stop instances and some xen/eucalyptus/ec2 useful command.</p>
<hr size="2" /><a name="Technical_background"></a></p>
<h2>Technical background</h2>
<p>When I start on cloud setup, I was sure I will go for XEN rather than KVM. Then came the Ubuntu jaunty as this version was built for the virtualization and designed with built-in support. I used eucalyptus, an opensource tool that provide Amazon like features and is EC2 tools compliance. So I starts researching the contents on all these technologies. The more I study, the more I got confident to use these technologies for cloud setup.</p>
<p>Though, Ubuntu prefers KVM for the visualization support and has added to the default packages. But limitation of KVM to run only virtualization extensions (Intel VT or AMD-V) processors only(see <a href="http://www.linux-kvm.org/page/Main_Page">http://www.linux-kvm.org/page/Main_Page</a>), makes my decision to use XEN for virtualization.</p>
<p><strong>Xen, </strong>is the underlaying technology used by eucalyptus. Xen hypervisor allows several guest operating systems to be executed on the same computer hardware concurrently. Xen partitions a single physical machine into multiple virtual machines, to provide server consolidation and utility computing. Existing applications and binaries run unmodified. The hypervisor controls the MMU, CPU scheduling, and interrupt controller, presenting a virtual machine to guests.</p>
<p>The first guest operating system, called in Xen terminology &#8220;domain 0&#8243; (dom0), is booted automatically when the hypervisor boots and given special management privileges and direct access to all physical hardware by default. The system administrator can log into dom0 in order to manage any further guest operating systems, called &#8220;domain U&#8221; (domU) in Xen terminology.</p>
<p>Eucalyptus has 3 major packages.<br />
<strong>Cluster Controller</strong>:  provides support for the virtual network overlay<br />
<strong>Cloud Controller</strong>: includes the front-end services and the Walrus storage system.<br />
<strong>Node Controller</strong>: that interacts with XEN to manage individual VMs.</p>
<p>The basic architecture how client, cloud controller, cluster controller and node controllers communicate with each other in a eucalyptus setup.</p>
<p><em>&#8212;-&#62; </em> <strong><em>eucalyptus-nc</em></strong></p>
<p>&#124;</p>
<p>&#124;</p>
<p><strong><em>Client</em></strong> &#8212;&#62; <strong><em>eucalyptus-cloud</em></strong> <em>&#8212;-&#62;</em> <strong><em>eucalyptus-cc</em></strong> &#8212;&#8212;&#62;  <strong><em>eucalyptus-nc</em></strong><em> </em></p>
<p>&#124;</p>
<p>&#124;</p>
<p>&#8212;-&#62;  <strong><em>eucalyptus-nc</em></strong></p>
<p>Packages provided by Ubuntu are: eucalyptus-cloud, eucalyptus-cc and eucalyptus-nc.</p>
<p>In my private cloud setup, the front end runs both eucalyptus-cloud and eucalyptus-cc and 3 machines act as node controller and run eucalyptus-nc.</p>
<hr size="2" /><a name="Front_end_setup"></a></p>
<h2>Front end setup</h2>
<p>I have setup a Dell machine as front end. Front end runs both <em>eucalyptus-cloud</em> and <em>eucalyptus-cc. So I install both packages on this machine. </em></p>
<p><em>Following are the steps for installing the front end:</em></p>
<h4>Step 1: Prepare a raw ubuntu OS system.</h4>
<p>Install Ubuntu 9.04 on a machine. Select ssh server to be installed on the machine by default, so We can connect to machine remotely.</p>
<h4>Step 2: Install postfix.</h4>
<p>Postfix is a mail server. Eucalyptus send mails to users that are added by admin on eucalyptus web interface. So we install postfix that eucalyptus will use as mail server.</p>
<p>Steps to install postfix and to setup configurations and testing successful Postfix installation<br />
<strong><em>command#</em></strong><em> apt-get install postfix</em></p>
<p><strong><em>Set configurations</em></strong><br />
<strong><em>command#</em></strong><em> sudo dpkg-reconfigure postfix</em></p>
<p><em> Set following parameters with given values.</em><code><br />
</code></p>
<p><code></p>
<blockquote><p>General type of mail configuration: <strong><em>Internet Site</em></strong><br />
NONE doesn't appear to be requested in current config<br />
System mail name: <strong><em>server1.example.com</em></strong><br />
Root and postmaster mail recipient: <strong><em>&#60;admin_user_name&#62; (Optional)</em></strong><br />
Other destinations for mail: <strong><em>server1.example.com, example.com, localhost.example.com, localhost</em></strong><br />
Force synchronous updates on mail queue?: <strong><em>No</em></strong><br />
Local networks: <strong><em>127.0.0.0/8</em></strong><br />
Yes doesn't appear to be requested in current config<br />
Mialbox size limit (bytes): <strong><em>0</em></strong><br />
Local address extension character: <strong><em>+</em></strong><br />
Internet protocols to use: <strong><em>all</em></strong></p></blockquote>
<p></code></p>
<p><strong><em>Test postfix installation</em></strong><br />
<strong><em> </em></strong><strong><em>command# </em></strong><em>EHLO localhost</em><code><br />
</code></p>
<p><code></p>
<blockquote>
<blockquote><p>mail from: root@localhost<br />
rcpt to: akashsharmaa@gmail.com<br />
data<br />
subject: your sub (press enter twice)<br />
Type your message and finish with "." then Enter<br />
Finish with "Quit"</p></blockquote>
</blockquote>
<p></code><br />
Check your mail (if received your mail is working)</p>
<h4>Step 3 Install Cloud and Cluster controller</h4>
<p>Install the packages provided by Ubuntu, all the dependencies will be installed automatically by package manager.</p>
<p><strong><em>command#</em></strong> apt-get install eucalyptus-cloud eucalyptus-cc</p>
<h4>Step 4 Install dhcp server</h4>
<p>Install the DHCP server which is used by eucalyptus for assigning the IPs to instances. DHCP server should not be in running state and set the DHCP server not to run when system is booted up again.</p>
<p><strong><em>command#</em></strong> apt-get install dhcp3-server<br />
<strong><em>command#</em></strong> /etc/init.d/dhcdbd stop<br />
<strong><em>command#</em></strong> update-rc.d -f dhcdbd remove</p>
<p>Set the DHCP server path in the eucalyptus config file &#8216;<strong><em>/etc/eucalyptus/eucalyptus.conf</em></strong>&#8216;<br />
<em>VNET_DHCPDAEMON=&#8221;/usr/sbin/dhcpd3&#8243;</em></p>
<h4>Step 5 Eucalyptus configuration</h4>
<p>Set the <strong>static</strong> mode for eucalyptus so that eucalyptus uses IP&#8217;s from the pool of IP&#8217;s provided in the config file and use the machine addresses provided along with IPs.</p>
<p>Configuration file for eucalyptus is &#8216;<strong><em>/etc/eucalyptus/eucalyptus.conf</em></strong>&#8216;<br />
open <strong><em>/etc/eucalyptus/eucalyptus.conf</em></strong> and set the following parameters</p>
<p><strong><em> VNET_INTERFACE=&#8221;peth0&#8243;</em></strong><br />
<strong><em> VNET_BRIDGE=&#8221;eth0&#8243;</em></strong></p>
<p>Locate &#8216;<strong>kvm</strong>&#8216; and replace to &#8216;<strong>xen</strong>&#8216;<br />
locate <strong><em>VNET_MODE=&#8221;SYSTEM&#8221;</em></strong> and disable it<br />
locate <strong><em>VNET_MODE=&#8221;STATIC&#8221;</em></strong> and enable it</p>
<p>Add machine and IPs for instances to be used and change the netowork setting to current network settings<code><br />
</code></p>
<p><code></p>
<blockquote><p>VNET_MODE="STATIC"<br />
VNET_SUBNET="192.168.145.0"<br />
VNET_NETMASK="255.255.255.0"<br />
VNET_BROADCAST="192.168.145.255"<br />
VNET_ROUTER="192.168.145.1"<br />
VNET_DNS="192.168.150.42"<br />
VNET_MACMAP="AA:DD:11:CE:FF:ED=192.168.145.73 AA:DD:11:CE:FF:EE=192.168.145.75  AA:DD:11:CE:FF:EF=192.168.145.77"</p></blockquote>
<p></code></p>
<h4>Step 6 Other configurations</h4>
<p>Edit : <strong><em>/usr/share/eucalyptus/gen_libvirt_xml </em></strong><br />
Locate all &#8216;<strong>sda</strong>&#8216; to &#8216;<strong>xvda</strong>&#8216;</p>
<p>Edit : <strong><em>/etc/xen/xend-config.sxp</em></strong><br />
<code><br />
</code></p>
<p><code></p>
<blockquote><p>(xend-http-server yes)<br />
gateway   = 192.168.145.1<br />
netmask   = 255.255.255.0<br />
broadcast = 192.168.145.255</p></blockquote>
<p></code></p>
<h4>Step 7 Rebbot the system to take effect</h4>
<h4>Step 8 Cloud configuarions</h4>
<p>Once eucalyptus front end has been installed, we can use the eucalyptus web interface and setup cluster and set other parameters.</p>
<p>Eucalyptus cloud web URL: <strong>https://&#60;front end ip&#62;:8443/</strong></p>
<p>Under configuration tab add cluster name<br />
Set <strong>host</strong> to &#8216;<strong>localhost</strong>&#8216;</p>
<p>Create <strong>kernel</strong> and <strong>ramdisk</strong> images and set in eucalyptus site. (Procedure to create images will be described later in the page)</p>
<p>Restart the eucalyptus daemon to take effects</p>
<hr size="2" /><a name="Back_end_setup"></a></p>
<h2>Back end setup</h2>
<p>On the systems where we want to run instances, we will install node controller and XEN 3.0. Since I used the XEN as virtualization package, I install the node controller package <em>eucalyptus-nc </em>manually. I installed required dependencies using the package manager <strong><em>apt-get, </em></strong><em>but the eucalyptus-nc was installed by donwloading and manually installing bypassing dependencies list.</em></p>
<h4>Step 1 Hardware compatibility</h4>
<p><em>eucalyptus-nc requires </em><em>&#8216;<strong>libvirt-bin</strong>&#8216; package. Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). More info can be found at: http://libvirt.org/</em></p>
<p><em>To install &#8216;<strong>libvirt-bin</strong>&#8216; package, certain flags should be supported by CPU.</em></p>
<p><strong><em>command#</em></strong> <em>egrep &#8216;(vmx&#124;svm)&#8217; /proc/cpuinfo</em><br />
[if no print], libvirt-bin cant be installed</p>
<p>Stop the apparmor for Ubuntu System<br />
<strong><em>command#</em></strong> /etc/init.d/apparmor stop<br />
<strong><em>command#</em></strong> update-rc.d -f apparmor remove</p>
<h4>Step 2 Install XEN package</h4>
<p>I am using the XEN virtualization package instead of Ubuntu&#8217;s default <strong>KVM</strong>, I install the eucalyptus-nc dependencies manually.<br />
<strong><em>command#</em></strong> apt-get install iproute  iptables module-init-tools python2.5 python2.6<br />
<strong><em>command#</em></strong> apt-get  install xen-utils<br />
<strong><em>command#</em></strong> apt-get  install ubuntu-xen-server</p>
<h4>Step 3 Install libvirt-bin package</h4>
<p><em>eucalyptus-nc requires </em><em>&#8216;<strong>libvirt-bin</strong>&#8216; package. Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). More info can be found at: http://libvirt.org/</em></p>
<p><strong><em>command#</em></strong> apt-get install adduser bridge-utils dnsmasq-base iptables libsasl2-2 libxen3 logrotate<br />
<strong><em>command#</em></strong> apt-get install netcat-openbsd libavahi-client3 libavahi-common3 libc6 libdbus-1-3<br />
<strong><em>command#</em></strong> apt-get install libgcrypt11 libgnutls26 libhal1 libpolkit-dbus2 libpolkit2 libreadline5 libselinux1<br />
<strong><em>command#</em></strong> apt-get install  libtasn1-3 libvirt0    libxml2   zlib1g policykit</p>
<p>Download the libvirt-bin package from URL: <a href="http://packages.ubuntu.com/jaunty/libvirt-bin">http://packages.ubuntu.com/jaunty/libvirt-bin</a></p>
<p>I used i386 package, <strong><em>http://mirrors.kernel.org/ubuntu/pool/main/libv/libvirt/libvirt-bin_0.6.1-0ubuntu5_i386.deb</em></strong></p>
<p>Install lib-virt<br />
<strong><em>command#</em></strong> dpkg -i libvirt-bin_0.6.1-0ubuntu5_i386.deb<br />
<strong><em>command#</em></strong> sudo adduser $USER libvirtd</p>
<h4>Step 4 Install eucalyptus node package</h4>
<p><strong><em>command#</em></strong> apt-get install apache2  eucalyptus-common eucalyptus-gl libapache2-mod-axis2c<br />
<strong><em>command#</em></strong> apt-get install libaxis2c0 librampart0 dhcp3-server vlan aoetools<br />
<strong><em>command#</em></strong> apt-get install libc6 libcurl3-gnutls  libvirt0  zlib1g</p>
<p>Download eucalyptus-nc package from Ubuntu package repository.</p>
<p><strong>eucalyptus-nc</strong> package URL: <a href="http://packages.ubuntu.com/jaunty/eucalyptus-nc">http://packages.ubuntu.com/jaunty/eucalyptus-nc</a></p>
<p>Download the i386 package from URL:<br />
<strong><em> http://mirrors.kernel.org/ubuntu/pool/universe/e/eucalyptus/eucalyptus-nc_1.5~bzr266-0ubuntu2_i386.deb</em></strong></p>
<p><strong><em>command#</em></strong> dpkg -i eucalyptus&#60;version&#62;</p>
<h4>Step 5 Grub loader for Xen Kernel</h4>
<p>Setup grub menus and load xen images to boot into XEN kernel.<br />
Download the modules and image from URLs:<br />
<strong><em> wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-modules-2.6.26-2-xen-686_2.6.26-15_i386.deb</em></strong><br />
<strong><em>wget http://ftp.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.26-2-xen-686_2.6.26-15_i386.deb</em></strong></p>
<p><strong><em>command#</em></strong> sudo dpkg -i linux-modules-2.6.26-2-xen-686_2.6.26-15_i386.deb<br />
<strong><em>command#</em></strong> sudo dpkg -i linux-image-2.6.26-2-xen-686_2.6.26-15_i386.deb</p>
<h4>Step 6 Eucalyptus Configuerations</h4>
<p>Stop the eucalyptus daemon and set the configuration depending upon your installation.<br />
<strong><em>command#</em></strong> /etc/init.d/eucalytpus-nc stop</p>
<p>Edit : <strong><em>/etc/sysctl.conf</em></strong><br />
(uncomment net.ipv4.ip_forward=1)</p>
<p>Edit : <strong><em>/etc/eucalyptus/eucalyptus.conf</em></strong><br />
(set)<br />
<code><br />
</code></p>
<p><code></p>
<blockquote><p>VNET_BRIDGE="eth0"<br />
VNET_INTERFACE="peth0"<br />
HYPERVISOR="xen"<br />
VNET_MODE="STATIC"</p></blockquote>
<p></code></p>
<p>Edit : <strong><em>/usr/share/eucalyptus/gen_libvirt_xml </em></strong><br />
locate &#8216;<strong>sda&#8217; s</strong> and replace to &#8216;<strong>xvda</strong>&#8216; s</p>
<p><strong><em>for static ips</em></strong><br />
Edit : <strong><em>/etc/xen-tools/xen-tools.conf</em></strong><br />
<code><br />
</code></p>
<p><code></p>
<blockquote><p>gateway 192.168.145.1<br />
broadcast 192.168.145.255<br />
netmask 255.255.255.0</p>
<p>(xend-http-server yes)<br />
(xend-unix-server yes)</p></blockquote>
<p></code></p>
<p><strong><em>command#</em></strong> /etc/init.d/eucalyptus-nc start</p>
<hr size="2" /><a name="Cloud_integration"></a></p>
<h2>Cloud integration</h2>
<p>Now, we have front controller and node controllers ready. We have to setup now the communication between cluster controller and node controllers. We will add the nodes list to the cloud, so cloud know about the available node.</p>
<p><strong><em>command#</em></strong> sudo euca_conf -addnode &#60;node ip&#62; &#60;node ip&#62; &#60;node ip&#62;</p>
<p>This will add nodes to cloud config file and replicates the permission and certificate files to the nodes to be able to have password-less communication between nodes and cloud.</p>
<p>To check the cloud installation, and node communication, you can run &#8216;<strong>euca-describe-availability-zones verbose</strong>&#8216; command and check if all the nodes are listed in output.</p>
<hr size="2" /><a name="euca2ools_setup"></a></p>
<h2>ec2  or euca2ools setup</h2>
<h4>Euca2ools setup</h4>
<p>Install dependencies<br />
<strong><em>command#</em></strong> apt-get install curl libopenssl-ruby ruby<br />
Download the appropriate tarball from <strong><em>http://open.eucalyptus.com/downloads </em></strong></p>
<h4>Steps</h4>
<p><strong><em> command#</em></strong> tar zxvf euca2ools-1.0-*.tar.gz<br />
<strong><em> command#</em></strong> cd euca2ools-1.0-* (Replace this with the actual directory name)<br />
<strong><em> command#</em></strong> sudo -s<br />
<strong><em> command#</em></strong> echo deb file://${PWD} ./ &#62;&#62; /etc/apt/sources.list<br />
<strong><em> command#</em></strong> apt-get update</p>
<p><strong><em> command#</em></strong> apt-get install euca2ools<br />
<em>WARNING: The following packages cannot be authenticated!</em><br />
<em> </em><em>&#8230;</em><br />
<em> Install these packages without verification [y/N]? y</em></p>
<h4>ec2 tools Setup</h4>
<p>Eucalyptus supports ec2-ami-tools-1.3-26357 and ec2-api-tools-1.3-30349 versions of ec2 tools.</p>
<p>Install dependencies<br />
Install <strong>jdk1.6.0_12</strong> java version.</p>
<p>Steps<br />
Download ec2-ami-tools-1.3-26357 and ec2-api-tools-1.3-30349.<br />
unzip these archives<br />
Copy the &#8216;lib&#8217; and &#8216;bin&#8217; folders under ~/.euca folder.</p>
<p><strong>Export parameters</strong><br />
<code><br />
</code></p>
<p><code></p>
<blockquote><p>export EC2_HOME=~/.euca<br />
export JAVA_HOME=&#60;directory&#62;/jdk1.6.0_12<br />
export PATH=$PATH:&#60;directory&#62;/jdk1.6.0_12/bin<br />
export PATH=$PATH:~/.euca/bin</p></blockquote>
<p></code></p>
<h4>Set URL and credentials</h4>
<p>Download &#8216;<strong>euca2-admin-x509.zip</strong>&#8216; file from cloud site at <strong><em>https://&#60;front end ip&#62;:8443/</em></strong>.<br />
Unzip this archive under ~/.euca folder and export the eucarc file.</p>
<p><strong><em> command#</em></strong> source ~/.eucarc</p>
<hr size="2" /><a name="Create_guest_machine"></a></p>
<h2>Create guest machine</h2>
<p>I create my image using vmbuilder.<br />
More info on vmbuilder can be found on: <em>https://help.ubuntu.com/8.04/serverguide/C/ubuntu-vm-builder.html</em></p>
<h4>Steps</h4>
<p>Select a directory where all files will be stored. I used &#8216;<strong>/usr/akash/cloud</strong>&#8216;</p>
<p>Create a &#8216;<strong>part</strong>&#8216; file under directory.<br />
The content of &#8216;<strong>part</strong>&#8216; is following:<br />
root 400<br />
/mnt/ephemeral 0 /dev/sda2<br />
swap 1 /dev/sda3</p>
<p>Create &#8216;<strong>firstboot</strong>&#8216; file, which is run first time, instance boots up.<br />
apt-get -y install openssh-server</p>
<p>Create the image.<br />
<strong><em>command# vmbuilder xen ubuntu  &#8211;firstboot ./firstboot &#8211;mirror=http://192.168.152.87:9999/ubuntu &#8211;addpkg ssh &#8211;rootsize=4096 &#8211;arch i386 &#8211;verbose &#8211;debug </em></strong><br />
This command creates the image file that i used for creating emi. You can found the image under &#8216;<strong><em>ubuntu-xen</em></strong>&#8216; folder.<br />
This image  can be tested, if its compatible to <strong><em>xen.</em> Use xm create</strong> command.</p>
<p><strong><em>command# xm create /usr/akash/cloud/ubuntu-xen/xen.cfg</em></strong></p>
<p>Check the status of emi using <strong>xm list command.</strong><br />
<strong><em>command# </em></strong>xm list<br />
If you see your emi ID in the output, your image can be run with <strong>XEN.</strong></p>
<hr size="2" /><a name="Creating_EMIs"></a></p>
<h2>Creating EMIs</h2>
<p>Now, cloud is setup, we should create images that can be run using eucalyptus. We will create emis for kernel, ramdisk and instance.</p>
<h4>kernel emi</h4>
<p><strong> Steps</strong><br />
<strong><em>command# </em></strong>mkdir kernel<br />
<strong><em>command# </em></strong>ec2-bundle-image -i vmlinuz-2.6.28-13-server -d ./kernel &#8211;kernel true<br />
<strong><em>command# </em></strong>ec2-upload-bundle -b eucaKernel -m ./kernel/vmlinuz-2.6.28-13-server.manifest.xml<br />
<strong><em>command# </em></strong>EKI=`ec2-register eucaKernel/vmlinuz-2.6.28-13-server.manifest.xml &#124; awk &#8216;{print $2}&#8217;`<br />
<strong><em>command# </em></strong>echo $EKI</p>
<h4>ramdisk emi</h4>
<p><strong> Steps</strong><br />
<strong><em>command# </em></strong>mkdir ramdisk<br />
<strong><em>command# </em></strong>ec2-bundle-image -i initrd.img-2.6.28-13-server -d ./ramdisk &#8211;ramdisk true<br />
<strong><em>command# </em></strong>ec2-upload-bundle -b eucaRamdisk -m ./ramdisk/initrd.img-2.6.28-13-server.manifest.xml<br />
<strong><em>command# </em></strong>ERI=`ec2-register eucaRamdisk/initrd.img-2.6.28-13-server.manifest.xml &#124; awk &#8216;{print $2}&#8217;`<br />
<strong><em>command# </em></strong>echo $ERI</p>
<h4>instance emi</h4>
<p><strong> Steps</strong><br />
<strong><em>command# </em></strong>mkdir image<br />
<strong><em>command# </em></strong>ec2-bundle-image -i root.img -d ./image<br />
<strong><em>command# </em></strong>ec2-upload-bundle -b plabImage -m ./image/root.img.manifest.xml<br />
<strong><em>command# </em></strong>EMI=`ec2-register plabImage/root.img.manifest.xml &#124; awk &#8216;{print $2}&#8217;`<br />
<strong><em>command# </em></strong>echo $EMI</p>
<hr size="2" /><a name="Run_instance"></a></p>
<h2>Run instance</h2>
<p>Add <strong>key pair</strong><br />
<strong><em>command# </em></strong>ec2-add-keypair mykey &#62; ~/.euca/mykey.priv<br />
<strong><em>command# </em></strong>chmod 0600 ~/.euca/mykey.priv<br />
<strong><em>command# </em></strong>ec2-run-instances emi-73FD0EAD -k mykey &#8211;kernel eki-8D701398 &#8211;ramdisk eri-E47F14E8 &#8211;instance-type m1.xlarge</p>
<hr size="2" /><a name="Troubleshoot"></a></p>
<h2>Troubleshoot</h2>
<p>Once I started installing eucalyptus, I encounter many issues and face problems because of no/less help available. To resolve the issues I have to google or search http://open.eucalyptus.com forums or post my issues in forums to get the solution. I will try to list some of the issues thats I face, it might be of some help if you got similar issues.</p>
<h4>Eucalyptus Logs</h4>
<p>When I got any issue, my first area of interest was the logs generated by eucalyptus and its dependencies. Eucalyptus maintain all the logs under pre-defined directory &#8216;<strong>/var/log/eucalyptus</strong>&#8216;.</p>
<p><strong><em>euca_test_nc.log</em></strong><br />
On node controllers, if there is any issue with starting <strong><em>eucalytus-nc</em></strong> command, check e<em>uca_test_nc.log </em>file for any errors. e<em>uca_test_nc.log file contains all the errors eucalytus-nc encounter while starting.</em></p>
<p><strong>nc.log</strong><br />
<em>nc.log </em>file contains all the logs generated in cluster-node communication.<br />
While starting a instance, initially I wasnt aware of buggy log handling of eucalyptus and it takes a lot time to understand this. While starting instance, and keep on adding the logs for non-existing network while instance is currently in booting up. Because of this issue, I got following in the <em>nc.log </em>file</p>
<p>[EUCAINFO  ] doDescribeResource() invoked<br />
[EUCAINFO  ] doDescribeResource() invoked<br />
[EUCAERROR ] <strong>libvirt: Domain not found (code=42)</strong></p>
<p>which indicates, domain can not be started, but after some time this error is resolved automatically when network is started for the instance. So we can omit this error message in nc.log file.</p>
<h4>Cloud resources</h4>
<p>Some times when you install the eucalyptus and cluster, cloud and nodes are running successfully on systems. Still you can not run instances, this may be issue with the node resource registration with the cluster. Or all the resources has been consumed by the instances. You can check the resource status for cluster using &#8216;ec2-describe-availability-zones verbose&#8217; command.</p>
<p><strong><em>command# </em></strong>ec2-describe-availability-zones verbose</p>
<p>Output of above command could be like this.<br />
AVAILABILITYZONE        iCloud    UP localhost<br />
AVAILABILITYZONE        &#124;- vm types     free / max   cpu   ram  disk<br />
AVAILABILITYZONE        &#124;- m1.small     0002 / 0002   1    128    15<br />
AVAILABILITYZONE        &#124;- c1.medium    0002 / 0002   1    256    15<br />
AVAILABILITYZONE        &#124;- m1.large     0001 / 0001   2    512    17<br />
AVAILABILITYZONE        &#124;- m1.xlarge    0001 / 0001   2   1024    20<br />
AVAILABILITYZONE        &#124;- c1.xlarge    0000 / 0000   4   2048    20<br />
AVAILABILITYZONE        &#124;- 192.168.145.71       certs[cc=true,nc=true] @ Wed Sep 30 02:12:15 EDT 2009</p>
<p>From the output, we can clearly visualize the resource management, free/used resources and number of instance we can run. Output also lists the nodes registered/available currently to cluster.</p>
<h4>Instance issues</h4>
<p>Some times, I got stuck with instance related issues. When I start instance using ec2 tools, instance will die and <strong>nc.log </strong> or any other log file doesnt provide useful info. So, best way to investigate issue and save time to run the instance using <strong>xm </strong> command provided by <strong>xen</strong>.</p>
<p>Common steps are,<br />
- copy the image file used to create emi to any of the node.<br />
- create xen conf file, check following xen config file content<br />
<code><br />
</code></p>
<blockquote><p><code> </code></p>
<blockquote><p><code> kernel = '/boot/vmlinuz-2.6.28-13-server'<br />
ramdisk = '/boot/initrd.img-2.6.28-13-server'</p>
<p>memory = 128<br />
root = '/dev/xvda1 ro'</p>
<p>disk = [<br />
'file:/usr/akash/cloud/ubuntu-xen/root.img,xvda1,w',<br />
'file:/usr/akash/cloud/ubuntu-xen/swap.img,xvda2,w'<br />
]</p>
<p>name = 'Ubuntu'<br />
dhcp    = 'dhcp'<br />
vif = ['']</p>
<p>on_poweroff = 'destroy'<br />
on_reboot   = 'restart'<br />
on_crash    = 'restart'</p>
<p></code><code> extra = 'xencons=tty console=tty1 console=hvc0'</code></p></blockquote>
</blockquote>
<p>- run the instance using <strong>xm</strong> command.<br />
<strong><em>command# xm create xen.cfg</em></strong></p>
<p>- while xm create is starting instance, use console command to check the console output.<br />
<em><strong>command#</strong> xm console <strong>Ubuntu</strong></em><br />
<strong><em>Ubuntu</em> &#8211; is the name option provided in xen.cfg file</strong></p>
<hr size="2" /><a name="Useful_Commands"></a></p>
<h2>Useful commands</h2>
<h3>Xen commands</h3>
<p><strong><em>command#</em></strong><em> xm list</em><br />
list all the available Xen instances you&#8217;re allowed to control</p>
<p><strong><em>command# xm create xen.cfg</em></strong><br />
<em>run the instance using <strong>xen.cfg</strong> file options</em></p>
<p><em> <strong>command#</strong> xm status</em><br />
current status of your Xen guest</p>
<p><em> <strong>command#</strong> xm console &#60;domain id&#62;</em><br />
allow you to access your Xen guest&#8217;s console</p>
<p><em> <strong>command#</strong> xm restore &#60;domain file&#62;</em><br />
Restore a domain from a saved state</p>
<p><em> <strong>command#</strong> xm save &#60;domain id&#62;</em><br />
Save a domain state to restore later</p>
<p><em> <strong>command#</strong> xm pause &#60;domain id&#62;</em><br />
Pause execution of a domain</p>
<p><em> <strong>command#</strong>#  xm shutdown &#60;domain id&#62;</em><br />
Shutdown a domain</p>
<p><em> <strong>command#</strong> xm destroy &#60;domain id&#62;</em><br />
Terminate a domain immediately</p>
<p><em> <strong>command#</strong> xm mem-max &#60;domain id&#62;</em><br />
Set the maximum amount reservation for a domain</p>
<p><em> <strong>command#</strong> xm mem-set &#60;domain id&#62;</em><br />
Set the current memory usage for a domain</p>
<h3>EC2 command</h3>
<p><strong>Delete image</strong><br />
<strong><em>command#</em></strong><em> </em><em> ec2-deregister emi-55150E20</em></p>
<p><strong><em>command#</em></strong><em> </em><em> euca-delete-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY &#8211;url $S3_URL -b eucaubuntu -p image &#8211;clear</em></p>
<p><strong>Check cloud status, </strong>returns all the available nodes and resource available<br />
<strong><em>command#</em></strong><em> </em><em> </em>euca-describe-availability-zones verbose</p>
<h3>EUCALYPTUS Commands</h3>
<p><strong>Add new node</strong><br />
<strong><em>command#</em></strong><em> </em><em> </em>euca_conf -addnode 192.168.145.71</p>
<p><strong>Delete node</strong><br />
<strong><em>command# </em></strong><em> </em>euca_conf -delnode 192.168.145.71</p>
<p><strong>Sync keys between nodes and cluster controller</strong><br />
<strong><em>command# </em></strong><em> $EUCALYPTUS/usr/sbin/euca_sync_key -c$EUCALYPTUS/etc/eucalyptus/eucalyptus.conf</em></p>
<p><em> </em></p>
<h3 style="font-weight:normal;font-size:1.4em;font-family:georgia, times, serif;border-width:0;margin:0;padding:0 0 .5em;">References</h3>
<ol id="knol-references" style="border-width:0;margin:0;padding:0 0 0 2em;">
<li style="line-height:normal;border-width:0;margin:0;padding:0 0 .5em;"><a style="color:#3366cc;" href="https://help.ubuntu.com/community/Eucalyptus">Ubuntu eucalyptus setup</a></li>
<li style="line-height:normal;border-width:0;margin:0;padding:0 0 .5em;"><a style="color:#3366cc;" href="http://libvirt.org/">lib-virt</a></li>
<li style="line-height:normal;border-width:0;margin:0;padding:0 0 .5em;"><a style="color:#3366cc;" href="http://open.eucalyptus.com/">Eucalyptus</a></li>
<li style="line-height:normal;border-width:0;margin:0;padding:0 0 .5em;"><a style="color:#3366cc;" href="http://xen.org/">Xen</a></li>
<li style="line-height:normal;border-width:0;margin:0;padding:0 0 .5em;"><a style="color:#3366cc;" href="http://www.linux-kvm.org/">KVM</a></li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Xen i Debian Lenny]]></title>
<link>http://krystianwlosek.wordpress.com/2009/09/28/xen-i-gdebian-lenny/</link>
<pubDate>Mon, 28 Sep 2009 14:32:37 +0000</pubDate>
<dc:creator>krystianwlosek</dc:creator>
<guid>http://krystianwlosek.wordpress.com/2009/09/28/xen-i-gdebian-lenny/</guid>
<description><![CDATA[Instalując pod Xenem dystrubucję Debian Lenny można napotkać na kilka problemów. Oto one wraz z prze]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Instalując pod Xenem dystrubucję Debian Lenny można napotkać na kilka problemów. Oto one wraz z przepisem jak je rozwiązać:</p>
<ul>
<li>Zawieszanie się Lennego podczas bootowania. Problemem jest konsola, a właściwie błędne zdefiniowanie. Rozwiązaniem jest dodatnie następującego zaklęcia do pliku konfiguracyjnego wirtualkę xenową, następującej linii:<br />
<code>extra = 'console=hvc0 xencons=tty'</code></li>
<p></p>
<li>Jeżeli ktoś zainstaluje pakiet openssh-server, to podczas próby połączenia dostanie komunikat typu:<br />
<div id="attachment_44" class="wp-caption alignleft" style="width: 487px"><img src="http://krystianwlosek.wordpress.com/files/2009/09/xenlenny_sshd_brak_pty.jpg" alt="Server refused to allocate pty stdin: is not a tty" title="xenlenny_sshd_brak_pty" width="477" height="304" class="size-full wp-image-44" /><p class="wp-caption-text">Server refused to allocate pty stdin: is not a tty</p></div></p>
<p>Rozwiązaniem jest dopisanie w instancji Lennego, do pliku <strong>/etc/fstab</strong> następującej kombinacji znaków:<br />
<code>none    /dev/pts        devpts  rw      0 0</code></li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Error: Device 0 (vif) could not be connected. Hotplug scripts not working]]></title>
<link>http://ajclark.wordpress.com/2009/09/25/error-device-0-vif-could-not-be-connected-hotplug-scripts-not-working/</link>
<pubDate>Fri, 25 Sep 2009 19:43:52 +0000</pubDate>
<dc:creator>napta2k</dc:creator>
<guid>http://ajclark.wordpress.com/2009/09/25/error-device-0-vif-could-not-be-connected-hotplug-scripts-not-working/</guid>
<description><![CDATA[Are you running Xen / &#8220;xm create&#8221; and you get this error? Try this (RHEL/CentOS): servic]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Are you running Xen / &#8220;xm create&#8221; and you get this error?</p>
<p>Try this (RHEL/CentOS): service haldaemon start</p>
<p>- and have a nice day!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Установка Xen в CentOS]]></title>
<link>http://lfwblog.wordpress.com/2009/09/23/ustanovka-xen-v-centos/</link>
<pubDate>Wed, 23 Sep 2009 08:51:03 +0000</pubDate>
<dc:creator>kegling</dc:creator>
<guid>http://lfwblog.wordpress.com/2009/09/23/ustanovka-xen-v-centos/</guid>
<description><![CDATA[Недавно начал пробовать систему виртуализации Xen. После быстрого чтения мануалов, смог установить в]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Недавно начал пробовать систему виртуализации Xen. После быстрого чтения мануалов, смог установить виртуальную машину с Debian, что говорит о достаточно простой конфигурации (для начальных нужд). Итак, в качестве хостовой машины (dom0) будет использоваться CentOS 5.2, запущенный на компьютере с поддержкой аппаратной виртуализации (AMD-V или Intel-VT). Поддержка аппаратной виртуализации нужна, если вы собираетесь запускать Windows. Первое что необходимо, установить ядро с поддержкой Xen. В стандартных репозитариях CentOS есть такое ядро, kernel-xen версии 2.6.18-164 с Xen 3.0 </p>
<p><!--more-->
<pre></pre>
<pre><code>yum install kernel-xen</code></pre>
<p> После установки, в /boot появится ядро vmlinuz-2.6.18-164.el5xen. Теперь надо загрузиться с ним. Можео либо вручную его выбрать при загрузке grub, либо отредактировать файл /boot/grub/menu.lst и параметр default сделать равным 0 (по-умолчанию, kernel-xen автоматчиески прописывает себя первым ядром в меню grub). После загрузки с ядром Xen&#8217;а, работу его можно проверить наличием интерфейсов xenbr и vif в выводе ifconfig: </p>
<pre><code>[root@gigi ~]# ifconfig</code></pre>
<pre><code>peth1     Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF</code></pre>
<pre><code>inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link</code></pre>
<pre><code>UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1</code></pre>
<pre><code>RX packets:1484845567 errors:0 dropped:848 overruns:0 frame:0</code></pre>
<pre><code>TX packets:21318806 errors:0 dropped:0 overruns:0 carrier:0</code></pre>
<pre><code>collisions:0 txqueuelen:1000</code></pre>
<pre><code>RX bytes:107304750948 (99.9 GiB)  TX bytes:1495739489 (1.3 GiB)</code></pre>
<pre><code>Memory:dc080000-dc0a0000</code></pre>
<pre><code>vifxenv0  Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF</code></pre>
<pre><code>inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link</code></pre>
<pre><code>UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1</code></pre>
<pre><code>RX packets:17643569 errors:0 dropped:0 overruns:0 frame:0</code></pre>
<pre><code>TX packets:1467766901 errors:0 dropped:390908 overruns:0 carrier:0</code></pre>
<pre><code>collisions:0 txqueuelen:32</code></pre>
<pre><code>RX bytes:863953497 (823.9 MiB)  TX bytes:100008573528 (93.1 GiB)</code></pre>
<pre><code>vif0.1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF</code></pre>
<pre><code>inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link</code></pre>
<pre><code>UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1</code></pre>
<pre><code>RX packets:3588998 errors:0 dropped:0 overruns:0 frame:0</code></pre>
<pre><code>TX packets:1483233162 errors:0 dropped:0 overruns:0 carrier:0</code></pre>
<pre><code>collisions:0 txqueuelen:0</code></pre>
<pre><code>RX bytes:370499902 (353.3 MiB)  TX bytes:107193417651 (99.8 GiB)</code></pre>
<pre><code>xenbr1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF</code></pre>
<pre><code>UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1</code></pre>
<pre><code>RX packets:3930114 errors:0 dropped:0 overruns:0 frame:0</code></pre>
<pre><code>TX packets:0 errors:0 dropped:0 overruns:0 carrier:0</code></pre>
<pre><code>collisions:0 txqueuelen:0</code></pre>
<pre><code>RX bytes:2361888673 (2.1 GiB)  TX bytes:0 (0.0 b)</code></pre>
<p> А также, посмотреть вывод команды xm list, он должен выглядеть примерно так: </p>
<pre><code>[root@gigi ~]# xm list Name                                      ID Mem(MiB) VCPUs State   Time(s)Domain-0                                   0      512     4 r-----  45273.0</code></pre>
<p> Запись Domain-0 обозначает, что запущена машина с dom0 (наша хостовая) и значит, все работает <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Из известных проблем, следует упомянуть, не используйте сетевые карты Realtek на чипсетах 8169 и ему подобном, т.к. при использовании такой сетевой карты, не сохраняются сетевые параметры (не применяются при создании моста xenbr), а также MAC адрес становится FF:FF:FF:FF:FF:FF В следующей заметке (очень скоро) расскажу про создание Linux и Windows виртуальных машин. Ссылки: Официальный <a href="http://www.xen.org/" target="_blank">сайт</a> Официальная <a href="http://tx.downloads.xensource.com/downloads/docs/user" target="_blank">документация</a> <a href="http://xgu.ru/wiki/Xen" target="_blank">Документация</a> на русском</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Xen-Virtualisierung und Zeit]]></title>
<link>http://fixedpoint7.wordpress.com/2009/09/23/xen-virtualisierung-und-zeit/</link>
<pubDate>Wed, 23 Sep 2009 08:50:52 +0000</pubDate>
<dc:creator>fixedpoint7</dc:creator>
<guid>http://fixedpoint7.wordpress.com/2009/09/23/xen-virtualisierung-und-zeit/</guid>
<description><![CDATA[Seit einiger Zeit hatte ich das Problem die Zeit auf einer Xen-virtualisierten Maschine zu verändern]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Seit einiger Zeit hatte ich das Problem die Zeit auf einer Xen-virtualisierten Maschine zu verändern. Alle Versuche scheiterten, bis ich die Zeit auf dem Wirtsystem dom0 änderte und siehe da, die Gastmaschinen hatte auch alle die korrekte Zeit.</p>
<p>Eine Suche bei Google brachte mich dann auch zu einem <a href="http://os-drive.com/files/docbook/xen-faq.html#virtual_guest_clock">Xen FAQ</a>.<br />
In dem FAQ wird beschrieben das unter Xen standardmäßig die Zeit der Gastmaschinen an die Wirtmaschine dom0 gekoppelt ist.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
