posted

0 Comments

By: Paco Gómez

This is a repost from Paco Gómez’s personal blog.

CoreOS is a popular Linux distribution for applications that use Docker Containers. The following article describes the steps to install CoreOS on VMware vCloud® Air™ OnDemand. The use of vCloud Air Command Line Interface makes the process easier to document and more convenient to follow.

The guide assumes the following pre-requisites:

We are using a vCloud Air OnDemand account, but these instructions can also be applied to subscription-based vCloud Air accounts and to vCloud Air Network (vCloud Director), with some modifications on how to login to the service. In the next blog post I will describe how to use vca-cli to login to those other types of accounts.

In a nutshell, the process consists of the following steps:

  1. Download the CoreOS OVA to the local computer and upload it to vCloud Air as a template
  2. Create a CoreOS VM based on the template
  3. Customize a local cloud-config file, create an ISO file and upload it to vCloud Air
  4. Attach the ISO to the VM, boot it up and let CoreOS configure itself
  5. Configure the edge gateway to allow SSH access to the CoreOS VM

The transfer of the OVA template is a one-time operation. The template can be used to instantiate multiple VMs.

To install vca-cli version 0.9.1, run the command below. Please note that the documentation for this release (0.9.1) has not been updated yet. The documentation on the GitHub site is for the previous version (0.5).

Log into the vCloud Air account and list the instances available:

Log in again to vCloud Air, this time indicating the instance where the virtual data center is located, in my case is the instance in ‘us-california-1-3…’ region:

It might come in handy to create an alias for the login command, in case the authentication token expires.

At this point you can explore the organization and virtual data center:

The status command gives the URL of the vCloud Director instance that is required to upload the OVA template and ISO image:

First, download the OVA to the local disk. The CoreOS OVA template comes with open-vm-tools installed.

Then, upload it to vCloud Air using ovftool, using the URL from the statuscommand and the org id from the vca org command:

Next step is to create the VM and connect it to the network. We are not starting the VM just yet, but we’ll take note of the IP assigned to the VM.

The IP address is used in the createiso.sh script to generate the cloud-config ISO that the CoreOS will use to configure itself. Thanks to William Lam for providing the original script. I have modified it to have CoreOS configure the static IP assigned by vCloud Air. It can be customized to configure additional services and settings.

Modify the file based on your preferences. At the very least, make sure to specify the IP address and the public ssh key:

Then create the ISO file and upload it to vCloud Air:

Attach the ISO to the VM and boot it up:

It is required to reboot the VM to activate the changes:

The final step is to configure the gateway to be able to ssh into the VM. If you haven’t added a public IP address to the virtual data center, you can do it now. The vca gateway command will show the allocated IP.

Then, disable the firewall and create the corresponding NAT rules. On another post, I will explain how to configure firewall rules with vca-cli.

The VM is now ready to accept ssh connections. Log into the machine with the private key:

Summary

vCloud Air provides a feature-rich cloud service with advanced virtual data center options. This guide will help CoreOS users to quickly deploy servers on vCloud Air and customize the instances using the native cloud-config mechanism.

For more information about vCloud Air, visit vcloud.vmware.com.

Be sure to subscribe to the the vCloud blog with your favorite RSS reader, or follow our social channels at @vCloudand Facebook.com/VMwarevCloud for the latest updates.