Koozali.org: home of the SME Server

70 servers to setup in a month! Ideas?

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
70 servers to setup in a month! Ideas?
« on: June 26, 2008, 04:29:01 PM »
I'm part of a project that will deploy one sme7 for each of the 70 non-profit organizations member of a coalition in Québec.
There will be a standard setup at first, and it will be adapted and customized later.

Is there anyone with an experience in such a project to share ideas and things "good-to-know-before-you-go" !?

Also, any tips would be appreciated for these actions from the command line or a script:
- change LAN IP and gateway addresses
- activate VPN
- setup pppoe connection

Thanks for any helps !
Sophie from Montréal

Offline dmay

  • *
  • 450
  • +0/-0
    • http://myezserver.com
Re: 70 servers to setup in a month! Ideas?
« Reply #1 on: June 26, 2008, 05:01:35 PM »
What exactly are you deploying? Is it a complete new hardware/server w. SME 7.x preinstalled? Will all the 70 sites receive the same identical hardware/server?

 If yes build unit 1, image hdds for units 2-70.

Can you gather config info so it is plug and play delivery for end user?

 If yes preconfig and ship.

Darrell

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: 70 servers to setup in a month! Ideas?
« Reply #2 on: June 26, 2008, 05:22:02 PM »
Thanks for replying!

Yes, all systems will be the same (probably Dell server, 2x500GB, 4GB, 2 NICs)
with 3 standard users and 3 standard ibays;

root password will (should ?) be different;

Each will have a ddclient to a subdomain name within a domain.

The SME will be a gateway behind a router but this will be customized on delivery.

LAN subnet is unknown at the time of setup.

partimage or ghost would work?
« Last Edit: June 26, 2008, 05:38:54 PM by soprom »
Sophie from Montréal

Offline Boris

  • *
  • 783
  • +0/-0
Re: 70 servers to setup in a month! Ideas?
« Reply #3 on: June 26, 2008, 07:38:24 PM »
I am not sure that drive clonning will be faster than just a install.
GHOST or other disk imaging tools copy entire drive even the empty space and may take up to an hour for 500GB disk.  Plus RAID (if used) will create additional difficulties. New install on the modern servers takes only 5-6 min :-P.

I would probably install one, updated it, configure the basic and assign the temp password and then did the backup to USB via console. For the rest of the servers just install and restore from USB configuration. The whole procedure may take much less time that clonning and you can do few servers at the time as well. With somebody's help to open the boxes and packing them back the entire job of preinstalling may be accomplished in one day.
...

Offline dmay

  • *
  • 450
  • +0/-0
    • http://myezserver.com
Re: 70 servers to setup in a month! Ideas?
« Reply #4 on: June 27, 2008, 07:11:07 PM »
You might want to take a look at these projects:

http://lrs.linbox.org
http://www.mondorescue.org

Darrell

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: 70 servers to setup in a month! Ideas?
« Reply #5 on: August 06, 2008, 11:33:31 PM »
The project is planned for the end of the month and I tested a scenario with a USB backup and a script.
I save some RPMS in the backup to install addons with the script.

I'm changing root password with this (copied from an other script):
Code: [Select]
echo $new_password | passwd root --stdin
Any comments for me?
« Last Edit: August 07, 2008, 12:46:05 AM by soprom »
Sophie from Montréal

Offline Reinhold

  • *
  • 517
  • +0/-0
    • http://127.0.0.1
Re: 70 servers to setup in a month! Ideas?
« Reply #6 on: August 08, 2008, 12:00:40 PM »
...if you have to modify a lot after installation..

- use affa - http://wiki.contribs.org/Moving_SME_to_new_Hardware


...btw: do not forget to change admin pwd (in addition to root)  :-o

Regards
Reinhold


« Last Edit: August 08, 2008, 12:12:13 PM by Reinhold »
............

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: 70 servers to setup in a month! Ideas?
« Reply #7 on: August 08, 2008, 04:40:35 PM »
Thanks for reminding me about admin password (i'd forgot that).

I tested different methods (based on comments in this thread) and USB Restore if the most straight forward in my view. It is easy to regenerate in case of changes to the master setup.

The script that I will run after the first install will setup Affa among other rpms (and also change admin password!). It would come later in the process.

The method with "dd" requires many steps, cloning requires a stable physical setup.
USB restore is mobile, straight forward, adaptable. I'll test installing from the USB too (if it is possible to burn the iso to a USB key).

How do I change LAN settings from a script?

Thanks to all who posted here. Your comments are much appreciated!
Sophie from Montréal

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: 70 servers to setup in a month! Ideas?
« Reply #8 on: August 08, 2008, 05:04:16 PM »
Since I will pass a serie of parameters to the setup script, what signal-event is needed after changes to the network like these?

machine_ip="2"
internal_net="192.168"
external_net="172.16.30"

config setprop InternalInterface IPAddress    $internal_net.$machine_ip
config setprop InternalInterface Broadcast    $internal_net.255
config setprop InternalInterface Network    $internal_net.0
config setprop InternalInterface Netmask    255.255.255.0

config setprop ExternalInterface Broadcast    $external_net.255
config setprop ExternalInterface Gateway    $external_net.1
config setprop ExternalInterface IPAddress    $external_net.$machine_ip
config setprop ExternalInterface Network    $external_net.0
config setprop ExternalInterface Netmask    255.255.255.0
Sophie from Montréal

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: 70 servers to setup in a month! Ideas?
« Reply #9 on: August 08, 2008, 07:07:17 PM »
Here is the script I'm working on... [edited]
Code: [Select]
#!/bin/sh

# call example:

#sh /home/e-smith/files/users/admin/home/setup.sh \
# 'pana00'\ machine name
# 'pananet!1234' \ root and admin password
# 'panagroup' \ lan workgroup
# '2' \ local ip address: last part like in 192.168.101.$variable
# '101' \ network subnet for lan and wan like in 172.16.$variable.x
# '1' gateway for wan li
#

# Parametres:

LOCALHOST_NAME=$1
ROOT_PASSWD=$2
WRKGROUP=$3

# Contantes:

ZONEDIT_USER="pananet"
ZONEDIT_PASS='pananet!1234'
ZONEDIT_DOMAIN="pana.net"
MYEMAIL="info@my.com"
WORKDIR=/root

# echo stuff...

echo "Host name: "$LOCALHOST_NAME
echo "Password: "$ROOT_PASSWD

# Workgroup

/sbin/e-smith/db configuration setprop smb ServerName $LOCALHOST_NAME
/sbin/e-smith/db configuration setprop smb Workgroup $WRKGROUP
/sbin/e-smith/signal-event ibay-modify
/sbin/e-smith/signal-event workgroup-update

# Se place dans le répertoire des modules contenant les RPMS
cd /home/e-smith/files/users/admin/home

# Lancer l'installation locale
echo "yum install..."
/sbin/e-smith/yum -y localinstall *.rpm

# Changer le mot de pass root:
echo "root password"
echo $ROOT_PASSWD | /usr/bin/passwd root --stdin
echo $ROOT_PASSWD | /usr/bin/passwd admin --stdin

# Placer les fichiers de configuration

# ddclient
echo "ddclient"
/etc/init.d/ddclient stop

# patch zonedit
cp 20Declaration /etc/e-smith/templates-custom/etc/ddclient
cp 30FreeHosts /etc/e-smith/templates-custom/etc/ddclient
/sbin/e-smith/db extras set $LOCALHOST_NAME.$ZONEDIT_DOMAIN domain
/sbin/e-smith/db extras setprop $LOCALHOST_NAME.$ZONEDIT_DOMAIN dns ZONEDIT
/sbin/e-smith/db extras setprop $LOCALHOST_NAME.$ZONEDIT_DOMAIN login $ZONEDIT_USER
/sbin/e-smith/db extras setprop $LOCALHOST_NAME.$ZONEDIT_DOMAIN password $ZONEDIT_PASS
/sbin/e-smith/expand-template /etc/ddclient.conf
/etc/init.d/ddclient start

# Désactiver ATALK (conflit pptp/vnc)
echo "atalk"
/sbin/e-smith/db configuration setprop atalk status disabled
/sbin/e-smith/signal-event workgroup-update

# ssh key

passok=1
while [ "$passok" != "0" ] ; do
 ssh-keygen -t rsa -f ${WORKDIR}/key.ppk 2>${WORKDIR}/err
 passok=$(grep -c "passphrase too short" < ${WORKDIR}/err)
 if [ "$passok" = "1" ]; then
  echo "passphrase too short: have 4 bytes, need > 4"
  echo
 fi
done
cat ${WORKDIR}/key.ppk.pub > /root/.ssh/authorized_keys
cat ${WORKDIR}/key.ppk >> /root/.ssh/authorized_keys
/sbin/e-smith/config setprop sshd PasswordAuthentication no
/sbin/e-smith/signal-event remoteaccess-update

echo > ${WORKDIR}/ssh.txt
echo >> ${WORKDIR}/ssh.txt
echo >> ${WORKDIR}/ssh.txt
echo "Sommaire:" >> ${WORKDIR}/ssh.txt
echo "----------------------------------" >> ${WORKDIR}/ssh.txt
echo "LOCALHOST_NAME: $LOCALHOST_NAME" >> ${WORKDIR}/ssh.txt
echo "ROOT_PASSWD: $ROOT_PASSWD" >> ${WORKDIR}/ssh.txt
echo "WRKGROUP: $WRKGROUP" >> ${WORKDIR}/ssh.txt

mutt -s "Installation du serveur" $MYEMAIL < ${WORKDIR}/ssh.txt -a ${WORKDIR}/key.ppk

rm -f ${WORKDIR}/err
rm -f ${WORKDIR}/key.ppk.pub
rm -f ${WORKDIR}/key.ppk
rm -f ${WORKDIR}/ssh.txt

# done

echo "done!"
/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot
« Last Edit: August 09, 2008, 05:45:00 AM by soprom »
Sophie from Montréal

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: 70 servers to setup in a month! Ideas?
« Reply #10 on: August 08, 2008, 07:38:45 PM »
Here is the script I'm working on...
Code: [Select]
#!/bin/sh
# patch zonedit
cp 20Declaration /etc/e-smith/templates-custom/etc/ddclient
cp 30FreeHosts /etc/e-smith/templates-custom/etc/ddclient

hi..

just a question:
does the directory /etc/e-smith/templates-custom/etc/ddclient exist before you try to copy these files?

ciao
Stefano
« Last Edit: August 08, 2008, 07:56:17 PM by nenonano »

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: 70 servers to setup in a month! Ideas?
« Reply #11 on: August 08, 2008, 08:36:43 PM »
Yes, ddclient is installed from rpms:
Code: [Select]
awstats-6.7-1.el4.rf.noarch.rpm
fping-2.4-1.b2.2.el4.rf.i386.rpm
libart_lgpl-2.3.16-3.i386.rpm
neon-0.24.7-4.i386.rpm
perl-Filesys-DiskFree-0.06-1.2.el4.rf.noarch.rpm
phpmyadmin-2.11.7.1-1.el4.rf.noarch.rpm
rrdtool-1.2.27-3.el4.i386.rpm
rrdtool-perl-1.2.27-3.el4.i386.rpm
sme7-ddclient-3.7.3-4.noarch.rpm
smeserver-affa-1.0.0-3.el4.sme.noarch.rpm
smeserver-awstats-1.2-5.el4.sme.noarch.rpm
smeserver-diskusage-0.0.1-5.el4.sme.noarch.rpm
smeserver-phpsysinfo-2.5.4-1.el4.sme.noarch.rpm
smeserver-sysmon-6.1-2.el4.sme.noarch.rpm
subversion-1.4.6-0.1.el4.rf.i386.rpm
sysstat-5.0.5-16.rhel4.i386.rpm
Sophie from Montréal

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: 70 servers to setup in a month! Ideas?
« Reply #12 on: August 09, 2008, 05:01:23 AM »
Yes, ddclient is installed from rpms: ...

I didn't see anyone ask that question.

I did see Stephano ask:

Quote
does the directory /etc/e-smith/templates-custom/etc/ddclient exist before you try to copy these files?

That's a reasonable question - your proposed script will fail if it did not. You should do this before the cp:

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/ddclient
ciao
Stefano

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: 70 servers to setup in a month! Ideas?
« Reply #13 on: August 09, 2008, 05:05:41 AM »
Since I will pass a serie of parameters to the setup script, what signal-event is needed after changes to the network like these?

You will need to do "signal-event post-upgrade ; signal-event reboot" after changing hostname or any networking parameters.

Quote
config setprop InternalInterface IPAddress    $internal_net.$machine_ip
config setprop InternalInterface Broadcast    $internal_net.255
config setprop InternalInterface Network    $internal_net.0
config setprop InternalInterface Netmask    255.255.255.0

You shouldn't change those parameters. Change LocalIP (and LocalNetmask) and the InternalInterface properties will be derived from them during the reconfiguration.

You'll also need to change various other parameters from which ExternalInterface properties are derived during reconfiguration - see /etc/e-smith/db/configuration/migrate/10interfaces for details.

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: 70 servers to setup in a month! Ideas?
« Reply #14 on: August 09, 2008, 05:40:45 AM »
Thanks for your notes Charlie.

Since the drivers and the exact WAN type will not be known in advance, it will be simpler to use the console to make those settings.
« Last Edit: August 09, 2008, 05:45:31 AM by soprom »
Sophie from Montréal