README.md in dev-lxc-2.4.0 vs README.md in dev-lxc-2.5.0

- old
+ new

@@ -5,11 +5,11 @@ Cluster management includes the ability to manage snapshots of the containers which makes dev-lxc well suited as a tool for support related work, customized cluster builds for demo purposes, as well as general experimentation and exploration. ### Features -1. LXC 2.0 Containers - Resource efficient servers with fast start/stop times and standard init +1. LXC Containers - Resource efficient servers with fast start/stop times and standard init 2. Btrfs - Efficient, persistent storage backend provides fast, lightweight container snapshots 3. Dnsmasq - DHCP networking and DNS resolution 4. Base Containers - Containers that are built to resemble a traditional server 5. ruby-lxc - Ruby bindings for liblxc 6. YAML - Simple, flexible definition of clusters @@ -24,38 +24,63 @@ The Btrfs backed snapshots provide a quick clean slate which is helpful especially for experimenting and troubleshooting. Or it can be used to build a customized cluster for demo purposes and be able to bring it up quickly and reliably. -If you aren't familiar with using containers please read this introduction. +If you aren't familiar with using containers you might be interested in this introduction. [LXC 1.0 Introduction](https://www.stgraber.org/2013/12/20/lxc-1-0-blog-post-series/) -### Requirements +Additional dev-lxc related documentation can be found in the [docs folder](docs) in this repository. -* Please follow the [Prerequisites Instructions](docs/prerequisites.md) +## Build dev-lxc-platform instance -When you are done with the prerequisites you should be able to log into the dev-lxc-platform VM and start using it. +The dev-lxc tool is used in a system that has been configured by the dev-lxc-platform cookbook. -You must login to the root user to use the dev-lxc command. +The easiest way to build a dev-lxc-platform system is to download the dev-lxc-platform repository +and use Test Kitchen to build a VirtualBox Vagrant instance or an AWS EC2 instance. +Follow the instructions in the [dev-lxc-platform README](https://github.com/jeremiahsnapp/dev-lxc-platform) to build +a dev-lxc-platform instance. + +## Login to the dev-lxc-platform instance + +Login to the dev-lxc-platform instance and switch to the root user to use the dev-lxc tool. + ``` cd dev-lxc-platform -vagrant ssh +kitchen login <ec2 or vagrant> sudo -i ``` -### Update dev-lxc gem +When you are logged in as the root user you should automatically enter a [byobu session](http://byobu.co/). -Run the following command if you ever need to upgrade the dev-lxc gem inside the dev-lxc-platform VM. +Byobu makes it easy to manage multiple terminal windows and panes. You can press `F1` to get help which includes a [list of keybindings](http://manpages.ubuntu.com/manpages/wily/en/man1/byobu.1.html#contenttoc8). +The prefix key is set to `Ctrl-o` + +Some of the keys that will be most useful to you are: + +* `option-Up`, `option-Down` to switch between Byobu sessions +* `option-Left`, `option-Right` to switch between windows in a session +* `shift-Left`, `shift-Right`, `shift-Up`, `shift-Down` to switch between panes in a window + +## Update dev-lxc gem + +Run the following command as the instance's root user if you ever need to upgrade the dev-lxc gem inside the dev-lxc-platform instance. + ``` +cd dev-lxc-platform +kitchen login <ec2 or vagrant> +sudo -i chef gem update dev-lxc ``` -### Display Help +## Demo: Build Chef Automate Cluster +### Display dev-lxc help + ``` dev-lxc help dev-lxc help <subcommand> ``` @@ -76,40 +101,19 @@ ``` dev-lxc snapshot dl sn ``` -### Demo: Build Chef Automate Cluster +### Create Base Container -Log into the dev-lxc-platform VM's root user. - -``` -cd dev-lxc-platform -vagrant up # if the VM is not already running -vagrant ssh -sudo -i -``` - -When you are logged in as the root user you should automatically enter a [byobu session](http://byobu.co/). - -Byobu makes it easy to manage multiple terminal windows and panes. You can press `fn-F1` to get help which includes a [list of keybindings](http://manpages.ubuntu.com/manpages/wily/en/man1/byobu.1.html#contenttoc8). - -Some of the keys that will be most useful to you are: - -* `option-Up`, `option-Down` to switch between Byobu sessions -* `option-Left`, `option-Right` to switch between windows in a session -* `shift-Left`, `shift-Right`, `shift-Up`, `shift-Down` to switch between panes in a window - -#### Create Base Container - The [base container](docs/base_containers.md) used for the cluster's containers must be created first. Let's use Ubuntu 14.04 for the base container. ``` dl create b-ubuntu-1404 ``` -#### Create Config File +### Create Config File Create the [dev-lxc.yml config file](docs/configuration.md) for the cluster. First, create an arbitrary directory to hold the dev-lxc.yml file. @@ -136,11 +140,11 @@ * Delete the `reporting` product from the Chef Server config since we will be using Chef Automate's Visibility. * Set the Automate server's `license_path` value to the location of your license file. * (Optionally) If you built other clusters then you can modify the server names (including the nodes' `chef_server_url`) in this cluster to make them [unique from the other clusters](docs/manage_multiple_clusters.md). -#### cluster-view +### cluster-view Run the `cluster-view` command to create a Byobu session specifically for this cluster. The session's first window is named "cluster". @@ -155,21 +159,21 @@ ``` cluster-view /root/work/clusters/automate ``` -#### Specifying a Subset of Servers +### Specifying a Subset of Servers Many dev-lxc subcommands can act on a subset of the cluster's servers by specifying a regular expression that matches the desired server names. For example, the following command will show the status of the infrastructure node. ``` dl status node ``` -#### Build the Cluster +### Build the Cluster dev-lxc knows to build the servers in an appropriate order. It downloads the product packages to a cache location and installs the packages in each server. @@ -180,17 +184,17 @@ ``` Note: You also have the option of running the `prepare-product-cache` subcommand which downloads required product packages to the cache. This can be helpful when you don't want to start building the cluster yet but you want the package cache ready when you build the cluster later. -#### Use the Servers +### Use the Servers At this point all of the cluster's servers should be running. If you setup the workstation's networking correctly as described in the prerequisites you should be able to ping any server from your workstation using it's FQDN. You can also browse to any server that has a web interface. -Since the cluster has a Chef Server you can use the `chef-repo` subcommand to create a chef-repo directory in the VM that contains a knife.rb and all of the keys for the users and org validator clients that are defined in dev-lxc.yml. This makes it very easy to use tools such as knife or berkshelf. +Since the cluster has a Chef Server you can use the `chef-repo` subcommand to create a chef-repo directory in the host instance that contains a knife.rb and all of the keys for the users and org validator clients that are defined in dev-lxc.yml. This makes it very easy to use tools such as knife or berkshelf. ``` dl chef cd chef-repo knife client list @@ -211,10 +215,10 @@ dl at chef ``` Since the cluster has a Chef Server and an infrastructure node dev-lxc made sure it configured the node's chef-client for the Chef Server so it is easy to converge the node. -#### Manage the Cluster +### Manage the Cluster The right pane of the "cluster" window should show `dev-lxc status` output. This shows the status of each server including any existing snapshots. It is recommended that you stop the servers before restoring or creating snapshots.