<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rogierm&#039;s Blog &#187; kvm</title>
	<atom:link href="http://rogierm.redbee.nl/blog/tag/kvm/feed/" rel="self" type="application/rss+xml" />
	<link>http://rogierm.redbee.nl/blog</link>
	<description>Just another blog with technical stuff</description>
	<lastBuildDate>Mon, 28 Jun 2010 21:04:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Storage performance difference between KVM and Xen</title>
		<link>http://rogierm.redbee.nl/blog/2010/06/28/storage-performance-difference-between-kvm-and-xen/</link>
		<comments>http://rogierm.redbee.nl/blog/2010/06/28/storage-performance-difference-between-kvm-and-xen/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 21:04:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://rogierm.redbee.nl/blog/?p=147</guid>
		<description><![CDATA[Several blogs and manuals with examples on kvm or xen setups use NFS as storage backend. Mostly they state that for production use iSCSI is recommended. However there are examples where NFS is part of the architecture, eg. OpenNebula. I tried to find specific statistics on the performance differences between NFS, iSCSI and local storage. [...]]]></description>
			<content:encoded><![CDATA[<p>Several blogs and manuals with examples on kvm or xen setups use NFS as storage backend. Mostly they state that for production use iSCSI is recommended. However there are examples where NFS is part of the architecture, eg. OpenNebula. I tried to find specific statistics on the performance differences between NFS, iSCSI and local storage. During this search I encountered some pointers that NFS and Xen is not a good combination, but never a straight comparison.</p>
<p>I decided to invest some time and setup a small test environment and run some bonnie++ statistics. This is not a scientific designed experiment, but a test to show the differences between the platforms. Two test platforms are setup, 1 with a Xen server (DL360G6) (xen1) and a 12 disk SATA storage server (storage1), and another with a KVM server (DL360G5) (kvm1) and a 2 disk SATA storage server (storage2) . Both servers are connected with a gigabit network. I&#8217;ve also run a test with a 100mb/s network between the kvm1 and storage2 server. For reference I&#8217;ve also done tests with the images on localdisk.</p>
<p>I realize that LVM and iSCSI storage is most efficient, but storage with image files is very convenient and in case of cloud setups sometimes the only option.</p>
<table border="1" cellspacing="0" frame="VOID">
<colgroup>
<col width="391"></col>
<col width="36"></col>
<col width="55"></col>
<col width="43"></col>
<col width="48"></col>
<col width="50"></col>
<col width="48"></col>
<col width="43"></col>
<col width="48"></col>
<col width="43"></col>
<col width="48"></col>
<col width="50"></col>
<col width="52"></col>
<col width="47"></col>
</colgroup>
<tbody>
<tr>
<td width="391" height="17" align="LEFT"></td>
<td width="36" align="LEFT"></td>
<td colspan="6" width="286" align="LEFT">Seq output</td>
<td colspan="4" width="188" align="LEFT">Seq input</td>
<td colspan="2" width="99" align="LEFT">Random</td>
</tr>
<tr>
<td height="17" align="LEFT"></td>
<td align="LEFT"></td>
<td colspan="2" align="LEFT">Per Chr</td>
<td colspan="2" align="LEFT">Block</td>
<td colspan="2" align="LEFT">Rewrite</td>
<td colspan="2" align="LEFT">Per Chr</td>
<td colspan="2" align="LEFT">Block</td>
<td colspan="2" align="LEFT">Seeks</td>
</tr>
<tr>
<td height="17" align="LEFT"></td>
<td align="LEFT">Size</td>
<td align="LEFT">K/sec</td>
<td align="LEFT">%CP</td>
<td align="LEFT">K/sec</td>
<td align="LEFT">%CP</td>
<td align="LEFT">K/sec</td>
<td align="LEFT">%CP</td>
<td align="LEFT">K/sec</td>
<td align="LEFT">%CP</td>
<td align="LEFT">K/sec</td>
<td align="LEFT">%CP</td>
<td align="LEFT">/sec</td>
<td align="LEFT">%CP</td>
</tr>
<tr>
<td height="17" align="LEFT">Xen-guest-via-nfs-tapaio</td>
<td align="LEFT">1G</td>
<td align="RIGHT">3570</td>
<td align="RIGHT">5</td>
<td align="RIGHT">2436</td>
<td align="RIGHT">0</td>
<td align="RIGHT">1366</td>
<td align="RIGHT">0</td>
<td align="RIGHT">26474</td>
<td align="RIGHT">41</td>
<td align="RIGHT">24831</td>
<td align="RIGHT">0</td>
<td align="LEFT">6719.0</td>
<td align="RIGHT">1</td>
</tr>
<tr>
<td height="17" align="LEFT">xen-guest-via-iscsi</td>
<td align="LEFT">1G</td>
<td align="RIGHT">25242</td>
<td align="RIGHT">40</td>
<td align="RIGHT">12071</td>
<td align="RIGHT">1</td>
<td align="RIGHT">15175</td>
<td align="RIGHT">0</td>
<td align="RIGHT">32071</td>
<td align="RIGHT">42</td>
<td align="RIGHT">47742</td>
<td align="RIGHT">0</td>
<td align="LEFT">7331.3</td>
<td align="RIGHT">1</td>
</tr>
<tr>
<td height="17" align="LEFT">kvm-guest-nfs-1gb-net</td>
<td align="LEFT">1G</td>
<td align="RIGHT">8140</td>
<td align="RIGHT">16</td>
<td align="RIGHT">17308</td>
<td align="RIGHT">3</td>
<td align="RIGHT">11864</td>
<td align="RIGHT">2</td>
<td align="RIGHT">40861</td>
<td align="RIGHT">81</td>
<td align="RIGHT">71711</td>
<td align="RIGHT">3</td>
<td align="LEFT">2126.6</td>
<td align="RIGHT">54</td>
</tr>
<tr>
<td height="17" align="LEFT">kvm-guest-nfs-qcow-100mb</td>
<td align="LEFT">1G</td>
<td align="RIGHT">1922</td>
<td align="RIGHT">3</td>
<td align="RIGHT">9874</td>
<td align="RIGHT">1</td>
<td align="RIGHT">3994</td>
<td align="RIGHT">0</td>
<td align="RIGHT">10720</td>
<td align="RIGHT">22</td>
<td align="RIGHT">10441</td>
<td align="RIGHT">0</td>
<td align="LEFT">595.4</td>
<td align="RIGHT">33</td>
</tr>
<tr>
<td height="17" align="LEFT">kvm-guest-nfs-qcow-100mb-2nd</td>
<td align="LEFT">1G</td>
<td align="RIGHT">9735</td>
<td align="RIGHT">21</td>
<td align="RIGHT">2039</td>
<td align="RIGHT">0</td>
<td align="RIGHT">3197</td>
<td align="RIGHT">0</td>
<td align="RIGHT">10729</td>
<td align="RIGHT">22</td>
<td align="RIGHT">10463</td>
<td align="RIGHT">0</td>
<td align="LEFT">685.3</td>
<td align="RIGHT">38</td>
</tr>
<tr>
<td height="17" align="LEFT">kvm-guest-nfs-qcow-100mb-3rd</td>
<td align="LEFT">1G</td>
<td align="RIGHT">5327</td>
<td align="RIGHT">10</td>
<td align="RIGHT">7378</td>
<td align="RIGHT">1</td>
<td align="RIGHT">4421</td>
<td align="RIGHT">0</td>
<td align="RIGHT">10655</td>
<td align="RIGHT">18</td>
<td align="RIGHT">10512</td>
<td align="RIGHT">0</td>
<td align="LEFT">706.3</td>
<td align="RIGHT">39</td>
</tr>
<tr>
<td height="17" align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
</tr>
<tr>
<td height="17" align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
<td align="LEFT"></td>
</tr>
<tr>
<td height="17" align="LEFT">xenserver-nfsmount</td>
<td align="LEFT">1G</td>
<td align="RIGHT">41507</td>
<td align="RIGHT">60</td>
<td align="RIGHT">60921</td>
<td align="RIGHT">7</td>
<td align="RIGHT">29687</td>
<td align="RIGHT">1</td>
<td align="RIGHT">33427</td>
<td align="RIGHT">48</td>
<td align="RIGHT">64147</td>
<td align="RIGHT">0</td>
<td align="LEFT">4674.4</td>
<td align="RIGHT">11</td>
</tr>
<tr>
<td height="17" align="LEFT">kvmserver-nfs-1G</td>
<td align="LEFT">20G</td>
<td align="RIGHT">31158</td>
<td align="RIGHT">52</td>
<td align="RIGHT">32044</td>
<td align="RIGHT">17</td>
<td align="RIGHT">10749</td>
<td align="RIGHT">2</td>
<td align="RIGHT">19152</td>
<td align="RIGHT">28</td>
<td align="RIGHT">18987</td>
<td align="RIGHT">1</td>
<td align="LEFT">90.3</td>
<td align="RIGHT">1</td>
</tr>
<tr>
<td height="17" align="LEFT">localdisk-on-nfs-server-cloudtest3</td>
<td align="LEFT">4G</td>
<td align="RIGHT">41926</td>
<td align="RIGHT">65</td>
<td align="RIGHT">43805</td>
<td align="RIGHT">7</td>
<td align="RIGHT">18928</td>
<td align="RIGHT">3</td>
<td align="RIGHT">52943</td>
<td align="RIGHT">72</td>
<td align="RIGHT">56616</td>
<td align="RIGHT">3</td>
<td align="LEFT">222.6</td>
<td align="RIGHT">0</td>
</tr>
</tbody>
</table>
<p>The  conclusion of the tests is that local storage is fastest. NFS storage with Xen is not a good combination. Xen runs best with iSCSI backed storage. KVM with NFS runs significantly better. It is safe to say that if you want to use NFS use it with KVM, not with Xen. In any case iSCSI is always the best option for Xen. I have not yet tested KVM with iSCSI but I expect this to perform better than NFS.</p>
]]></content:encoded>
			<wfw:commentRss>http://rogierm.redbee.nl/blog/2010/06/28/storage-performance-difference-between-kvm-and-xen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to access libvirtd from remote server</title>
		<link>http://rogierm.redbee.nl/blog/2010/03/02/access-libvirtd-from-remote-server/</link>
		<comments>http://rogierm.redbee.nl/blog/2010/03/02/access-libvirtd-from-remote-server/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 23:42:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[libvirt]]></category>
		<category><![CDATA[libvirtd]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[tls]]></category>

		<guid isPermaLink="false">http://rogierm.redbee.nl/blog/?p=125</guid>
		<description><![CDATA[Libvirt is a toolkit to interact with several virtualization platform from a single interface. Considering you can stop and start virtual machines through this API, security is quite important. Libvirt offers several options to give authenticated access from remote machines. By default most distributions disable remote network access for libvirtd. However, I would like to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.libvirt.org/">Libvirt</a> is a toolkit to interact with several virtualization platform from a single interface. Considering you can stop and start virtual machines through this API, security is quite important. Libvirt offers several options to give authenticated access from remote machines. By default most distributions disable remote network access for libvirtd. However, I would like to access libvirtd on some of my KVM servers from a single management host to gather some information. The documentation on how to set this up is not too good, so I decided to write up a  short how-to. </p>
<p><strong>Step 1: Enable network access for libvirtd</strong><br />
First enable network access for libvirtd on the KVM server(s). On CentOS/RHEL this is done by uncommenting or adding the following line in /etc/sysconfig/libvirtd:<br />
<code><br />
LIBVIRTD_ARGS="--listen"<br />
</code></p>
<p><strong>Step 2: Install a CA on the management server</strong><br />
Install the Perl certificate tools:<br />
<code><br />
yum install openssl-perl<br />
</code><br />
Create Certificate authority:<br />
<code><br />
cd /etc/pki/tls/misc/<br />
./CA.pl -newca<br />
</code><br />
Example output:<br />
<code><br />
 ./CA.pl -newca<br />
CA certificate filename (or enter to create)</p>
<p>Making CA certificate ...<br />
Generating a 1024 bit RSA private key<br />
..........++++++<br />
.............++++++<br />
writing new private key to '../../CA/private/cakey.pem'<br />
Enter PEM pass phrase:<br />
Verifying - Enter PEM pass phrase:<br />
-----<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter '.', the field will be left blank.<br />
-----<br />
Country Name (2 letter code) [GB]:XX<br />
State or Province Name (full name) [Berkshire]:XX<br />
Locality Name (eg, city) [Newbury]:XXXXX<br />
Organization Name (eg, company) [My Company Ltd]:XXXXX<br />
Organizational Unit Name (eg, section) []:XXXX<br />
Common Name (eg, your name or your server's hostname) []:CA XXX XXX<br />
Email Address []:XXX</p>
<p>Please enter the following 'extra' attributes<br />
to be sent with your certificate request<br />
A challenge password []:<br />
An optional company name []:<br />
Using configuration from /etc/pki/tls/openssl.cnf<br />
Enter pass phrase for ../../CA/private/cakey.pem:<br />
Check that the request matches the signature<br />
Signature ok<br />
Certificate Details:<br />
        Serial Number:<br />
            d8:95:24:xx:xx:xx:13:9b<br />
        Validity<br />
            Not Before: Feb 25 23:14:08 2010 GMT<br />
            Not After : Feb 24 23:14:08 2013 GMT<br />
        Subject:<br />
            countryName               = XX<br />
            stateOrProvinceName       = XX<br />
            organizationName          = XXXX<br />
            organizationalUnitName    = XXXX<br />
            commonName                = CA XXX XXX<br />
            emailAddress              = XXXXX<br />
        X509v3 extensions:<br />
            X509v3 Subject Key Identifier:<br />
                XXX<br />
            X509v3 Authority Key Identifier:<br />
                keyid:XXXX<br />
                DirName:/C=XX/ST=XX/O=XXX/OU=XXXX/CN=CA XXX XXX/emailAddress=XXX<br />
                serial:XXX</p>
<p>            X509v3 Basic Constraints:<br />
                CA:TRUE<br />
Certificate is to be certified until Feb 24 23:14:08 2013 GMT (1095 days)</p>
<p>Write out database with 1 new entries<br />
Data Base Updated<br />
</code></p>
<p><strong>Step 3: Create CSR&#8217;s</strong><br />
<code><br />
openssl genrsa -des3 -out kvm-server1.tmp<br />
openssl rsa -in kvm-server1.tmp -out kvm-server1.key<br />
openssl genrsa -des3 -out mgmt-host.tmp<br />
openssl rsa -in mgmt-host.tmp -out mgmt-host.key<br />
openssl req -new -key kvm-server1.key -out kvm-server1.csr<br />
openssl req -new -key mgmt-host.key -out mgmt-host.csr<br />
</code></p>
<p><strong>Step 4: Sign the certificates</strong><br />
<code><br />
 openssl ca -config /etc/pki/tls/openssl.cnf -policy policy_anything -out /root/mgmt-host.crt -infiles /root/mgmt-host.csr<br />
 openssl ca -config /etc/pki/tls/openssl.cnf -policy policy_anything -out /root/kvm-server1.crt -infiles /root/kvm-server1.csr<br />
</code><br />
Example output:<br />
<code><br />
Using configuration from /etc/pki/tls/openssl.cnf<br />
Enter pass phrase for /etc/pki/CA/private/cakey.pem:<br />
Check that the request matches the signature<br />
Signature ok<br />
Certificate Details:<br />
        Serial Number:<br />
            d8:95:24:4b:4e:b1:13:9c<br />
        Validity<br />
            Not Before: Feb 25 23:31:40 2010 GMT<br />
            Not After : Feb 25 23:31:40 2011 GMT<br />
        Subject:<br />
            countryName               = XX<br />
            stateOrProvinceName       = XX<br />
            localityName              = XX<br />
            organizationName          = XX<br />
            organizationalUnitName    = XX<br />
            commonName                = mgmt-host.xxx.nl<br />
            emailAddress              = xxxxx<br />
        X509v3 extensions:<br />
            X509v3 Basic Constraints:<br />
                CA:FALSE<br />
            Netscape Comment:<br />
                OpenSSL Generated Certificate<br />
            X509v3 Subject Key Identifier:<br />
                6C:EA:8B:C1:D6:XX:B6:6B:5B:18:02<br />
            X509v3 Authority Key Identifier:<br />
                keyid:C9:36:4A:XXXX:6F:FD:2E:86</p>
<p>Certificate is to be certified until Feb 25 23:31:40 2011 GMT (365 days)<br />
Sign the certificate? [y/n]:y</p>
<p>1 out of 1 certificate requests certified, commit? [y/n]y<br />
Write out database with 1 new entries<br />
Data Base Updated</p>
<p></code></p>
<p><strong>Step 5: Copy over the certificates to the correct location</strong><br />
On the management host (mgmt-host):<br />
<code><br />
mkdir /etc/pki/libvirt<br />
mkdir /etc/pki/libvirt/private<br />
mkdir /etc/pki/libvirt-vnc</p>
<p>cp /root/mgmt-host.key /etc/pki/libvirt/private/clientkey.pem<br />
cp /root/mgmt-host.key /etc/pki/libvirt-vnc/clientkey.pem<br />
cp /root/mgmt-host.crt /etc/pki/libvirt/clientcert.pem<br />
cp /root/mgmt-host.crt /etc/pki/libvirt-vnc/clientcert.pem<br />
</code></p>
<p>Transfer the key and certificate files to the KVM server (kvm-server1). Ideally, you create the key and CSR on the host itself, so you only have to transfer the certificate. Then, copy the certificates and CA to the correct location on the KVM (libvirtd) server:</p>
<p><code><br />
mkdir /etc/pki/libvirt<br />
mkdir /etc/pki/libvirt/private<br />
mkdir /etc/pki/libvirt-vnc</p>
<p>cp kvm-server1.key /etc/pki/libvirt/private/serverkey.pem<br />
cp kvm-server1.key /etc/pki/libvirt-vnc/server-key.pem</p>
<p>cp kvm-server1.crt /etc/pki//libvirt/servercert.pem<br />
cp kvm-server1.crt /etc/pki/libvirt-vnc/server-cert.pem<br />
</code></p>
<p>Make sure the CA generated on the management server is available on the KVM server in the following file:<br />
/etc/pki/CA/cacert.pem</p>
<p><strong>Step 6: Reload libvirtd</strong><br />
<code><br />
/etc/init.d/libvirtd reload<br />
</code></p>
<p><strong>Step 7: Test</strong><br />
With these certificates setup, you should be able to access libvirtd on kvm-server1 from mgmt-host. Use the following command to test:<br />
<code><br />
virsh -c qemu://kvm-server1.xxxx.nl/system<br />
Welcome to virsh, the virtualization interactive terminal.</p>
<p>Type:  'help' for help with commands<br />
       'quit' to quit</p>
<p>virsh #<br />
</code><br />
Use the list command to see a list of running guests on the server. This only works if these guests have also been created via libvirtd. Manually started KVM guests will not show up in this list. </p>
]]></content:encoded>
			<wfw:commentRss>http://rogierm.redbee.nl/blog/2010/03/02/access-libvirtd-from-remote-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ONE Management Console show VNC display</title>
		<link>http://rogierm.redbee.nl/blog/2010/02/25/one-management-console-show-vnc-display/</link>
		<comments>http://rogierm.redbee.nl/blog/2010/02/25/one-management-console-show-vnc-display/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 01:39:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[opennebula]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://rogierm.redbee.nl/blog/?p=120</guid>
		<description><![CDATA[I&#8217;ve made some quick changes to ONEMC to show the VNC port in the interface. I&#8217;ve updated the template that onemc creates with a GRAPHICS section. This enables vnc on the quest. As a workaround until ONE can use the VMID in the graphics section, I use a virsh command to get the vncport. To [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made some quick changes to ONEMC to show the VNC port in the interface. I&#8217;ve updated the template that onemc creates with a GRAPHICS section. This enables vnc on the quest. </p>
<p>As a workaround until ONE can use the VMID in the graphics section, I use a virsh command to get the vncport. To get this working the webserver user should be allowed to execute the virsh command via sudo. Add the following to sudoers:<br />
<code><br />
apache     ALL=(ALL)       NOPASSWD: /usr/bin/virsh *<br />
</code><br />
Also I encountered some problems with the model section in the KVM template so I commented that out as well. </p>
<p>Below the patch and a screenshot listing the vnc ports in ONEMC<br />
<a href="http://rogierm.redbee.nl/blog/wp-content/uploads/2010/02/Picture-64.png"><img src="http://rogierm.redbee.nl/blog/wp-content/uploads/2010/02/Picture-64-300x136.png" alt="ONEMC screenshot" title="ONEMC" width="300" height="136" class="aligncenter size-medium wp-image-121" /></a><br />
<a href='http://rogierm.redbee.nl/blog/wp-content/uploads/2010/02/onemc_funcs.patch.txt'>onemc_funcs.patch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rogierm.redbee.nl/blog/2010/02/25/one-management-console-show-vnc-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
