Fedora/CentOS/RHEL: setting bond

Below an example of setting bond (active-backup mode)

1) Disable NetworkManager (if you have)
# chkconfig NetworkManager off
/etc/init.d/NetworkManager stop

2) Load module
# vi /etc/modprobe.d/bonding.conf
alias bond0 bonding

3) Setup eth0
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
MASTER=bond0
SLAVE=yes
USERCTL=no
ONBOOT=yes
BOOTPROTO=none

4) Setup eth1
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes

5) Setup bond0
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.54
NETWORK=192.168.1.0
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS=8.8.8.8
USERCTL=no
BONDING_OPTS="miimon=1000 mode=active-backup"
TYPE=Ethernet

6) Restart your network service or reboot your machine

7) Checking bonding setup
# cat   /proc/net/bonding/bond0

More about bonding:
/usr/src//Documentation/networking/bonding.txt

mount.nfs: Unknown error 521

#mount -t nfs 10.10.1.109:/data /data
mount.nfs: Unknown error 521

To solve I have included into my NFS server the insecure mode.

# vi /etc/exportfs
/data *(rw,sync,insecure)

# exportfs -a (reload /etc/exportfs)

The insecure option allows clients with NFS implementations that don’t use a reserved port for NFS.

The same post is valid to error msg:
mount.nfs: access denied by server while mounting 10.10.1.109:/data

virt-manager: cloning sparse images

The virt-manager version 0.8.6 cannot clone sparse images using the virt-manager clone option.
Instead of create a new sparse image, it creates a new image with the full size of image.

To avoid this, you can clone by hand using cp and adding the new image manually, here an example:

Cloning the image
# cd /var/libvirt/images
# cp --sparse=auto my-virtual-machine-template.img my-new-vm.img

# cd /etc/libvirt/qemu/
# cp my-virtual-machine-template.xml new-virtual-machine.xml
# vi new-virtual-machine.xml

Change the fields:
my-virtual-machine-template
dc16b3e4-baee-2bf7-6b02-b6217e81b03d

Example:
new-virtual-machine
dc16b3e4-baee-2bf7-6b02-b6217e81b00d (choose random change)

# virsh define /etc/libvirt/qemu/new-virtual-machine.xml

Now open your virt-manager and enjoy!

virt-manager: importing kvm image

1) Copy the xml definition of your virtual machine from original host to your new host into /etc/libvirt/qemu/
# scp /etc/libvirt/qemu/my-virtual-machine.xml myuser@newhost:/etc/libvirt/qemu/my-virtual-machine.xml
(you can use virsh dumpxml)

2) Copy the original image too /var/lib/libvirt/images
# cd /var/lib/libvirt/images
# scp my-image.iso myuser@newhost:/var/lib/libvirt/images/my-image.iso
Copying sparse file? use rsync instead of scp, otherwise scp will copy the full size of file
http://dougsland.livejournal.com/118882.html

3) Use virsh to enable your the virtual machine
# virsh define /etc/libvirt/qemu/my-virtual-machine.xml

4) Start your virtual machine from virt-manager