Magneticore

Development, Operations and Design

  • Articles
  • Resume
  • About Me
  • Contact
  • DevOps
  • Featured
  • Astronomy
  • Portfolio
  • UI/UX
You are here: Home / Archives for DevOps

VM boxes with Bento and Vagrant

February 4, 2015 by Jorge Morales

Bento

When you have the need to create VM boxes that can run in multiple environments Packer is an excellent choice.

Out of the box Packer comes with support to build images for Amazon EC2, DigitalOcean, Google Compute Engine, QEMU, VirtualBox, VMware, and more.

Support for more platforms is on the way, and anyone can add new platforms via plugins.

For a local development environment we can leverage the advantages of using Vagrant to run VMs and test or develop right in a clean environment without inadvertently introducing settings or configurations of our host machine.

This allows to level the conditions of the development, staging, QA and production environments.

In this way we would avoid circumstances like:

I don’t know what happened. It ran fine in my machine.

[Read more…]

Filed Under: Articles, DevOps

blessed-contrib

January 19, 2015 by Jorge Morales

While browsing in Google+ I encountered blessed-contrib and I wanted to share.

Build dashboards (or any other application) using ascii/ansi art and javascript.

[Read more…]

Filed Under: Articles, DevOps Tagged With: devops, linux

Docker OSX Vagrant and VMware fusion

December 19, 2014 by Jorge Morales

Awhile ago I started exploring what containers were and how to wrap my head around them to do deployments.

I pointed my browser to Docker’s Mac OS X installation web page which read something like this:

Because the Docker daemon uses Linux-specific kernel features, you can’t run Docker natively in OS X. Instead, you must install the Boot2Docker application. Boot2Docker includes a VirtualBox VM, Docker itself, and the Boot2Docker management tool.

Since I already have another VM environment installed (aka VMWare Fusion) and also Vagrant, I wasn’t too keen to install VirtualBox just for the exploratory exercise.

The solution was rather simple. Use Vagrant to start a Linux Box and then Install Docker in it.

You can use the following Vagrantfile as an example.

  The Vagrantfile refers to bootstrap_docker.sh. This is a simple bash script that runs after Vagrant boots your VM and then installs Docker.  
Copy and paste the code into the Vagrantfile and bootstrap_docker.sh in a new directory then run Vagrant.

 

$ vagrant up
$ vagrant ssh

Once you ssh into the box test your Docker installation:

$ sudo docker run -i -t ubuntu /bin/bash

This will download the Ubuntu container and start a shell session on it.

Docker in Vagrant

That’s it!
Time to experiment with more containers.

Filed Under: Articles, DevOps

Linux Performance Analysis and Tools

September 4, 2014 by Jorge Morales

Excellent Presentation from Brendan Gregg’s Talk at SCaLE 11x

Slides…

Linux Performance Analysis and Tools from Brendan Gregg

Filed Under: Articles, DevOps Tagged With: devops, linux

DevOps seeds

July 31, 2013 by Jorge Morales

Success

As promised let’s chat about the tools we at Coral now use in our development process. The first tool is for easy VM creation.

Veewee is a tool for easily (and repeatedly) building custom Vagrant base boxes, KVMs, and virtual machine images.

With Veewee I demo to my team how to create a VM from the OS ISO in just a few minutes.

Veewee isn’t only for Vagrant. It currently supports exporting VM images for the following providers:

  • VirtualBox – exports to OVF filetype
  • VMware (Fusion) – exports to OVA filetype
  • KVM – exports to IMG filetype

Check Veewee on GitHub

A sample of the settings available to tuned your VMs are:


Veewee::Session.declare({
  :cpu_count => '2',
  :memory_size=> '2048',
  :disk_size => '256000',
  :disk_format => 'VDI',
  :hostiocache => 'off',
  :os_type_id => 'RedHat6_64',
  :iso_file => "CentOS-6.5-x86_64-minimal.iso",
  :iso_src => "http://yum.singlehop.com/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso",
  :iso_md5 => "0d9dc37b5dd4befa1c440d2174e88a87",
  :iso_download_timeout => 1000,
  :boot_wait => "10",
  :boot_cmd_sequence => [
    ' text ks=http://%IP%:%PORT%/ks.cfg'
  ],
  :kickstart_port => "7122",
  :kickstart_timeout => 10000,
  :kickstart_file => "ks.cfg",
  :ssh_login_timeout => "10000",
  :ssh_user => "veewee",
  :ssh_password => "veewee",
  :ssh_key => "",
  :ssh_host_port => "7222",
  :ssh_guest_port => "22",
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
  :shutdown_cmd => "/sbin/halt -h -p",
   :postinstall_files => [
    "base.sh",
    "vmwaretools.sh",
    "dynmotd",
    "coral.sh",
    "cleanup.sh",
    "zerodisk.sh"
  ],
  :postinstall_timeout => 10000
})

Post-Install files and scripts

If some degree of personalization and optimization of the VMs is required you can do so calling scripts.

  • Base.sh
    • Installs Epel Repo and standard build essential packages
  • vmwaretools.sh
    • VMWARE Tools for ESXi/Vsphere
  • dynmotd
    • Provides servers basic information after ssh session ie. IP address/Server Name
  • coral.sh
    • Creates Coral User with privileges and directories
  • cleanup.sh
    • Deletes temp files, removes persistent network config (MAC) and Sets HOSTNAME
  • zerodisk.sh
    • Zero out the free space to save space in the final image

DEMO…

TERMINAL

# Build a new VM based on Definition						
veewee fusion build jasper-centos65-minimal
  • veewee
    • fusion (Provider)
    • build (Command)
    • jasper-centos65-minimal (Definition)

OK THAT’S NICE BUT…

WHAT ABOUT THE REST?

 The outcome is a VM image ready to use in Vagrant, can be imported in VMware Fusion and/or ESXi
 Will leave Chef and Deployment for another day.
Stay tuned!

Filed Under: Articles, DevOps Tagged With: devops

  • 1
  • 2
  • Next Page »

Recent Articles

  • Kano Computer for Kids based on Raspberry pi
  • Welcome Home App and Meteor part 2
  • Welcome Home App and Meteor
  • Are we alone in the universe?
  • A new car UI
I'm currently looking for new opportunities. Are you interested, let's chat!

Work with Jorge Now

Previous role

Project Lead at CoralCEA where I led the implementation on Coral platform and Coral's production systems.

 

I’m also in here…

  • Email
  • GitHub
  • LinkedIn
  • Twitter

Copyright © 2025 · Magneticore · My online Resume

Copyright © 2025 · Log in