<?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>Bits of Arrogance &#187; KVM</title>
	<atom:link href="https://www.crummylogic.com/wordpress/?feed=rss2&#038;tag=kvm" rel="self" type="application/rss+xml" />
	<link>https://www.crummylogic.com/wordpress</link>
	<description>Making myself pervasive</description>
	<lastBuildDate>Wed, 04 Oct 2017 17:25:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.4</generator>
	<item>
		<title>Oracle Linux 7 &#8211; KVM Console is broken, OCFS2 kicks ass though</title>
		<link>https://www.crummylogic.com/wordpress/?p=414</link>
		<comments>https://www.crummylogic.com/wordpress/?p=414#comments</comments>
		<pubDate>Wed, 09 Nov 2016 01:18:24 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Oracle Linux]]></category>
		<category><![CDATA[UEK]]></category>
		<category><![CDATA[Unbreakable Enterprise Kernel]]></category>

		<guid isPermaLink="false">http://www.crummylogic.com/wordpress/?p=414</guid>
		<description><![CDATA[This post was originally written for spiceworks, so ignore the formatting shortcomings and such. I have chosen to just throw it on my blog since I&#8217;ve found a valid workaround to the problem, that being use OL6. I have a farm of KVM servers running CentOS 7.2. I have procured some hardware that is best &#8230; <a href="https://www.crummylogic.com/wordpress/?p=414" class="more-link">Continue reading <span class="screen-reader-text">Oracle Linux 7 &#8211; KVM Console is broken, OCFS2 kicks ass though</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This post was originally written for spiceworks, so ignore the formatting shortcomings and such. I have chosen to just throw it on my blog since I&#8217;ve found a valid workaround to the problem, that being use OL6.</p>
<p>I have a farm of KVM servers running CentOS 7.2. I have procured some hardware that is best utilized with a cluster aware filesystem such as GFS2 or OCFS2. I started fiddling with GFS2, got a functional cluster on some spare hosts and everything worked &#8211; poorly. I was going from NFS on a LACP bond assembled from gigabit Ethernet to GFS2 on a functioning MPIO with 4 gigabit Ethernet links. I tested with XFS and the performance was as expected &#8211; nominal number of IOPS based upon number of spindles and ~450MB/s of read and write throughput. Moving to GFS2 the IOPS and throughput were both there, but also some latency spikes of up to 30 seconds which is obviously unacceptable. I tried tuning for awhile and couldn&#8217;t massage out the bugs.</p>
<p>I crapped that setup out and installed Oracle Linux to try O2CB/OCFS2. Setup was great and performance looks vastly improved. The problem with the configuration was that KVM domains seem to be fully functional, but nothing I&#8217;ve tried will allow me to see the consoles of the running domain. I start a domain and look at a console (tried virt-viewer, virt-manager on Linux, and the builtin Gnome Remote client) and all I see is a black screen. I also tried VNC as an alternative, something I&#8217;ve never done so I don&#8217;t know if that should *just work* but it didn&#8217;t either. Lastly I tried a few different video modes, qxl, vga, cirris, nothing changed anything. The only logs I know of to look at are `/var/log/libvirt/qemu/domain.log` &#8211; which when trying to connect to the domain look like this:</p>
<pre>    main_channel_link: add main channel client
    main_channel_handle_parsed: net test: latency 12.194000 ms, bitrate 146799512 bps (139.998924 Mbps)
    red_dispatcher_set_cursor_peer:
    inputs_connect: inputs channel client create</pre>
<p>I compared that to a good connection on another machine &#8211; it looks like this:</p>
<pre>    main_channel_link: add main channel client
    main_channel_handle_parsed: net test: latency 3.128000 ms, bitrate 69543957 bps (66.322286 Mbps)
    red_dispatcher_set_cursor_peer:
    inputs_connect: inputs channel client create</pre>
<p>To complicate but fix things I was hoping reinstalling and using CentOS 7.2 which I&#8217;m more familiar with and has obviously all different packages would solve the issue. I did just that &#8211; fresh CentOS install and then installed nothing but UEK and OCFS2 tools so I could proceed with libvirt/KVM tools I knew that worked, but continue testing the OCFS2 filesystem:</p>
<pre>    [root@kvmhost images]# yum list installed | grep ol7
    kernel-uek.x86_64                     3.8.13-118.14.1.el7uek         @ol7_UEKR3
    kernel-uek-devel.x86_64               3.8.13-118.14.1.el7uek         @ol7_UEKR3
    kernel-uek-firmware.noarch            3.8.13-118.14.1.el7uek         @ol7_UEKR3
    libdtrace-ctf.x86_64                  0.5.0-2.el7                    @ol7_UEKR3
    ocfs2-tools.x86_64                    1.8.6-7.el7                    @ol7_latest
    ocfs2-tools-devel.x86_64              1.8.6-7.el7                    @ol7_latest</pre>
<p>So the interesting takeaway from this configuration is that it worked no differently when using UEK, but if I boot into the Base CentOS kernel it works fine. To be clear &#8230; I boot into the system choosing `CentOS Linux (3.8.13-118.14.1.el7uek.x86_64) 7 (Core)` at the prompt and the problem persists, but if I reboot the system and choose `CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)` then things work proper.</p>
<p>Reading just that, one would assume the problem is simply a situation where the userland components were compiled with other kernel libraries and find a new problem to think about &#8211; however I have another system running that was installed from an OL7 iso and never had anything but OL7 packages instaled exhibiting exact behavior.</p>
<p>The only other place I could think to look for anything useful was the virt-manager logs. I installed enough X11 components so that I could get on it graphically and make some local logs from that app, here is what came from that:</p>
<p>Not working</p>
<pre>    [Sat, 05 Nov 2016 14:55:04 virt-manager 15862] DEBUG (details:602) Showing VM details: 
    [Sat, 05 Nov 2016 14:55:04 virt-manager 15862] DEBUG (engine:357) window counter incremented to 2
    [Sat, 05 Nov 2016 14:55:04 virt-manager 15862] DEBUG (console:650) Starting connect process for proto=spice trans= connhost=127.0.0.1 connuser= connport= gaddr=127.0.0.1 gport=5900 gtlsport=None gsocket=None
    [Sat, 05 Nov 2016 14:55:04 virt-manager 15862] DEBUG (console:771) Viewer connected</pre>
<p>Working:</p>
<pre>    [Sat, 05 Nov 2016 15:06:49 virt-manager 3917] DEBUG (details:602) Showing VM details: 
    [Sat, 05 Nov 2016 15:06:49 virt-manager 3917] DEBUG (engine:357) window counter incremented to 2
    [Sat, 05 Nov 2016 15:06:49 virt-manager 3917] DEBUG (console:650) Starting connect process for proto=spice trans= connhost=127.0.0.1 connuser= connport= gaddr=127.0.0.1 gport=5900 gtlsport=None gsocket=None
    [Sat, 05 Nov 2016 15:06:49 virt-manager 3917] DEBUG (console:771) Viewer connected</pre>
<p>Googling &#8216;Spice blank screen UEK&#8217; yields nothing helpful that I can see so for posterity&#8217;s sake and perhaps in hope that someone else will have the problem and *CAN* indeed file a bug with Oracle, this was my experience.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=414</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenIndiana ZFS backed iSCSI SAN &#8211; Resize Volumes</title>
		<link>https://www.crummylogic.com/wordpress/?p=400</link>
		<comments>https://www.crummylogic.com/wordpress/?p=400#comments</comments>
		<pubDate>Mon, 11 Apr 2016 19:03:37 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenIndiana]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.crummylogic.com/wordpress/?p=400</guid>
		<description><![CDATA[I banged my head for a couple minutes. Resizing the ZFS is easy peasy right? root@oi-storage:~# zfs get -Hp volsize pool0/kvm/kvmdomain pool0/kvm/kvmdomain       volsize 42949672960     local Well of course that isn&#8217;t big enough&#8230; root@oi-storage:~# zfs set volsize=42956488704 pool0/kvm/kvmdomain No problemo, now just rescan on the Linux side right? [root@linux-hv ~]# iscsiadm -m node --targetname iqn.2010-09.org.openindiana:02:6640d696-90b3-6709-804e-da40a0ffffff -R &#8230; <a href="https://www.crummylogic.com/wordpress/?p=400" class="more-link">Continue reading <span class="screen-reader-text">OpenIndiana ZFS backed iSCSI SAN &#8211; Resize Volumes</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I banged my head for a couple minutes. Resizing the ZFS is easy peasy right?</p>
<pre>root@oi-storage:~# zfs get -Hp volsize pool0/kvm/kvmdomain
 pool0/kvm/kvmdomain       volsize 42949672960     local</pre>
<p>Well of course that isn&#8217;t big enough&#8230;</p>
<pre>root@oi-storage:~# zfs set volsize=42956488704 pool0/kvm/kvmdomain</pre>
<p>No problemo, now just rescan on the Linux side right?</p>
<pre>[root@linux-hv ~]# iscsiadm -m node --targetname iqn.2010-09.org.openindiana:02:6640d696-90b3-6709-804e-da40a0ffffff -R
[root@linux-hv ~]# dmesg
  ...
[1329034.807613] sd 4:0:0:0: [sdc] 83886080 512-byte logical blocks: (42.9 GB/40.0 GiB)
  ...</pre>
<p>Hmm&#8230; that didn&#8217;t do it (512 * 83886080 = 42949672960). I banged around a little bit and found what I was missing:</p>
<pre>root@oi-storage:~# sbdadm modify-lu -s 42956488704 600144f0340b80c719ff570bb7460001</pre>
<p>Then the Linux rescan yielded more useful results:</p>
<pre>[root@linux-hv ~]# dmesg
  ...
[1340836.125483] sdc: detected capacity change from 42949672960 to 42956488704</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=400</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KVM Networking, bond &amp; bridge with VLANs</title>
		<link>https://www.crummylogic.com/wordpress/?p=306</link>
		<comments>https://www.crummylogic.com/wordpress/?p=306#comments</comments>
		<pubDate>Fri, 17 Oct 2014 17:55:02 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://www.jrssite.com/wordpress/?p=306</guid>
		<description><![CDATA[I never found a complete tutorial on setting up KVM networking the way I wanted. One thing that VMware has everyone beat on is simple and effective network configurations. KVM hosts can be just as good, but it won&#8217;t draw the pictures for you so it&#8217;s difficult to visualize what&#8217;s going on and troubleshoot it &#8230; <a href="https://www.crummylogic.com/wordpress/?p=306" class="more-link">Continue reading <span class="screen-reader-text">KVM Networking, bond &#038; bridge with VLANs</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I never found a complete tutorial on setting up KVM networking the way I wanted. One thing that VMware has everyone beat on is simple and effective network configurations. KVM hosts can be just as good, but it won&#8217;t draw the pictures for you so it&#8217;s difficult to visualize what&#8217;s going on and troubleshoot it when things are going wrong.</p>
<p>This write-up should give you all the information you need to create a robust, bonded and VLAN aware &#8220;virtual switch&#8221; configuration on your KVM host. My config uses all native Linux networking constructs. It does not make use of the newer &#8220;team&#8221; method of interface aggregation and it definitely does not make use of Network Manager; as a matter of fact unless you have express need for it I suggest you uninstall Network Manager as it can cause grief in your configuration. As with all my other KVM related write-ups, this is based on EL7 type hosts, CentOS 7.0 in my case. If you wish to adapt it for other flavors of Linux this may still give you a good starting point.</p>
<p>Here is an approximation of what it should look like when you&#8217;re done:</p>
<p><a href="http://www.jrssite.com/wordpress/wp-content/uploads/2014/10/Linux-KVM-Bond-VLAN-bridge-config-New-Page.jpg"><img class="aligncenter size-full wp-image-308" alt="Linux KVM Bond-VLAN bridge config - New Page" src="http://www.jrssite.com/wordpress/wp-content/uploads/2014/10/Linux-KVM-Bond-VLAN-bridge-config-New-Page.jpg" width="845" height="622" /></a></p>
<p>&nbsp;</p>
<p>In case it&#8217;s not obvious, the shaded balls are your KVM domains. When configuring your new domains you will select the &#8220;Specify shared device name&#8221; option in virt-manager and type out the bridge you want the domain connected to. Or alternatively if you&#8217;re hand crafting your domain&#8217;s XML file it will look like this:</p>
<pre>&lt;interface type='bridge'&gt;
  &lt;mac address='ff:ff:ff:ff:ff:ff'/&gt;
  &lt;source bridge='virbr120'/&gt;
  &lt;target dev='vnet0'/&gt;
  &lt;model type='rtl8139'/&gt;
  &lt;alias name='net0'/&gt;
  &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' /&gt;
&lt;/interface&gt;</pre>
<p>This would connect your VM to VLAN120 per my config above. Obviously many other things in this XML are domain and environment specific so don&#8217;t just try to copy and paste that and expect your machine to work, if you&#8217;re hand editing XML &#8211; know what you&#8217;re doing. Some of the other configs that you&#8217;ll need are as follows:</p>
<p>Cisco 3650:</p>
<pre>sw# <span style="color: #ff0000;">config t</span>
sw(config)# <span style="color: #ff0000;">interface range gi0/1,gi0/2</span>
sw(config-if-range)# <span style="color: #ff0000;">switchport trunk encapsulation dot1q</span>
sw(config-if-range)# <span style="color: #ff0000;">switchport trunk allowed vlan 100,110,120,200</span>
sw(config-if-range)# <span style="color: #ff0000;">switchport mode trunk</span>
sw(config-if-range)# <span style="color: #ff0000;">channel-group 1 mode on</span>
sw(config-if-range)# <span style="color: #ff0000;">exit</span>
sw(config)# <span style="color: #ff0000;">interface po1</span>
sw(config-if)# <span style="color: #ff0000;">switchport trunk encapsulation dot1q</span>
sw(config-if)# <span style="color: #ff0000;">switchport trunk allowed vlan 100,110,120,200</span>
sw(config-if)# <span style="color: #ff0000;">switchport mode trunk</span>
sw(config-if)# <span style="color: #ff0000;">description "KVM Server 1 VMNetwork bonded and trunked"</span></pre>
<p>On your KVM host:</p>
<p><strong>/etc/modprobe.d/bond0.conf:</strong></p>
<pre>alias bond0 bonding</pre>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-eth0:</strong></p>
<pre>DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes</pre>
<p>Make eth1 or whatever your 2nd adapter look similar, obviously change the <span style="color: #ff0000;">DEVICE= line</span></p>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-bond0:</strong></p>
<pre>DEVICE=bond0
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="miimon=100 mode=4 lacp_rate=1"</pre>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-bond0.100:</strong></p>
<pre>DEVICE=bond0.100
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
NM_CONTROLLED=no
BRIDGE=virbr100</pre>
<p>Like the physical interfaces, you can copy/paste this for the other VLANs you want to include in your configuration, you will have to change the <span style="color: #ff0000;">DEVICE=</span> line and <span style="color: #ff0000;">BRIDGE=</span> line in each separate config file.</p>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-virbr100:</strong></p>
<pre>DEVICE=virbr100
ONBOOT=YES
TYPE=Bridge
DELAY=0
BOOTPROTO=none</pre>
<p>This one is another copy/paste candidate to bridge you into any of your VLAN interfaces, this time the only line you&#8217;ll need to modify as you copy and paste is <span style="color: #ff0000;">DEVICE=</span>. If you&#8217;d like you can add an IP address, subnet mask, etc to any of the bridge interfaces and then use that to connect to your KVM server. For me I prefer to have dedicated out-of-band interfaces for management purposes so all of my bridges are without layer 3 termination.</p>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=306</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CentOS 7, Live Block Migration, getting the right qemu binary built and installed</title>
		<link>https://www.crummylogic.com/wordpress/?p=302</link>
		<comments>https://www.crummylogic.com/wordpress/?p=302#comments</comments>
		<pubDate>Tue, 07 Oct 2014 02:00:03 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jrssite.com/wordpress/?p=302</guid>
		<description><![CDATA[You were all excited because you read my other post, but you didn&#8217;t pay attention to the part about needing a special version of qemu-kvm and were saddened to be hit with this: error: unsupported configuration: block copy is not supported with this QEMU binary Don&#8217;t fret, I&#8217;ll help you get where you want to &#8230; <a href="https://www.crummylogic.com/wordpress/?p=302" class="more-link">Continue reading <span class="screen-reader-text">CentOS 7, Live Block Migration, getting the right qemu binary built and installed</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>You were all excited because you read <a title="KVM Live Block Migration – My Recipe" href="http://www.jrssite.com/wordpress/?p=269">my other post</a>, but you didn&#8217;t pay attention to the part about needing a special version of qemu-kvm and were saddened to be hit with this:</p>
<pre>error: unsupported configuration: block copy is not supported with this QEMU binary</pre>
<p>Don&#8217;t fret, I&#8217;ll help you get where you want to go. Do everything as root, and don&#8217;t do it on a production system &#8230; duh</p>
<p>Get your development environment ready:</p>
<pre># yum install -y rpm-build redhat-rpm-config make gcc
# mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
# echo '%_topdir %(echo $HOME)/rpmbuild' &gt; ~/.rpmmacros</pre>
<p>Get your source rpm and prerequisites &#8211; note that while this is current as of this posting, things could change. Up to you to handle keeping yourself current:</p>
<pre># wget http://ftp.redhat.com/redhat/linux/enterprise/6Server/en/RHEV/SRPMS/qemu-kvm-rhev-1.5.3-60.el7_0.7.src.rpm
# yum install -y zlib-devel SDL-devel texi2html gnutls-devel cyrus-sasl-devel libtool libaio-devel pciutils-devel pulseaudio-libs-devel libiscsi-devel libattr-devel libusbx-devel usbredir-devel texinfo spice-protocol spice-server-devel libseccomp-devel libcurl-devel glusterfs-api-devel glusterfs-devel systemtap systemtap-sdt-devel nss-devel libjpeg-devel libpng-devel libuuid-devel bluez-libs-devel brlapi-devel check-devel libcap-devel pixman-devel librdmacm-devel iasl ncurses-devel</pre>
<p>Build your binary:</p>
<pre># rpmbuild --rebuild qemu-kvm-rhev-1.5.3-60.el7_0.7.src.rpm</pre>
<p>Install your binary and its dependencies. Enjoy blockcopy funcitonality:</p>
<pre># yum install -y rpmbuild/RPMS/x86_64/*</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=302</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
