<?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>/dev/pawwa</title>
	<atom:link href="http://www.pawwa.in.rs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pawwa.in.rs</link>
	<description>hi-tech / lo-life blogging.</description>
	<lastBuildDate>Thu, 15 Dec 2011 15:18:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>jd-gui &#8211; yet another fast Java decompiler</title>
		<link>http://www.pawwa.in.rs/2011/12/jd-gui-yet-another-fast-java-decompiler/</link>
		<comments>http://www.pawwa.in.rs/2011/12/jd-gui-yet-another-fast-java-decompiler/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 15:15:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=154</guid>
		<description><![CDATA[Sometimes jd-gui, java class decompiler, really comes in handy (if the code is not obfuscated or protected in some other way of course): http://java.decompiler.free.fr/?q=jdgui]]></description>
			<content:encoded><![CDATA[<p>Sometimes jd-gui, java class decompiler, really comes in handy (if the code is not obfuscated or protected in some other way of course): <a title="jd-gui" href="http://java.decompiler.free.fr/?q=jdgui">http://java.decompiler.free.fr/?q=jdgui</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/12/jd-gui-yet-another-fast-java-decompiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Correct driver for a device</title>
		<link>http://www.pawwa.in.rs/2011/12/correct-driver-for-a-device/</link>
		<comments>http://www.pawwa.in.rs/2011/12/correct-driver-for-a-device/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 17:16:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=155</guid>
		<description><![CDATA[Here&#8217;s a tip to check whether your piece of hardware is supported by the installed Linux kernel modules on your machine. First, check lspci output for let&#8217;s say a wireless card: $ lspci &#124; grep -i wireless 01:00.0 Network controller: Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01) Note the number 01:00.0 in [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a tip to check whether your piece of hardware is supported by the installed Linux kernel modules on your machine.</p>
<p><span id="more-155"></span>First, check lspci output for let&#8217;s say a wireless card:</p>
<pre class="brush: bash; gutter: false">$ lspci | grep -i wireless
01:00.0 Network controller: Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01)</pre>
<p>Note the number <strong>01:00.0</strong> in lspci output, in which 01 represents the bus number the device is attached to, 00 is the device number and final 0 is PCI device function. To get more information on that device we could list the entries in /sys/bus/pci/devices/0000:01:00.0 directory of sysfs (a RAM file system that exports kernel structures, attributes and their inner links. udev uses sysfs also to create dynamic device files). lspci actually reads sysfs.</p>
<p>Next, we print <strong>raw</strong> (<strong>-n</strong> option) PCI identification data that includes the previous numbers:</p>
<pre class="brush: bash; gutter: false">$ lspci -n | grep 01:00.0
01:00.0 0280: 168c:002a (rev 01)</pre>
<p>These numbers are from /usr/share/misc/pci.ids file. Lets brake down the numbers:</p>
<ul>
<li>01:00.0 &#8211; 01 is bus number, 00 device number, 0 device function</li>
<li>0280 &#8211; device class</li>
<li>168c &#8211; vendor ID</li>
<li>002a &#8211; device ID</li>
</ul>
<p>We use the vendor ID and device ID numbers and compare them to a modinfo of kernel drivers:</p>
<pre class="brush: actionscript3; gutter: true">$ find /lib/modules/$(uname -r)/kernel/drivers -type f -exec modinfo "{}" \; | grep -B 200 -i 168c | grep -B 50 -i 002a | grep filename
filename:       /lib/modules/2.6.31-23-generic/kernel/drivers/net/wireless/ath/ath5k/ath5k.ko
filename:       /lib/modules/2.6.31-23-generic/kernel/drivers/net/wireless/ath/ath9k/ath9k.ko</pre>
<p>So, my wireless card is supported by the ath9k driver. If I didn&#8217;t got the output from modinfo, it would probably mean that the hardware is not supported and that I need to get the driver from the device vendor. I could also search only for the vendor ID to get some results but that could yield some unexpected results I suppose.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/12/correct-driver-for-a-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Servers and racks compability (EIA-310)</title>
		<link>http://www.pawwa.in.rs/2011/11/servers-and-racks-compability-eia-310/</link>
		<comments>http://www.pawwa.in.rs/2011/11/servers-and-racks-compability-eia-310/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 10:09:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=137</guid>
		<description><![CDATA[One of the things to check in a planning process of acquiring a new rack-mount server, is if it will fit in your existing server rack. As www.server-racks.com states: not all racks are created equal and not all servers will fit in all racks. No mater if you have a 19&#8243; rack, some servers might [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things to check in a planning process of acquiring a new rack-mount server, is if it will fit in your existing server rack. As <a title="server-racks.com" href="www.server-racks.com">www.server-racks.com</a> states: not all racks are created equal and not all servers will fit in all racks.</p>
<p><span id="more-137"></span> No mater if you have a 19&#8243; rack, some servers might not fit in. There is a standard named EIA-310-D which defines &#8220;standard rack&#8221; and specifies design features for 19&#8243; racks.</p>
<p>The problem is that this standard does not define some details such as how deep is rack&#8217;s mounting width, rack holes (threaded, rounded, square&#8230;). For example, rack holes are the number one problem for server and rack incompatibility. Things should be good if you have square holes on your rack &#8211; you can always add threads with a cage nut if you need them.</p>
<p>In December of 1995 the EIA-310-D standard was updated. The changes made were mostly grammatical. The mechanical requirements were left unchanged. The updated documentation was originally known as EIA-310-E. It is currently referred to as EIA/ECA-310-E</p>
<p>So, be careful when choosing new servers for your racks, always double check the compatibility between them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/11/servers-and-racks-compability-eia-310/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open source fingerprint biometrics</title>
		<link>http://www.pawwa.in.rs/2011/11/open-source-fingerprint-biometrics/</link>
		<comments>http://www.pawwa.in.rs/2011/11/open-source-fingerprint-biometrics/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 11:46:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=111</guid>
		<description><![CDATA[DigitalPersona has open sourced its fingerprint minutiae extraction technology &#8211; FingerJetFX OSE. It is released under LGPL license and is MINEX-certified (fingerprint template interoperability standard). It&#8217;s written in C++ and can run on Linux, Windows, Android and some other operating systems. FingerJetFX runs well on embedded chips, desktop computers and servers. They say that it [...]]]></description>
			<content:encoded><![CDATA[<p>DigitalPersona has open sourced its fingerprint minutiae extraction technology &#8211; <strong>FingerJetFX</strong> <strong>OSE</strong>.</p>
<p>It is released under LGPL license and is <a title="MINEX" href="http://www.nist.gov/itl/iad/ig/minex.cfm">MINEX</a>-certified (fingerprint template interoperability standard). It&#8217;s written in C++ and can run on Linux, Windows, Android and some other operating systems. FingerJetFX runs well on embedded chips, desktop computers and servers. They say that it is easy to use &#8211; it can be used with as little as one function call.</p>
<p>More information @ <a href="http://digitalpersona.com/fingerjetfx">http://digitalpersona.com/fingerjetfx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/11/open-source-fingerprint-biometrics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which hardware for virtualization server?</title>
		<link>http://www.pawwa.in.rs/2011/11/which-hardware-for-virtualization-server/</link>
		<comments>http://www.pawwa.in.rs/2011/11/which-hardware-for-virtualization-server/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 13:45:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=112</guid>
		<description><![CDATA[Here are some notes that I took when I was choosing components for a server to run the KVM-based virtualized environment. Introduction The new server was meant to be placed in our DMZ and should run a few virtual machines providing services to external clients. Some basic hardware requirements were: 1U rack mount 1 x [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some notes that I took when I was choosing components for a server to run the KVM-based virtualized environment.</p>
<p><span id="more-112"></span></p>
<h1>Introduction</h1>
<p>The new server was meant to be placed in our DMZ and should run a few virtual machines providing services to external clients.</p>
<p>Some basic hardware requirements were:</p>
<ul>
<li>1U rack mount</li>
<li>1 x Xeon based CPU</li>
<li>8 GB RAM</li>
<li>2 x 500 GB</li>
<li>Hardware RAID</li>
<li>2 x Intel NIC, 1Gbps</li>
</ul>
<p>The software and services which are planned to be installed or implemented:</p>
<ul>
<li>Debian Squeeze</li>
<li>KVM</li>
<li>MySQL</li>
<li>NTP</li>
<li>JBoss</li>
<li>EJBCA</li>
<li>VPN</li>
<li>&#8230;</li>
</ul>
<h2>Some virtualization notes</h2>
<p>There are different performance goals:</p>
<ul>
<li>Single guest performance</li>
<li>Aggregate performance</li>
<li>Density (as much guests running on single host)</li>
</ul>
<p>Virtualization optimization depends on the needs. Experiment with transparent huge pages, try different IO schedulers, try hyperthreading&#8230; High performance virtualization is <strong>hard</strong>. Some things just cannot be emulated efficiently. Timekeeping has always been a virtualization headache. It is good to have a tickless kernel, and pvclock so guests can ask the host what time it is.</p>
<h1>KVM</h1>
<p>KVM (Kernel-based Virtual Machine) is virtualization hypervisor. It is integrated in kernel, lightweight and great in performance. The host machines need to be running either Intel VT or AMD-V chipsets that support hardware-assisted virtualization.</p>
<h1>Hardware</h1>
<h2>CPU</h2>
<p>Since Xeon was on the requirements list, I was looking for ones with the following capabilities:</p>
<ul>
<li>VT-x</li>
<li>Hyperthreading (?)</li>
<li>ECC</li>
</ul>
<p>From the Xeon-5500 series, probably the best model for virtualization is E5520 (2.26GHz) in price/performance estimation. We have chosen quad-core <a href="http://ark.intel.com/products/47925/Intel-Xeon-Processor-E5620-%2812M-Cache-2_40-GHz-5_86-GTs-Intel-QPI%29">Intel® Xeon® E5620</a>. It is a quad core CPU that supports VT-x, ECC memory and hyperthreading.</p>
<p>By the way, the main difference between some cheaper consumer CPU&#8217;s such as Intel&#8217;s I7 and enterprise targeted CPU&#8217;s such as Intel&#8217;s Xeon, is the support for ECC memory which is a must for mission critical applications.</p>
<h3>VT</h3>
<p>Nowadays, Virtualization Technology instruction set is implemented inside the CPU&#8217;s, which makes hypervisors simpler, thus providing better performance over software-only virtualization solutions.</p>
<h3>Hyperthreading</h3>
<p>Is Hyperthreading an advantage or can it have even a negative impact on the system? Because HT takes advantage of unknown variables (cache misses for example), it is hard to take advantage of HT. It seems that nobody has a real idea of how HT impacts on application performances. Depending on application internal architecture HT execution of threads can be a benefit or a real pain. Some suggest switching HT off.</p>
<p>Hyperthreading can reduce scheduling latencies, which reduces spinlock worst case overhead.</p>
<h2>Memory</h2>
<h2>Registered on unbuffered?</h2>
<p>In enterprise server systems, it is a question of registered or unbuffered memory modules. Registered (also called buffered) memory modules have a register between the DRAM modules and the system&#8217;s memory controller. They place less electrical load on the memory controller and allow single systems to <strong>remain stable with more memory modules</strong> than they would have otherwise.</p>
<p>The difference between registered memory and unbuffered memory is whether there are registers on the memory module. Almost all system memory in today’s PCs is unbuffered memory. For those who need to utilize more than 4GB of memory (maybe more like 16GB or 32GB) in a system, registered memory is absolutely a must-have. Registered memory is all about scalability and <strong>stability</strong>. A small performance hit is generally incurred.</p>
<h2>ECC</h2>
<p>ECC stands for Error Checking and Correction. ECC detects and corrects memory errors so it is highly advisable to use this type of modules in servers that utilize multi-gigabytes of memory and usually run 24/7, and have increased probability of soft errors.</p>
<h2>Storage adapter (RAID)</h2>
<p>Beware of fakeraid controllers! Check driver support for your operating system or support in Linux vanilla kernel, and decide whether to use battery backed cache. The cache memory in RAID controllers improves performance to some extent by storing information that was recently used, or that the controller predicts will be used in the future, so it can be supplied to the system at high speed if requested instead of necessitating reads from the slow hard disk platters. Battery backed cache is for data protection from unexpected power outage. In every case, the goal of the cache is the same: to provide a temporary storage area that allows a faster device to run without having to wait for a slower one.</p>
<p>One area where caching can impact performance significantly is write caching, sometimes also called write-back caching. When enabled, on a write, the controller tells the system that the write is complete as soon as the write enters the controller&#8217;s cache; the controller then &#8220;writes back&#8221; the data to the drives at a later time. The reason that write-back caching is so important with RAID is while writes are slightly slower than reads for a regular hard disk, for many RAID levels they are much slower.</p>
<p>Read performance under mirroring is far superior to write performance.</p>
<p>Chosen controller for our system is <a href="http://www.redbooks.ibm.com/abstracts/tips0738.html">ServeRAID M5014 SAS/SATA Controllers</a> because it is supported in Linux vanilla kernel (driver name is <em>megaraid_sa</em>s), and it provides additional performance advantages of an adequate amount of cache (256MB) + we ordered a standard battery backup unit.</p>
<h2>Hard drives</h2>
<p>We have chosen 2 x IBM 500GB 7200 6Gbps NL SAS 2.5&#8243; SFF Slim-HS HDD.</p>
<h3>SAS vs. SATA</h3>
<ul>
<li>SAS is full duplex</li>
<li>SATA uses the ATA command set; SAS uses the <acronym title="Small Computer System Interface">SCSI</acronym> command set</li>
<li>SAS hardware allows multipath I/O to devices while SATA (prior to SATA 3Gb/s) does not</li>
<li>SATA is more consumer, SAS targets critical server applications</li>
<li>SAS error-recovery and error-reporting use <acronym title="Small Computer System Interface">SCSI</acronym> commands which have more functionality than the ATA SMART commands used by SATA drives</li>
</ul>
<h2>Network adapters</h2>
<p>We have chosen Intel Ethernet Dual Port Server Adapter I340-T2 for IBM System x, as it is based on 82580 chip that is supported by Linux in <a title="IBM link to igb driver" href="http://downloadcenter.intel.com/detail_desc.aspx?agr=Y&amp;DwnldID=13663">igb</a> driver.:</p>
<pre class="brush: actionscript3; gutter: true"># dpkg -S "igb.ko"
linux-image-2.6.31-19-generic: /lib/modules/2.6.31-19-generic/kernel/drivers/net/igb/igb.ko
linux-image-2.6.31-20-generic: /lib/modules/2.6.31-20-generic/kernel/drivers/net/igb/igb.ko
linux-image-2.6.31-14-generic: /lib/modules/2.6.31-14-generic/kernel/drivers/net/igb/igb.ko
linux-image-2.6.31-22-generic: /lib/modules/2.6.31-22-generic/kernel/drivers/net/igb/igb.ko
linux-image-2.6.31-23-generic: /lib/modules/2.6.31-23-generic/kernel/drivers/net/igb/igb.ko</pre>
<pre class="brush: actionscript3; gutter: true">...
01:00.0 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)
        Subsystem: Intel Corporation Ethernet Server Adapter I340-T2
...</pre>
<p>When choosing network adapter always be careful to look if the device is supported by Linux (for example, for some Broadcom NeXtreme NIC&#8217;s you don&#8217;t have a driver for Debian).</p>
<h1>Software</h1>
<h2>Operating system</h2>
<p>KVM supports both 32 and 64 bit guests. According to KVM&#8217;s guest list, Debian Squeeze is supported.</p>
<h1>References</h1>
<ol>
<li><a href="http://www.linux-kvm.org/page/Main_Page" target="_blank">http://www.linux-kvm.org/page/Main_Page</a></li>
<li><a title="KVM HOWTO" href="http://www.linux-kvm.org/page/HOWTO" target="_blank">http://www.linux-kvm.org/page/HOWTO</a></li>
<li><a href="http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaai/kvminstall/liaaikvminstallstart.htm" target="_blank">http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaai/kvminstall/liaaikvminstallstart.htm</a></li>
<li><a href="http://searchservervirtualization.techtarget.com/answer/Hyperthreading-in-virtualized-environments" target="_blank">http://searchservervirtualization.techtarget.com/answer/Hyperthreading-in-virtualized-environments</a></li>
<li><a href="http://www.redhat.com/promo/summit/2010/presentations/summit/in-the-weeds/thurs/riel-420-kernel/summit2010-kvm-optimizations.pdf">http://www.redhat.com/promo/summit/2010/presentations/summit/in-the-weeds/thurs/riel-420-kernel/summit2010-kvm-optimizations.pdf</a></li>
<li><a href="http://www.pcguide.com/ref/hdd/perf/raid/conf/advCaching-c.html">http://www.pcguide.com/ref/hdd/perf/raid/conf/advCaching-c.html</a></li>
<li><a href="http://blog.fastmail.fm/2009/10/19/ibm-x3550-m2-or-x3650-m2-and-debianubuntu/">http://blog.fastmail.fm/2009/10/19/ibm-x3550-m2-or-x3650-m2-and-debianubuntu/</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/11/which-hardware-for-virtualization-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client/Server systems</title>
		<link>http://www.pawwa.in.rs/2011/07/clientserver-systems/</link>
		<comments>http://www.pawwa.in.rs/2011/07/clientserver-systems/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 11:58:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[databases]]></category>
		<category><![CDATA[dabases]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=98</guid>
		<description><![CDATA[Today, a friend of mine had asked me about general information regarding DBMS and databases systems. After I started describing the basic theoretical principals, I remembered that back in the days I wrote a quite comprehensive paper on client/server systems, for the local Phearless security e-zine. The article was written in simple and understandable language, [...]]]></description>
			<content:encoded><![CDATA[<p>Today, a friend of mine had asked me about general information regarding DBMS and databases systems. After I started describing the basic theoretical principals, I remembered that back in the days I wrote a quite comprehensive paper on client/server systems, for the local <a title="Phearless Security Ezine" href="http://www.phearless.org" target="_blank"><em>Phearless</em></a> security e-zine. The article was written in simple and understandable language, so I can really recommend it to anyone who wants to introduce himself to distributed systems technology.</p>
<p>The article (in Serbian language) can be found @ <a title="Client/Server Systems" href="http://www.phearless.org/i4/Client-Server_Systems.txt" target="_blank">http://www.phearless.org/i4/Client-Server_Systems.txt</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/07/clientserver-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-28001: Oracle expired passwords</title>
		<link>http://www.pawwa.in.rs/2011/06/ora-28001-oracle-expired-passwords/</link>
		<comments>http://www.pawwa.in.rs/2011/06/ora-28001-oracle-expired-passwords/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 14:19:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=89</guid>
		<description><![CDATA[Sometimes you forget to check the expiry date for your Oracle users. Then, one day applications that use Oracle database are not working any more, and in the log files you find the ORA-28001 error code, meaning that the database user account is expired and the password should be changed. You can check your users [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you forget to check the expiry date for your Oracle users. Then, one day applications that use Oracle database are not working any more, and in the log files you find the <em>ORA-28001</em> error code, meaning that the database user account is expired and the password should be changed.</p>
<p><span id="more-89"></span>You can check your users and their account statuses by using <em>sqlplus</em>, logging in as SYSDBA and checking the information found in <strong>DBA_USERS</strong> table with the following query:</p>
<pre class="brush: sql; gutter: false">SQL&gt; SELECT USERNAME,ACCOUNT_STATUS,EXPIRY_DATE FROM DBA_USERS;</pre>
<p>Note expired users from the resultset and change their password. There are several ways to do this, but the easiest may be to log in as the expired user by using <em>sqlplus</em>, which will ask you for your old password, and then it will prompt you to enter the new one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/06/ora-28001-oracle-expired-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RHEL 6 Cluster Suite</title>
		<link>http://www.pawwa.in.rs/2011/06/rhel-6-cluster-suite/</link>
		<comments>http://www.pawwa.in.rs/2011/06/rhel-6-cluster-suite/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 09:39:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Clustering]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=9</guid>
		<description><![CDATA[This article is supposed to give a rather basic and understandable overview of RHCS in the context of HA (failover) clusters, that is provided by High Availability Add-On for RHEL 6, and also some handful troubleshooting and administration tips using the command line utilities. I tried to stay away from unnecessary and too much detailed [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">This article is supposed to give a rather basic and understandable overview of <em>RHCS</em> in the context of HA (failover) clusters, that is provided by <em>High Availability Add-On</em> for <em>RHEL 6</em>, and also some handful troubleshooting and administration tips using the command line utilities. I tried to stay away from unnecessary and too much detailed information.</p>
<p style="text-align: justify;"><span id="more-9"></span></p>
<h2 style="text-align: justify;">Introduction</h2>
<p style="text-align: justify;">HA clusters provide highly available services by eliminating SPOF&#8217;s and by failing over services from one cluster node to another in case a node becomes inoperative.</p>
<p style="text-align: justify;">The <em>RedHat&#8217;s High Availability Add-On</em> consists of the following major components:</p>
<ul style="text-align: justify;">
<li>Cluster Infrastructure (provides fundamental functions such as configuration, membership, lock management and fencing)</li>
<li>Service Management (provides failover of services)</li>
<li>Administration Tools</li>
</ul>
<h2 style="text-align: justify;">Cluster Infrastructure</h2>
<h3 style="text-align: justify;">cman</h3>
<p style="text-align: justify;"><strong>CMAN manages cluster quorum and cluster membership</strong>. It runs on each node and keeps track of cluster quorum by monitoring the count of cluster nodes, and keeps track of membership by monitoring messages from other cluster nodes. The algorithm that is used to compute the quorum is <em>simple majority</em> &#8211; more than half the nodes in cluster should be online and in communication, in order for quorum to exist. In clustering, if quorum doesn&#8217;t exist, the service can not be provided. Also, quorum prevents a serious condition that could lead to file system inconsistency &#8211; a <a href="http://en.wikipedia.org/wiki/Split-brain_%28computing%29" target="_blank">split-brain</a>. Read about <a href="http://en.wikipedia.org/wiki/Two_Generals%27_Problem">Two Generals&#8217; Problem</a> thought experiment and <a href="http://en.wikipedia.org/wiki/Paxos_algorithm">Paxos</a> algorithm (The most widely known algorithm that solves consensus is Paxos, which can tolerate failure of up to half of the participating nodes). The important thing is that quorum actually can not prevent a split-brain scenario in a literal meaning, but rather decides who is dominant and allowed to function in a cluster. Should split-brain occur, quorum prevents one cluster group from doing anything.</p>
<p style="text-align: justify;">Quorum is determined by communication of messages among cluster nodes via Ethernet. There are some additional checks that can be done prior determining whether to fence a network disconnected node (Quorum Disc, Tie-Breakers).</p>
<p style="text-align: justify;"><em>Corosync</em> is used as the cluster communication layer (as opposed to openais from RHEL 5.x).</p>
<h3 style="text-align: justify;">fenced</h3>
<p style="text-align: justify;">Fencing is the <strong>disconnection of a node from the cluster&#8217;s shared storage</strong>. <strong>It is an ultimate cure for the Split-brain condition</strong>. Fencing cuts off I/O from shared storage, thus ensuring data integrity. The cluster infrastructure performs fencing through the fence daemon, fenced. When CMAN determines that a node has failed, it communicates to other  cluster-infrastructure components that the node has failed. fenced, when  notified of the failure, fences the failed node. Other cluster-infrastructure components determine what actions to take —  that is, they perform any recovery that needs to done. For example, DLM  and GFS2, when notified of a node failure, suspend activity until they  detect that fenced has completed fencing the failed node.</p>
<p>Upon confirmation that the failed node is fenced, DLM and GFS2 perform  recovery. DLM releases locks of the failed node; GFS2 recovers the  journal of the failed node.</p>
<p>Two key elements in the cluster configuration file define a fencing  method: <em>fencing agent</em> and <em>fencing device</em>. The fencing program makes a  call to a fencing agent specified in the cluster configuration file. The  fencing agent, in turn, fences the node via a fencing device. When  fencing is complete, the fencing program notifies the cluster manager.</p>
<p>The High Availability Add-On provides a variety of fencing methods:</p>
<ul>
<li>
<div>Power fencing — A fencing method that uses a power controller to power off an inoperable node</div>
</li>
<li>
<div>Fibre Channel switch fencing — A  fencing method that disables the Fibre Channel port that connects  storage to an inoperable node.</div>
</li>
<li>
<div>Other fencing — Several other  fencing methods that disable I/O or power of an inoperable node,  including IBM Bladecenters, PAP, DRAC/MC, HP ILO, IPMI, IBM RSA II, and  others.</div>
</li>
</ul>
<p style="text-align: justify;">The way in which a fencing method is specified depends on if a node has  either dual power supplies or multiple paths to storage. If a node has dual power supplies, then the fencing method for the node must specify at least two fencing devices — one fencing device for each power supply.</p>
<h3>dlm_controld</h3>
<p>Lock management is a common cluster-infrastructure service that provides  a mechanism for other cluster infrastructure components to <strong>synchronize their access to shared resources</strong>. GFS2 and CLVM use locks from the lock manager. rgmanager uses DLM to synchronize service states.</p>
<h3>Configuration Management</h3>
<p>The cluster configuration file is located at <strong>/etc/cluster/cluster.conf</strong>. The configuration file is an <acronym title="Extensible Markup Language">XML</acronym> file that describes the following cluster characteristics:</p>
<ul>
<li>
<div>Cluster name &#8211; cluster name, cluster.conf revision level, basic fence timing properties</div>
</li>
<li>
<div>Cluster &#8211; node, node name, node ID, number of quoting votes, fencing method for that node</div>
</li>
<li>
<div>Fence device &#8211; fence device with parameters such as IP, user, pass…</div>
</li>
<li>
<div>Managed resources &#8211; specifies  resources required to create cluster services &#8211; failover domains,  resources (IP for example) and services.</div>
</li>
</ul>
<p>&nbsp;</p>
<h2 style="text-align: justify;">Service Management</h2>
<h3 style="text-align: justify;">rgmanager</h3>
<p style="text-align: justify;">rgmanager implements <strong>cold failover</strong> for off-the-shelf (not need to be customized) applications. It allows administrators to define, configure, and monitor cluster services. A cluster service comprises cluster resources which are building blocks that you create and manage in the cluster  configuration file — for example, an IP address, an application  initialization script, or a GFS2 shared partition. In the event of a node failure, rgmanager will relocate the clustered service to another node with minimal service disruption.</p>
<p style="text-align: justify;">There are various processes and agents that combine to make rgmanager work.</p>
<p>You can associate a cluster service with a <em>failover domain</em>. A failover domain is a subset of cluster nodes that are eligible to run a particular cluster service.</p>
<p>There are five <em>service operations</em>, options to <strong>clusvcadm</strong> command that administrator may call to apply one of the following actions:</p>
<ul>
<li>enable (start the service. If start fails it will relocate)</li>
<li>disable (stop the service, place in disabled state. Only permissible if service is in failed state)</li>
<li>relocate (move the service to another node)</li>
<li>stop (stop the service, place in stopped state)</li>
<li>migrate (for virtual machines)</li>
</ul>
<p>There are five <em>service states</em> in which the service can be:</p>
<ul>
<li>disabled (until administrator re-enables the service)</li>
<li>failed (the service is presumed dead, usually when stop operation failed. The Administrator must check that there are no any allocated resources (mounted file systems for example) prior to issuing disable request)</li>
<li>stopped (just a temporary measure)</li>
<li>recovering (the cluster is trying to recover the service. This may be stopped by disabling the service)</li>
<li>started</li>
</ul>
<h2>Administration Tools</h2>
<h2>Conga</h2>
<p><a href="http://sourceware.org/cluster/conga/spec/"><em>Conga</em></a> is a user interface for installing, configuring and managing clusters. It has two components:</p>
<ul>
<li>luci &#8211; application server that provides web interface</li>
<li>ricci &#8211; software daemon that manages the distribution of cluster configuration. In RHEL 6 ricci replaces ccsd. Users define the configuration using Luci interface, and it is passed to corosync for distribution to cluster nodes. ricci must be run on every cluster node.</li>
</ul>
<h2>Command Line Tools</h2>
<p>There are a few handy CLI tools at administrator&#8217;s disposal for checking and managing the cluster.</p>
<h3>Starting the cluster software on a node</h3>
<p>Run commands in the following order:</p>
<pre class="brush: bash; gutter: false"># service cman start
# service rgmanager start</pre>
<h3>Stopping the cluster software on a node</h3>
<p>Run commands in the following order:</p>
<pre class="brush: bash; gutter: false"># service rgmanager stop
# service cman stop</pre>
<p>Stopping cluster software on a node causes its HA services to fail over  to another node. As an alternative to that, consider relocating or  migrating HA services to another node before stopping cluster software, using the <em>clusvcadm</em> command.</p>
<h3>clustat</h3>
<p>Use the <em>clustat</em> utility to display cluster-wide status, such as membership information, quorum and state of services:</p>
<pre class="brush: bash; gutter: false"># clustat -l
Cluster Status for MY_CLUSTER @ Mon Jun 20 15:59:48 2011
Member Status: Quorate

 Member Name                                                     ID   Status
 ------ ----                                                     ---- ------
 node01                                                             1 Online, Local, rgmanager
 node02                                                             2 Online, rgmanager

Service Information
------- -----------

Service Name      : service:MY_SERVICE
  Current State   : started (112)
  Owner           : node01
  Last Owner      : node01
  Last Transition : Tue Jun 14 09:46:25 2011</pre>
<p>Service status can be one of the following:</p>
<ul>
<li>Started</li>
<li>Recovering &#8211; The service is pending start on another node.</li>
<li>Disabled &#8211; disabled service is never automatically started by the cluster.</li>
<li>Stopped &#8211; temporary state, the service will be evaluated for starting after the next service or node transition. You may disable or enable the service from this state.</li>
<li>Failed &#8211; the service is dead. A service is placed into this state whenever a resource&#8217;s <em>stop</em> operation fails. After a service is placed into this state, you must  verify that there are no resources allocated (mounted file systems, for  example) prior to issuing a disable request. The only operation that can take place when a service has entered this state is disable.</li>
<li>Uninitialized</li>
</ul>
<h3>clusvcadm</h3>
<p><em>clusvcadm</em> is a cluster administration utility, which enables an administrator to enable, disable, relocate and restart user services in cluster. Some of the useful <em>clusvcadm</em> commands are:</p>
<ul>
<li>clusvcadm -e &lt;service_name&gt; -m &lt;member&gt; &#8211; start the service.</li>
<li>clusvcadm -d &lt;service_name&gt; &#8211; stop the service and place in <em>disabled</em> state. This is the only permissible operation when a service is in the <em>failed</em> state.</li>
<li>clusvcadm -r &lt;service_name&gt; -m &lt;member&gt; &#8211; relocate the service to another node. If no permissible target node in the cluster successfully starts the  service, the relocation fails and the service is attempted to be  restarted on the original owner. If the original owner cannot restart  the service, the service is placed in the <em>stopped</em> state.</li>
<li>clusvcadm -s &lt;service_name&gt; &#8211; stop the service and place in <em>stopped</em> state.</li>
<li>clusvcadm -R &lt;service_name&gt; &#8211; restart the service.</li>
</ul>
<h3>cman_tool</h3>
<p><em>cman_tool</em> manages the cluster management subsystem. You can use this tool to join the node to a cluster, leave the cluster, kill another cluster node&#8230; Some useful <em>cman_tool</em> commands are:</p>
<ul>
<li> cman_tool version -r &#8211; distribute the new cluster.conf version to all the nodes</li>
<li>cman_tool debug -d &lt;value&gt; &#8211; sets  the  debug  level  of the running cman daemon. Debug output will be sent to syslog level LOG_DEBUG. The -d switch specifies the new logging level:
<ul>
<li>2 Barriers</li>
<li>4 Membership messages</li>
<li>8 Daemon operation, including command-line interaction</li>
<li>16 Interaction with Corosync</li>
<li>32 Startup debugging (cman_tool join operations only)</li>
</ul>
</li>
</ul>
<blockquote></blockquote>
<h3>fence_tool</h3>
<p><em>fence_tool</em> controls and queries the fenced daemon. Some useful commands are:</p>
<ul>
<li>fence_tool ls &#8211; display internal fenced state</li>
<li>fence_tool dump &#8211; print the internal fenced debug buffer to stdout</li>
</ul>
<h3>fence_node</h3>
<p><em>fence_node</em> can be used to fence the node using agent based on cluster.conf parameters.</p>
<h2>Troubleshooting</h2>
<p>Cluster can be difficult to troubleshoot and diagnose, but there are some common issues that system administrators are more likely to encounter when administrating the cluster. Here is a small list, that will hopefully expand over time:</p>
<ul>
<li>Cluster uses multicast for communication between nodes, so make sure that this is not blocked, delayed or otherwise interfered</li>
<li>Ensure that firewall rules are not blocking the traffic</li>
<li>Ensure that interfaces that are used for cluster communication are not using some exotic bonding mode (0 or round-robin mode is fine) or VLAN tagging</li>
<li>Use <em>tcpdump</em> on each node to check network traffic</li>
<li>Cluster services may hang, and cluster nodes may have different view of cluster membership. Sometimes it is necessary to reboot the nodes to make the cluster up and running again. This conditions can be checked in the following ways:
<ul>
<li>Fence operation may have failed (check the logs for any failed fence messages)</li>
<li>Verify if network is up</li>
<li>Verify that if some nodes have left the cluster, if the cluster is quorate (if it is not &#8211; the service or storage fill hang)</li>
</ul>
</li>
<li>Common problem is unusual failover behaviour. The services may refuse to start on failover. Make sure you understand how some features and conditions of your cluster service may affect failover.</li>
<li>The root cause of fences is <em>always</em> when a node loses a token, meaning that it lost communication with the rest of the cluster and stopped returning heartbeats.
<ul>
<li>If a node does not return a token within token interval, fence is taking place. Default token interval is 10 seconds, and it can be specified in cluster.conf</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/06/rhel-6-cluster-suite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to differentiate between local and SAN storage?</title>
		<link>http://www.pawwa.in.rs/2011/06/how-to-differentiate-between-local-and-san-storage/</link>
		<comments>http://www.pawwa.in.rs/2011/06/how-to-differentiate-between-local-and-san-storage/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 13:11:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=72</guid>
		<description><![CDATA[By looking at fdisk -l output you cannot know whether, for example, /dev/sda is locally attached disk or is it available from SAN. # fdisk -l Disk /dev/sda: 200.0 GB, 200000143360 bytes 255 heads, 63 sectors/track, 24315 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System [...]]]></description>
			<content:encoded><![CDATA[<p>By looking at <em>fdisk -l</em> output you cannot know whether, for example, /dev/sda is locally attached disk or is it available from SAN.</p>
<p><span id="more-72"></span></p>
<pre class="brush: bash; gutter: true"># fdisk -l                                                                                                                 

Disk /dev/sda: 200.0 GB, 200000143360 bytes
255 heads, 63 sectors/track, 24315 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       24315   195310206   83  Linux 

Disk /dev/sdb: 2000 MB, 2000683008 bytes
62 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 3844 * 512 = 1968128 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1016     1952721   83  Linux 

Disk /dev/sdc: 140.0 GB, 140000624640 bytes
255 heads, 63 sectors/track, 17020 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       17020   136713118+  83  Linux 

Disk /dev/sdd: 400.0 GB, 400000286720 bytes
255 heads, 63 sectors/track, 48630 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       48630   390620443+  83  Linux 

Disk /dev/sde: 2857.7 GB, 2857795321856 bytes
255 heads, 63 sectors/track, 347440 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1      267349  2147480811   83  Linux
/dev/sde2          267350      347440   643330957+  83  Linux

Disk /dev/sdf: 899.9 GB, 899949789184 bytes
255 heads, 63 sectors/track, 109412 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1      109412   878851858+  83  Linux

Disk /dev/sdg: 599.9 GB, 599965827072 bytes
255 heads, 63 sectors/track, 72941 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1       72941   585898551   83  Linux

Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 63 sectors/track, 17844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          13      104391   83  Linux
/dev/cciss/c0d0p2              14       17844   143227507+  8e  Linux LVM

Disk /dev/cciss/c0d1: 146.7 GB, 146778685440 bytes
255 heads, 32 sectors/track, 35132 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

Disk /dev/cciss/c0d1 doesn't contain a valid partition table</pre>
<p>But, you can compare <em>fdisk</em> output with the contents of sysfs virtual filesystem which exports information about devices and drivers, for example:</p>
<pre class="brush: bash; gutter: true"># ls -l /sys/block/*/device
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/cciss!c0d0/device -&gt; ../../devices/pci0000:00/0000:00:03.0/0000:06:00.0/disk0
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/cciss!c0d1/device -&gt; ../../devices/pci0000:00/0000:00:03.0/0000:06:00.0/disk1
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/hda/device -&gt; ../../devices/pci0000:00/0000:00:1f.1/ide0/0.0
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/sda/device -&gt; ../../devices/pci0000:00/0000:00:02.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/host0/target0:0:1/0:0:1:1
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/sdb/device -&gt; ../../devices/pci0000:00/0000:00:02.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/host0/target0:0:1/0:0:1:2
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/sdc/device -&gt; ../../devices/pci0000:00/0000:00:02.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/host0/target0:0:1/0:0:1:3
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/sdd/device -&gt; ../../devices/pci0000:00/0000:00:02.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/host0/target0:0:1/0:0:1:4
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/sde/device -&gt; ../../devices/pci0000:00/0000:00:02.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/host0/target0:0:1/0:0:1:5
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/sdf/device -&gt; ../../devices/pci0000:00/0000:00:02.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/host0/target0:0:1/0:0:1:6
lrwxrwxrwx 1 root root 0 Jun 20 14:58 /sys/block/sdg/device -&gt; ../../devices/pci0000:00/0000:00:02.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/host0/target0:0:1/0:0:1:7
</pre>
<p>So, in this output I see that /dev/cciss/c0d0 and /dev/cciss/c0d1 are local drives (<a title="CCISS" href="http://cciss.sourceforge.net/" target="_blank">cciss</a> is a driver for HP&#8217;s Smart Array disk controllers), /dev/hda is probably mapped to my CD-ROM device, and /dev/sd[a-g] are exports from SAN storage (note the host0 and target0).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/06/how-to-differentiate-between-local-and-san-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HASP SRM</title>
		<link>http://www.pawwa.in.rs/2011/05/hasp-srm/</link>
		<comments>http://www.pawwa.in.rs/2011/05/hasp-srm/#comments</comments>
		<pubDate>Fri, 20 May 2011 14:21:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.pawwa.in.rs/?p=28</guid>
		<description><![CDATA[HASP is an acronym for Hardware Against Software Piracy, and is generally employed for software copy protection. This software DRM (Digital Rights Management) technique can be used by software vendors to protect their copyrighted software from piracy and therefore secure their intellectual property assets. I had a chance to use HASP SRM solution from Aladdin [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em> HASP</em> is an acronym for <em>Hardware Against Software Piracy</em>, and is generally employed for <strong>software copy protection</strong>. This software <em>DRM</em> (<em>Digital Rights Management</em>) technique can be used by software vendors to protect their copyrighted software from piracy and therefore secure their intellectual property assets. I had a chance to use <em>HASP SRM</em> solution from <em>Aladdin Knowledge Systems</em> (<em>AKS</em>, an Israeli security vendor which is acquired by <a title="SafeNet" href="http://www.safenet-inc.com/?aldn=true"><em>SafeNet</em></a> &#8211; one of the largest suppliers of encryption technology to the United States Government).</p>
<p style="text-align: center;"><span id="more-28"></span></p>
<h2 style="text-align: justify;">Vendor suite introduction</h2>
<p style="text-align: justify;">Aladdin&#8217;s software suite has a number of tools, for example the <em>HASP SRM Envelope</em> which wraps the application with a protective shield which incorporates anti-reverse engineering, file encryption, code obfuscation, system-level anti-debugging, and automatic licensing. There is also <em>HASP SRM Business Studio</em> and <em>Business Studio Server</em> which give a single centralized system for management of the licences and protection keys.</p>
<p style="text-align: justify;">To protect the software, I have used hardware based protection keys (<em>HASP HL</em>), which come in the form of dongles. Dongles are USB plugs with a little more EPROM than usual and custom ASIC coated in epoxy to prevent tampering. The idea behind a dongle protection is that the developer is issuing checks against return values obtained from the dongle, either by reading directly from its memory or using some internal algorithm. Aladdin&#8217;s hardware keys implement full on-chip AES encryption. With a symmetric encryption system such as AES all of the security rests in the secrecy of the actual key, AES has thus far proven itself very resistant indeed to any known attacks aimed at recovering the key,  and this implies that <em>HASP-HL</em> itself ought to be very secure as well.</p>
<h2 style="text-align: justify;">Vendor keys</h2>
<p style="text-align: justify;">I&#8217;ve been provided with two <em>HASP SRM Vendor Keys</em>:</p>
<ol>
<li><em>Master key</em> &#8211; used for licence production (it is connected to the <em>Business Studio Server</em> machine)</li>
<li><em>Developer key</em> &#8211; used to protect programs</li>
</ol>
<p style="text-align: justify;">I used the <em>Cross-Locking</em> technology which enabled a protected application to work with a <em>HASP HL</em> key, since I only wanted to employ the copy protection.</p>
<h2 style="text-align: justify;">Roles</h2>
<p style="text-align: justify;">The <em>HASP SRM</em> system is role-based, I will briefly describe some of them:</p>
<ul>
<li><em>Product Manager</em> determines the product components to be protected (called <em>Features</em>).</li>
<li><em>Development</em> role is for protecting the software using the <em>HASP SRM Envelope</em></li>
<li><em>Order Management</em> role is for defining and managing customer orders</li>
<li><em>Production</em> role is for producing customer orders</li>
</ul>
<h2>Steps to protect the software</h2>
<p>The steps to copy protect the application are enumerated:</p>
<ul>
<li>Install the software (<em>HASP SRM Business Studio Server </em>and<em> Vendor Suite)</em></li>
</ul>
<p>I have choosen to install the software on a <em>VirtualBox</em> machine, and I encountered a problem &#8211; while starting the installation of <em>HASP SRM</em>, the machine (<em>Windows XP SP3</em>) would just go to blue screen of death and restart. To resolve the problem I had to have a VT-x capable processor, that is to support hardware virtualization, which I luckily enough had:</p>
<pre class="brush: bash; gutter: false;">$ grep vmx /proc/cpuinfo
 flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm ida tpr_shadow vnmi flexpriority
 flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm ida tpr_shadow vnmi flexpriority</pre>
<p>But to get it to work, I did had to enable these virtualization extensions through my BIOS first, and then for the <em>VirtualBox</em> machine.</p>
<ul>
<li>Launch <em>HASP SRM Vendor Suite</em> and introduce two Vendor keys to the system</li>
<li>Define <em>Features</em> in <em>Business Studio</em> (a <em>Feature</em> is an identifiable functionality of a software application that can be independently licensed).</li>
<li>Use <em>Envelope </em>in <em>Work Offline</em> mode to apply protection to my application. Prior to protecting the .exe I had to select my <em>Vendor Code</em>, and add a few required assemblies for my application to a folder, and include that folder in assembly path in <em>Envelope</em>, or otherwise I would get errors complaining that some DLLs are missing.</li>
<li>Define a <em>Product</em> in <em>Business Studio (Manage Products) </em>with a perpetual license<em>.</em></li>
<li>Define and produce <em>Orders</em> in <em>Business Studio (Manage Orders)</em>, for previously defined products, and lock its license to the <em>HASP HL</em> protection key. The <em>Orders</em> are produced for a specific customer that has to be created in the system. In this section I have also burned the data to <em>HASP HL</em> key. If I hadn&#8217;t burned the key and tried to run the application with the key pluged in, I would get the &#8220;<em>Feature not found</em> (H0031)&#8221; error.</li>
<li>As an end-user I have tested everything: copied the protected binary over the unprotected one, installed the drivers for HASP HL protection keys (otherwise it would print an error message &#8220;<em>Unable to access HASP SRM Run-time Environment (H0033)</em>&#8220;), and tested it with the wrong key (error message was &#8220;<em>Feature not found</em> (H0031)&#8221;), without the key (it showed an error message that I have defined), and with the key with success.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.pawwa.in.rs/2011/05/hasp-srm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

