dv1 configuration notes
- eth1 has IP address 192.168.0.253
- Disks are in s/w raid, partition 1 (boot) and 2 (root) straight on md0 and 1, the rest is an LVM PV, on md2
- dv1 installation
www1
Has swap as partition on lv1.
dv2 configuration notes
- eth1 has IP address 192.168.0.243
- Disks are on h/w raid, partition 1 is the compaq special BIOS partition, partition 2 is boot, partition 3 is a big LVM PV, with the first lv0 the root partition.
- dv2 installation
Todo
- alpha, bravo: logwatch
- werk traffic bij
- werk homepage bij
- maak demo van panel via flash
- Ruby
- charlie: problem in panel_new_vps.php
- bravo: Fix problem where eth0 doesn't come up after booting
- bravo: can't mail from there. install postifx and aliases
- Make sure all network interfaces can be read out and plotted
- Test transfer of large 1G files
- Make copy-on-write thing
New VPS
- Check user data, does it look good?
- Go to table users. Look up username and machinename and combine, for instance joop_dnsbox -- write it down
- Go to table VPS. Make up a short machinename and fill it in, write down vps_id. Write down the distro.
- Go to table vps_if and note the number of new interfaces, write down MAC adresses
- Go to table ip_addr. Write down the assigned IP addresses, or if there weren't any, create new and assign them.
- Go to alpha. See if there's enough space free, vgdisplay
- Create new lv according to type of VPS, sudo lvcreate -L 5G -n username_vpsname vg0
- Copy base install to new lv; sudo cp /dev/vg0/staff_centos5 /dev/vg0/lvX
- Enlarge partition with fdisk /dev/vg0/username_vpsname, delete the partition and create a new one which covers the full space
- Enlarge filesystem. First add partition to mapper: kpartx -a /dev/vg0/username_vpsname. Check what name the mapper generated: ls /dev/mapper.
- Then run fsck: e2fsck -f /dev/mapper/vg0-username_vpsname1. Then resize: resize2fs /dev/mapper/vg0-username_vpsname1
- Make file in /etc/xen/auto naming it after username/machinename, using generated MAC addresses, memory appropriate for VPS type and a UUID using uuidgen
- Start the image, use serial console: xm create -c /etc/xen/auto/username_machinename
- Set noatime,nodiratime in /etc/fstab
- Configure all interfaces with IP addresses, for CentOS in /etc/sysconfig/network-scripts/ifcfg-ethX and for Debian in /etc/network/interfaces
- Debian: if you have multiple interfaces it's best to install package "ifrename", create an /etc/iftab with entries "eth0 mac xx:xx:..." and edit /etc/init.d/ifrename start function to add the -t flag.
- Debian: the MAC address is stored in /etc/udev/rules.d/70-persistent-net.rules, change it
- Set hostname in /etc/sysconfig/network (CentOS) or /etc/hostname (Debian)
- Set nameserver in /etc/resolv.conf
- Check out how swapspace is set up
- Exit domU and reboot it
- Check if external interfaces come up
- Check if swapspace comes up
- ssh to domU
- check hostname and interfaces
- Test networking; do a wget
- Generate SSH server keys:
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa
- clear logs
- Reset root password
- Set user active
- Set DNS entry, as well as reverse entry
- Test shutdown/startup through panel
- Restart snmpd so the new network interface is exported: sudo service snmpd restart
- Send mail to client about the new VPS
Update MRTG
- Login to charlie
- Create a new config file, then add the comments for totalling:
/usr/bin/cfgmaker --ifref=descr --ifdesc=eth \
--global 'HtmlDir: /var/www/mrtg' \
--global 'ImageDir: /var/www/mrtg' --global 'LogDir: /var/lib/mrtg' \
--global 'ThreshDir: /var/lib/mrtg' public@alpha > tmp.cfg
grep "Target\[alpha_x\." tmp.cfg | sed -e 's/^.*\[//' \
-e 's/\].*$//' -e 's/\(.*\)/#-#Total\[\1\]: Totals/' >> tmp.cfg
- Then copy the newly generated file to /etc/mrtg under the name mrtg4.cfg
- Test mrtg by executing the command specified in /etc/cron.d/mrtg manually. No errors should show up.
- Remove the file /var/lib/mrtg/mrtg.ok when the problem "Can not determine ifNumber" is reported by mrtg.
New test VPS
- First carve out a snapshot volume
To do long term
VMs with:
- CIFS
- WebDav
- Asterisk
- Exchange clone
- Exchange itself
- Oracle, DB2
- Tomcat, Jira
- JBoss
- Encrypted disk
- Shoutcast
- Subversion
- Trixbox
Set up a wiki which describes installation of the above
Put it on a separate .info domain - Qt applet or Firefox extension for status VM and messages from the admin or syslog
Links
http://lonesysadmin.net/2007/06/21/how-to-configure-ipmi-on-a-dell-poweredge-running-red-hat-enterprise-linux/
Backing up an LVM
Plain backups:
sudo cat /dev/vg0/my_lv0_name | gzip -c > my_lv0_name.img.gz
Or compression with partimage. Shut down the domU, then:
sudo kpartx -a /dev/vg0/my_lv0_name
sudo e2fsck /dev/vg0/my_lv0_name1
... Check all partitions ...
sudo partimage -b -z1 -d save /dev/mapper/my_lv0_name1 \
/mnt/backups/my_lv0_name1.partimg.gz