Wednesday 30 May 2012

Spacewalk and RHEL6

Register RHEL6 client with Spacewalk

Reference:

  • http://linuxinternetworks.com/register-clients-in-spacewalk/ 

Instructions

  1. First set a couple of variables to help the following instructions work with more versions:
    BASE_ARCH=$(uname -i)
    BASE_REL=$(sed -e '/.*release /s///' -e 's/\..*//' /etc/redhat-release)
  2. Install the Space walk client for your architecture:
    rpm -Uvh http://spacewalk.redhat.com/yum/1.7/RHEL/$BASE_REL/$BASE_ARCH/spacewalk-client-repo-1.7-5.el$BASE_REL.noarch.rpm
    wget --directory-prefix=/tmp ftp://mirror.optus.net/epel/$BASE_REL/$BASE_ARCH/epel-release*.noarch.rpm && rpm -Uvh /tmp/epel-release*.noarch.rpm
  3. Install the client packages:
    yum install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin
  4. Register the client:
    rhnreg_ks --serverUrl=https://<fqn_spacewalk_server>/XMLRPC --activationkey=1-<activation_key_label>

Install Spacewalk on RHEL6

Links
Instructions
wget rpm -Uvh http://spacewalk.redhat.com/yum/1.7/RHEL/6/x86_64/spacewalk-repo-1.7-5.el6.noarch.rpm

Fedora16 with horde

Amazing, I have got horde with a postgres backend to work on Fedora16.

Links:
Install Postgres:
yum install php-pgsql postgresql postgresql-server
chkconfig postgresql on
postgresql-setup initdb
service postgresql start
su - postgres
cp /usr/share/horde/scripts/sql/create.pgsql.sql .
vim create.pgsql.sql  -- (set a password for the horde user)
psql -d template1 -f create.pgsql.sql
(if all the tables and indexes don't fly up the screen as they are created then you have a problem.  For me it took awhile to get pg_hba.conf correct.  See supplementary points below.)
exit  -- (return to the root user)
psql -h 127.0.0.1 -p 5432 -U horde -d horde  -- (to test logging into the horde database as the horde user.)
rm /var/lib/pgsql/create.pgsql.sql


Supplementary Points:
  • Horde is out of date in the Fedora16 repository!  I persisted thinking that things will be easier if I use the Fedora packages :-(
  • http://your-server/horde/test.php -- is not working and the doco I have found so far is not relevant for activating the test feature.
  • Turn off selinux as the provided policies are not good enough.  (Now that I've saved you some time maybe you can work on the selinux policies for me???)
  • Add the following to /etc/php.ini and service httpd restart for fedora16_x86-64:
    • extension_dir = "/usr/lib64/php/modules"
  •  Add the following to /var/lib/pgsql/data/pg_hba.conf before the "local all all peer" line to allow the horde database user to login via a localhost TCP socket.  Don't forget to reload the database configuration service postgresql reload :

local horde horde md5
host  horde horde 127.0.0.1/8 md5
host  horde horde ::1/128 md5
local horde postgres  ident
  • Clean out the postgres database to retry the horde initialisation:

su - postgres
psql
DROP DATABASE horde;
DROP USER horde;

Saturday 26 May 2012

rsync of block devices

How to clone virtual disks as logical volumes with resume?

Some clever folks are working on patches to "rsync" to allow the copying of block devices:  http://lists.samba.org/archive/rsync/2010-June/025164.html

Paul Whittaker fixed me up with just such a patched version of rsync so I can move my VM disks around my network more efficiently.  The only thing to note is /dev/mapper/<logical_volume> is a symbolic link and you must use /dev/<vg>/<lv> to access the real block device.  

The example below is me running an "rsync" check over a previously cloned volume that failed to cleanly complete when using my favourite "nc" (netcat) method.  A three minute verify is not bad for an 8GB virtual disk!
root@blackdouglas> rsync -vP --inplace --copy-devices jd:/dev/mapper/JD-vm_canobolissmith_ROOT /dev/mapper/BD1-vm_canobolissmith_ROOT
JD-vm_canobolissmith_ROOT
           0 100%    0.00kB/s    0:03:18 (xfer#1, to-check=0/1)

sent 741502 bytes  received 370826 bytes  3570.88 bytes/sec
total size is 0  speedup is 0.00
root@blackdouglas>