RHEL Linux VMware migration eth0 eth1 problems…

I’ve recently had an incident where a Red Hat Enterprise Linux server that had been migrated between two VMware clusters (in this case dev to live) had no network connectivity after the migration.  The server had lost eth0 and had gained an unconfigured eth1 instead.  After a little bit of research I found that this was because the UUID and the MAC address had changed on the virtual hardware making the ifcfg-eth0 configuration file invalid

The fix was fairly simple – remove the UUID from ifcfg-eth0, delete the udev rules for the the network card, correct the MAC address and restart the network service.

I wrote this simple script for others to use:

#!/bin/bash

# Backup all files first
mkdir nic_change_backup
cp /etc/sysconfig/network-scripts/ifcfg-eth0 nic_change_backup
cp /etc/udev/rules.d/70-persistent-net.rules nic_change_backup
tar jcpvf nic_change_backup.tar.bz2 nic_change_backup
rm -rf nic_change_backup

# Remove the udev rule
# They are re-created on boot up
rm -f /etc/udev/rules.d/70-persistent-net.rules

# Fix the eth0 file
# This involves removing the UUID and
# updating the HWADDR with the MAC
# address of the new card.
grep -v UUID /etc/sysconfig/network-scripts/ifcfg-eth0 | sed '/HWADDR/c\'$(echo "HWADDR:$(echo "$(ip addr | grep ether | cut -d\  -f 6)" | tr '[:lower:]' '[:upper:]')") > /etc/sysconfig/network-scripts/ifcfg-eth0

# Restart networking, or in this case the server
shutdown -r now
Facebooktwittergoogle_plusredditmail

Slice of Pi I/O!

I decided to try and spend some time working with my Raspberry Pi this week.  The first thing I wanted to do was to add an MCP23017 to the device to expand the I/O.  I did this by buying the Slice of Pi I/O kit from Ciseco. This adds the MCP23017 and some pluggable headers via a PCB that slots onto to the GPIO headers on the Raspberry Pi.  It comes in a kit form and needs some basic soldering skills to put it together.

The Slice of Pi I/O took about 20 minutes to put together and was fairly easy.  I would recommend it as a beginner project if your new to soldering and electronics.

Unfortunately my Raspberry Pi is still running Debian, rather than Raspbian.  This means I don’t have I2C support yet, so my next step is to re-install with Raspbian and test the device out.

Facebooktwittergoogle_plusredditmail