This commit is contained in:
Scott Lowe 2016-07-19 15:16:59 -06:00
commit 2e4f961e6e
2 changed files with 62 additions and 2 deletions

View file

@ -8,10 +8,14 @@ This repository contains a variety of files and tools for learning new technolog
**consul**: In this folder you'll find a `Vagrantfile` and supporting documents to run a Consul cluster under Vagrant on your local laptop. The provisioning is handled via shell scripts.
**containerd-runc**: _This is a placeholder for future work._
**coreos-cloudinit-toolbox**: This folder contains files for using cloud-init to customize the CoreOS toolbox. This learning environment can be used with local Vagrant VMs, with OpenStack instances, or with AWS instances.
**debian-generic**: This folder has a Vagrant environment for spinning up a generic, 64-bit Debian 8.0 ("Jessie") VM. Note there's nothing special here---just a plain, generic Debian VM. No custom provisioning is provided in this environment.
**docker-ipvlan-l3**: This folder has files to create a learning environment for using ipvlan L3 interfaces with Docker containers.
**docker-ipvlan**: This folder has files to create a learning environment for using ipvlan interfaces with Docker containers.
**docker-macvlan**: This folder has files to create a learning environment for using macvlan interfaces with Docker containers.
@ -24,8 +28,12 @@ This repository contains a variety of files and tools for learning new technolog
**etcd-2.0**: Use the `Vagrantfile` and other files in this directory to turn up an etcd 2.0.9 cluster running on Ubuntu 14.04. The provisioning is handled via shell scripts.
**ipvs-docker**: Use this learning environment to experiment with using IPVS/LVS for load balancing Docker containers.
**kvm-macvtap**: This learning environment has a `Vagrantfile` and supporting files for working with KVM and macvtap interfaces on Ubuntu 14.04. The provisioning is handled via Ansible (pre-2.0) installed on the Vagrant host.
**junos**: _This is a placeholder for future work._
**kvm**: The files in this folder allow you to create a learning environment for working with KVM and Libvirt on Ubuntu 14.04. The provisioning is handled via Ansible (pre-2.0) installed on the Vagrant host.
**lxc**: This folder holds a `Vagrantfile` and supporting files to create an environment for working with LXC (pronounced "lex-see"). LXC is a set of tools for working with OS containers. The provisioning is handled via Ansible (pre-2.0) installed on the Vagrant host.
@ -40,6 +48,8 @@ This repository contains a variety of files and tools for learning new technolog
**ovs-geneve**: This folder contains a Vagrant environment and supporting files for compiling Open vSwitch (OVS) from source and using Geneve tunneling to connect network namespaces on two different VMs.
**ovs-multi-br**: In this folder is a Vagrant environment, Ansible playbook, and related data files for experimenting with multiple Open vSwitch (OVS) bridges.
**photon-ansible**: In this folder is a Vagrant environment for using Ansible with VMware Photon; specifically, for using Ansible to configure Photon's pre-installed Docker daemon to listen over a network socket. Naturally, the provisioning is handled via Ansible (pre-2.0) installed on the Vagrant host.
**photon-cloudinit**: This folder contains the files to spin up VMs, using Vagrant and customized via `cloud-init`, running the VMware Photon Technical Preview. The provisioning is handled via shell scripts.
@ -62,7 +72,7 @@ This repository contains a variety of files and tools for learning new technolog
**vagrant-aws**: This folder contains a `Vagrantfile` and supporting files for using Vagrant to spin up an instance on AWS. This allows you to use Vagrant to spin up and destroy an instance on AWS.
**vagrant-docker-json**: Like `vagrant-docker-yaml`', this folder is an extension of "vagrant-docker" in that it provides the ability to specify, in an external JSON file, a list of Docker containers to be instantiated by Vagrant. The provisioning is handled by Vagrant's built-in Docker provisioner.
**vagrant-docker-json**: Like `vagrant-docker-yaml`, this folder is an extension of "vagrant-docker" in that it provides the ability to specify, in an external JSON file, a list of Docker containers to be instantiated by Vagrant. The provisioning is handled by Vagrant's built-in Docker provisioner.
**vagrant-docker-yaml**: This folder is an extension of "vagrant-docker" in that it provides the ability to specify the list of Docker containers that Vagrant will create in a separate YAML file. The provisioning is handled by Vagrant's built-in Docker provisioner.
@ -70,6 +80,8 @@ This repository contains a variety of files and tools for learning new technolog
**vagrant-json**: The files in this folder illustrate the use of an external JSON data file to drive Vagrant.
**vagrant-multi-platform**: This Vagrant environment demonstrates one possible way to create a `Vagrantfile` that supports multiple virtualization platforms without any edits needed across platforms.
**vagrant-openstack-multi**: This folder is similar to `vagrant-openstack`, but supports Vagrant operations on multiple instances.
**vagrant-openstack**: This folder contains a `Vagrantfile` and supporting files for using Vagrant with the OpenStack provider. This allows you to use Vagrant to provision and destroy an instance in an OpenStack cloud.

View file

@ -20,4 +20,52 @@ These files were created to test a method of providing a single Vagrant ([http:/
These instructions assume you've already installed Vagrant, the necessary back-end virtualization provider(s) (only VirtualBox and VMware Fusion are supported by this testing environment), and any necessary plugins. Please refer to the documentation for those products for more information on installation or configuration.
**INSTRUCTIONS NOT YET COMPLETE**
1. Use `vagrant box add` to install a 64-bit Ubuntu 14.04 Vagrant box. If you are a VMware Fusion user, I have a base box you can use for this purpose; to use my Ubuntu 14.04 x64 base box, add the box with `vagrant box add slowe/ubuntu-trusty-x64`. (In theory you should be able to use this Vagrant environment with VMware Workstation as well, but only VMware Fusion was tested.)
2. Copy the files from the `ovs-multi-br` directory of this repository (the "learning-tools" repository) to a directory on your system. You can clone the entire "learning-tools" repository (using `git clone`), or just download the specific files from the `ovs-multi-br` directory.
3. Edit `machines.yml` to ensure that the box specified in that file matches the Ubuntu 14.04 x64 base box you just installed and will be using. If you are using VMware Fusion (or VMware Workstation), specify the value on the "vmw_box" line. If you are using VirtualBox, specify the value for "vb_box". _I recommend that you do not change any other values in this file unless you know it is necessary._
4. From a terminal window, change into the directory where the files from this directory are stored and run `vagrant up` to bring up the VMs according to the instructions in `machines.yml` and `Vagrantfile`. (By default, it will create and power on a single VMs that will act as a KVM hypervisor.)
5. Run `vagrant ssh` to connect to the VM.
6. In the VM, run `sudo virsh net-create br0.xml` to create a Libvirt-based network that will connect VMs to the OVS bridge named "br0". After that completes, run `sudo virsh net-create br1.xml` to do the same for the OVS "br1" bridge.
7. Make three copies of the `cirros-0.3.2-x86_64-disk.img` file (this file was already downloaded by Ansible), and make note of the names. For these instructions, I'll assume the file names are `cirros1.img`, `cirros2.img`, and `cirros3.img`.
8. Now launch three KVM VMs using this command line:
sudo virt-install --name=cirros1 --ram=128 --vcpus=1 \
--disk path=./cirros1.img,format=qcow2 \
--import --network network:br0 --vnc
Repeat for the second VM:
sudo virt-install --name=cirros2 --ram=128 --vcpus=1 \
--disk path=./cirros2.img,format=qcow2 \
--import --network network:br1 --vnc
And again for the third VM:
sudo virt-install --name=cirros3 --ram=128 --vcpus=1 \
--disk path=./cirros3.img,format=qcow2 \
--import --network network:br1 --vnc
9. Determine the VNC display allocated to the new VM with this command (it should be `127.0.0.1:0`):
sudo virsh vncdisplay cirros1
10. While still logged into the Vagrant guest, enable SSH forwarding to the VM's VNC display by first pressing `~C`, then entering this command (this assumes the VNC display was 0; adjust the command if the output of the previous command was different):
-L 5910:127.0.0.1:5900
11. On your host system, point your VNC viewer to `127.0.0.1:5910` (or tell it to use display 10 on `127.0.0.1`). This will connect you to the console of the first CirrOS VM.
12. Log into the CirrOS VM using the credentials provided (username `cirros`, password `cubswin:)`, as noted on the screen).
13. Verify that you have received an IP address (typically assigned via DHCP) and that you have connectivity to hosts on the same subnet.
14. Repeat steps 9 through 13 for `cirros2` and `cirros3`, respectively. You should have network connectivity to the respective local subnets from each VM, but no connectivity between subnets.
Enjoy!