How to move eth devices on Oracle Linux 6.x

When you install more than 1 Linux server at a site, it often happens that the patched interfaces get a different interface name. I’ll try to explain in this blogentry how to get them renamed correctly.

What we want

eth0      LAN 1Gb
eth1      LAN 1Gb
eth2      STORAGE 10Gb
eth3      STORAGE 10Gb

What we have

We installed 3 brand new servers and when we detect the interfaces :

# ifup eth0-9
# ethtool eth0-9

It results in the following mixed up configuration

– Server A

eth0      LAN 1Gb
eth1      LAN 1Gb
eth2      STORAGE 10Gb
eth3      STORAGE 10Gb

– Server B

eth2      LAN 1Gb
eth3      LAN 1Gb
eth8      STORAGE 10Gb
eth9      STORAGE 10Gb

– Server C

eth2      LAN 1Gb
eth3      LAN 1Gb
eth4      STORAGE 10Gb
eth5      STORAGE 10Gb

How To Correct it?

1) Adjust the /etc/udev/rules.d/70-persistent-net.rules file by interchanging the interfacenames. ( f.e. change eth2 to eth0 and viceversa )
2) Adjust the mac adress in the ifcfg-ethx config files in /etc/sysconfig/network-scripts.
3) reboot

Hope this helps somebody.


Tips and Tricks for OVM – 1. Choose PVM ( for now )

Typical mistake many people make when they first start out with OVM is creating VM’s as HVM. The reason is simple. We are all used to putting in a cd/dvd and start installing an OS. But in OVM that means that the VM is automatically HVM. You can’t create PVM VM’s directly from an iso because the OS needs to be modified so that it knows it’s running in an ovm environment.

So you are stuck with a HVM virtual machine and if you are unaware of the mistake, you’ll clone this into a template and create all your VM’s from this template resulting in a bunch of HVM vm’s.

So if you are setting up OVM servers and are planning on creating vm’s be aware of the differences. From the manual :

  • Hardware virtualized (HVM). An unmodified guest operating system executes in complete isolation. Instructions are trapped and emulated at the hardware level (Intel VT-x/VT-i and AMD-V), allowing excellent performance thanks to limited overhead for guest modifications.

  • Paravirtualized (PVM). A software interface similar but not identical to the underlying hardware is presented to the guest operating system. Paravirtualization provides hooks for guest instructions so that complicated tasks can be performed by the host instead of the virtual machine, where performance is worse. Paravirtualization requires that the guest kernel is ported to be made aware of the virtual environment.

  • Hardware virtualized with paravirtualized drivers (PVHVM). Similar to HVM but with additional paravirtualized drivers to off load more processes to the host and increase VM performance. This domain type is typically used to run Microsoft Windows guests with a limited performance penalty.

How then can you create a PVM vm?

  • from ISO : export the iso using nfs, ftp or http and provide it as boot option for your vm.

  • from template/assembly : just clone the template into a new VM and select PVM

If you are now checking your OVM setup and detect a lot of HVM vm’s, check to convert them to PVM.

Be aware that HVM will be faster then PVM once the CPU’s include net/io virtualisation. But we are years away from that, for now PVM is the faster solution.