Roy Lindauer

Ohai Plugin for OpenVZ VMs to get public IP Address

Media Temple uses the OpenVZ virtualization system and I have quite a few Media Temple servers under Chef management. The one thing that has made management difficult is that by default during a Chef run ohai returns 127.0.0.1 as the default IP address which means I cannot run knife to execute commands from my workstation.

For example, when I run  knife node show mydv.server.com  I get the following:

Kinda sucks. If try to execute on all of my MT servers, say something like  knife ssh 'tags:mt' 'sudo chef-client'  I will get a ton of failed connection errors because it is trying to connect to 127.0.0.1.

The solution is to get ohai to return the correct IP. OpenVZ has virtual interfaces and the actual public IP is assigned to them, while the main interface, eth0, is given the ip 127.0.0.1. This ohai plugin will retrieve the correct IP.

Put this in your ohai plugins directory for chef: /etc/chef/plugins/openvz.rb and when chef runs, it will get the correct IP address.

Now when I run knife show mydb.server.com

 

Corgi Meetup at Fuji Park

IMG_2148

IMG_2038

IMG_2109

IMG_2069

IMG_2130

IMG_2176

IMG_2112

See more photos at https://www.flickr.com/photos/ecsyle32/sets/72157651648832885/

There’s a fun little world in my backyard

IMG_1779

IMG_1926

IMG_1928

IMG_1966

IMG_1972

IMG_1986

Pink Flowers

IMG_1975

IMG_1976

IMG_1979

IMG_1982

SHIFT Artwork

shift-dec-2014

shift-jan-2015

shift-feb-2015

shift-mar-2015