welcome: please sign in

Diff for "FritzVirtualization"

Differences between revisions 4 and 63 (spanning 59 versions)
Revision 4 as of 2012-03-25 02:30:52
Size: 6066
Editor: ClintonEbadi
Comment: concrete plans for debarchiver
Revision 63 as of 2012-12-20 20:53:49
Size: 10809
Editor: ClintonEbadi
Comment: prune scratch work areas
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
== Test Setup Notes ==

Nothing in particular order since it's all quite fuzzy

 * Account `clinton_admin` has been added to the `libvirt` group (permits ClintonEbadi to manage kvms as his user remotely using [[http://virt-manager.et.redhat.com/|virt-manager]]

 * Investigated bridging and firewalling: https://bugzilla.redhat.com/show_bug.cgi?id=512206
   * This also implies that using a separate bridge per VM is ideal
   * As advised in the bug, we have disabled netfilter on the bridge
 * Installed and configured: `less sudo vim emacs23-nox etckeeper changetrack openssh-server debsums logcheck bzip2 denyhosts rkhunter openafs-client ntp nscd krb5-user libpam-krb5 ssmtp libpam-afs-session openafs-krb5`
Line 19: Line 8:
(./) = done, {o} = not done, {X} = gave up or died trying (./) = done, {o} = not done, <!> = possibly done, awaiting verification, {X} = gave up or died trying
Line 21: Line 10:
 * (./) Set up network bridge
 * (./) Create test KVM to discover preseed values and other config bits
 * (./) Generate basic preseed file where login + `kinit && aklog` work
 * {o} Create local Debian archive for `libnss-afs`
   * {o} gnupg keyring etc. for verified package builds
   * {o} Archive key for secure apt installs
 * {o} Package `nsswitch.conf` changes and generate preseed for a machine that recognizes pts users (ssh $hcoop-user@machine should work at this point)
 * {o} Update `domtool` init scripts to work with `insserv` since non-dependency-based init is deprecated and will be removed in `wheezy`
 * {o} Update FirewallRules `closed.conf` for the modern age and package
   * {o} Add hostname field `fwtool` firewall config (so that users / services can have different ports on different machines)
   * {o} Codify universal afs / kerberos / etc. ports that always have to be open in firewall config (can probably mostly yank this info from fritz)
 * {o} Apply advanced wine making techniques to carefully blend the Apache configurations on `fritz` and `mire` and package the result
   * {o} Add new `phpVersion 53` to DomTool and (hopefully this can be done) make `phpVersion` support checking if the host supports that version (easy check: if the node is mire, support 4/5, if the node is fritz only support 5.3)
 * {o} Spin up the fancy new Apache KVM and pray that it works
 * <!> Apply advanced wine making techniques to carefully blend the Apache configurations on `fritz` and `mire`
   * {o} Per machine NameVirtualHost config
     * It turns out that '''both''' the `NameVirtualHost` and `VirtualHost` directive must use `*` or an explicit IP. For the sake of correctness, keeping the IP in `VirtualHost` directives seems like a Good Idea (tm), so we need to have domtool install `/etc/apache2/conf.d/hcoop-namevhost-$machine` for every web serving node.
   * {o} Per-machine apache default vhost
   * {o} Change defaultPhpVersion to 5
     * {o} Check all user `domtool` configs and explicitly set `phpVersion = 4` if needed
   * <!> Domtool `mod_proxy` support to machines other than `localhost`
   * (./) Check DomTool for all used modules and sure they are enabled
 * <!> Spin up the fancy new Apache KVM and pray that it works
   * (./) Reinstall using preseed + postinst
   * (./) Make openafs start earlier in boot process
     * Things like apache need to resolve pts users; it's easier to divert/transform the openafs script than to divert every script that needs access to afs uids.
     * {i} This was really hard. insserv in squeeze has weird problems.
Line 37: Line 25:
   * {X} Set up `squirrelmail` (harder than rcube: we have to point `mail.` at the KVM, and then use MX records... punt on this for the time being)    * {o} Install squirrelmail at `webmail.hcoop.net` temporarily (mod_proxy from deleuze later)
Line 39: Line 27:
     * {o} Deal with http://debian.hcoop.net (if we move it to navajos, we can't reinstall navajos... but we probably should move it to navajos)
   * {o} Move mire web services
     * {o} phpmyadmin
     * {o} ajaxterm
   * (./) Move `unknownlamer.org` onto navajos (what better a guinea pig)
Line 40: Line 33:
   * {o} Start assisting the first brave users with "moving" to new machine (i.e. `webAt "newNode", or adding an env var to `Easy_Domain` to change the default web node for everything)    * <!> Start assisting the first brave users with "moving" to new machine (i.e. `webAt "newNode"`, or adding an env var to `Easy_Domain` to change the default web node for everything)
     * (./) DavorOcelic
       * (./) Fix SSL problems
     * <!> SteveKillen
       * (./) Fix `moinmoin-install`
     * (./) BtTempleton
Line 42: Line 40:
 * (./) Databases
   * (./) Set up postgresql 9.1
     * {i} And we're even using kerberos instead of ident for auth!
   * (./) Install postgres/mysql client libraries
   * (./) Firewall rules for connecting to database server
Line 43: Line 47:
Line 44: Line 49:
   * {o} Remove php4 support from domtool
Line 45: Line 52:
   * {o} Move secondary DNS to hopper, update ns aliases

 * {o} Migrate web services from deleuze
   * {o} Migrate and upgrade hcoop wiki
     * Ideally into afs space, owned by the hcoop account.
     * Or not? One reason for it being on local fs space is to remain accessible in case kerberos/afs are gone. This is less of an issue now (and will be even less so once we have multiple volservers and ensure the hcoop volume is on all of them), so might not be worth it. Alternative: set up automatic moin mirroring to outpost using a trivial lighttpd setup.
   * {o} Migrate Portal
     * {o} Move all data storage into afs
     * {o} Hack needed 32-bit libraries
     * {o} Update SMLSQL for libpq5

Other tasks, lower priority:

 * {o} Configuration package nits
   * {o} ssh: restart sshd after installation
     * Actually easy: just setup a trivial postinst/prerm ala `hcoop-apache2-config`
   * {o} firewall: restart ferm after installation

=== Bog Initial Setup Notes ===

The preseed in theory is enough to have a user node; the admin config package restricts logins. A few open questions:

 * Do user nodes need to run domtool-slave?
   * Yes -- for fwtool at the very least
 * Add `/afs/hcoop.net/common/bin` to default path using `/etc/profile.d/`
   * Should we use `@sys`? We have no binaries installed right now, can probably skip.

Check preseed for installation of admin node specific packages and move to navajos postinst. We need some preseed templating system eventually, but for now...

Automatic re-installability is officially a low priority for this release cycle... so don't worry about post-installing or preseeding the various packages a fully featured user node needs (db clients, perl, etc.).
Line 47: Line 84:

{{{#!wiki note
This, and other information, should be merged into a general description of our infrastructure and how it differs from a stock Debian installation.
}}}
Line 58: Line 99:
 * Need a Debian mirror for libnss-afs (debarchiver?) {{{#!wiki note
This, and other things, should be merged into a "Undecided Infrastructure Issues" document, so that folks don't make the mistake that "the path of least resistance" is how we wanted to do things.
}}}

Line 60: Line 105:
 * Automated partitioning (looks like I might have to manually craft the partman template instead of dumping it from d-i)  * Figuring out what to do wrt local users for system services that need to access afs
   * e.g. Apache, Exim, debarchiver, domtool, impad, spamd, ...
   * AFAICT, it makes more sense to just have afs users -- if the ptdb is gone, the services will not operate in a correct way anyway
   * Removes issues with keeping UIDs in sync
   * How does this interact with Debian automatically creating system users for packages?
   * A few system users were created using `create-user` -- mail is routed to them and they are subscribed to mailing lists and whatnot which is ... probably bad. i.e. We probably want to split `create-user` into the portions to just create an afs/kerberos user and then to do the fancy stuff an actual factual human user needs.
 * Integration with package requests
   * Preseeding means we can kill/respin web node images with ease -- but not restore packages users have requested to support their cgi programs
   * If the portal stores this info, we need a package to reinstall user packages
 * Is the keytab situation messy? Having the domtool keytab at the toplevel seems out of place
   * Reading old -sysadmin posts revealed that only having $user.daemon keys was supposed to be temporary -- we really should have a few standard principles for hcoop services to access data (e.g. $user.mail for mail delivery), and have a portal interface (and domtool integration) allowing users to request additional principles if they want (e.g. $user.$webapp-they-run ... or just $user.cgi in the default Just Works (tm) configuration)
Line 62: Line 117:
== Debian Mirror == ==== fwtool ====
Line 64: Line 119:
 * Using debarchiver on hopper (we want to run as little as possible on fritz)
 * `/afs/hcoop.net/common/debian/...`
   * `.../old/` = current contents (obsolete package sources / builds)
   * `.../src/` = git source packages (this must be symlinked into `~hcoop/.hcoop-git/
   * `.../archive/` = debarchiver
 * Export `/afs/hcoop.net/debian/archive/` @ http://hcoop.net/debian/ (open to suggestions on this)
 * Using `debuild` on ClintonEbadi's personal workstation for now (only going to package the `amd64` version of `libnss-afs` (for now) and arch independent config file debs)
   * Ideally, we'd use `pbuilder` on an amd64 KVM; in the real world we'll probably end up with `pbuilder` on fritz (using `debuild` directly on fritz has the unfortunate consequence of installing lots of unecessary build deps)
Making FirewallRules support all of the needed functionality for a user machine is proving difficult
Line 73: Line 121:
== Debian Based Package Config ==  * Want to store per-node firewall config for system services (apache, exim, imap, etc.)
   * Ideally, also store common port config (afs, kerberos, domtool, etc.)
 * Need to easily grant certain users additional permissions (e.g. all admins should be allowed outgoing ssh, normal users should not) on multiple nodes
 * Don't want to tie configuration to physical nodes (e.g. moving to a new shell server)
 * Restrict users to having rules on certain nodes (statically enforced)
Line 75: Line 127:
Based on http://debathena.mit.edu/config-packages/ and http://wiki.debian.org/ConfigPackages Conclusion: the current fwtool implementation would require duplicating a lot of functionality already present in the support machinery for the domtool `domain` type. A new syntax for user rule files would need to be created (or tons of hackish supporting code) so ...
Line 77: Line 129:
Anything we can't use debconf for in the preseed, we should push using Debian packages. We already need a mirror for `libnss-afs` so we may as well take advantage of it? The only (in)sane way forward is to create a domtool `node` type and firewall plugin to manage rules. This has distinct advantages:
Line 79: Line 131:
Packages needing customization on all machines:  * Takes advantage of current domtool infrastructure for pushing configs
 * The domtool language is quite nice and has the needed functionality for abstracting groups of users, common config, etc.
 * Lays the groundwork for using domtool to perform node management in addition to domain management
Line 81: Line 135:
 * ferm (`closed.conf`)
 * `nsswitch.conf` (not sure of package)
 * `mdadm`, `rkhunter`, `tripwire`, et al: This will need to be done as a general "CleaningUpOurAtrociouslyNoisyLoggingConfiguration" project (hint, hint).
And a few distinct disadvantages:
Line 85: Line 137:
Packages that need customization if installed:  * Need to solve the uid mismatch between nodes for system users problem beforehand
   * ClintonEbadi says: openafs pts shall be the only source for users (except those needed before afs can come up)
 * Pretty hefty time/code investment
   * ClintonEbadi's SML-fu and type theory are weak (but knowledge is power™)
   * The portal will need updating (but its interface to firewall rules sucks anyway)
Line 87: Line 143:
 * whatever imapd we use on the new machines
 * exim
 * ejabberd
 * apache
Interim solution:
Line 92: Line 145:
Ideas: Getting a user shell machine online is slightly less important than shifting cgi hosting off of mire (load average is usually high, software is outdated). Users can live with for another month logging into an etch system but running their php and whatnot on a new machine... Therefore:
Line 94: Line 147:
 * virtual packages `hcoop-user-node-config` and `hcoop-services-node-config` that conflict and depend on the appropriate basic config settings (e.g. for setting up `login.restrict`, default ulimits, etc.)
 * If we want to use `runit` for services, we might include the service files and `init.d` overrides
 * Common ferm config distributed using Debian package
   * conffiles for local system ports created
 * Local ports config distributed using another Debian package (divert of site-wide conffiles)

This will force codification of the open ports for the web server machine, and will be easy to undo when domtool support is in place. A slightly hacked together FirewallRules may need to be used for the user node (time, what is time?) -- but a restrictive firewall '''must''' be used (it's impossible to implement one on a box that didn't have one before with breaking things). Unfortunately, without SELinux, we can't restrict what ports members listen on, so input firewall rules will be less useful than they could be for now.



== Installer Preseeding ==

{{{#!wiki note
Move to a page describing infrastructure decisions
}}}

http://wiki.debian.org/DebianInstaller/Preseed

http://git.hcoop.net/?p=hcoop/machine-template.git;a=summary

Pretty useful, need to document more.

Installer command line: `auto url=http://hcoop.net/~clinton_admin/preseed-test-0.cfg`

Proof this is worth it (enter network info -> hot damn any afs user can login to the kvm)

{{http://unknownlamer.org/tmp/proof.png}}

Initial scratch notes on getting kvm working on fritz. This will need to be integrated into SetupNewMachines and AdminArea after everything is working.

See http://wiki.hcoop.net/Migration2009/SoftwareSetup for the gist of what ClintonEbadi is trying to do here, but s/OpenVZ/KVM via libvirt/g.

1. Tasks

(./) = done, {o} = not done, <!> = possibly done, awaiting verification, {X} = gave up or died trying

  • <!> Apply advanced wine making techniques to carefully blend the Apache configurations on fritz and mire

    • {o} Per machine NameVirtualHost config

      • It turns out that both the NameVirtualHost and VirtualHost directive must use * or an explicit IP. For the sake of correctness, keeping the IP in VirtualHost directives seems like a Good Idea (tm), so we need to have domtool install /etc/apache2/conf.d/hcoop-namevhost-$machine for every web serving node.

    • {o} Per-machine apache default vhost

    • {o} Change defaultPhpVersion to 5

      • {o} Check all user domtool configs and explicitly set phpVersion = 4 if needed

    • <!> Domtool mod_proxy support to machines other than localhost

    • (./) Check DomTool for all used modules and sure they are enabled

  • <!> Spin up the fancy new Apache KVM and pray that it works

    • (./) Reinstall using preseed + postinst

    • (./) Make openafs start earlier in boot process

      • Things like apache need to resolve pts users; it's easier to divert/transform the openafs script than to divert every script that needs access to afs uids.
      • {i} This was really hard. insserv in squeeze has weird problems.

    • {o} Move gitweb and git hosting over

    • {o} Set up rcube

    • {o} Install squirrelmail at webmail.hcoop.net temporarily (mod_proxy from deleuze later)

    • {o} Turn off fritz's Apache (it's the KVM host and KDC ... change of plans, eh)

      • {o} Deal with http://debian.hcoop.net (if we move it to navajos, we can't reinstall navajos... but we probably should move it to navajos)

    • {o} Move mire web services

      • {o} phpmyadmin

      • {o} ajaxterm

    • (./) Move unknownlamer.org onto navajos (what better a guinea pig)

    • {X} Point hcoop.net at the new machine (also a huge reconfiguration PITA)

    • <!> Start assisting the first brave users with "moving" to new machine (i.e. webAt "newNode", or adding an env var to Easy_Domain to change the default web node for everything)

      • (./) DavorOcelic

        • (./) Fix SSL problems

      • <!> SteveKillen

        • (./) Fix moinmoin-install

      • (./) BtTempleton

      • After sure of everything working, inspect all user DomTool configs and make the needed changes for the users to switch their hosting to new node (in trivial cases e.g. mod_proxy to app on mire, static file serving)

  • (./) Databases

    • (./) Set up postgresql 9.1

      • {i} And we're even using kerberos instead of ident for auth!

    • (./) Install postgres/mysql client libraries

    • (./) Firewall rules for connecting to database server

  • {o} Using lessons from above tasks, spin up new user shell machine

  • {o} Harrass any users who refuse to leave mire

    • {o} Remove php4 support from domtool

  • {o} Turn mire off, remove from rack, set on fire

    • {o} Move secondary DNS to hopper, update ns aliases

  • {o} Migrate web services from deleuze

    • {o} Migrate and upgrade hcoop wiki

      • Ideally into afs space, owned by the hcoop account.
      • Or not? One reason for it being on local fs space is to remain accessible in case kerberos/afs are gone. This is less of an issue now (and will be even less so once we have multiple volservers and ensure the hcoop volume is on all of them), so might not be worth it. Alternative: set up automatic moin mirroring to outpost using a trivial lighttpd setup.
    • {o} Migrate Portal

      • {o} Move all data storage into afs

      • {o} Hack needed 32-bit libraries

      • {o} Update SMLSQL for libpq5

Other tasks, lower priority:

  • {o} Configuration package nits

    • {o} ssh: restart sshd after installation

      • Actually easy: just setup a trivial postinst/prerm ala hcoop-apache2-config

    • {o} firewall: restart ferm after installation

2. Bog Initial Setup Notes

The preseed in theory is enough to have a user node; the admin config package restricts logins. A few open questions:

  • Do user nodes need to run domtool-slave?
    • Yes -- for fwtool at the very least
  • Add /afs/hcoop.net/common/bin to default path using /etc/profile.d/

    • Should we use @sys? We have no binaries installed right now, can probably skip.

Check preseed for installation of admin node specific packages and move to navajos postinst. We need some preseed templating system eventually, but for now...

Automatic re-installability is officially a low priority for this release cycle... so don't worry about post-installing or preseeding the various packages a fully featured user node needs (db clients, perl, etc.).

3. Packages Config

This, and other information, should be merged into a general description of our infrastructure and how it differs from a stock Debian installation.

Things not mentioned on SetupNewMachines that had to have their default debconf values changed.

  • ssmtp

    • forward all mail for UID < 1000 to logs

    • Masquerade as hcoop.net

  • PAM
    • Newfangled pam-config framework for a fresh squeeze install looks quite promising... (enabled kerberos + unix + afs session)

4. Major Open issues

This, and other things, should be merged into a "Undecided Infrastructure Issues" document, so that folks don't make the mistake that "the path of least resistance" is how we wanted to do things.

  • Exim setup (have to add to forwardable domains on deleuze)
  • Figuring out what to do wrt local users for system services that need to access afs
    • e.g. Apache, Exim, debarchiver, domtool, impad, spamd, ...
    • AFAICT, it makes more sense to just have afs users -- if the ptdb is gone, the services will not operate in a correct way anyway
    • Removes issues with keeping UIDs in sync
    • How does this interact with Debian automatically creating system users for packages?
    • A few system users were created using create-user -- mail is routed to them and they are subscribed to mailing lists and whatnot which is ... probably bad. i.e. We probably want to split create-user into the portions to just create an afs/kerberos user and then to do the fancy stuff an actual factual human user needs.

  • Integration with package requests
    • Preseeding means we can kill/respin web node images with ease -- but not restore packages users have requested to support their cgi programs
    • If the portal stores this info, we need a package to reinstall user packages
  • Is the keytab situation messy? Having the domtool keytab at the toplevel seems out of place
    • Reading old -sysadmin posts revealed that only having $user.daemon keys was supposed to be temporary -- we really should have a few standard principles for hcoop services to access data (e.g. $user.mail for mail delivery), and have a portal interface (and domtool integration) allowing users to request additional principles if they want (e.g. $user.$webapp-they-run ... or just $user.cgi in the default Just Works (tm) configuration)

4.1. fwtool

Making FirewallRules support all of the needed functionality for a user machine is proving difficult

  • Want to store per-node firewall config for system services (apache, exim, imap, etc.)
    • Ideally, also store common port config (afs, kerberos, domtool, etc.)
  • Need to easily grant certain users additional permissions (e.g. all admins should be allowed outgoing ssh, normal users should not) on multiple nodes
  • Don't want to tie configuration to physical nodes (e.g. moving to a new shell server)
  • Restrict users to having rules on certain nodes (statically enforced)

Conclusion: the current fwtool implementation would require duplicating a lot of functionality already present in the support machinery for the domtool domain type. A new syntax for user rule files would need to be created (or tons of hackish supporting code) so ...

The only (in)sane way forward is to create a domtool node type and firewall plugin to manage rules. This has distinct advantages:

  • Takes advantage of current domtool infrastructure for pushing configs
  • The domtool language is quite nice and has the needed functionality for abstracting groups of users, common config, etc.
  • Lays the groundwork for using domtool to perform node management in addition to domain management

And a few distinct disadvantages:

  • Need to solve the uid mismatch between nodes for system users problem beforehand
    • ClintonEbadi says: openafs pts shall be the only source for users (except those needed before afs can come up)

  • Pretty hefty time/code investment
    • ClintonEbadi's SML-fu and type theory are weak (but knowledge is power™)

    • The portal will need updating (but its interface to firewall rules sucks anyway)

Interim solution:

Getting a user shell machine online is slightly less important than shifting cgi hosting off of mire (load average is usually high, software is outdated). Users can live with for another month logging into an etch system but running their php and whatnot on a new machine... Therefore:

  • Common ferm config distributed using Debian package
    • conffiles for local system ports created
  • Local ports config distributed using another Debian package (divert of site-wide conffiles)

This will force codification of the open ports for the web server machine, and will be easy to undo when domtool support is in place. A slightly hacked together FirewallRules may need to be used for the user node (time, what is time?) -- but a restrictive firewall must be used (it's impossible to implement one on a box that didn't have one before with breaking things). Unfortunately, without SELinux, we can't restrict what ports members listen on, so input firewall rules will be less useful than they could be for now.

5. Installer Preseeding

Move to a page describing infrastructure decisions

http://wiki.debian.org/DebianInstaller/Preseed

http://git.hcoop.net/?p=hcoop/machine-template.git;a=summary

Pretty useful, need to document more.

Installer command line: auto url=http://hcoop.net/~clinton_admin/preseed-test-0.cfg

Proof this is worth it (enter network info -> hot damn any afs user can login to the kvm)

http://unknownlamer.org/tmp/proof.png


CategorySystemAdministration CategoryWorkInProgress

FritzVirtualization (last edited 2013-01-28 07:21:09 by ClintonEbadi)