Wednesday, November 9, 2011

Install KVM Virtualization on RedHat

http://www.cyberciti.biz/faq/centos-rhel-linux-kvm-virtulization-tutorial/

KVM (Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions Intel VT or AMD-V. How do I install KVM under CentOS or Red Hat Enterprise Linux version 5.5?

The Linux kernel 2.6.20 and above included KVM. RHEL 5.5 (and upcoming RHEL 6) supports KVM out of box and it has also been ported to FreeBSD as a loadable kernel module. However, this tutorial is tested on both CentOS and RHEL 5.5 only running 64 bit Intel Xeon CPU (with Intel VT) and 64 bit kernels with SELinux running in enforcing mode.

Why KVM?

XEN allows several guest operating systems to execute on the same computer hardware and it is also included with RHEL 5.5. But, why use KVM over XEN? KVM is part of the official Linux kernel and fully supported by both Novell and Redhat. Xen boots from GRUB and loads a modified host operating system such as RHEL into the dom0 (host domain). KVM do not have concept of dom0 and domU. It uses /dev/kvm interface to setup the guest operating systems and provides required drivers. See the official wiki for more information.

Required Packages

You must install the following packages:
  1. kmod-kvm : kvm kernel module(s)
  2. kvm : Kernel-based Virtual Machine
  3. kvm-qemu-img : Qemu disk image utility
  4. kvm-tools : KVM debugging and diagnostics tools
  5. python-virtinst : Python modules and utilities for installing virtual machines
  6. virt-manager : Virtual Machine Manager (GUI app, to install and configure VMs)
  7. virt-viewer: Virtual Machine Viewer (another lightweight app to view VM console and/or install VMs)
  8. bridge-utils : Utilities for configuring the Linux Ethernet bridge (this is recommended for KVM networking)

KVM Package Group

RHEL comes with KVM software group which includes full virtualization support with KVM. You can list all packages in the group as follows:
# yum groupinfo KVM
Sample outputs:
Loaded plugins: rhnplugin, security
Setting up Group Process
Group: KVM
 Description: Virtualization Support with KVM
 Mandatory Packages:
   celt051
   etherboot-zroms
   etherboot-zroms-kvm
   kmod-kvm
   kvm
   kvm-qemu-img
   qcairo
   qffmpeg-libs
   qpixman
   qspice-libs
 Default Packages:
   Virtualization-en-US
   libvirt
   virt-manager
   virt-viewer
 Optional Packages:
   celt051-devel
   etherboot-pxes
   etherboot-roms
   etherboot-roms-kvm
   gpxe-roms-qemu
   iasl
   kvm-tools
   libcmpiutil
   libvirt-cim
   qcairo-devel
   qffmpeg-devel
   qpixman-devel
   qspice
   qspice-libs-devel

A Note About libvirt

libvirt is an open source API and management tool for managing platform virtualization. It is used to manage Linux KVM and Xen virtual machines through graphical interfaces such as Virtual Machine Manager and higher level tools such as oVirt. See the official website for more information.

A Note About QEMU

QEMU is a processor emulator that relies on dynamic binary translation to achieve a reasonable speed while being easy to port on new host CPU architectures. When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests. See the official website for more information.

A Note About Virtio Drivers

Virtio is paravirtualized drivers for kvm/Linux. With this you can can run multiple virtual machines running unmodified Linux or Windows VMs. Each virtual machine has private virtualized hardware a network card, disk, graphics adapter, etc. According to Redhat:
Para-virtualized drivers enhance the performance of fully virtualized guests. With the para-virtualized drivers guest I/O latency decreases and throughput increases to near bare-metal levels. It is recommended to use the para-virtualized drivers for fully virtualized guests running I/O heavy tasks and applications.

Host Operating System

Your main operating system such as CentOS or RHEL is known as host operating system. KVM is a Linux kernel module that enables a modified QEMU program to use hardware virtualization. You only need to install KVM under host operating systems.

KVM Domains

It is nothing but a guest operating system running under host operating system. Each kvm domain must have a unique name and ID (assigned by system).

Guest Operating Systems

KVM supports various guest operating systems such as
  1. MS-Windows 2008 / 2000 / 2003 Server
  2. MS-Windows 7 / Vista / XP
  3. FreeBSD
  4. OpenBSD
  5. Sun Solaris
  6. Various Linux distributions.
  7. NetBSD
  8. MINIX
  9. QNX
  10. MS DOS
  11. FreeDOS
  12. Haiku
  13. Amiga Research OS

Install KVM

Type the following command to install KVM under RHEL or CentOS:
# yum install kvm virt-viewer virt-manager libvirt libvirt-python python-virtinst
OR
# yum groupinstall KVM

Important Configuration And Log Files (Directories) Location

The following files are required to manage and debug KVM problems:
  1. /etc/libvirt/ - Main configuration directory.
  2. /etc/libvirt/qemu/ - Virtual machine configuration directory. All xml files regarding VMs are stored here. You can edit them manually or via virt-manager.
  3. /etc/libvirt/qemu/networks/ - Networking for your KVM including default NAT. NAT is only recommended for small setup or desktops. I strongly suggest you use bridged based networking for performance.
  4. /etc/libvirt/qemu/networks/default.xml - The default NAT configuration used by NAT device virbr0.
  5. /var/log/libvirt/ - The default log file directory. All VM specific logs files are stored here.
  6. /etc/libvirt/libvirtd.conf - Master libvirtd configuration file.
  7. /etc/libvirt/qemu.conf - Master configuration file for the QEMU driver.

TCP/UDP Ports

By default libvirt does not opens any TCP or UDP ports. However, you can configure the same by editing the /etc/libvirt/libvirtd.conf file. Also, VNC is configured to listen on 127.0.0.1 by default. To make it listen on all public interfaces, edit /etc/libvirt/qemu.conf file.

Our Sample Setup

+-------------> vm#1 ( 10.10.21.71 / 123.1.2.4, CentOS MySQL Server)
                                                                             |
                                                                             +-------------> vm#2 ( 10.10.21.72 / 123.1.2.5, FreeBSD 7 Web Server)
LAN --> Switch    -->  eth0 --> -+   10.10.21.70                             |
                                 | ---> br0 -+      +----------------+       +-------------> vm#3 ( 10.10.21.73 / 123.1.2.6, OpenBSD 4.x Firewall )
                                 |           | ===> |   RHEL Server  |  -----+
                                 |           |      |      KVM       |       +-------------> vm#4 ( 10.10.21.74 / 123.1.2.7, Solaris 10 Testing Server )
                                 | ---> br1 -+      +----------------+       |
Wan --> ISP Router --> eth1 --> -+   123.1.2.3                               +-------------> vm#5 ( 10.10.21.71 / 123.1.2.8, Windows Server Testing Server )
                                                                             |
                                                                             +-------------> vm#6 ( 10.10.21.71 / 123.1.2.9, RHEL Mail Server )
(Fig.01: Our sample server setup - you need to scroll to see complete diagram)
Where,

Host Configuration

  • OS - RHEL / CentOS v5.5 is our host operating system.
  • Host has two interface eth0 and eth1
  • LAN - eth0 with private ip
  • Internet - eth1 with public IPv4/IPv6 address.
  • Disk - 73x4 - 15k SAS disk in RAID 10 hardware mode. All VMs are stored on same server (later I will cover SAN/NFS/NAS configuration with live migration).
  • RAM - 16GB ECC
  • CPU - Dual core dual Intel Xeon CPU L5320 @ 1.86GHz with VT enabled in BIOS.

Virtual Machine Configuration

  • Bridged mode networking (eth0 == br0 and eth1 == br1) with full access to both LAN and Internet.
  • Accelerator virtio drivers used for networking (model=virtio)
  • Accelerator virtio drivers for disk (if=virtio) and disk will show up as /dev/vd[a-z][1-9] in VM.
  • Various virtual machines running different guest operating systems as per requirements.
With bridged networking you can share actual network device with KVM machines. This is required for servers with multiple network cards and gives you good performance. You can choose to put multiple segments into one bridged network or to divide it into different networks interconnected by routers.

Our Sample Setup

The following describes the networking used by our setup:
+------+       +-----+
LAN      --> | eth0 |  <==> | br0 |       -> KVM VMs connected to LAN for SAN/NFS
  +------+       +-----+
                               10.10.x.y/24
  +------+       +-----+
Internet --> | eth1 |  <==> | br1 |       -> KVM VMs connected to the Inernet
  +------+       +-----+
                               123.1.2.0/28
Where,
  • All other clients can reached to all VMs via br1 which is connected to public interface. br1 is our default gateway.
  • br0 is connected to private LAN to access other servers, services and storage devices such as SAN/NAS or NFS servers. br0 route is configured via route-br0 static networking configuration file.

Turn Off NetworkManager

The NetworkManager (GUI) tool can create problems with bridged based networking so disable it as follows, enter:
# chkconfig NetworkManager off
# chkconfig network on
# service NetworkManager stop
Edit /etc/sysconfig/network, enter:
# vi /etc/sysconfig/networkUpdate file as follows:
 
NETWORKING=yes
HOSTNAME=kvm42.nixcraft.net
GATEWAY=br1
 
Save and close the file.

br0: Configure Bridging for eth0

Edit /etc/sysconfig/network-scripts/ifcfg-eth0, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0Update it as follows:
 
 
DEVICE=eth0
ONBOOT=yes
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
BRIDGE=br0
HWADDR=b8:ac:6f:65:31:e5
 
Save and close the file. Create /etc/sysconfig/network-scripts/ifcfg-br0, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-br0Update it as follows (note options are case sensitive i.e. Bridge and bridge are two different options)
 
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.10.21.70
NETMASK=255.255.255.192
DELAY=0
 
Save and close the file. Finally, create static routing file /etc/sysconfig/network-scripts/route-br0, enter :
# vi /etc/sysconfig/network-scripts/route-br0Edit it as follows:
10.0.0.0/8 via 10.10.21.122 dev br0
Save and close the file. Delete old /etc/sysconfig/network-scripts/route-eth0 (if exists):
# rm /etc/sysconfig/network-scripts/route-eth0

br1: Configure Bridging for eth1

Edit /etc/sysconfig/network-scripts/ifcfg-eth1, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-eth1Update it as follows:
 
 
DEVICE=eth1
ONBOOT=yes
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
BRIDGE=br1
HWADDR=00:30:49:8c:48:ad
 
Please note that test server is set to 100Mbps full duplex. Save and close the file. Edit /etc/sysconfig/network-scripts/ifcfg-br1, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-br1Define public IP address including gateway as follows:
 
DEVICE=br1
BOOTPROTO=static
ONBOOT=yes
IPADDR=123.1.2.3
NETMASK=255.255.255.248
GATEWAY=123.1.2.200
TYPE=Bridge
DELAY=0
 
Save and close the file.

Restart Network Service

Type the following command:
# service network restartMake sure everything is working fine:
# brctl showSample outputs:
bridge name bridge id  STP enabled interfaces
br0  8000.0030488e31ac no  eth0
br1  8000.0030488e31ad no  eth1
virbr0  8000.000000000000 yes
Verify IPs and routing tables:
# ip addr show br0
# ip addr show br1
# ip route
# ping cyberciti.biz
# host google.com


Now, you have installed the KVM software and required drivers on the host operating systems. You also configured bridged based networking which will provide direct access to the Internet. It is time to create your first guest operating systems. For demonstration purpose you will install CentOS Linux v5.5 using the Internet using virt-manager GUI tool.

The virt-manager is the easiest way to install guest operating system using CDROM or Internet. It is a a desktop tool for managing virtual machines. It provides the ability to control the lifecycle of existing machines (bootup/shutdown,pause/resume,suspend/restore), provision new virtual machines, manage virtual networks, access the graphical console of virtual machines, and view performance statistics. You need to use this tool locally or remotely over the ssh session.

Step # 1: Download CentOS Linux Network Installation CD

Visit the official website and grab CentOS network installation disk and store it in /opt or /tmp directory. The wget command can be used to download an ISO file quickly:
# cd /tmp
# wget http://mirrors.hns.net.in/centos/5.5/isos/x86_64/CentOS-5.5-x86_64-netinstall.iso

Step #2: Creating CentOS Linux Guests With virt-manager

Type the following command at local server
# virt-manager
OR run virt-manager remotely over the ssh session, enter:
# ssh -X -C root@kvmserver42.nixcraft.in
# virt-manager

Sample outputs:

Fig.01: Creating A Virtualized Guest With virt-manager GUI Tool
Fig.01: Creating A Virtualized Guest With virt-manager GUI Tool

Next, click the New button to create a new guest and just follow on screen instructions. The following is the wizard based installation procedure:

Fig.02: New guest wizard to install CentOS Linux
Fig.02: New guest wizard to install CentOS Linux
Fig.03: Name the KVM virtual machine
Fig.03: Name the KVM virtual machine
Fig.04: Define virtualization method
Fig.04: Define virtualization method (full virtualization due to Intel VT)
Fig.05: Define installation method (CDROM/Network/HTTP/NFS etc)
Fig.05: Define installation method (CDROM/Network/HTTP/NFS etc)
Fig.06: Local media installation via CDROM or ISO image
Fig.06: Local media installation via CDROM or ISO image
Fig.07: KVM Storage setup (network [must be mounted] or local or block disk)
Fig.07: KVM Storage setup (network iscsi/nfs must be mounted or local or block disk)
Fig.08: KVM Set Virtual network (NAT) or Shared physical device (bridge br0 or br1)
Fig.08: KVM Set Virtual network (NAT) or Shared physical device (bridge br0 or br1)
Fig.09: KVM Guest VM Memory and CPU Allocation Setup
Fig.09: KVM Guest VM Memory and CPU Allocation Setup
Fig.10: KVM VM setup done and you can start guest installation
Fig.10: KVM VM setup done and you can start guest installation
Within minutes you will see a vnc window and with guest operating system installation process as follows:
Fig.11: KVM - guest operating system installation procedures started using vnc
Fig.11: KVM - guest operating system installation procedures started using vnc
Now, just follow on screen installation instructions and install CentOS as per your requirements. The above procedure can be repeated for MS-Windows, OpenBSD, FreeBSD and all other supported guest operating systems.

virt-manager requires GUI locally and it is slow. On other hand virt-install is a command line tool for provisioning new virtual machines using the "libvirt" hypervisor management library. The tool supports both text based & graphical installations, using serial console, SDL graphics or a VNC client/server pair. The guest can be configured to use one or more virtual disks, network interfaces, audio devices, and physical host devices (USB, PCI). You can use the virt-install to create virtualized guests as follows to install FreeBSD or CentOS.

Install FreeBSD As Guest OS

Again, use the wget command to grab FreeBSD ISO image:
# cd /tmp
# wget ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/7.3/FreeBSD-7.3-RELEASE-amd64-disc1.iso

Type the following command to install FreeBSD 7.3 64 bit with 512 MB RAM, 1 vcore cpu, 4GB disk space, br0 and br1 network interface:
# virt-install \
-n freebsd \
-r 512 \
--vcpus=1 \
--os-variant=freebsd7 \
--accelerate \
-v \
-c /nfsclient/iso/FreeBSD-7.3-RELEASE-amd64-disc1.iso \
-w bridge:br0 \
-w bridge:br1 \
--vnc \
--disk path=/raid10/kvm/freebsd73.img,size=4

Sample outputs:

Starting install...
Creating storage file...                                                                     | 4.0 GB     00:00
Creating domain...                                                                           |    0 B     00:01
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
Use your local vnc viewer or type the following at server itself:
# vncviewer
OR over ssh session, enter:
# ssh -X -C root@kvmserver42.nixcraft.in
# virt-viewer freebsd

Sample outputs:

Fig.01: Creating guest with virt-install and installing guests with vnc
Fig.01: Creating guest with virt-install and installing guests with vnc

Once again, just follow on screen installation instructions and install FreeBSD as per your requirements. The above procedure can be repeated for MS-Windows, OpenBSD, FreeBSD and all other supported guest operating systems.

Install CentOS As Guest OS

Type the following command to install CentOS using http mirror method with 512MB RAM, 4GB disk space stored on nas server mounted at /nas, br0 and br1 network interface:
# virt-install \
-n centos \
-r 512 \
--vcpus=1 \
--os-variant=rhel5.4 \
--accelerate \
-v \
-l http://mirrors.kernel.org/centos/5.5/os/x86_64/ \
-w bridge:br0 \
-w bridge:br1 \
--vnc \
--disk path=/nas/kvm/centos.img,size=4

You can grab installer screen using vnc as follows (or use your local vnc viewer):
# ssh -X -C user@server.example.com
# virt-viewer centos

Understanding virt-install Command Line Options

  1. -n centos - Name of the new guest virtual machine instance. This must be unique amongst all guests known to the hypervisor on this machine, including those not currently active.
  2. -r 512 - VM memory allocation.
  3. --vcpus=1 - VM cpu allocation.
  4. --os-variant=rhel5.4 - Optimize the guest configuration for a type of operating system called rhel5.4.
  5. --accelerate - When installing a QEMU guest, make use of the KVM or KQEMU kernel acceleration capabilities if available. Use of this option is recommended unless a guest OS is known to be incompatible with the accelerators. The KVM accelerator is preferred over KQEMU if both are available.
  6. -v - This guest should be a fully virtualized guest
  7. -l http://mirrors.kernel.org/centos/5.5/os/x86_64/ - Install using http mirror.
  8. -w bridge:br0 - Connect the guest to the host network. In this example connect to a bridge device in the host called "br0". Use this option if the host has static networking config & the guest requires full outbound and inbound connectivity to/from the LAN. Also use this if live migration will be used with this guest.
  9. -w bridge:br1 - Same as above but using br1 so that guest can have full outbound and inbound connectivity to/from the Internet.
  10. --vnc - Setup a virtual console in the guest and export it as a VNC server in the host.
  11. --disk path=/nas/kvm/centos.img,size=4 - Path to the file, disk partition, or logical volume to use as the backing store for the guest's virtual disk.
Kickstart is a network installation system for RHEL, Fedora and CentOS Linux distributions. Another good option is Cobbler which is a Linux provisioning server that centralizes and simplifies control of services including DHCP, TFTP, and DNS for the purpose of performing network-based operating systems installs. In this tutorial, I'm going to show you how to use kickstart file to install CentOS.

Create Kickstart file

An automated installation method to install CentOS / Fedora or RHEL is recommend to automate procedure. Using kickstart, a system administrator can create a single file containing the answers to all the questions that would normally be asked during a typical RHEL Linux installation. Use kickstart GUI tool called "Kickstart Configurator" (run system-config-kickstart command to start the tool) to create a file called ks.cfg as follows:
auth  --useshadow  --enablemd5
bootloader --location=mbr
zerombr
clearpart --all --initlabel
text
firewall --enabled --port=22:tcp
firstboot --disable
keyboard us
network --device eth0 --bootproto static --ip 10.10.21.76 --netmask 255.255.255.240 --gateway 10.10.21.100 --nameserver 10.10.21.1,10.10.21.2 --noipv6
network --device eth1 --bootproto static --ip 123.1.2.6 --netmask 255.255.255.240 --gateway 123.1.2.100 --nameserver 10.10.21.1,10.10.21.2 --hostname centos.nixcraft.in --noipv6
lang en_US
logging --level=info
url --url=http://mirrors.nixcraft.in/centos/5.5/os/x86_64/
reboot
rootpw --iscrypted $1$somepassword
selinux --enforcing
skipx
timezone  America/New_York
install
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1
part swap --recommended
%packages
@core
--nobase
%post
(
echo '10.0.0.0/8 via 10.10.21.100' > /etc/sysconfig/network-scripts/route-eth0
sed -i 's/LABEL=\//& console=ttyS0/' /etc/grub.conf
echo 'S0:12345:respawn:/sbin/agetty ttyS0 115200' >> /etc/inittab
echo "ttyS0" >> /etc/securetty
echo 'IPV6INIT=no' >> /etc/sysconfig/network
echo 'install ipv6 /bin/true' >> /etc/modprobe.conf
) 1>/root/post_install.log 2>&1
Upload this file to a web server as ks.cfg. You can use nfs server too.

virt-install: Install CentOS using Kickstart

Type the following command:
# virt-install \
-n centos \
-r 2048 \
--vcpus=1 \
--os-variant=rhel5.4 \
--accelerate \
-v \
-w bridge:br0 \
-w bridge:br1 \
--disk path=/emc/kvm/centos.img,size=100 \
-l http://mirrors.nixcraft.in/centos/5.5/os/x86_64/ \
-nographics \
-x "ks=http://10.10.21.3/static/ks.cfg ksdevice=eth0 ip=10.10.21.76 netmask=255.255.255.240 dns=10.10.21.1 gateway=10.10.21.100"

The -x option is used to pass additional kernel command line to the installer when performing a guest install. The ks option sets ks file location and rest are networking options so that installer can fetch ks.cfg and do automated installation for you.


There are various log files stored on the host system to assist with debugging KVM related problems. In this tutorial, I will cover log file locations and tools used to track down KVM problems.

=> $HOME/.virtinst/virt-install.log - virt-install tool log file.
=> $HOME/.virt-manager/virt-manager.log - virt-manager tool log file.
=> /var/log/libvirt/qemu/ - Log files for each running virtual machine. If centos is virtual machine name, than log file is /var/log/libvirt/qemu/centos.log.
You can use the grep and other Linux tools to view this files:
# tail -f /var/log/libvirt/qemu/freebsd.log
# grep something $HOME/.virtinst/virt-install.log

Connecting To Console

Use the virsh command to connect to guest serial console as follows :
# virsh list
# virsh console freebsd

This is useful to troubleshoot problem such as networking and much more from host itself. However, you need to configure guest operating system for a serial console. See how to setup a serial console for
FreeBSD and CentOS virtual machines.

KVM Configuration Files

You can edit configuration file to define hardware properties for VMs or other setup. They are located in /etc/libvirt/qemu/ directory. Here is sample FreeBSD guest configuration file.
less /etc/libvirt/qemu/freebsd.xml
OR
virsh dumpxml freebsd
Sample outputs:

<domain type='kvm'>
  <name>freebsd</name>
  <uuid>6b7f44df-b67a-b1e1-0f9a-40c9ad760b0a</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel5.4.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
<pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' cache='none'/>
      <source file='/nfs/freebsd73.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='file' device='cdrom'>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <interface type='bridge'>
      <mac address='54:53:01:12:4c:0a'/>
      <source bridge='br0'/>
      <model type='ne2k_pci'/>
    </interface>
    <interface type='bridge'>
      <mac address='54:53:02:1e:9c:0b'/>
      <source bridge='br1'/>
      <model type='ne2k_pci'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target port='0'/>
    </console>
<input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
  </devices>
</domain>
 
When you create guests with the virt-manager or virt-install, the guests configuration files are created automatically in the /etc/libvirt/qemu/ directory. You can use this file error checking. You can edit this file using a text editor or virsh command itself:
virsh edit freebsd
virsh edit centos

KVM tools

Type the following command to install kvm-tools package which contains some diagnostics and debugging tools for KVM, such as kvmtrace and kvm_stat, enter:
# yum -y install kvm_tools
You need to mount debugfs, enter:
# mount -t debugfs debugfs /sys/kernel/debug
# kvm_stat

Sample outputs:

Fig.01: Getting stats about KVM with kvm_stat
Fig.01: Getting stats about KVM with kvm_stat

You can use normal tools to troubleshoot and get other information using the following tools:

  • ps, pstree, and top
  • vmstat, iostat, and lsof
  • tcpdump, brctl, ip, and ifconfig
I'm using KVM to run multiple virtual machines under Redhat Enterprise Linux server 5.5. I've installed FreeBSD 7.x 64 bit as guest operating systems. How do I redirect the FreeBSD version 6, 7 or 8 virtual machine console to a serial port using virsh console command for management purpose from host itself?

FreeBSD does support a dumb terminal on a serial port as a console. This is useful for quick login or debug guest system problem without using ssh. First, login as root using ssh to your guest operating systems:
$ ssh vivek@freebsd.nixcraft.in
su -

Edit /boot/loader.conf, enter:
# vi /boot/loader.conf
Append the following entry:
console="comconsole"
Save and close the file. Edit /etc/ttys, enter:
# vi /etc/ttys
Find the line that read as follows:

ttyd0  "/usr/libexec/getty std.9600"   dialup  off secure
Update it as follows:
ttyd0   "/usr/libexec/getty std.9600"   vt100   on secure
Save and close the file. Reboot the guest, enter:
# reboot
After reboot, you can connect to FreeBSD guest as follows from host (first guest the list of running guest operating systems):
# virsh list
Sample outputs:

Id Name                 State
----------------------------------
  3 ographics            running
  4 freebsd              running
Now, connect to Freebsd guest, enter:
virsh console 4
OR
virsh console freebsd
Sample outputs:

Fig.01: Virsh console connected to FreeBSD guest
Fig.01: Virsh console connected to FreeBSD guest

References:

The virsh command can be used to mange local or remote guest operating systems. The program can be used to create, pause, and shutdown domains. It can also be used to list current domains.

List Running VMS

Type the following command:
# virsh list
Sample outputs:

Id Name                 State
----------------------------------
  1 centos.nixcraft.in   running
  2 freebsd              running

Shut Down A Guest

# virsh list
# virsh shutdown dominName
# virsh shutdown freebsd
# virsh shutdown 3

Rebooting A Guest

# virsh list
# virsh reboot domaiName
# virsh reboot 3
# virsh reboot win2008biz

Forcefully Stop A Guest

Force a guest to stop with the virsh command if it is not responding or crashed
# virsh list
# virsh destroy domainName
# virsh destroy openbsd.nixcraft.in

Get Information About Guest

# virsh list
# virsh dominfo dominName
# virsh dominfo 2
# virsh dominfo freebsd

Sample outputs:

Id:             2
Name:           freebsd
UUID:           6b7f44df-b67a-b1e1-0f9a-40c9ad760b0a
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       26.3s
Max memory:     524288 kB
Used memory:    524288 kB
Autostart:      disable

Get Information About Node

# virsh nodeinfo
Sample Outputs:

CPU model:           x86_64
CPU(s):              4
CPU frequency:       2394 MHz
CPU socket(s):       1
Core(s) per socket:  4
Thread(s) per core:  1
NUMA cell(s):        1
Memory size:         8181332 kB

Conclusion

The first part in this series covered KVM installation, KVM bridged based networking, KVM guest setup using virt-install, virt-manager, kickstart based guest installation and troubleshooting KVM with log files. Stay tunned for next part of series which will cover other advanced topics such as:
  • VM storage configuration using NFS and iSCSI
  • VM live migration
  • VM security and firewall
  • VM load balancing
  • VM instillation using Cobbler
The virtual network (virbr0) used for Network address translation (NAT) which allows guests to access to network services. However, NAT slows down things and only recommended for desktop installations. To disable Network address translation (NAT) forwarding type the following commands:

Display Current Setup

Type the following command:
# ifconfig
Sample outputs:

virbr0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:7921 (7.7 KiB)
Or use the following command:
# virsh net-list
Sample outputs:

Name                 State      Autostart
-----------------------------------------
default              active     yes
To disable virbr0, enter:
# virsh net-destroy default
# virsh net-undefine default
# service libvirtd restart
# ifconfig


I've setup FreeBSD and OpenBSD under KVM. Everything works great except ftp protocol. I've no firewall installed inside FreeBSD and OpenBSD. How do I configure Linux host KVM firewall to allow ftp traffic?

You need to configure iptables to allow all traffic to be forwarded across the bridge from KMV guest. There are two options here:

Option #1: Configure Iptables

Type the following command as root user on KVM host (RHEL / CentOS host system):
/sbin/iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
/sbin/service iptables save
/sbin/service iptables restart

Option #2: Disable Iptables On Bridges

Edit /etc/sysctl.conf, enter:
# vi /etc/sysctl.conf
Append the following config directives:

# Disable iptables on bridges so that ftp will work
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
Save and close the file. Reload the changes:
# sysctl -p

There are various ways to start virtual machines at at boot time. This means you don't have to type virsh start vmName command. This can be done by marking a vm as autostart. To configure a domain to be automatically started at boot. It will create an softlink at /etc/libvirt/qemu/autostart/. So if your VM name is debianlenny1, your config file name should be /etc/libvirt/qemu/debianlenny1.xml and the softlink should be created at /etc/libvirt/qemu/autostart//debianlenny1.xml

KVM: Autostart a Domain / VM Command

Type the following command:
virsh autostart vmName
virsh autostart debianlenny1
Sample outputs:
Domain debianlenny1 marked as autostarted
Also, make sure /etc/init.d/libvirtd service is stared on boot:
chkconfig libvirtd on

OpenBSD is a UNIX like system based on Berkeley Software Distribution (BSD). It was forked form NetBSD and created by Theo de Raadt in 1995. OpenBSD is famous for quality code and documentation without compromising position on software licensing. OpenBSD is also well know for focus on security features such as Memory protection, cryptography, randomization and much more in default base installation.

OpenBSD Installation

You need to first download OpenBSD iso image by visiting this page. You can use the wget command to grab the same as follows. The following command will download OpenBSD v4.7 64 bit (AMD64) iso file:
cd /tmp
wget http://filedump.se.rit.edu/pub/OpenBSD/4.7/amd64/install47.iso

Install OpeBSD 4.7 AMD64

Type the following command to install OpenBSD v4.7 64 bit with 512 MB RAM, 1 vcore cpu, 5GB disk space, br0 and br1 network interface:
 
virt-install \
-n openbsd1 \
-r 512 \
--vcpus=1 \
--os-variant=openbsd4 \
--accelerate \
-v -c /tmp/install47.iso \
-w bridge:br0 -w bridge:br1 \
--vnc \
--disk path=/raid10/kvm/openbsd1.img,size=5
 
Sample outputs:
Starting install...
Creating domain...                                                                                                                                                                                                    |    0 B     00:01
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
Use your local vnc viewer or type the following at server itself to view installer screen:
# vncviewer
OR run it over the ssh session, enter:
# ssh -X -C root@kvmserver42.nixcraft.in
# virt-viewer openbsd1

Sample outputs:

Fig.01: Creating OpenBSD guest with virt-install and installing the same with vnc
Fig.01: Creating OpenBSD guest with virt-install and installing the same with vnc

Now, just follow on screen installation instructions and install OpenBSD as per your requirements.

After Reboot My OpenBSD Guest Hangs At The Boot Screen...

Optional: Configure Serial Console Login and Redirection

OpenBSD version 4.5 and above made changes in kernel which prevents booting OpenBSD using KVM technology. OpenBSD 4.4 runs with mbbios enabled. However, due to some sort of bug in KVM it does not boot and hangs while displaying a message which read as "Starting tty flags". The workaround is to disable mpbios. This may or may not happen with your installation, but if it hanged, use the following procedure.

Step # 1: Boot OpenBSD With -c Option

At boot> prompt type the following command:
bsd -c
disable mpbios
quit
Sample session:
Fig.01: OpenBSD KVM Hangs at setting tty flags workaround
Fig.01: OpenBSD KVM Hangs at setting tty flags workaround

Now OpenBSD will boot without any problem. Login as root and type the following command to disable mpbios permanently:
# config -ef /bsd
disable mpbios
quit
Sample session:
Fig.02: Disabling mpbios for OpenBSD running under Linux KVM
Fig.02: Disabling mpbios for OpenBSD running under Linux KVM

Now you can use OpenBSD without any problem. Please note that this problem only occured under RHEL 5.5 64bit (KVM83) running OpenBSD 4.7 64bit guest. The config command can be used to build kernel compilation directories or modify a kernel. In this case you've modified the kernel to boot without mpbios support. The mpbios driver extracts configuration information from the BIOS on multiprocessor systems that conform to the Intel MultiProcessor Specification. See config and mpbios man page for further information.

I'm running a KVM virtual machine (FreeBSD 7 and Fedora Linux 13 desktop) under Redhat Enterprise Linux 5.5. However, I'm not getting the remote access via VNC (Virtual Network Computing) to access my Fedora Linux graphical desktop or FreeBSD console. How do I turn on VNC support without reinstalling both operating systems?

You need to attach your vncserver with the guest operating system console. This can be done using any one of the following method:

Method # 1: Command Line Option

Normally, QEMU (/usr/libexec/qemu-kvm) uses SDL to display the VGA output. With the -vnc option option, you can have QEMU listen on VNC display display and redirect the VGA display over the VNC session. When using the VNC display, you must use the -k parameter to set the keyboard layout if you are not using en-us. Valid syntax for the display is as follows:
-vnc :0
-vnc 192.168.1.5:0
-vnc 0.0.0.0:5
-vnc 0.0.0.0:1 -k en-us
####  Require that password based authentication is used for client connections ####
-vnc 0.0.0.0:1,password -k en-us
 
In the following example start centos1 guest vm using vnc
/usr/libexec/qemu-kvm -S -M rhel5.4.0 -m 1024 -smp 1 -vnc 0.0.0.0:1 -k en-us -name centos1 -monitor pty -boot c -drive file=/var/lib/libvirt/images/centos1.img

Method # 2: qemu-kvm VM Config File (Recommended)

You need to edit your VM config file which is in XML format. The config file is located at /etc/libvirt/qemu directory. In this example, edit centos1.xml as follows:
# vi /etc/libvirt/qemu/centos1.xml
Append the following line before final </devices>:

 
 <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
 
Here is my sample config file:
 
<domain type='kvm'>
  <name>centos1</name>
  <uuid>88d067cf-e5f7-7229-f35f-472a9c884864</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel5.4.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
<pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' cache='none'/>
      <source file='/emc/vms/images/host302.f02.dc05.corplan.nixcraft.net.in/c/centos1.img'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <interface type='bridge'>
      <mac address='xx:yy:zz:ee:f4:63'/>
      <source bridge='br0'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <mac address='54:52:xx:yy:zz:ee'/>
      <source bridge='br1'/>
      <model type='virtio'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target port='0'/>
    </console>
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
  </devices>
</domain>
 
Finally, restart your libvirtd:
# /etc/init.d/libvirtd restart
# virsh shutdown centos1
# virsh start centos1

How Do I Use VNC Client?

Type your VNC (KVM) server ip and port:
Fig.01: Connecting to KVM Guest Using VNC Client
Fig.01: Connecting to KVM Guest Using VNC Client

Once connected you can view your desktop:
Fig.02: RHEL 6 Guest Beta Desktop Over VNC Session Running Under KVM
Fig.02: RHEL 6 Guest Beta Desktop Over VNC Session Running Under KVM

Make sure you browse the desktop using ssh tunnel or over some sort of VPN session.

How Do I Find Out Current VNC Setting For Any Given Domain / VM?

Type the following command:
# virsh vncdisplay domainName
# virsh vncdisplay 3
# virsh vncdisplay centos1

Sample outputs:

:2

How Do I Password Protect My VNC Session?

The passwd attribute provides a VNC password in clear text (so make sure your xml config file is only readable by root user). Edit centos1.xml file as follows:
 
 <graphics type='vnc' port='-1' autoport='yes' passwd='YOUR-PASSWORD-HERE' keymap='en-us'/>
 
OR
 
 <graphics type='vnc' port='-1' autoport='yes' listen='192.168.1.5' passwd='YOUR-PASSWORD-HERE' keymap='en-us'/>
 
Where,
  • type='vnc': The graphics element has a mandatory type attribute which takes the value "sdl", "vnc", "rdp" or "desktop". In this case it is set to VNC for remote access.
  • autoport='yes': The autoport attribute is the new preferred syntax for indicating autoallocation of the TCP port to use.
  • passwd='YOUR-PASSWORD-HERE': The passwd attribute provides a VNC password in clear text.
  • keymap='en-us': The keymap attribute specifies the keymap to use.
  • listen='192.168.1.5': The listen attribute is an IP address for the server to listen on.
Save and close the file. Restart services as follows:
# /etc/init.d/libvirtd restart
# virsh start centos1

linux commands

  • To check if ipv6 module is currently loaded in the system:
    # lsmod | grep ipv6
  • Disable ipv6
    In /etc/sysconfig/network: NETWORKING_IPV6=no
    In /etc/sysctl.conf: net.ipv6.conf.all.disable_ipv6 = 1
    Next: disable the IPv6 firewall: chkconfig ip6tables off
  • Disable disk journaling
    • create ext4 without journaling:
      mkfs.ext4 -O ^has_journal /dev/sda1
    • disable journaling:
      tune2fs -O ^has_journal /dev/sda1
    • enable writeback to improve performance:
      tune2fs -o journal_data_writeback /dev/sda1
    • require fsck: # e2fsck -f /dev/sda1
    • check fs options:
      dumpe2fs /dev/sda1 | grep -i 'Filesystem features'
    • modify fstab options:
      /dev/sda1 /test ext4 default,data=writeback,noatime,nodiratime 0 0
  • kernel modules are stored in /lib/modules/`uname -r`
    https://wiki.archlinux.org/index.php/Kernel_modules
    • settings pass to udev are in /etc/modprobe.d
    • For modules built into kernel, options can be passed to module using kernel command:
      modname.parametername=parametercontents
    • show loaded kernel modules: # lsmod
    • show module info # modinfo <module_name>
    • list options set for a loaded module # systool -v -m <module_name>
      systool in package "sysfsutils"
    • display comprehensive config for all modules # modprobe -c
    • list dependencies of a module # modprobe --show-depends <module_name>
    • manual load module # modprobe <module_name>
    • manual unload module # modprobe -r <module_name>
      or # rmmod <module_name>
    • reload config files # systemctl restart systemd-modules-load.service
  • View current firewall policy:
    # /sbin/iptables -L
  • # ifconfig -a; ip addr show
  • # findfs LABEL=/
  • Disable ipv6:
    To completely disable IPv6 in your system, all you have to do is save the following line in a file inside /etc/modprobe.d/ or /etc/modprobe.conf:
     install ipv6 /bin/true
    or
     options ipv6 disable=1
  • rpm "specifies multiple packages"
    rpm -q --queryformat "%{name}.%{arch}\n" package
  • rpm find dependency
    rpm -q --requires package (rpm -qR package)
    rpm -q --provides package
    rpm -q --whatrequires CAPABILITY
    rpm -q --whatprovides 
    CAPABILITY
  • find where specific package comes from
    yum info package
    yum list package
  • System Informations
    • CPU Information: #cat /proc/cpuinfo
    • memory usage: #free -m
    • disk partition: #fdisk -l
    • PCI devices: #lspci
    • USB devices: #lsusb
    • #lsdev
    • #lshw
    • ifconfig -a; ip addr show
    • Open ports and process
      sudo lsof -i
      sudo netstat -lptu
      sudo netstat -tulpn
  • System Status: top; vmstat; uptime; pgrep; free; iostat; mpstat; pmap; ss; netstat; iptraf; strace
  • Check swap usage: swapon -s; cat /proc/meminfo; cat /proc/swaps; free -m; vmstat; top
  • Check and make swap: cat /etc/fstab; fdisk -l /dev/sda2; mkswap /dev/sda2; swapon /dev/sda2
    use swapfie:
    1. create an (1GB) empty file: dd if=/dev/zero of=/swapfile bs=1024 count=1048576
    2. mkswap /swapfile
    3. create swap entry in /dev/fstab: /swapfile none swap sw 0 0
      (Linux 2.6 kernel added a new kernel parameter called swappiness to let administrators tweak the way Linux swaps. It is a number from 0 to 100 (default 60). In essence, higher values lead to more pages being swapped, and lower values lead to more applications being kept in memory, even if they are idle. alter it temporarily (until you next reboot) by typing as root: echo 50 > /proc/sys/vm/swappiness or permanently by changing the vm.swappiness parameter in the /etc/sysctl.conf file.
  • disable usb storage
    • remove driver:
      # mv /lib/modules/$(uname -r)/kernel/drivers/usb/storage/usb-storage.ko /var/tmp
    • prevent loading the module, but root can still manually load with insmod
      # echo 'install usb-storage : ' >> /etc/modprobe.conf
    • disable kernel support in grub.conf
      kernel /vmlinuz-2.6.18-128.1.1.el5 ro root=LABEL=/ nousb
  • mount usb storage
    • check usb support in included in kernel
      # lspci -v | grep HCI
      0000:00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI
      ...
    • Make sure your external drive detected by system
      # dmesg | grep -i usb
      SLPB PCI0 HUB0 USB0 USB1 USB2 USBE
      usbcore: registered new driver usbfs
      usbcore: registered new driver hub
      USB Universal Host Controller Interface driver v2.3
      uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 1
      hub 1-0:1.0: USB hub found
      ...
    • If you cannot see your external USB drive in above dmesg output then try to load usb-uhci and usb-ohci modules (driver):
      # modprobe usb-uhci
      # modprobe usb-ohci
      # modprobe usb-storage
  • OpenIPMI command
    • ipmitool sensor
    • ipmitool mc info
    • ipmitool help
  • Force yum update:
    remove package from rpm database first: rpm -e --justdb --nodeps package_name
  • set up satellite client:
    download and run http://myserver/pub/bootstrap/bootstrap.sh
  • create local mirror of rhn satellite updates (http://kenfallon.com/how-to-mirror-rhn-behind-your-firewall/)
    1. Regist to satellite through proxy: rhn_register --nox --proxy=myproxy:8080
    2. Install the yum-utils package from the RHN: yum install yum-utils
    3. download the channel locally
      # yum repolist
      # reposync -p /opt/mylocalrepo/ --repoid=rhel-x86_64-server-5 -l # -l is for load plugin
      or #: reposync -l
      or #: reposync --gpgcheck -l --repoid=channel-id --download_path=/test/path
    4. add your own RPMs or RPM’s from EPEL, DAG, etc to the repository
    5. yummify the local directory using the createrepo command. This goes through all the RPM’s and extracts version and dependency information which it uses to generate XML metadata files that the yum command can understand. Run createrepo after add new packages.
      # createrepo /opt/mylocalrepo/
    6. (re-use the repodata of rhn:
      # yum –disablerepo=* –enablerepo=$RELEASE makecache
      # cp -f /var/cache/yum/$RELEASE/*.gz /var/cache/yum/$RELEASE/*.xml /opt/mylocalrepo/$RELEASE/repodata
      )
    7. Point apache at the local directory so that it’s accessible from an internal url e.g: http://myserver.local/myrepo/. You could also use NFS or FTP if you prefer. Once that is done you can distribute a yum config file for your new repo to /etc/yum.repos.d/my.repo on all the internal servers.

      [rhel-myrepo]
      name=My Red Hat Enterprise Linux $releasever - $basearch
      baseurl=http://myserver.local/myrepo/
      enabled=1
      gpgcheck=0
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    8. check new repo: yum repolist
    9. disable the Red Hat network by setting enabled = 0 in /etc/yum/pluginconf.d/rhnplugin.conf to prevent the server trying to connect directly to the RHN
  • create local dvd depot for RHEL6
    1. # mkdir /media/cdrom
    2. # mount /dev/cdrom /media/cdrom
    3. # cat > /etc/yum.repos.d/DVD.repo <<EOF
      [baseOS]
      name=Red Hat Enterprise Linux $releasever – $basearch baseOS
      baseurl=file:///media/cdrom
      enabled=1
      gpgcheck=1
      
      [ScalableFileSystem]
      name=Red Hat Enterprise Linux $releasever – $basearch ScalableFileSystem
      baseurl=file:///media/cdrom
      enabled=1
      gpgcheck=1
      
      [Workstation]
      name=Red Hat Enterprise Linux $releasever – $basearch Workstation
      baseurl=file:///media/cdrom
      enabled=1
      gpgcheck=1
      
      EOF

      Or just simply,
      [dvd]
      mediaid=1339640147.274118
      name= DVD for RHEL6
      baseurl=file:///media/cdrom/Server
      enabled=1
      gpgcheck=0
      
      Where mediaid is value comes from the .discinfo file located in the root of the DVD

  • clean all yum cache: # yum clean all
  • list of yum transactions: # yum history
    backup yum: # yum history undo x (x being the numeric value associated with the transaction list above).
  • exclude packages: # yum -x php -x httpd update
    or: # yum -x php,httpd update
    or: # yum -x docker\* update
  • list rpm package content: #rpm -q -filesbypkg -p filename.rpm
  • Compatible packages:
    RHEL6: # yum groupinstall "Compatibility Libraries"
            # yum groupinstall "Development Tools"

    RHEL5: # yum groupinstall "Legacy Software Support"
            # yum groupinstall "Legacy Software Development"
  • IPMItool
    Baseboard Management Controller (BMC), which acts as a hub for the various sensors throughout a system board. Second, IPMI became the standardized way to interact with the BMC. Service Processor (SP), such as Dell's Remote Access Card (DRAC) or Sun's Lights Out Manager (LOM), are add-on boards that add value to the BMC's capabilities, such as providing a Web interface, SSH interface, SNMP, or networking, but by no means a requirement for utilizing IPMI.
    • # ipmitool chassis status
    • # ipmitool chassis power status
    • read all sensors: ipmitool sdr list
      (sensor number|sensor id|sensor reading|sensor status)
    • # ipmitool sdr elist full
    • # ipmitool sdr entity # sensor data repository
    • # ipmitool sdr entity 20
    • # ipmitool sel list # system event log
    • # ipmitool sel list last 3
  • Mount which support for Chinese file name
    # mount /dev/hda2 /mnt/hda2/ -t vfat -o iocharset=utf8
    # mount /dev/hda5 /mnt/hda5/ -t ntfs -o iocharset=utf8
    /dev/sda1 /mnt/flash auto iocharset=gb2312,noauto,user 0 0
  • hpacucli utility
    Abbreviationschassisname = ch
    controller = ctrl
    logicaldrive = ld
    physicaldrive = pd
    drivewritecache = dwc
    hpacucli# hpacucli
    # hpacucli help
    Controller Commands
    Display (detailed) hpacucli> ctrl all show config
    hpacucli> ctrl all show config detail
    Statushpacucli> ctrl all show status
    Cachehpacucli> ctrl slot=0 modify dwc=disable
    hpacucli> ctrl slot=0 modify dwc=enable
    Rescanhpacucli> rescan
    Note: detects newly added devices since the last rescan
    Physical Drive Commands
    Display (detailed) hpacucli> ctrl slot=0 pd all show
    hpacucli> ctrl slot=0 pd 2:3 show detail
    Note: you can obtain the slot number by displaying the controller configuration (see above)
    Statushpacucli> ctrl slot=0 pd all show status
    hpacucli> ctrl slot=0 pd 2:3 show status
    Erasehpacucli> ctrl slot=0 pd 2:3 modify erase
    Blink disk LED hpacucli> ctrl slot=0 pd 2:3 modify led=on
    hpacucli> ctrl slot=0 pd 2:3 modify led=off
    Logical Drive Commands
    Display (detailed) hpacucli> ctrl slot=0 ld all show [detail]
    hpacucli> ctrl slot=0 ld 4 show [detail]
    Statushpacucli> ctrl slot=0 ld all show status
    hpacucli> ctrl slot=0 ld 4 show status
    Blink disk LED hpacucli> ctrl slot=0 ld 4 modify led=on
    hpacucli> ctrl slot=0 ld 4 modify led=off
    re-enabling failed drive hpacucli> ctrl slot=0 ld 4 modify reenable forced
    Create# logical drive - one disk
    hpacucli> ctrl slot=0 create type=ld drives=1:12 raid=0
    # logical drive - mirrored
    hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14 size=300 raid=1
    # logical drive - raid 5
    hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14,1:15,1:16,1:17 raid=5
    Note:
    drives - specific drives, all drives or unassigned drives
    size - size of the logical drive in MB
    raid - type of raid 0, 1 , 1+0 and 5
    Removehpacucli> ctrl slot=0 ld 4 delete
    Expandinghpacucli> ctrl slot=0 ld 4 add drives=2:3
    Extendinghpacucli> ctrl slot=0 ld 4 modify size=500 forced
    Sparehpacucli> ctrl slot=0 array all add spares=1:5,1:7
  • Get HP server serial number
    • # hpasmcli
      hpasmcli> show server
    • #dmidecode -t system


Mounting 13TB Raid
This is some quick info I learned while trying to mount a 13TB partition in RHEL 5.3. The main thing is that fdisk does not like to make partitions larger than 2.2TB because dos labels are not recognized. The second is that ext3 file system doesn't like anything bigger than 8Tb. So here is what I did to go around it. I had to used parted instead of fdisk to overcome that 2TB limit.
#parted /dev/sdd
#mklabel gpt
>mkpart primary 0 13000G
>quit
#yum install e4fsprogs
#mkfs.ext4 /dev/sdd1

To lay this all out I had to rename the label of the partition to gpt so I could use the larger partitionsize and then I installed support for ext4 and used that as the filesystem. Yes I know I punked out a bit but I am sick of trying to find work arounds for ext3.

Linux (RedHat) Deamons

http://magazine.redhat.com/2007/03/09/understanding-your-red-hat-enterprise-linux-daemons/

A Unix daemon is a program that runs in the “background,” enabling you to do other work in the “foreground,” and is independent of control from a terminal. Daemons can either be started by a process, such as a system startup script, where there is no controlling terminal, or by a user at a terminal without “tying up” that terminal as the daemon runs. But which daemons can you safely play with? Which should you leave running?

An introduction to daemons

The real-world (i.e., non-computer) definition of “daemon” is either a spirit (an evil one) or an inner or private voice. It’s interesting to note that each of the real-world definitions actually does apply to Unix daemon programs. Like mythological daemons, Unix daemon programs skulk around unseen in the background just as a daemon would. And daemons act like an inner voice in that they can run continuously and, like a conscience, can always be accessed. The word “daemon” is one of those cases of chicken and egg computer acronyms in search of a definition and supposedly is based on “Disk And Execution MONitor” program.

An introduction to services

The daemons referenced in /etc/init.d are configured to be run as Linux services. Services are programs that are started and stopped through the init scripts in the /etc/init.d directory. Many of these services are launched when the system is booted. The /sbin/service utility provides a consistent interface to executing the init scripts. The init scripts provide a consistent interface to managing a service by providing options that start, stop, restart, query status, and perform other actions on services. For example, the httpd service init script provides these options:
/sbin/service httpd
Usage: httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}
You can view the current state of all services with this option to the service utility:
/sbin/service –status-all
acpid (pid 2481) is running...
anacron (pid 2647) is running...
atd (pid 2657) is running...
auditd (pid 2189) is running...
....
Runlevel information for these services, that is, the settings for which system runlevel the service will be started at boot time, can be queried and modified with the chkconfig utility. For example, to query the current settings for the syslog service:
/sbin/chkconfig --list syslog
syslog          0:off   1:off   2:on    3:on    4:on    5:on    6:off
This shows that that syslog service will be automatically started at boot-time for runlevels 2, 3, 4, and 5. To set the service to not start for runlevels 3 and 4 (not a good idea, by the way), you would use these options for the chkconfig utility:
/sbin/chkconfig –levels 34 syslog off
The /usr/bin/system-config-services utility provides a GUI interface that enables you to both query and modify the current state of a service, as well as its defined run levels. See Illustration 1.
Illustration 1
Illustration 1: The /usr/bin/system-config-services utility GUI
Let’s look at how these services and daemons appear in output from ps. Here’s a short list:
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 23:36 ?        00:00:00 init [5]
root      2161     1  0 23:37 ?        00:00:00 auditd
root      2177     1  0 23:37 ?        00:00:00 syslogd -m 0
root      2180     1  0 23:37 ?        00:00:00 klogd -x
root      2207     1  0 23:37 ?        00:00:00 mcstransd
root      2254     1  0 23:37 ?        00:00:00 rpc.statd
root      2287     1  0 23:37 ?        00:00:00 rpc.idmapd
root      2577     1  0 23:37 ?        00:00:00 crond
root      2631     1  0 23:37 ?        00:00:00 /usr/sbin/atd
root      2654     1  0 23:37 ?        00:00:00 rhnsd --interval 240
What’s important to note here? (Other than I’m staying up too late at night, that is.) For each of the daemons, the parent process ID (PPID) is 1. This indicates that the daemons were started up during the boot process by init.
A useful tool for viewing the “tree” of processes and their parents is “pstree.” Here’s a fragment of the output from pstree:
init-+
     |-NetworkManager---2*[{NetworkManager}]
     |-NetworkManagerD
     |-acpid
     |-atd
     |-auditd-+-python
     |        `-{auditd}
     |-avahi-daemon---avahi-daemon
     |-bonobo-activati---{bonobo-activati}
     |-crond
     |-cupsd---cups-polld
     |-2*[dbus-daemon---{dbus-daemon}]
     |-dbus-launch
     |-dhcdbd---dhclient

A closer look at your system’s daemons

So much for background information. Let’s take a look at your system’s daemons and see which ones you can safely play with. Note that for this article, the system used was running the Red Hat Enterprise Linux Beta 2 release, workstation configuration. Based on your specific system, you may see more or fewer daemons, or even some not included here.
We’ve listed web-sites where you can learn more about these daemons, but the best place to start learning is the manpage. O’Reilly also has an excellent alphabetic index of Linux commands and wikipedia.org has entries for most of these daemons. And, don’t forget to look in the README files.

acpid

This is the daemon for the Advanced Configuration and Power Interface (ACPI). ACPI is an open industry standard for system control related actions, most notably plug-and-play hardware recognition and power management, such as startup and shutdown and putting systems into low poser consumption modes.
You’ll probably never want to shut down this daemon, unless you are explicitly instructed to do so to debug a hardware problem.
Learn more:
http://www.acpi.info

anacron

One of the problems with living on a laptop, as so many of us do these days, is that when you set up a cron job to run, you can’t always be sure that your laptop will be running at the time that the job should run. anacron (the name refers to its being an “anachronistic cron”) gets around this problem by scheduling tasks in days. For example, anacron will run a job if the job has not been run in the specified number of days.
When are you safe not running anacron? When your system is running continuously. Should you simply stop cron from running if you have anacron running? No; anacron is able to specify job intervals in days, not hours and seconds.
Learn more:
http://anacron.sourceforge.net

apmd

This is the daemon for the Advanced Power Management (APM) BIOS driver. The APM hardware standard and apmd are being replaced by ACPI and acpid. If your hardware supports ACPI, then you don’t need to run apmd.

atd

This is the daemon for the at job processor (at enables you to run tasks at specified times). You can turn off this daemon if you don’t use it.

autofs

This daemon automatically mounts disks and file systems that you define in a configuration file. Using this daemon can be more convenient that explicitly mounting removable disks.
Learn more:
http://freshmeat.net/projects/autofs

auditd

The Linux Auditing System provides kernel-resident logging of system calls and user space tools to collect and view the logs. The auditd daemon writes the logging records to disk. auditd is configurable to allow control over what information is written to the logs.
Why should you keep auditd running? The information in the log may prove useful in debugging security-related issues. For example, auditd is used to log SELinux events. There are also utilities such as aureport that enable you to view the audit log. Here’s an example of a report generated by aureport:
Summary Report
======================
Range of time in logs: 11/28/2006 06:07:04.800 - 02/06/2007 21:10:09.957
Selected time for report: 12/31/1969 19:00:00 - 02/06/2007 21:10:09.957
Number of changes in configuration: 285
Number of changes to accounts, groups, or roles: 32
Number of logins: 145
Number of failed logins: 11
Number of users: 2
Number of terminals: 22
Number of host names: 11
Number of executables: 27
Number of files: 91
Number of AVC denials: 688
Number of MAC events: 12
Number of failed syscalls: 404
Number of anomaly events: 0
Number of responses to anomaly events: 0
Number of crypto events: 0
Number of process IDs: 14022
Number of events: 70694

Avahi-daemon and avahi-dnsconfd

The Avahi website defines Avahi as: ‘a system which facilitates service discovery on a local network. This means that you can plug your laptop or computer into a network and instantly be able to view other people who you can chat with, find printers to print to, or find files being shared…’ Avahi is a Zeroconf implementation. Zeroconf is an approach that enables users to create usable IP networks without having special configuration servers such as DNS servers.
A common use of the avahi-daemon is with Rhythmbox, so you can see music that is made available to be shared with others. If you’re not sharing music or files on your system, you can turn off this daemon.
Learn more:
http://avahi.org
http://zeroconf.org

Bluetooth and hidd and pand

The name says it all. Run this service to enable your system to make use of Bluetooth devices. The name of the actual daemon is hcid (Host Controller Interface Daemon).
There’s also a daemon named hidd. This is the Bluetooth Human Interface Device Daemon. It provides keyboard, mouse, and track-ball device support over Bluetooth.
And, there’s pand. This daemon enables your computer to connect to ethernet networks using Bluetooth.
Learn more:
http://www.bluetooth.com
http://bluez.sourceforge.net/contrib/HOWTO-PAN

capi

This daemon supports the Common ISDN Application Programming Interface. You’ll run this if you’re connecting to ISDN hardware components. The service runs capiinit.
Learn more:
http://www.capi.org/pages

conman

No, this isn’t related to late-night infomercials about real estate investing. The conman service (and the conmand daemon) support console management. This supports multiple console devices and simultaneous users. It supports local serial devices and remote terminal servers (via the telnet protocol). If you’re managing multiple servers, you may want to run conman.
Learn more:
http://home.gna.org/conman/

cpuspeed

This daemon adjusts the CPU speed based on the power consumption. Less power is used when the CPU is idle, and more power is available when needed to improve performance. If you’re running on a laptop, you might want to consider running cpuspeed.
Learn more:
http://carlthompson.net/Software/CPUSpeed

crond

This daemon automates the running of tasks. These jobs are necessary for any Linux or Unix system. Don’t stop or disable this one.
Learn more:
http://www.unixgeeks.org/security/newbie/unix/cron-1.html
http://www.linuxhelp.net/guides/cron/

CUPS and cups-config-daemon

This daemon is the “Common UNIX Printing Solution.” Like the name implies, it’s a printing system that can handle multiple data formats and printers. If you want to print, leave this daemon running.
Learn more:
http://www.cups.org
http://www.easysw.com/cups/index.php

dhcdbd

This is the DHcp Client D-Bus Daemon. According to The Free DeskTop wiki,
D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a “single instance” application or daemon, and to launch applications and daemons on demand when their services are needed.
Do you want to run this daemon? If you’re running your system on a network (and who isn’t?), especially if you’re moving between networks such as when you move from a wired network to wireless as you move around your office, then you should be running NetworkManager. (We’ll discuss NetworkManager in a bit.)
The dhcdbd daemon provides a D-Bus interface to dhclient, the DHCP client from ISC. This makes it possible for NetworkManager can to query and control dhclient.
Learn more:
http://www.freedesktop.org/wiki/Software/dbus

gpmd

This daemon enables you to use your mouse in text-based applications such as the Midnight Commander file manager and on the console. You might find this useful if you’re working through situations in the console; otherwise, you’ll be working in the X windowing system and you might never need gpmd.

hald

No, this isn’t related to the evil computer in the film “2001, A Space Odyssey.” In this context, HAL refers to the “Hardware Abstraction Layer.” The HAL daemon collects this information about hardware devices from the kernel and the hardware and makes it available in a consistent manner.
Don’t turn off this daemon. Multiple applications rely on it.
Learn more:
Desktop and hardware configuration,” by David Zeuthen

hplipd

This daemon supports HP Linux Imaging and Printing (HPLIP) for printing, scanning, and faxing with HP inkjet and laser printers. HPLIP works CUPS by providing a backend to connect to HP devices.
Learn more:
http://hplip.sourceforge.net

hsqldb

This is the daemon for a Java relational database. The daemon gets its name from the Hypersonic SQL project that has been discontinued. hsqldb is used widely in open source projects such as OpenOffice (it’s the database behind the “base” feature) and is often used in demonstration programs, as it can run entirely in memory. It also runs fast. Should you run this daemon? Only if you have a specific program that makes use of it. But, it’s a very useful tool, and if you’re not familiar with it, it’s worth taking a look.
Learn more:
http://hsqldb.org
http://dba.openoffice.org

httpd

The Apache web server. Used by almost 60% of all websites. If you want to host a website, you run Apache. Need we say more?
Learn more:
http://httpd.apache.org

ip6tables and iptables

These daemons are firewalls. A firewall, according to Wikipedia, is an “information technology (IT) security device which is configured to permit, deny or proxy data connections set and configured by the organization’s security policy. Firewalls can either be hardware and/or software based.”
iptables functions by maintaining tables of IPv4 packet filter rules in the kernel. It checks incoming and outgoing packets against these rules and blocks packets that don’t meet the rules. ip6tables does the same for IPv6 packets.
Which should you run? Both. Always. It’s a dangerous world on the ‘net.
Learn more:
http://www.netfilter.org
http://www.ipv6.org

irda

IrDA (Infrared Data Association) is an industry standard for inter-device wireless, infrared communications. Most laptops are configured with an IrDA infrared transceiver. You only need to run this daemon if you need to communicate via an infrared connection to other devices.
Learn more:
http://irda.sourceforge.net

irqbalance

This daemon distributes hardware interrupts to the CPUs in SMP (symmetric processor: multi-processor architecture) systems to increase performance. The daemon balances savings in power consumption with performance.
You need not run this daemon on single processor systems, as it only has an effect on multiple-processor systems. Red Hat Kbase articles1 indicate that irqbalance is relevant on x86, x86_64, and AMD systems.
Learn more:
http://www.irqbalance.org

kudzu

This is a very useful daemon. At boot time, it detects if hardware devices have been added to or removed from the the system. It”s worthwhile to run kudzu at boot time, even if you don’t plan on adding or removing hardware often. You might run into a situation where you add a device and just assume that the system will figure out that it’s there. Also, since kudzu only runs at boot time, and does not stay running, there’s no performance hit on the system.
Learn more:
http://fedora.redhat.com/projects/additional-projects/kudzu

lisa

This daemon gets its name from Lan Information Server. lisa provides a function similar to the MS-Windows Network Neighborhood and provides you access to servers, including CIFS (Common Internet File Systems) servers on your network. lisa only needs the TCP/IP stack to function. It sends ICMP echo requests to ranges of IP address that you define in its configuration file and waits for responses.
Learn more:
http://docs.kde.org/stable/en/kdenetwork/lisa
http://docs.kde.org/userguide/networking-with-windows.html
http://lisa-home.sourceforge.net

lm_sensors

This daemon supports monitoring temperatures, voltages, and cooling fans. In order to make use of this daemon, your system hardware has to include sensors to perform this monitoring. You can only run this daemon if your hardware can support if. You probably don’t want to run this daemon on a workstation. It’s more likely to be used for hi-end, mission critical servers.
Learn more:
http://www.lm-sensors.org
http://freshmeat.net/projects/lm_sensors

mcstrans

SELinux Context Translation System Daemon. This daemon translates security context informartion into a human readable form. You can probably stop this daemon, but if you do, you’ll see a change in the SELinux information displayed with ls -Z. For example, with the daemon running, you’ll see:
ls -Z
-rw-r--r--  jsmith jsmith user_u:object_r:user_home_t      bookmarks.html
drwxr-xr-x  jsmith jsmith user_u:object_r:user_home_t      Desktop
-r-xr-xr-x  jsmith jsmith user_u:object_r:user_home_t      hello
-r--r--r--  jsmith jsmith user_u:object_r:user_home_t      hello.c
And, with it stopped, you’ll see:
ls -Z
-rw-r--r--  jsmith jsmith user_u:object_r:user_home_t:s0   bookmarks.html
drwxr-xr-x  jsmith jsmith user_u:object_r:user_home_t:s0   Desktop
-r-xr-xr-x  jsmith jsmith user_u:object_r:user_home_t:s0   hello
-r--r--r--  jsmith jsmith user_u:object_r:user_home_t:s0   hello.c
Note that with the daemon stopped, the security context value of “s0” is displayed. mctrans translates this to a null display. Other security contexts are translated from alphanumeric values in their names.
Learn more:
http://fedoraproject.org/wiki/SELinux/Understanding
http://danwalsh.livejournal.com

mdmonitor and mdmpd

These two daemons are used with RAID (redundant array of inexpensive/independent disks) data storage systems. Mdmonitor starts, stops, and reloads the mdadm (multipath device monitoring and management) software RAID monitoring and management utilities. You should only run these daemons if you have RAID storage in your system.
Learn more:
http://www.linuxdevcenter.com/pub/a/linux/2002/12/05/RAID.html

messagebus

This is the D-BUS system-wide message bus daemon. This daemon broadcasts notifications of system events and such as changes in the printer queue or the adding and removing of devices. (Note that this is not the same operation as Kudzu, as it can take place while the system is running and not only at boot time.)
Learn more:
http://www.freedesktop.org/software/dbus

netplugd and ifplugd

These daemons configure Ethernet devices when cables are plugged in and deconfigure them when the cables are removes. Why would you want this to happen? It makes sense for laptops so that your network connections are only brought up when their cables are attached.
Note that the development of netplugd has been discontinued in favor of ifplugd.
Learn more:
http://0pointer.de/lennart/projects/ifplugd

NetworkManager and NetworkManagerDispatcher

The NetworkManager daemon automates switching between network connections. This is a useful daemon for laptop users who switch between wireless WiFi connections and Ethernet connections. The NetworkManagerDispatcher daemon automatically runs scripts (including scripts to force any actions that you want to have happen such as setting up specific routes) when NetworkManager changes the network state.
Learn more:
http://www.gnome.org/projects/NetworkManager

named

This daemon is the Domain Name Server. You’ll need to run this daemon only if your system is acting as a DNS server for your network.
Learn more:
http://www.dns.net/dnsrd

nfsd

The nfs daemon supports the nfs communications protocol for file sharing across TCP/IP networks. You’ll want to run this daemon if you make use of file systems shared with nfs.
Learn more:
http://nfs.sourceforge.net

nscd

This is the name service cache daemon. It takes care of group and password lookups for running programs and then caches the lookup results for the next query for services that can experience slowness in picking up changes such as NIS or LDAP. If you’re running these services, you may want to run nscd.

ntpd

This is the Network Time Protocol daemon. This deamon sets and maintains the system time of day by keeping it in synch with Internet standard time servers. If your system is connected to the Internet (and who isn’t?) then running ntpd will keep your system time correct.
Learn more:
http://www.ntp.org

oddjobd

The oddjobd daemon provides the com.redhat.oddjob service on the system-wide message bus. Each facility which oddjobd provides is provided as a separate D-Bus method. oddjobd provides support for unprivileged applications that require privileged operations to be performed.
You should only run this daemon if you are using an application that requires it, such as Conga.
Learn more:
http://people.redhat.com/nalin/oddjob/oddjob.html
http://sourceware.org/cluster/conga

openvpn

This daemon supports virtual private networks (VPNs). The daemon startup script says it all:
OpenVPN is a robust and highly flexible tunneling application that uses all of the encryption, authentication, and certification features of the OpenSSL library to securely tunnel IP networks over a single UDP port.
If your system is a node in a VPN, then you’ll probably run OpenVPN.
Learn more:
http://openvpn.net

pcscd

This is the PC/SC Smart Card Daemon. pcscd is the daemon for pcsc-lite (middleware for accessing smart cards) and the (java-based) MuscleCard framework. It enables communications with smart card readers and smart cards.
(A smart card is a card that is embedded with either a memory chip or microprocessor and a memory chip. And Muscle is the Movement for the Use of Smart Cards in a Linux Environment.)
Learn more:
http://www.smartcardalliance.org
http://pcsclite.alioth.debian.org
http://www.linuxnet.com/musclecard/index.html

portmap

The portmapper daemon manages RPC (remote procedure call) connections. It converts RPC program numbers into TCP/IP (or UDP/IP) protocol port numbers. The most common use of portmapper is by NFS and NIS.
So, if your system relies on NIS or NFS, don’t turn off the portmap daemon.
Learn more:
http://www.linux-nis.org/nis-howto/HOWTO/portmapper.html

postfix

This daemon is a mail transport agent. Unless your system is a mail relay server, you don’t need to run this daemon.
Learn more:
http://www.postfix.org

rdisc

This daemon (the router discovery daemon) discovers routers on the local subnet. It is run at boot time to populate the network routing tables with default routes.
Learn more:
http://www.informit.com/articles/article.asp?p=23951&rl=1

restorecond

This is an SELinux daemon. restorecond watches for file creation (of files listed in /etc/selinux/restorecond.conf) and then ensures that the files have the correct file context associated with the policy, and then sets the default SELinux file context.
Don’t turn this one off. SELinux needs it.
Learn more:
http://fedoraproject.org/wiki/SELinux/Understanding
http://danwalsh.livejournal.com/

rhnsd

This daemon periodically checks for actions that have been scheduled though the Red Hat Network web interface and runs them. This includes actions such as installing, removing, or updating software, rebooting the system, starting a kickstart installation, or installing configuration files.
Learn more:
https://www.redhat.com/rhn/

rpcgssd and rpcidmapd and rpcsvcgssd

The rpcgssd and rpcsvcgssd daemons handle security for RPC. The rpcidmapd maps user names to UID and GID numbers.
If you’re running NFS or NIS, then you should have these daemons running.
Learn more:
http://nfs.sourceforge.net/

readahead_early and readahead_later

The readahead daemon causes the programs used during startup to be loaded into memory before they are needed, to improve startup performance.

saslauthd

This is the SASL authentication server daemon. SASL is the Simple Authentication and Security Layer and allows for adding authentication to connection-based protocols.
Learn more:
http://asg.web.cmu.edu/sasl

sendmail

This is a SMTP (Simple Mail Transfer Protocol) server. sendmail moves mail from one system to another as a Mail Transport Agent. If you run a mail program such as Thunderbird or Evolution, you don’t need to run sendmail.
Learn more:
http://www.sendmail.org

setroubleshoot

This is the SELinux Troubleshooting Daemon. setroubleshooter is one of the great recent additions to SELinux. setroubleshooter provides real-time feedback to users on SELInux AVC denials. And it provides this feedback in a easy to follow format.
Learn more:
https://hosted.fedoraproject.org/projects/setroubleshoot

smartd

This daemon monitors the SMART (Self-Monitoring, Analysis and Reporting Technology) systems included in many types of disk drives, such as SCSI-3 type drives. The daemon will monitor reliability and performs self-tests. You should run this daemon if your hardware supports it.
Learn more:
http://sourceforge.net/projects/smartmontools

spamassassin

This daemon uses the Apache SpamAssassin program to check email for SPAM. It is usually run on a mail deleivery agent (MDA) server. If you use a client program such as Thunderbird or Evolution to access your mail, then you don’t need to run spamassassin.
Learn more:
http://spamassassin.apache.org

sshd

This is the daemon for open ssh. ssh replaces the insecure rsh and rlogin programs and enables encryption for communications between hosts over insecure networks. If you connect with other systems over the public Internet, you want to use ssh and run this daemon.
Learn more:
http://www.ssh.com
http://www.openssh.com

syslog

syslog is the standard logging system for Linux systems. Don’t turn this one off.
Learn more:
http://www.syslog.org

winbind

This daemon is part of the Samba suite and enables Windows domain users to function as Unix users on Unix servers. You may want to run this daemon if you’re dealing with a mixed PC and Linux/Unix network.
Learn more:
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/winbind.html
http://www.samba.org

xfs

This damon is the xfs font server. This daemon loads fonts into memory to enable X applications to run faster than if they had to load the fonts from disk. This daemon is worth running to improve application performance.
Learn more:
http://linuxreviews.org/howtos/xfree/xfs

ypbind

This daemon binds NIS clients to an NIS domian. The “yp” refers to “yellow pages,” as the NIS directory of user accounts acts like the telephone book yellow pages. You only want to run this daemon if your system relies on NIS (Network Information Service) for user accounts and system names.
Learn more:
http://www.linux-nis.org

yum-updatesd

yum-updatesd checks for software updates and can send notifications of these updates via mail, dbus, or syslog messages, or can automatically install the updates. The dbus messages are picked up by the “puplet” (package updater), which notifies the user of the updates and lets the user install them.
Learn more:
http://linux.duke.edu/projects/yum
http://www.redhat.com/magazine/024oct06/features/fc62

References

“Which Services Can I Disable?,” Dinkar, Tejas
Linux Services, Devices, and Daemons
Fedora Core 3 Linux Services
Services in Fedora, Mauriat Miranda