HTTPS SSH

SeqDB-vagrant

This repository contains a Vagrant deployment of the SeqDB production, UAT, and development VMs.

Requirements

Vagrant

Vagrant v1.7+ is required due to the use of functionality not available in previous versions.

Public Networking

The bridge device used must be in promiscuous mode.

sudo ifconfig eth0 promisc Substitute eth0 with the appropraite interface name.

libvirt Provider

vagrant-libvirt plugin (vagrant plugin) qemu / kvm system packages

Virtualbox Provider

VirtualBox 4+

OpenStack Provider

OpenStack username and password Public and private ssh key pair vagrant-openstack-plugin (vagrant plugin)

AWS

AWS EC2 Access ID and Secret Key Public and private ssh key pair vagrant-aws (vagrant plugin)

Getting Started

Ensure that you have met the outlined requirements above. See the supported hypervisors section below for more information.

Clone this repository git clone https://<USERID>@bitbucket.org/aafc-mbb/seqdb-vagrant.git

Configure the provisioning parameters withing the configuration file. Note that you must decide whether you want a production, UAT, or dev deployment and modify the appropriate section within the configuration file. cd seqdb-vagrant cp config.yml.sample config.yml vim config.prod.yml

Add the CentOS box with the appropriate name. vagrant box add centos70_x86_64_minimal https://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.5-x86_64-v20140504.box

Begin the provisioning process (only complete one of the following depending on the deployment environment you want) * For the Production deployment, two VMs will be provisioned: Application server (Centos 7.0 Java 8 Tomcat 7) and Database server (CentOS 7.0 MySQL 5.6)

vagrant up
  • For the UAT deployment, one VM will be provisioned (CentOS 7.0 Java 8 Tomcat 7 MySQl 5.6)

    vagrant up uat

  • For the Development environment, one VM will be provisioned (Ubuntu 12.04 Java 8 Tomcat 7 MySQL 5.6)

    vagrant up dev

Hypervisor Support

VirtualBox (default)

VirtualBox is the default hypervisor for Vagrant. This hypervisor permits using a Windows, Linux, or Mac host.

Ensure that you have VirtualBox installed before continuing.

sudo apt-get install virtualbox

Inside the GIT repository you cloned, start the VM using (see the Getting Started section)

vagrant up [dev|uat]

libvirt

Support for the libvirt provider allows using several underlying hypervisors through the libvirt api. KVM is the default hypervisor, which is supported using most modern Linux hosts.

Ensure that you have installed libvirt, kvm, and all relevant system packages and are able to start a KVM Virtual Machine before using this vagrant provider.

The vagrant-libvirt plugin is required before issuing a vagrant up command. In brief, you can install it as follows:

sudo apt-get install libxslt-dev libxml2-dev libvirt-dev vagrant plugin install vagrant-libvirt

Inside the GIT repository you cloned, start the VM with libvirt using (see the Getting Started section)

vagrant up --provider=libvirt [dev|uat]

OpenStack

The vagrant-openstack-plugin is required before issuing a vagrant up command. This plugin can be installed using:

vagrant plugin install vagrant-openstack-plugin

Generate a private/public key pair to use for SSHing into the VM and register it in Openstack and your workstation. See Openstack's documentation for more information.

Ensure that the image defined in config.yml is a CentOS 7 image with cloud-init support and is designed to work with Vagrant. See the documentation on Vagrant's website describing how to create Vagrant boxes.

Configuration

The openstack provider requires some configuration in config.yml under the vm->provider->openstack section.

NOTE: This provider ignores the vm->networking section config.yml completely!

See the following for a brief explanation of the options.

  enabled: true | false - Set to 'true' if you want to use the openstack provider (vagrant-openstack-plugin required)
  box: dummy - Name of the empty box to user. This is a limitation of Vagrant.
  vm-name: 'IPT' - Name of the instance that you will see in OpenStack
  box-url: https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box - Place holder
  username: admin - OpenStack identity/authentication username
  api-key: admin - OpenStack identity/authentication password.
  flavor: m1.small - Name of VM flavor to use. m1.small, m1.medium, etc are default flavours in openstack. They control the VM's cpu, mem, and storage paremeters.
  project-name: admin | - The project name to use. Leave empty to use the default project for your account.
  image: Ubuntu 14.04 Trusty - The base image to use (must be available in OpenStack).  This Vagrantfile is based on and tested on Debian 6 and Ubuntu 14.04 only.
  identity-auth-url: http://openstack-test.biodiversity.agr.gc.ca:5000/v2.0/tokens - URL to identity service appended by "/tokens"
  ssh-username: ubuntu - The username used to SSH into the VM, which is typically defined in the image (default is ubuntu for Ubuntu cloud images)
  ssh-key-path: ~/.ssh/cloud.key - Location of the SSH private key on disk. You must generate a private/public key pair abd unoirt the public key to openstack.
  keypair-name: iyad - Name of the private/public key pair defined in OpenStack.  You must generate a private/public key pair and import the public key to openstack.
  floating-ip: 192.168.0.100 | auto | - Provide a floating-ip address, or set to 'auto', or leave it empty. This will be the IP used to access the VM.  If left empty, the nova network IP will be used.

Starting VM

Insite the GIT repository you cloned, start the VM with OpenStack using

vagrant up --provider=openstack dev|uat|prod

Limitations

  • Not all openstack functionality is integrated into this Vagrantfile. Adding additional functionality through the config.yml should be relateively simple.
  • The openstack provider does not "share" folders (e.g. /ipt_data) but rather rsyncs their content from provisioner to the VM. Hence, the data lives in the VM and is lost when the VM is terminated!

AWS

The vagrant-aws plugin is required before issuing a vagrant up command. Install this plugin using:

vagrant plugin install vagrant-aws

In AWS EC2, generate a private/public key pair to use for SSHing into the VM and register it in AWS and your workstation. See [Amazon's keypair documentation]http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) for more information.

The image defined in config.yml should be a CentOS 7 image with cloud-init and should be designed to work with Vagrant. See the documentation on Vagrant's website describing how to create vagrant boxes.

Configuration

The AWS provider requires some configuration in config.yml under the vm->provider->aws section.

NOTE: This provider ignores the vm->networking section config.yml completely!

See the following for a brief explanation of the options.

  vm-name: 'SeqDB' - Identifier to assign to VM
  box: dummy_aws - A dummy box that Vagrant requires for backwards compatibility
  box-url: https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box - The path for the dummy box
  access-key-id:  <username> - AWS username
  secret-access-key: <password> - AWS secret key
  keypair-name: example-keypair - SSH keypair name in AWS (ensure it is in your default region)
  ssh-key-path: ~/.ssh/example-keypair.pem - Private key path on your disk
  ssh-username: centos - Username to ssh with (set in the image)
  instance-type: t2.micro - The instance type defines the CPU, Mem, and Storage for the VM 
  image: ami-96a818fe - Amazon Machine Image identifier
  elastic-ip: - Provide an existing elastic-ip address, or set to 'auto' to assign a new one, or leave it empty

Starting VM

Insite the GIT repository you cloned, start the VM with AWS using

vagrant up --provider=aws dev|uat|prod

Ensure that you open the correct ports in the AWS EC2 secutiy groups.

Limitations

Not all AWS functionality is integrated into this Vagrantfile. Adding additional functionality through the config.yml should be relateively simple.