====== anyMeta Virtual Machine ====== {{wiki:mm:anyvm.png?600|anyVM in qemu}} ===== About ===== anyVM is a bootable [[wp>iso9660|ISO image]]((The ISO image can be burned on a CD, DVD, runs from USB stick or from harddisk.)) that runs an [[http://anymeta.nl|anyMeta]] CMS on a live [[http://debian.org|Debian gnu/Linux]] operating system. It is intended for * rapid & decentralized development * reproducible test environments * scalable server deployment and offers distinct features for anyMeta development and deployment: * easily share customized software packages (apache, PHP, depcached,..) * reduce admin overhead for developers/designers * anyMeta system-setup and configuration utilities. * build-in or remote database * remaster on the fly ===== System Requirements ===== * i686 compatible CPU (default-kernel) or i386 compatible CPU (vserver) * min. 128MB RAM; 384MB recommended * for local mysql: min. 256MB RAM; 512MB recommended. * network interface * bootable CD-Drive ===== getting Started ===== - download the iso-image from ''office.mediamatic.nl:/Kantoor/6-mensen/Robin_Gareus/cdimage.iso.gz'' - unzip the image -> ''cdimage.iso'' - boot the image * run in with your favorite Emulator * burn it to CD/DVD and restart the computer - see the next chapter: "Bootup sequence" ==== Emulator and Image Hints ==== === Parallels === Notes from my head: (need to test) * Create a new VM (Debian Linux) * **no** Hard-disk - //only// CD-ROM ; select Image -> ''cdimage.iso'' * use //bridged networking// (in the office) and create a new Network adapter (-> unique MAC address) Notes: * If you copy a parallels config-file, you *must* change the MAC address of the Network interface for bridged network-setups. Duplicate MAC/ARP addresses could make our office switches go haywire. * "NAT/Shared-Network" is also an option but requires extra DNS setup when outside the office. more on that later.. === Qemu === Here's minimal commandline to launch it with qemu. qemu -boot d -m 384 -cdrom cdimage.iso and a more elaborate example overriding the default network settings and adding port-redirects: qemu -boot d -m 384 -cdrom cdimage.iso -net nic,vlan=0 -net user,vlan=0 -redir tcp:8081::80 -redir tcp:2222::22 Simply use the ''qemu-launcher'' GUI: //Bootdisk//: "CD-ROM" and set //CD-ROM// to the downloaded image file; optionally tweak other settings to your preferences. //Note:// With qemu's ''-curses'' option many anyVM images can be launched within a detachable ''screen(1)'' session. running qemu with ''-nographic'' is even fancier ;) === VMware === === writing the image to CD/DVD === Any CD/DVD writing software should be able to do so. Here's a unix commandline: zcat cdimage.iso.gz | cdrecord - //Note:// Do not write the ''cdimage.iso'' as file on a Data-CD. The ISO9660 image *is* the raw data from the disk. see [[http://www.petri.co.il/how_to_write_iso_files_to_cd.htm|How to write iso files to cd]]. === booting from USB stick === Simply copy the .iso to memory-stick's device (not the memory-stick's filesystem). Example unix commandline (replace ''/dev/disk1'' with the usb-stick's device, eg. ''/dev/sda'') sudo zcat cdimage.iso.gz > /dev/disk1 If you do not want to erase the whole memory-stick you will need to load ''syslinux'' onto the stick and simply copy the iso onto the stick's filesystem. see [[http://www.debian.org/releases/stable/i386/ch04s04.html.en|Debian Howto]] and [[http://syslinux.zytor.com/faq.php|syslinux faq]]. ==== Booting the Virtual Server ===== The bootloader (after the bios) asks if you have a specific CD-ROM setup. //Autodetection// will work for most systems. So just //press Enter// or //wait for 5 sec//. Close to the end of the bootup-sequence you are asked (5 seconds timeout) if you want to skip/override auto-configuration. After booting the image it will show a small welcome screen (with password hints) and drop you at a shell logon. You do not need to use this console and can proceed to point a web-browser at the newly instantiated virtual-server or log in via ssh. ===== Configuration ===== All images have an identical initial configuration which is customized during bootup. Customization can include nearly every sysadmin task from creating vhosts, dumping databases, to starting services.. This allows the VM to become a standalone server or take a part in a shared cluster. The VM can also be reconfigured during runtime. ==== default configuration ==== The default system comes with a //catch-all// apache2 vhost that points to a local empty mysql database ''anymeta4''. Visiting the site with a webbrowser will redirect you to the anymeta setup page.. mysqld is not started by default (requires 40MB ramdisk space). However the default remote-configuration for unknown VM's is to just ''start_mysql''. If you manually bypassed the remote-config during bootup mysqld may not be launched (depending on your choice). ==== config UI ==== There is a [[wp>Ncurses]] user-interface for common anyMeta sysadmin tasks. You can enter it during bootup as alternative to remote-config or start it at any later time by calling ''anyconfig.sh'' as user root. ==== configuration commands ==== see [[anyrcfg]]. ==== remote configuration ==== anyVM makes an HTTPS request to https://anyvm.test.mediamatic.nl/rcfg.php and POSTs it's network MAC address as identifier ((it also sends it's DHCP IP-address, which can be used as additional identifier)). It receives a configuration-script which is parsed and executed. ==== remote configuration admin ==== visit https://anyvm.test.mediamatic.nl/admin.php ==== anyMeta configs ==== Per default every VM node launches a webserver((apache2 non-treaded, pre-fork with php5-module and xcache)) and depcached. Modes of operation: * use remote DB (persistent, optionally shared with other VMs) - see ''set_apache_envdb'', ''add_vhost'' * local database server * start with empty local db - see ''create_new_default_db'', ''add_vhost'',.. * download/clone remote DB(s) - see ''mysql_curl_db'', ''mysql_patch_*'',.. * dump/upload DB(s) - see ''mysql_upload_db'' ==== anyMeta notes ==== * //depcached// is included and launched by default. * product/project templates/modules can be checked out and configured with ''mysql_patch_product'' * commonly used path's at mediamatic: ''/srv/www/vhosts/..'' ''/srv/www/anymeta/..'' are symlinks - you should feel at home.. ===== Remastering ===== Mount some storage device (fi. network-FS or a local HDD or a memory-stick) to ''/var/spool/bootcd/'' and run ''bootcdwrite -s'' (you can ignore most of the warnings..) - after ~5mins there will be a cdimage.iso file there.