<?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>Admon Home &#187; centos</title>
	<atom:link href="http://www.admon.org/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.admon.org</link>
	<description>Linux System Administration</description>
	<lastBuildDate>Wed, 08 Feb 2012 10:24:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Batch rename files in Linux</title>
		<link>http://www.admon.org/batch-rename-files-in-linux/</link>
		<comments>http://www.admon.org/batch-rename-files-in-linux/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 07:55:35 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[rename]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=595</guid>
		<description><![CDATA[Is there any easy ways to batch rename files in Linux? A common requirement is that the web developers may ask you to help rename all *.html files to *.htm, how can we do that? Someone probably will say that they can make a simple script in some minutes to do this kind of things. [...]]]></description>
			<content:encoded><![CDATA[<p>Is there any easy ways to batch rename files in Linux? A common requirement is that the web developers may ask you to help rename all <em>*.html</em> files to<em> *.htm</em>, how can we do that?<span id="more-595"></span></p>
<p>Someone probably will say that they can make a simple script in some minutes to do this kind of things. Actually you don&#8217;t need to recreate the wheel, the operating system have supplied such an utility already, the command is rename, it&#8217;s part of the <a href="http://www.kernel.org/pub/linux/utils/util-linux/">util-linux package</a>.</p>
<p>With the help of this command, it&#8217;s a very easy work to bulk rename files.<br />
But, note that this command is a little different by systems.<br />
Here we&#8217;ll show the usage examples for <strong>rename</strong> in both Redhat / CentOS and Debian / Ubuntu.</p>
<p><strong>1, Batch rename files in Redhat / CentOS</strong><br />
For the scenario we mentioned above, it can be done like this:</p>
<pre>$ rename .html .htm *</pre>
<p>It renames all files in current working directory that match <em>*.html*</em> to <em>*.htm*</em>.<br />
Note that only the first matched occurrence will be modified. If there&#8217;s a file called <em>abc.html.abc.html</em>, after renamed once, the new name is abc.htm.abc.html, not abc.html.abc.htm.</p>
<p><strong>2, Bulk rename files in Debian / Ubuntu</strong><br />
The command here in Debian are quite different which makes it more powerful and professional.<br />
I&#8217;ll show two examples with explaination:</p>
<pre>$ rename -n 's/.html$/htm/' *</pre>
<p><em>-n</em> means no action will be applied, it will shows detailed information on what files would have been renamed:</p>
<pre>$ rename -n 's/.html$/.htm/' abc.html.abc.html
abc.html.abc.html renamed as abc.html.abc.htm</pre>
<p>The expression regunation here is in Perl style, which means you can apply multiple actions at one time, like this:</p>
<pre>$ rename 's/.html$/htm/, s/css/css.backup/, s/jscript/js/' *</pre>
<p>For more details you can raise a forum thread <a href="http://forum.admon.org/linux-scripting/">here at our support forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/batch-rename-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RHEL 5.5 Released yesterday</title>
		<link>http://www.admon.org/rhel-5-5-released-yesterday/</link>
		<comments>http://www.admon.org/rhel-5-5-released-yesterday/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 11:56:16 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[rhel-5.5]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=572</guid>
		<description><![CDATA[Redhat.com release another update of RHEL5 yesterday at 2010/03/30. This minor update releases typically provide feature enhancements, bugfixes and new hardware support. From the release notes: Highlights of the Red Hat Enterprise Linux 5.5 release include hardware enablement for the Intel Boxboro-EX platform, AMD Magny-Cours processor and IBM Power 7 processor. Virtualization is improved, with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.redhat.com/"><a href="http://planet.admon.org/wp-content/uploads/2010/03/redhat.jpg"><img class="alignleft size-full wp-image-747" title="redhat" src="http://planet.admon.org/wp-content/uploads/2010/03/redhat.jpg" alt="Redhat Linux Logo" width="150" height="150" /></a>Redhat.com</a> release another update of RHEL5 yesterday at 2010/03/30.</p>
<p>This minor update releases typically provide feature enhancements, bugfixes and new hardware support. From the <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.5/html/Release_Notes/">release notes</a>:<br />
<span id="more-572"></span><br />
Highlights of the <strong>Red Hat Enterprise Linux 5.5</strong> release include hardware enablement for the <a href="http://www.theregister.co.uk/2009/05/26/intel_nehalem_ex_preview/print.html">Intel Boxboro-EX</a> platform, AMD <a href="http://blogs.amd.com/work/tag/magny-cours/">Magny-Cours processor</a> and <a href="http://www-03.ibm.com/systems/power/">IBM Power</a> 7 processor.<br />
Virtualization is improved, with support for multiple 10 GigE <a href="http://blog.scottlowe.org/2009/12/02/what-is-sr-iov/">SR-IOV cards</a>, and automatic usage of hugepages for virtual guest memory when enabled on the system. Interoperability improvements include boot support for virtual machines using Microsoft based PXE services.</p>
<p>A summary of technical details would highlight:</p>
<ul>
<li>Kickstart improvements to logging post-install</li>
<li>New hardware driver support (<a href="http://www.pmc-sierra.com/sas-expanders-loopswitch-chips/">pmcraid</a>, ibmvfs, bfa, be2iscsi)</li>
<li>Updated hardware support (too many to list)</li>
<li>Run-time memory allocation for KVM guests (memory ballooning)</li>
<li>PCI passthrough improvements (hotswapping PCI devices, 1:1 performance improvements)</li>
<li>Detecting kernel tasks stuck in the uninterruptible sleep state (D-state)</li>
<li>Improved <a href="http://planet.admon.org/howto/how-to-change-default-io-scheduler/">CFQ I/O scheduler</a> performance</li>
<li>Kernel CIFS updates and new GFS mount option (for troubleshooting)</li>
</ul>
<p>Apart from this Red Hat also shared Technology Previews within each release. Functionality that is not yet supported, but available for testing purposes:</p>
<ul>
<li>FCoE (Fibre Channel over Ethernet)</li>
<li>ext4 filesystem support</li>
<li>gcc 4.4 and new glibc malloc</li>
<li>Trusted Platform Module (TPM) hardware support</li>
<li>eCryptfs cryptographic filesystem</li>
<li>Stateless Linux</li>
<li>SGPIO Support for dmraid</li>
<li>Device Failure Monitoring of RAID sets</li>
<li>iSER support (block storage transfer across a network)</li>
</ul>
<p>The above Technology Preview features of <a href="http://planet.admon.org/howto/rhel-5-5-released-yesterday/">RHEL5.5</a> may become part of a future RHEL5 release! Even though there is no predicted timeline for CentOS releases, CentOS 5.5 is not expected before May 4th 2010.</p>
<p>For more details on the changelog, please check the <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.5/html/Release_Notes/">release notes</a> here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/rhel-5-5-released-yesterday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to skip updating certain packages by YUM</title>
		<link>http://www.admon.org/how-to-skip-updating-certain-packages-by-yum/</link>
		<comments>http://www.admon.org/how-to-skip-updating-certain-packages-by-yum/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 07:58:37 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[system updates]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=557</guid>
		<description><![CDATA[I&#8217;m runing RHEL/CentOS for a group of database servers, and they mainly use MySQL for productive services. Recently I noticed that MySQL&#8217;s new feathers and bug fixes that comes from system updates make little sense to our needs, so I&#8217;m planing not to apply these changes on our live servers, unless it&#8217;s really needed. The [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m runing RHEL/CentOS for a group of database servers, and they mainly use MySQL for productive services. Recently I noticed that MySQL&#8217;s new feathers and bug fixes that comes from <a href="http://mirror.centos.org/centos/5/updates/">system updates</a> make little sense to our needs, so I&#8217;m planing not to apply these changes on our live servers, unless it&#8217;s really needed.<span id="more-557"></span></p>
<p>The question is: How can I disable a certain package from being updated by <a href="http://yum.baseurl.org/">Yum</a> in Linux server environment?</p>
<p>After having a check with the parameter &#8220;<em>&#8211;help</em>&#8220;, I know that the Yum under RedHat / CentOS has an option &#8220;<em>&#8211;exclude</em>&#8220;, and it will exclude a specific package by name or shell glob (* or ?) from being updated, here&#8217;re two examples:</p>
<p><strong>1, Bypass updates for an exact package</strong><br />
You can just run this command. Note that you need to login as privileged user to use following commands:</p>
<pre>yum --exclude=mysql-server update</pre>
<p><strong>2, Bypass some packages with glob</strong><br />
For example, with the following command, you can exclude both mysql-client and mysql-server from update:</p>
<pre>yum --exclude=mysql* update</pre>
<p>There&#8217;s another alternative way to bypass the package.<br />
Yum also supplies a <strong>configuration parameter</strong> that can be used in <em>/etc/yum.conf</em> to bypass specified packages completely.<br />
To exclude packages from being updated, you can edit <em>/etc/yum.conf</em> and add one line as below:</p>
<pre>exclude=mysql*</pre>
<p>Further readings:  <a href="http://www.centos.org/docs/5/html/yum/sn-updating-your-system.html">Updating Your System with yum</a><br />
For any issues, it&#8217;s welcome to create postings at our support forum at <a href="http://forum.admon.org/">forum.admon.org</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/how-to-skip-updating-certain-packages-by-yum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update CentOS 4 to CentOS 5 remotely</title>
		<link>http://www.admon.org/update-centos-4-to-centos-5-remotely/</link>
		<comments>http://www.admon.org/update-centos-4-to-centos-5-remotely/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 14:36:24 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=510</guid>
		<description><![CDATA[I just successfully updated my Dell PowerEdge 1850 from CentOS 4.8 to CentOS 5.4, luckily the issues I faced were not so rare. The steps I used are listed below, may it helpful for you as well! Although this post is mainly intended for CentOS it should work on RHEL systems as well. Before you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://planet.admon.org/wp-content/uploads/2009/12/centos5-150x150.png"><img class="alignleft size-full wp-image-749" title="centos5-150x150" src="http://planet.admon.org/wp-content/uploads/2009/12/centos5-150x150.png" alt="CentOS-5 Logo" width="150" height="150" /></a>I just successfully updated my Dell <a href="http://reviews.zdnet.co.uk/hardware/servers/0,1000001736,39193837,00.htm">PowerEdge 1850</a> from CentOS 4.8 to CentOS 5.4, luckily the issues I faced were not so rare. The steps I used are listed below, may it helpful for you as well! Although this post is mainly intended for CentOS it should work on RHEL systems as well.</p>
<p>Before you start, A word of advice i believe most experienced RHEL/CentOS users will show you regarding what you&#8217;re thinking:</p>
<p>Upgrade between minor versions (i.e. CentOS 5.2 -&gt; 5.3 -&gt; 5.4, or even 5.0 -&gt; 5.4) YES<br />
Upgrade between major system versions (i.e. CentOS 4.8 to CentOS 5.4) NO<span id="more-510"></span></p>
<p>As far as I recall, not even Red Hat recommends this &#8211; although they do guarantee the miner updates will go smoothly. Even if you manage to hammer that 4.8 to 5.4 upgrade into place, you might end up with a mess that will be very difficult to maintain. Before processing the system update, it&#8217;s suggested to create a backup!</p>
<p>If you are currently running a version of RHEL/CentOS earlier than 4.8 (<em>cat /etc/redhat-release</em>), then please do a proper &#8216;<em>yum update</em>&#8216; and get your current system updated to 4.8 before we start.</p>
<p>Then the first thing we need to do is to make sure none of our core binaries, libraries or other content is immutable as it causes package installation failures. If you use immutable bits on system paths then you should run these commands:</p>
<pre>chattr -Ria /bin
chattr -Ria /etc
chattr -Ria /etc
chattr -Ria /include
chattr -Ria /lib
chattr -Ria /sbin
chattr -Ria /usr/bin
chattr -Ria /usr/include
chattr -Ria /usr/lib
chattr -Ria /usr/libexec
chattr -Ria /usr/local/bin
chattr -Ria /usr/local/include
chattr -Ria /usr/local/lib
chattr -Ria /usr/local/sbin
chattr -Ria /usr/sbin
chattr -Ria /usr/share
chattr -Ria /var/lib
chattr -Ria /var/lock
chattr -Ria /var/log
chattr -Ria /var/run
chattr -Ria /var/spool/repackage</pre>
<p>Once finished, go ahead and have a quick run through of cleaning up yum cache, double check that any pending updates are installed and <a href="http://planet.admon.org/howto/rpm-common-usage-examples/">rebuild the rpmdb</a>:</p>
<pre>yum clean all &amp;&amp; yum update</pre>
<p>If you run into any dependency issues for packages that are not essential, such as syslinux and lftp then you can either exclude them or better just remove them. If the denpency issue is openssh-server related, you can enable telnet login during update by modifing <em>/etc/xinetd.d/telnet</em>.</p>
<pre>rpm -e lftp syslinux mkboot</pre>
<p>OR (but not recommended)</p>
<pre>yum update --exclude=syslinux --exclude=lftp --exclude=mkboot</pre>
<p>At this point you should be able to run a &#8216;<em>yum update</em>&#8216; command with optional exclude and receive no errors. Now we are ready to get going, please google around, find and download these packages, they mostly available at <a href="http://mirror.centos.org/centos/5.4/os/i386/CentOS/">CentOS official mirror site</a>:</p>
<pre># ls
centos-release-5-4.el5.centos.1.i386.rpm    python-elementtree-1.2.6-5.el4.centos.i386.rpm
centos-release-notes-5.4-4.i386.rpm       python-elementtree-1.2.6-5.el5.i386.rpm
kernel-2.6.18-164.el5.i686.rpm            python-elementtree-1.2.6-5.i386.rpm
kernel-devel-2.6.18-164.el5.i686.rpm      python-sqlite-1.1.7-1.2.1.i386.rpm</pre>
<p>We need to go ahead and setup the centos-release package as follows:</p>
<pre>rpm -Uhv centos-release-*.rpm</pre>
<p>If you see that CentOS-Base.repo was created as <em>/etc/yum.repos.d/CentOS-Base.repo.rpmnew</em> then move it to the right place:</p>
<pre># mv /etc/yum.repos.d/CentOS-Base.repo.rpmnew /etc/yum.repos.d/CentOS-Base.repo</pre>
<p>Now we are ready to go with kernel changes, this is an important part so pay attention. The key to successful upgrade is that you remove ALL OLD KERNELS as many packages will fail to install during the upgrade if they detect a release 4.x kernel due to minimum kernel version dependency checks. We will first start with installing the new CentOS 5.4 kernel so it preserves grub templating:</p>
<pre>rpm -ivh kernel-2.6.18-164.el5.i686.rpm kernel-devel-2.6.18-164.el5.i686.rpm --nodeps</pre>
<p>NOTE: release 5.x has smp support integrated into the standard kernel, so no *-smp version is required for multi-processor systems.</p>
<p>If you are running an older system the chances are you got allot of older kernel packages installed, so make sure you get them all out of the way:</p>
<pre>rpm -e $(rpm -qa | grep kernel | grep -v 2.6.18 | tr 'n' ' ') --nodeps</pre>
<p>That said and done you should now only have 2 kernel packages installed which are the 2.6.18 release 5.x kernels. DO NOT under any circumstance continue if you still got 2.6.9 release 4.x kernels packages installed, remove them ALL!</p>
<pre># rpm -qa | grep -i kernel
kernel-2.6.18-164.el5
kernel-devel-2.6.18-164.el5</pre>
<p>A cleanup of <em>/etc/grub.conf</em> may be required, though the rpm command should have done this for you already, but review it anyways for good measure. You should find that 2.6.18-164.el5 is the only kernel in the file. When kernel updated, a reboot here is OK, but it&#8217;s not suggested.</p>
<p>Then we can continute the system updates. There is a known bug with python-elementtree package versions which cause yum/rpm to think the release 4.x version is newer than the 5.x version, to get around this without blowing up the entire python installation we need to remove the package from just the rpmdb as follows:</p>
<pre>rpm -e --justdb python-elementtree --nodeps</pre>
<p>We can now go ahead and use yum to start the upgrade process, this is a dry run and will take some minutes to compile list of available packages and associated dependency checks. You should carry the exclude options, if any, that you used during the &#8216;yum update&#8217; process as so to avoid unresolvable dependencies:</p>
<pre>yum clean all
yum upgrade</pre>
<p>You will end up with a small list of dependency errors, these should be resolved by again evaluating a packages need as a critical system component and either removing it with &#8216;<em>rpm -e</em>&#8216; or excluding it with &#8216;<em>–exclude</em>&#8216; (remember to <a href="http://planet.admon.org/howto/rpm-common-usage-examples/">query description</a> if you are unsure what something does). In my case the packages that threw up red flags were stuff I had manually installed over time such as nfs in addition to default installed samba, these can all safely be removed or excluded as you prefer.</p>
<pre>    Error: Missing Dependency: perl(Convert::ASN1) is needed by package samba
    Error: Missing Dependency: libevent-1.1a.so.1 is needed bypackage nfs-utils</pre>
<p>At this point you should be ready to do a final dry run and see where we stand on dependencies, rerun the earlier &#8216;<em>yum upgrade</em>&#8216; while making sure to carry over any exclude options you are using.</p>
<p>You should now end up with a summary of actions that yum needs to perform, go ahead and kick it off&#8230; this will take a bit time to complete.</p>
<pre>    Transaction Summary
    ===========================================================
    Install 183 Package(s)
    Update 527 Package(s)
    Remove 0 Package(s)
    Total download size: 679 M
    Is this ok [y/N]:<strong>Y</strong>
</pre>
<p>Once yum has completed we need to fix a few things, the first is the rpmdb needs a rebuild due to version changes that will cause any rpm commands to fail:</p>
<pre>rm -f /var/lib/rpm/__db.00*
rpm --rebuilddb
yum clean all</pre>
<p>The next issue on the list is python-elementtree and python-sqlite, one or both of these may have <a href="http://forum.admon.org/rhel-centos/7355-yum-no-module-named-sqlite-resovled.html">ended up in a broken state</a> that will cause all yum commands to break, so we will go ahead and reinstall both of them:</p>
<pre>rpm -e --justdb python-elementtree --nodeps
rpm -ivh python-elementtree-1.2.6-5.el5.i386.rpm
rpm -ivh python-sqlite-1.1.7-1.2.1.i386.rpm --nodeps --force</pre>
<p>The yum command should now work, go ahead and run it with no options, if you do not get any errors, you are all sorted!</p>
<p>Hopefully the install went well for you, the only thing left to do is go ahead and reboot the system:</p>
<pre>shutdown -rf now</pre>
<p>For the sake of avoiding a system raised fsck, we will reboot with the -f option to skip fsck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/update-centos-4-to-centos-5-remotely/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Avoid IP conflicts in Xen DomU</title>
		<link>http://www.admon.org/avoid-ip-conflicts-in-xen-domu/</link>
		<comments>http://www.admon.org/avoid-ip-conflicts-in-xen-domu/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 09:23:32 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[IP conflicts]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=425</guid>
		<description><![CDATA[Recently I’m playing with Xen virtualization, and I came across one protential problem. As I need to share my guest machines to clients,  I must give them root privileges&#8230; that’s whats VPS-es all about&#8230; having root access to OS without having to purchase expensive physical ones.  So having that in mind they are by default [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I’m playing with Xen virtualization, and I came across one protential problem. As I need to share my guest machines to clients,  I must give them root privileges&#8230; that’s whats <a href="http://en.wikipedia.org/wiki/Virtual_private_server">VPS</a>-es all about&#8230; having root access to OS without having to purchase expensive physical ones.  So having that in mind they are by default untrusted and unpredictable. Probably only god knows what they will do on their VMs!<span id="more-425"></span></p>
<p>So what&#8217;s the exact problem here?</p>
<p>By default xen, and all those tools, like <a href="http://www.cpanel.net/">Cpanel / WHM</a> and  <a href="http://www.webmin.com/">Webmin</a>, don’t really have a way of sorting out ip conflicts. So basically you have some scripts that will setup clients ip address during his machine startup, you have vif ip statment in the config file. But what’s really holds clients from entering:</p>
<pre># ifconfig eth0 x.x.x.x</pre>
<p>Where x.x.x.x is the IP of some super important server in same netmask. Luckily for me I came across this problem while still in testing. Xen supports ip declaration in vif statment of dom config file:</p>
<pre>vif = ['ip=x.x.x.x, more parametars here....']</pre>
<p>Also you can declare multiple ip’s by simply putting space between them, like this:</p>
<pre>vif = ['ip=xx.xx.xx.x1 xx.xx.xx.x2, more parametars here....']</pre>
<p>For the purpose of ip conflict prevention make sure you declare unique MAC address in vif section too.</p>
<p>Next step is to install <a href="http://ebtables.sourceforge.net/">ebtables</a> on your Dom0 box. After that, all we need to do is to apply the following patch for the script <em>vif-bridge</em> located in <em>/etc/xen/scripts/</em>:</p>
<pre>[root@dom0 scripts]# diff -u vif-bridge-org vif-bridge
--- vif-bridge-org      2009-11-12 16:31:56.000000000 +0800
+++ vif-bridge  2009-11-12 16:40:38.000000000 +0800
@@ -57,15 +57,41 @@
     online)
        setup_bridge_port "$vif"
        add_to_bridge "$bridge" "$vif"
+
+       ebtables -N $vif
+       ebtables -P $vif DROP
+       ebtables -A INPUT -i $vif -j $vif
+       ebtables -A FORWARD -i $vif -j $vif
+       ebtables -A $vif -p ARP --arp-opcode 1 -j ACCEPT
+
+       if [ ! -z "$ip" ]
+       then
+       for oneip in $ip
+       do
+               ebtables -A $vif -p IPv4 --ip-src $oneip -j ACCEPT
+               ebtables -A $vif -p IPv4 --ip-dst $oneip -j ACCEPT
+               ebtables -A $vif -p ARP --arp-opcode 2 --arp-ip-src $oneip -j ACCEPT
+       done
+
+       ebtables -A $vif --log-prefix="arp-drop" --log-arp -j DROP
+
+       fi
+
         ;;

     offline)
         do_without_error brctl delif "$bridge" "$vif"
         do_without_error ifconfig "$vif" down
+
+       do_without_error ebtables -D INPUT -i $vif -j $vif
+       do_without_error ebtables -D FORWARD -i $vif -j $vif
+       do_without_error ebtables -F $vif
+       do_without_error ebtables -X $vif
+
         ;;
 esac

-handle_iptable
+#handle_iptable

 log debug "Successful vif-bridge $command for $vif, bridge $bridge."
 if [ "$command" == "online" ]</pre>
<p>It&#8217;s tested OK in my latest CentOS-5.4 box.</p>
<p>Presuming you use bridging scripts this effectively binds ip address-es from “vif = ['ip=x.x.x.x']” list to mac addresses from vif list. Binding is done while enabling vps machine and undone when powering it off.</p>
<p>So this way untrusted user is limited only to the ip addresses defined in xen guest conf file, trying to change existing ip address into another one on same network will only cause that machine unresponsive.</p>
<p><em>Warning:</em> This post is original created by <a href="http://toic.org/2008/09/22/preventing-ip-conflicts-in-xen/">Branko at his blog site</a>.  I copied his content, and updated some settings so that it can work in CentOS-5.4.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/avoid-ip-conflicts-in-xen-domu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Set system variables in Debian and CentOS</title>
		<link>http://www.admon.org/set-syste-variables-in-debian-and-centos/</link>
		<comments>http://www.admon.org/set-syste-variables-in-debian-and-centos/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 16:19:38 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[global variable]]></category>
		<category><![CDATA[system variable]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=388</guid>
		<description><![CDATA[As indicated in title, this request is probably very common for sysadmins. For example, when a Java environment is ready, we need to make sure that JAVA_HOME is globally available for some system accounts, so that they can restart java instance smoothly. The following section would show an example on how to set the variable [...]]]></description>
			<content:encoded><![CDATA[<p>As indicated in title, this request is probably very common for sysadmins.</p>
<p>For example, when a Java environment is ready, we need to make sure that JAVA_HOME is globally available for some system accounts, so that they can restart java instance smoothly.<span id="more-388"></span></p>
<p>The following section would show an example on how to set the variable ORACLE_HOME to be a global one on both Debian and CentOS. Before we start, it&#8217;s suggested to have a glance on our former post &#8220;<a href="http://planet.admon.org/howto/difference-between-login-shell-and-non-login-shell/">difference between login shell and non-login shell</a>&#8220;.</p>
<p><strong>Set system variables in Debian / Ubuntu</strong></p>
<p>What is considered the best way to set globally exported environment variables in debian?  There are two ways:</p>
<p>For global settings, you can simply add a new line in <strong>/etc/environment</strong> like this:</p>
<pre>ORACLE_HOME=/opt/oracle</pre>
<p>After this modification, re-login is needed, then it would take effect for both login shell and non-login shells.</p>
<p>For a single user, you can apply this line in <strong>~/.bashrc</strong></p>
<pre>export ORACLE_HOME=/opt/oracle</pre>
<p>The above setting would take effect on both shells.<br />
Normally, we just need to support login shells, so you can append the new line in <strong>/etc/profile</strong>. It would do the same work, BUT will not take effect on non-login shells.</p>
<p><strong>Set global variables in CentOS / RHEL</strong></p>
<p>There&#8217;s a standard way to set global environment variables on Redhat based systems, including Redhat 9.0, Fedora series, Red Hat Enterprise series, CentOS 4/5.<br />
You can create a new file in <strong>/etc/profile.d/</strong>, and put the variables in it. This directory is used to store new variables:</p>
<pre>example# ls /etc/profile.d/
colorls.csh  glib2.sh               krb5-devel.sh         lang.sh
colorls.sh   gnome-ssh-askpass.csh  krb5-workstation.csh  less.csh
cvs.sh       gnome-ssh-askpass.sh   krb5-workstation.sh   less.sh
glib2.csh    krb5-devel.csh         lang.csh              which-2.sh</pre>
<p>The file you created should have a suffix &#8220;.sh&#8221;, so that it would be recognized as variable files by bash. No executable permission is needed for this new file. An example file is listed below:</p>
<pre>example# cat oralce.sh
ORACLE_HOME=/opt/oracle</pre>
<p>Note: All the above examples are assumed that you&#8217;re using <a href="http://www.gnu.org/software/bash/">BASH</a>. If you use <a href="http://en.wikipedia.org/wiki/C_shell">CSH </a>as default shell, you should name this new file as &#8220;oracle.csh&#8221;, means the suffix should be &#8220;.csh&#8221;.</p>
<p>If you have any issue on this post, please leave a comment or raise a thread at <a href="http://forum.admon.org/linux-scripting/">our support forum</a>, thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/set-syste-variables-in-debian-and-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS-5.4 i386 and x86_64 Released</title>
		<link>http://www.admon.org/centos-5-4-i386-and-x86_64-released/</link>
		<comments>http://www.admon.org/centos-5-4-i386-and-x86_64-released/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 14:07:55 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=367</guid>
		<description><![CDATA[CentOS community annouced the availability of CentOS-5.4 for i386 and x86_64 Architectures this week. It&#8217;s based on the upstream release Redhat Enterprise Linux 5.4.0 and includes packages from all variants including Server and Client. This is just an announcement email, not the release notes. The Release Notes for CentOS-5.4 can be found on-line at wiki.centos.org. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.centos.org/"><a href="http://planet.admon.org/wp-content/uploads/2009/12/centos5-150x150.png"><img class="alignleft size-full wp-image-749" title="centos5-150x150" src="http://planet.admon.org/wp-content/uploads/2009/12/centos5-150x150.png" alt="CentOS-5 Logo" width="150" height="150" /></a>CentOS community</a> annouced the availability of CentOS-5.4 for i386 and x86_64 Architectures this week. It&#8217;s based on the upstream release Redhat Enterprise Linux 5.4.0 and includes packages from all variants including Server and Client.</p>
<p>This is just an announcement email, not the release notes. The Release Notes for CentOS-5.4 can be found <a href="http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.4">on-line at wiki.centos.org</a>.<span id="more-367"></span></p>
<p><strong><a href="http://mirror.centos.org/centos/5/isos/">Download CentOS 5.4 at Mirror.CentOS.org Now!</a></strong></p>
<p>Since upstream released their 5.4 media, a series of updates have been issued. All these pending updates for CentOS-5.4 will be released over the next 48 to 96 hours to be complete by Monday, 26th Oct 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/centos-5-4-i386-and-x86_64-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Windows XP in Xen CentOS</title>
		<link>http://www.admon.org/install-windows-xp-in-xen-centos/</link>
		<comments>http://www.admon.org/install-windows-xp-in-xen-centos/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 09:46:54 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[VNC]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=343</guid>
		<description><![CDATA[In a former post, we know how to use OpenVZ to create virtual system in CentOS, this article will show you how to install Windows under Xen on CentOS 5.3. We fixed one of the problems of Windows XP under Xen. Windows XP&#8217;s inability to shut itself down completely. Windows ends up on the &#8216;it [...]]]></description>
			<content:encoded><![CDATA[<p>In a former post, we know how to <a href="http://planet.admon.org/howto/openvz-on-centos-5-3-installation-and-config/">use OpenVZ to create virtual system in CentOS</a>, this article will show you how to install Windows under Xen on CentOS 5.3.</p>
<p><em>We fixed one of the problems of Windows XP under Xen. Windows XP&#8217;s inability to shut itself down completely. Windows ends up on the &#8216;it is safe to turn off your computer&#8217; screen, but the virtual machine is not destroyed. See <a href="http://wiki.xensource.com/xenwiki/XenWindowsACPI">XenWindowsACPI</a> for a summary.<span id="more-343"></span></em></p>
<p><strong>Preparation Windows image</strong></p>
<p>To create windows installation image is optional, and just describes a way that I&#8217;ve set things up that makes it easier to commission more than one VM. You can also use <em>/dev/cdrom</em> instead with the help of virt-manager.</p>
<p>Create a folder for the ISO image. the folder could be named like this <em>/tmp/windows</em>, we&#8217;ll use this directory to store a windows dump image from CDROM.</p>
<p>Put your windows installation disc in the CDROM drive.When it&#8217;s mounted, issue a command as follows:<br />
dd if=/dev/cdrom of=/tmp/windows/windows-xp.iso</p>
<p>If the CDROM cannot mounted automatically, you might need to mount it yourself. It would take a long time to dump a full windows images depending on the disc&#8217;s size.</p>
<p><strong>Create DISK file for Virtual Server</strong></p>
<p>After that, we need to create a disk image file for the virtualized WinXP. Here we store this file in a new sub directory /srv/xen. You might need to create this directory yourself if you are using CentOS. The hard drive of the virtual machine can be created like this:</p>
<pre>nice dd if=/dev/zero of=/srv/xen/winxp.img bs=1024k seek=4096 count=0</pre>
<p>Dont forget that raw disk is also supported by Xen.</p>
<p><strong>Install Windows in Xen Container</strong></p>
<p>Then we can start the installation process with help of <a href="http://virt-manager.et.redhat.com/ ">virt-install</a> command:</p>
<pre>virt-install -n winxp -r 256 -f /srv/xen/winxp.img -b xenbr0 --sdl -v -c /tmp/windows/windows-xp.iso</pre>
<p>This command will create a configuration file <em>/etc/xen/winxp</em>, start the new virtual machine,  and try to connect to it. Here&#8217;s a bit problematic. As you  may wonder how we gain the access to windows graphic desktop during the installation.</p>
<p>Generally there are two ways:<br />
1, Using the physic server&#8217;s graphic instead. When you have grphic access to physic server, you can use virt-manager&#8217;s grphic interface to control the process.<br />
2, You can use VNC client to connect virtual windows XP directly. By default when the installation started, there&#8217;s a VNC server running at localhost. It&#8217;s configurable in <em>/etc/xen/winxp</em>, you can set which socket it should bind to, and what password can be used to connect this running windows.</p>
<p>Some other adjustings to <em>/etc/xen/winxp</em> are highly recommended. We need to make note that when any error happened, the winxp should be shut down soon not hanging or doing some other crappy things that only god knows.</p>
<ul>
<li><em>&#8216;on_crash</em>&#8216; should be changed to &#8216;<em>destroy</em>&#8216;.</li>
<li>Change the line <em>on_reboot = &#8216;restart&#8217;</em> to <em>on_reboot = &#8216;destroy&#8217;</em>. This will ensure that Windows doesn&#8217;t restart during setup without our permission, which will be required for ACPI support in the guest to be set up properly.</li>
<li>Add <em>file:/var/lib/xen/images/winxp-install.iso,hdb:cdrom,r&#8217;</em>, to the list in the line disk = [ ... ]</li>
<li>Add new<em> line boot = &#8216;d&#8217;</em> (preferably after the line disk = [ ... ].).</li>
</ul>
<p>There&#8217;s a sample config file for windows XP in Xen:</p>
<pre>name = "winxp"
uuid = "821cc805-ecc3-cc1a-20de-79d4bc99c134"
maxmem = 256
memory = 256
vcpus = 1
builder = "hvm"
kernel = "/usr/lib/xen/boot/hvmloader"
boot = "d"
pae = 1
acpi = 1
apic = 1
localtime = 0
on_poweroff = "destroy"
on_reboot = "destroy"
on_crash = "restart"
device_model = "/usr/lib64/xen/bin/qemu-dm"
sdl = 0
vnc = 1
vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "virtual-chen"
keymap = "en-us"
disk = [ "file:/srv/xen/winxp.img,hda,w", "file:/tmp/windows/windows-xp.iso,hdc:cdrom,r" ]
vif = [ "mac=00:13:34:ae:70:3b,bridge=xenbr0" ]
serial = "pty"</pre>
<p>Then re-launch the virtual machine with &#8220;<em>xm create winxp</em>&#8220;,and use VNC to connect the virtual OS, and direct the installation process. When finished, setup tries to reboot, it will instead be shut down. Don&#8217;t panic, this is intentional and was created by the line on_reboot = &#8216;destroy&#8217; that we modified in the config file.</p>
<p><strong>Things to do when installation finished</strong></p>
<p>Now we need to recover the settings that we&#8217;ve made to /etc/xen/winxp:</p>
<ul>
<li>Change the line boot = &#8216;d&#8217; to boot = &#8216;c&#8217;</li>
<li>Change the line on_reboot = &#8216;destroy&#8217; to on_reboot = &#8216;restart&#8217;</li>
</ul>
<p>Continue the setup process by restarting the virtual machine with &#8220;<em>xm create winxp</em>&#8220;. Run through the rest of the normal Windows setup process, for example add the machine to the domain.</p>
<p>Install TightVNC in the guest so that you can access the guest remotely, so that the virtual machine is accessble while we are not logged into the physical machine. Boot the virtual machine with <em>xm create winxp</em>. If successful, the virtual machine will not show a display, but will show up in the results of xm list and you can connect to it with <a href="http://www.realvnc.com/">vncviewer</a>, <a href="http://www.tightvnc.com/">TightVNC</a>, etc.</p>
<p><strong>Trouble shooting</strong></p>
<p>If something goes wrong and you can&#8217;t connect via VNC or rdesktop, you can use virt-manager (aka Applications → System Tools → Virtual Machine Manager) to connect directly to the virtual machine&#8217;s console and see what it&#8217;s doing. Please keep note that using virt-manager depends on graphic destop at the physical server, which always eats lots of system resournces.</p>
<p>For other issues please logon our support forum <a href="http://forum.admon.org/virtualization/">Virtualization</a>, and raise a thread there.  You can also <a href="http://forums.citrix.com/support">ask Citrix for help directly at their forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/install-windows-xp-in-xen-centos/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>OpenVZ On CentOS 5.4 installation and configuration</title>
		<link>http://www.admon.org/openvz-on-centos-5-3-installation-and-config/</link>
		<comments>http://www.admon.org/openvz-on-centos-5-3-installation-and-config/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 11:45:01 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[openvz]]></category>
		<category><![CDATA[Virtuozzo]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=335</guid>
		<description><![CDATA[This article will describe how to create OpenVZ container in CentOS 5.4. With OpenVZ you can create multiple Virtual Private Servers (VPS) on same hardware machine and running them simultaneously and efficiently. OpenVZ is the open-source branch of Virtuozzo, a commercial virtualization solution widely used by hosting providers. The OpenVZ kernel patch is licensed under [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://planet.admon.org/wp-content/uploads/2010/04/openvz.png"><img class="alignleft size-full wp-image-743" title="openvz" src="http://planet.admon.org/wp-content/uploads/2010/04/openvz.png" alt="" width="135" height="135" /></a>This article will describe how to create <a href="http://wiki.openvz.org/Main_Page">OpenVZ</a> container in <a href="http://mirror.centos.org/centos/5/isos/">CentOS 5.4</a>. With OpenVZ you can create multiple <a href="http://en.wikipedia.org/wiki/Virtual_private_server">Virtual Private Servers</a> (VPS) on same hardware machine and running them simultaneously and efficiently.</p>
<p>OpenVZ is the open-source branch of <a href="http://www.parallels.com/en/products/virtuozzo/">Virtuozzo</a>, a commercial virtualization solution widely used by hosting providers. The OpenVZ kernel patch is licensed under <a href="http://www.gnu.org/licenses/gpl.html">GPL license</a>, and the user-level tools are under the QPL license.<br />
<span id="more-335"></span><br />
As there are many ways of achieving this goal, I&#8217;d keep this howto as smart as possible. In the following days, I&#8217;d create similar posts on Xen / <a href="http://linux-vserver.org/">Vserver</a>, please keep a close eye on <a href="http://planet.admon.org/">my planet</a>.</p>
<p><strong>1, Install OpenVZ</strong></p>
<p>In order to install OpenVZ, we need to add the OpenVZ repository to yum,  this would also help us keep the kernel up-to-date:</p>
<pre>cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ</pre>
<p>The repository contains a few different OpenVZ kernels (you can find more details here: http://wiki.openvz.org/Kernel_flavors), or with this command &#8220;<em>yum search ovzkernel</em>&#8220;.</p>
<p>Pick one of them and install it as follows:</p>
<pre>yum install ovzkernel</pre>
<p>This should automatically update the GRUB bootloader as well. An example is listed below&#8221;</p>
<pre>cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.2.1.el5.028stab064.7)
	root (hd0,0)
	kernel /vmlinuz-2.6.18-128.2.1.el5.028stab064.7 ro root=LABEL=/
	initrd /initrd-2.6.18-128.2.1.el5.028stab064.7.img</pre>
<p><strong>2, Pre-adjustings before the installation</strong></p>
<p>Now we install some OpenVZ user tools:</p>
<p><em>yum install vzctl vzquota</em></p>
<p>Open /etc/sysctl.conf and make sure that you have the following settings in it:</p>
<pre>cat /etc/sysctl.conf

net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1</pre>
<p>The following step is important if the IP addresses of your virtual machines are from a different subnet than the host system&#8217;s IP address. If you don&#8217;t do this, networking will not work in the virtual machines!</p>
<p>Open <em>/etc/vz/vz.conf</em> and set <em>NEIGHBOUR_DEVS</em> to all,  the modified entry is like this &#8220;<em>NEIGHBOUR_DEVS=all</em>&#8220;. SELinux needs to be disabled, you can do it by making changes on its config file <em>/etc/sysconfig/selinux</em>. Finally, reboot the system, and then your new OpenVZ kernel should show up:</p>
<pre>[root@server1 ~]# uname -r
2.6.18-128.2.1.el5.028stab064.7</pre>
<p><strong>3, Create a Virutal Server</strong></p>
<p>Before we can create virtual machines with OpenVZ, we need to have a template for the distribution that we want to use in the virtual machines in the <em>/vz/template/cache</em> by default. New virtual machines will be created from these templates. A list of <a href="http://wiki.openvz.org/Download/template/precreated">precreated templates is available here</a>.</p>
<p>I want to use CentOS 5 in my virtual machines, so I download a CentOS 5 template:</p>
<pre>cd /vz/template/cache
wget http://download.openvz.org/template/precreated/contrib/centos-5-i386-default.tar.gz</pre>
<p>To set up a VPS from the default CentOS 5 template, run:</p>
<pre>vzctl create 211 --ostemplate centos-5-i386-default --config vps.basic</pre>
<p>The 211 must be uniqe and each virtual machine must have its own ID. You can use the last part of the VPS&#8217;s IP address for it. For example, if the virtual machine&#8217;s IP address is 192.168.0.211, you use 211 as the ID.</p>
<p><strong> </strong></p>
<p><strong>4, Common controls on OpenVZ</strong></p>
<p>If you want to have the vm started at boot, run:</p>
<pre>vzctl set 211 --onboot yes --save</pre>
<p>To set a hostname and IP address for the vm, run:</p>
<pre>vzctl set 211 --hostname test.example.com --save
vzctl set 211 --ipadd 192.168.0.211 --save</pre>
<p>Next we set the number of sockets to 120 and assign a few nameservers to the vm:</p>
<pre>vzctl set 211 --numothersock 120 --save
vzctl set 211 --nameserver 85.17.150.123 --nameserver 83.149.80.123 --nameserver 145.253.2.75 --save</pre>
<p>Instead of using the vzctl set commands, you can directly edit vm&#8217;s configuration file which is stored in the directory <em>/etc/vz/conf</em>. If the ID of the vm is 211, then the configuration file is <em>/etc/vz/conf/211.conf</em>.</p>
<p>In order to start the vm, run &#8220;vzctl start 211&#8243;, to set a root password for the vm, run &#8220;vzctl exec 211 passwd&#8221;. Now You can either connect to the vm via SSH (e.g. with PuTTY), or login through console directly as follows:</p>
<pre>vzctl enter 211</pre>
<p>To leave the vm&#8217;s console, type &#8220;exit&#8221;, to stop a vm, run &#8220;<em>vzctl stop 211</em>&#8220;, to restart a vm, run &#8220;<em>vzctl restart 211</em>&#8220;.</p>
<p>To delete a vm from the hard drive (it must be stopped before you can do this), run &#8220;<em>vzctl destroy 211</em>&#8220;.</p>
<p><strong>5, Check VM Status</strong></p>
<p>To get a list of your vms and their statuses, run &#8220;<em>vzlist -a</em>&#8221; like this:</p>
<pre>[root@server1 cache]# vzlist -a
      VEID      NPROC STATUS  IP_ADDR         HOSTNAME
       211         18 running 192.168.0.211   test.example.com</pre>
<p>To find out about the resources allocated to a vm, run like follows:</p>
<pre>[root@server1 cache]# vzctl exec 211 cat /proc/user_beancounters
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
      211:  kmemsize        1508202    1661695   11055923   11377049          0
            lockedpages           0          0        256        256          0
            privvmpages        5430       7102      65536      69632          0
            shmpages            381        381      21504      21504          0
            dummy                 0          0          0          0          0
            numproc              19         21        240        240          0
            physpages          2489       2775          0 2147483647          0
            vmguarpages           0          0      33792 2147483647          0
            oomguarpages       2489       2775      26112 2147483647          0
            numtcpsock            5          5        360        360          0
            numflock              3          4        188        206          0
            numpty                0          1         16         16          0
            numsiginfo            0          2        256        256          0
            tcpsndbuf         44720          0    1720320    2703360          0
            tcprcvbuf         81920          0    1720320    2703360          0
            othersockbuf      13144      14356    1126080    2097152          0
            dgramrcvbuf           0       8380     262144     262144          0
            numothersock         11         13        120        120          0
            dcachesize            0          0    3409920    3624960          0
            numfile             503        531       9312       9312          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            10         10        128        128          0</pre>
<p>The failcnt column is very important, it should be only zeros; if not, means that the vm needs more resources than currently allocated. Open the vm&#8217;s configuration file in <em>/etc/vz/conf</em> and raise the appropriate resource, then restart it.</p>
<p>To find out more about the vzctl command, run &#8220;man vzctl&#8221;. If you faced any issues during the installation, please create a thread and show your errors  in the sub forum <a href="http://forum.admon.org/virtualization/">virtualization</a> at admon community.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/openvz-on-centos-5-3-installation-and-config/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Enable Disable the automatic YUM updates</title>
		<link>http://www.admon.org/enabledisable-the-automatic-yum-updates/</link>
		<comments>http://www.admon.org/enabledisable-the-automatic-yum-updates/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 02:22:25 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[rhel4]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.admon.org/?p=928</guid>
		<description><![CDATA[How can I disable YUM automatic update completely? In some old versioned system, YUM auto-update feature comes as an extension named &#8220;yum-autoupdate&#8221;, and it contains runlevel scripts and scheduled crontab scripts.  Enable YUM automatic update It&#8217;s as simple as our services, which can be done as below: chkconfig --add yum-autoupdate service yum-autoupdate start Diable YUM [...]]]></description>
			<content:encoded><![CDATA[<p>How can I disable YUM automatic update completely?</p>
<p>In some old versioned system, YUM auto-update feature comes as an extension named &#8220;yum-autoupdate&#8221;, and it contains runlevel scripts and scheduled crontab scripts. <span id="more-928"></span></p>
<p><strong>Enable YUM automatic update</strong></p>
<p>It&#8217;s as simple as our services, which can be done as below:</p>
<pre>chkconfig --add yum-autoupdate
service yum-autoupdate start</pre>
<p><strong>Diable YUM automatic update</strong></p>
<p>Here&#8217;s a script for you to do the job, it disables both run-level script, and remove the scheduled cron jobs:</p>
<pre>#!/bin/sh
################################
# Disable yum cron and daemons #
################################

echo "++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Yum cron jobs are now disabled"

[ -e /etc/cron.hourly/yum-autoupdate ] &amp;&amp; rm -f /etc/cron.hourly/yum-autoupdate
[ -e /etc/cron.hourly/yum ] &amp;&amp; rm -f /etc/cron.hourly/yum
[ -e /etc/cron.daily/yum.cron ] &amp;&amp; rm -f /etc/cron.daily/yum.cron

yum_status=`chkconfig --list |grep yum |grep "3:on"`
service_name=`chkconfig --list |grep yum | cut -f 1`

for serv in $service_name; do
  if [ "x$yum_status" != "x" ]; then
    echo "++++++++++++++++++++++++++++++++++++++++++++++++"
    echo "+ $serv has been switched to off"
    chkconfig $serv off
  fi

  if [ -e /var/lock/subsys/$serv ]; then
    /etc/init.d/$serv stop
  fi

  echo "Done $serv"
done
############################</pre>
<p>If you need to re-enable the service, better to force re-install the extension &#8220;yum-autoupdate&#8221;, and the removed files will be restored.</p>
<p>[Updates] In recent distributions, the auto-update extension is named yum-updatesd, which has the scheduled cron jobs removed, so basically you can take it as a normal service.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/enabledisable-the-automatic-yum-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

