Skip to content

jayjanssen/packer-percona

 
 

Repository files navigation

Packer Percona

The goal of these packer builds is to create consistent Vagrant boxes across multiple vagrant providers, specifically for Percona vagrant usage. Currently only Virtualbox and EC2 are supported.

These setups are typically for the purposes of internal testing and demonstration purposes and don't necessarily reflect recommended production settings.

Setup

Required Software:

And one or all of the following for the associated box types to get created:

AWS

Put your access and secret keys in environment variables in your .bashrc or similar (for packer):

export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=THE_ASSOCIATED_SECRET_KEY

Building

Currently only CentOS 6 is up to date. Ubuntu and other Linux types are feasible with Packer.

  • Modify centos6.json as desired
  • Source AMI
  • Region
packer validate centos-6_5-64.json
packer build centos-6_5-64.json
vagrant box add centos-6_5-64_percona centos-6_5-64_percona_virtualbox.box
vagrant box add centos-6_5-64_percona centos-6_5-64_percona_aws.box
cd ..

This will add boxes for each of the providers packer builds a box for. You can optionally just build a box for specific provider like this:

packer build --only=virtualbox-iso centos-6_5-64.json
packer build --only=amazon-ebs centos-6_5-64.json

Once you are done building boxes, they will be located in the 'boxes' subdir. You can manually load them using 'vagrant box add' or use the 'load_boxes.sh' to add all boxes and replace any that may already be in Vagrant.

Nuances

  • These boxes assume Vagrant is logging in with 'root', not 'vagrant'.
  • These boxes should be updated to the latest package releases on build
  • An extra device or logical volume is available (and possibly setup) for /var/lib/mysql (note: for AWS you can configure these at the vagrant-aws level now, so we will leave this unset for EC2 instances)

Local Percona package repository

These boxes contain a local repository that is disabled by default containing recent releases of Percona software. This repo can be enabled for the purposes of using these boxes in situations with poor or no internet connectivity. (E.g., conferences)

OSes

CentOS 6 builds

The VM-based builds use a netinstall ISO and a kickstart file to provision the box. This guarantees all packages are up to date at the time of the build.

AWS uses an official CentOS 6 AMI "with Updates". http://wiki.centos.org/Cloud/AWS These are Region-specific, so you'll need a different AMI identifier for different AWS regions.

The local Percona repo is stored in /var/repo and the repo definition is in /etc/yum.repos.d/local.repo. Change 'enabled' to '1' in that file to use the local repo.

Ubuntu

Needs work

???

Providers

Virtualbox

Local VM -- a favorite for conference tutorials.

http://virtualbox.org

Amazon EC2 - EBS AMI

Creates an EBS-based AMI associated with a specific AWS Region.

The current instance comes with no extra EBS volumes because these can be added at the Vagrant level. However, you can create AMIs with the EBS volumes pre-defined. An example of such a configuratuion creating a 100GB volume with 1000 provisioned IOPS:

    "ami_block_device_mappings": [
      {
        "device_name": "/dev/sda",
        "delete_on_termination": true
      },
      {
        "device_name": "/dev/sdf",
        "virtual_name": "mysql_data",
        "volume_size": 100,
        "volume_type": "io1",
        "iops": 1000,
        "delete_on_termination": true
      }
    ]

???

Maintenance

Packer will cruft up your EC2 dashboard. In particular, pay attention and periodically delete:

  • Old AMIs
  • Unused EBS volumes left over from AMI creation

About

Packer config to build Percona base boxes - Deprecated in favor of https://github.com/grypyrg/packer-percona

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 94.9%
  • Ruby 5.1%