Setting up virtual machines using dda-pallet
Setting up virtual machines reliably, flexibly, user-specific and automated sounds like a hard task. We make this possible and provide an open-source system for you to get into it and try it. We use pallet (an automation open-source framework written in Clojure and compiled into java byte code) and our extensions, the dev-ops system dda-pallet: (GitHub: DomainDrivenArchitecture).
In this example we use Oracle VirtualBox and a clean installation of (x)Ubuntu 14.04. During the base-system-installation we created just a initial user (username "initial"), other users are created during automatic configuration. Since we want to try a local installation here we need a java virtual machine to run our compiled code and an SSH server to transfer it to the target virtual machine:
# package installation $ sudo apt-get install openssh-server openjdk-7-jdk # also create a new ssh key without passphrase or copy your key over $ ssh-keygen
You might try a prepared compiled jar with existing configuration. Copy over the standalone jar to the target VM: Your Workstation:
$ scp dda-managed-vm-0.1.0-SNAPSHOT-standalone.jar email@example.com:/home/initial
In our domain driven architecture we describe phases that occur during the setup of a node. Let's start with the init phase:
$ sudo java -jar ./dda-managed-vm-0.1.0-SNAPSHOT-standalone.jar init 2>/dev/null
This step will prepare the VM for further interaction with our domain-driven-architecture autoconfiguration tools. As a result a pallet user is added – you should find this empty directory:
$ ls /home/pallet/state
Your ssh key is added to the authorized keys of root and pallet:
$ cat ~/.ssh/id_rsa.pub $ cat /home/pallet/.ssh/authorized_keys $ sudo cat /root/.ssh/authorized_keys
Next step is the install phase:
$ sudo java -jar ./dda-managed-vm-0.1.0-SNAPSHOT-standalone.jar install 2>/dev/null
This might take a while to download and install required packages. It will install the VirtualBox guest extensions and LibreOffice. For convenience you can as well import your bookmarks in this step if you try to modify the configuration later.
Check the directory again
$ ls /home/pallet/state
and you will find state files for the installed crates.
Last step is the configure phase:
$ sudo java -jar ./dda-managed-vm-0.1.0-SNAPSHOT-standalone.jar configure 2>/dev/null
This will configure the backup included in the dda-managed-vm crate as a daily cron job!