Monday, March 26, 2018

Setting up bonding on redhat physical servers

Setup bond1 using eth1 and eth2 in master slave ( 10g eth)

cat /proc/net/bonding/bond1

Ethernet Channel Bonding Driver: xx

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth1 (primary_reselect always)
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: mac add
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: mac add
Slave queue ID: 0


[root@test-host network-scripts]# more ifcfg-bond1
DEVICE="bond1"
BOOTPROTO="none"
BROADCAST="xx.xx.xx.xx"
IPADDR="xx.xx.xx.xx"
NETMASK="xx.xx.xx.xx"
NETWORK=xx.xx.xx.xx
GATEWAY=xx.xx.xx.xx
ONBOOT="yes"
IPV6INIT=no
USERCTL=no
BONDING_OPTS="mode=1 miimon=100 primary=eth1"

[root@test-host network-scripts]# more ifcfg-eth1

DEVICE="eth1"
HWADDR=mac add
MASTER=bond1
BOOTPROTO="none"
SLAVE=yes
ONBOOT=yes
USERCTL=no

[root@test-host network-scripts]# more ifcfg-eth2

DEVICE="eth2"
HWADDR="mac add"
MASTER=bond1
BOOTPROTO="none"
SLAVE=yes
ONBOOT=yes
USERCTL=no


When had issues with the wrong bond

ifconfig bond down
ifconfig eth? down
echo -bond1 /sys/class/net/bonding_masters
echo "-eth2" > /sys/class/net/bond1/bonding/slaves
echo "-eth1" > /sys/class/net/bond1/bonding/slaves

Automating Linux Installation using Kickstart

1. Install a webserver

yum -y install httpd
service httpd start
service httpd status
chkconfig –level 35 httpd on

2. Setting up Kickstart

mkdir -p  /var/www/html/pub/redhat/
touch /var/www/html/pub/redhat/ks-img.cfg

The Kickstart file holds what could be termed an "answers" file to questions that the installer needs to know in order to perform installation.
It is possible to manually create a kickstart file using a text editor but RHEL provides GUI Kickstart maker program.

3. Booting from the kickstart

Ensure that the VM is connected to the iso img

Press Tab

vmlinuz initrd=initrd.img asknetwork hostname=<system-hostname> ks=http://webserver-ip/pub/redhat/ks-img.cfg

you can change the windows using atl+f1

resizing lun/volume on vmware redhat linux

1. Assign additional space to host from vCenter
2. Logon to host and rescan disks
#Rescan disks on host
ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; done
for device in `ls /dev/sd?|awk -F\/ '{print $3}'`; do echo 1 > /sys/block/$device/device/rescan;done;
pvresize /dev/sd?
3. Expand space
[root@test]# lvresize /dev/VG_test/LV_test --size +10GB
[root@test]# resize2fs /dev/VG_test/LV_test