Tuesday, July 14, 2009

Converting DVDs to DIVX files under Linux

I recently purchased an Iomega ScreenPlay device that allows me to copy a DVD to USB drive and then play it to my TV. Using a 500GB USB then allows me to access most of my DVD library without having to hunt for disks.

However, I am not running in High Definition, I am not connecting via HDMI, and I dont think my TV can handle anything larger than a standard TV signal, so why do I need to copy the full DVD? I have seen online how lower quality videos play fine on my home TV, so how could I import my DVDs at a lower size and quality?

I found this link referring to using a Linux program called DVD::RIP to convert a DVD to divx format: http://www.my-guides.net/en/content/view/136/26/

Monday, July 13, 2009

Recovering NFS datastores

I recently setup a linux server running an NFS export that I mounted in my VMware cluster. This was going to essentially be for archive information - offline servers that were not needed to be active, but still had to be kept in case they were needed. Everything was working great and I needed to reboot the server one last time before letting it run on its own.
When I rebooted, the NFS datastores became unavailable - as expected since the server was offline. However, when the server came back online the NFS datastores still reported as unavailable. Even after waiting several hours, the datastores did not come back.

A little googling and I found several people restarting services, running esxcfg-nas -r (which is supposedly unsupported), and even rebooting their VMware hosts. The only option I could get to work was rebooting my physical host, but that only resolved connectivity on that one host. And that could become a nightmare if I had to reboot every single host everytime my NFS server had to make changes.

I thought about removing the datastores and then readding them - a simple matter of a powershell script. However that would leave any guest systems on those datastores unavailable and require me to re-import all of them. Then I realized that I could remove and re-add the datastores to an individual ESX host, without breaking any bindings or cluster wide configurations.

Resolution:
To resolve this, we need to remove and re-add the datastore on the individual ESX server. This needs to be done on each ESX server that is reporting the issue
  1. Connect via SSH to the ESX host
  2. List the NFS datastores by running esxcfg-nas -l
  3. Remove the offending datastore by running esxcfg-nas -d datastorename
  4. Re-add the datastore by running esxcfg-nas -a -o hostname -s sharename datastorename
  5. Wait a few minutes for the VC to be updated with the datastore status

Why this works:
It appears that the individual servers check datastore connectivity on a routine cycle, then reports status to the VC server. By removing and re-adding a datastore at the host level, the VC still sees it as the same datastore (it does have the same name and same target). As such, the next time the ESX host polls the datastores, it reports it as active and the VC doesnt know any different.
This is of-course all an educated guess, and I encourage anyone with more understanding on the mechanics to update the technical details.

Wednesday, July 01, 2009

Bonding interfaces in Linux

I recently setup a Linux box to act as an NFS gateway and wanted to bond multiple 1GB interfaces together. The bonding would allow for more throughput, as well as redundancy in case a link failed. I asked my network guy to create an LACP group on the Cisco switch, and then followed the bonding how-to's on the internet.

Problem: Some hosts couldnt connect. To make it even more odd, the hosts that couldn't connect can connect to the working hosts. Hmmmm.... Something is either wrong with the Linux firewall, routing tables, Cisco LACP configuration, or Linux LACP configuration.

I ruled out the firewall by turning it off (not suggested). I changed the IP of the server and confirmed that the routing was working. I checked the Cisco config against other LACP configs, and they were configured the same as this one. That only left the Linux LACP config - which was configured the way everyone said to configure it.

Finally, I gave up and started looking to see if Linux supported Etherchannel instead of LACP (I am using a Cisco switch) and came across this link - http://zmq503o1.spaces.live.com/blog/cns!2DE8BC7CE0181410!493.entry?wa=wsignin1.0&sa=302266494. The title of the link referrs to Etherchannel, but I noticed a new option "lacp_rate" being used in the modprobe.conf

I added this option to my config and reloaded the bonding module and everything worked! Supposedly this option specifies how fast the bond attempts to create teh LACP group. Setting it to 1 (fast), forced the link to initiate and begin passing traffic to all source/destinations.