Getting in contact with OpenStack

Till now, i was only able to deploy some vm’s on my MacMini Server with VMware Fusion on it. This worked oukay so far… Due to the mac mini is reaching its second birthday, it does not power vm’s very well. Also to keep the vm powered on, i need always stay logged in with the user and of course the management is only possible trough vnc directly on the server.

That was the reason for me to rent some virtual machines by rackspacecloud.com. Seriously, rackspacecloud is impressive! But keeping two or more vm’s up and running for more than a month is a really expensive playground! Moving to Amazon’s EC2 wasn’t an option too. So i decided to buy a extreme low-end cheap virutalisation capable server. After some research (Hardware should be compatible with ESXi in case of whatever) i’ve build the following server for me:

Case: Asus Vintage V8-P8H67E, Intel H67, Socket 1155, USB 3.0 (about 170$)

CPU: Intel Core i5 2500 BOX, 3.3GHz, LGA 1155, 4C/4T (about 200$)

RAM: Kingston ValueRAM, 3×4 GB, DDR3-1333, CL9 (about 60$)

Raid (optional): Adaptec RAID 2405, 4-Channel SAS/SATA, low profile (about 200$)

Additional Network: Intel PWLA8391GTBLK Pro 1000GT Gigabit Adapter PCI, Bulk (about 30$)

VLAN Gigabit Switch: HP ProCurve Switch V1810G-8 8 Port 10/100/1000 Mbps, SFP (about 110$)

Harddisk: got some at home

The Result is a Box with 100% Virtualisation Support (vPro, VT-x, VT-d, 64bit), 12GB RAM and small in form and silent too.

In the past i’ve landed several times on openstack.org during some research in automating virtualisation infrastructures. Openstack is a framework for building private clouds. Openstack promises an virtualisation ecosystem with all needed components to build a perfect world. The project looks very mature and there are a lot of partners supporting them. Openstack supports also a wide range of Hypervisors though they’r strongly recommending to use KVM for virtualistion. I will give the project a try…

 

Tagged: , , , , , ,

Enabling Redmine for Receiving Mails

Today i struggled around getting Redmine pulling Mails from a remote IMAP server and creating issues with its content. Finally i’v get it working… There are several rules you should keep in mind:

  • Be carful if you have defined any mandatory additional fields for your Issues
  • If you set unknown_user=create be sure the newly created user has access to the project automatically. If he has no access, the issue will not be created
  • If you just want to pipe Mails into a Redmine project use unknown_user=accept and o_permission_check=1 and issues are getting created with the anonymous User. Works well for a simple “one-way” posting

Finally i’ve created a small bash script to run the import process all 5 minutes:

SERVER=host.domain.tld
USER=jbauer
PASS=ILike24
 
rake -f /path/to/your/Redmine/installation/Rakefile redmine:email:receive_imap RAILS_ENV="production" \
host="$SERVER" \
username="$USER" \
password="$PASS" \
move_on_success=read \
project=sandbox \
allow_override=project,tracker,category,priority,status \
unknown_user=accept \
no_permission_check=1 \
status=New \
tracker=Bug \
priority=Low
exit $?

For mor detailed information visit the Redmine Wiki.

Tagged: , , , , ,

Booting into WDS (Windows Deployment Service) from Linux DHCPD

I’m currently working in developing a automated DHCP Boot Environment which serves automated Linux and Windows deployments. Some more articles about this topic will follow soon.

It took me some minutes to figure out how i need to configure my ISC-DHCPD Server to boot into the WDS Server. Thats why i want to feed this knowledge into the internet with this post ;)

Configure your host like this, where 192.168.1.2 is your WDS Server IP:

host wdsBootClient {
   	hardware ethernet 01:02:03:04:05:06;
	next-server 192.168.1.2;
        option tftp-server-name "192.168.1.2";  
        option bootfile-name "boot\\x86\\wdsnbp.com\000";  
}
Tagged: , , , , ,

Creating Config Templates in Linux

As an Linux/Unix Engineer i’m spending a huge percentage in developing automatism. Sometimes you need to periodically or automated create config files. I’m using the following script create them in a cool automated way.

  1. You need a perfect config file e.g. Apache vHost config file
  2. All occurences of required dynamic variables are replaced with %n% where “n” is numbered streight from 0 to x. If you need the same content more than once you should us the same number again.
  3. Start the templating script with each value as seperated parameter and pipe the output to the destination file

This is the Script:

#!/bin/bash
# Thomas Spycher - Zero-One - 05.11.2010
# This Script reads in the piped input and goes trough it line for line
# and replaces all occurrences of %n% where n represents an Argument
# passed to the script
 
# Read in piped input
while IFS= read -r data; do
        # Search an Replace line for line
        COUNTER=0
        for ARG in "$@"     
        do
                VARNAME="%$COUNTER%"
                data=${data//$VARNAME/$ARG}
                COUNTER=`expr $COUNTER + 1`
        done
        echo "$data"
done
exit 0

For example the creation of a simple Textfile:

Welcome to %0% which lies in %1%. 
We in %0% are speaking %2%.

and the execution of the script:

cat template.txt | ./templateScript.sh "Switzerland" "Europe" "German" > switzerland.txt
Tagged: ,

Script to templateing a Directory in Linux

I’ve used this script to first create all directorys from my source in the destination and link all files from the source to destination. I needed this script for a centralized hosted environment of a online platform.

This enables me to have all critical files in one location, but it allows to customize the destination. For example installing plugins.

The Script – scriptname.sh

#!/bin/bash
# Thomas Spycher - Zero-One 

# Create Directory Structure
for i in `find $1 -type d`;
do
     DIR=${i//$1/$2\/};
     mkdir -p $DIR
done

for i in `find $1 -type f`;
do
     DESTINATION=${i//$1/$2\/};
     SOURCE=$i;
     ln -sf $SOURCE $DESTINATION
done

Usage

# ./scriptname.sh /this/is/my/source /this/is/my/destination
Tagged: , , , ,