Fix 2 for moving ips to be static
[genesis.git] / foreman / ci / README.md
1 # Foreman/QuickStack Automatic Deployment README
2
3 A simple bash script (deploy.sh) will provision out a Foreman/QuickStack VM Server and 4-5 other baremetal or VM nodes in an OpenStack HA + OpenDaylight environment.
4
5 ##Pre-Requisites
6 ####Baremetal:
7 * At least 5 baremetal servers, with 3 interfaces minimum, all connected to separate VLANs
8 * DHCP should not be running in any VLAN. Foreman will act as a DHCP server.
9 * On the baremetal server that will be your JumpHost, you need to have the 3 interfaces configured with IP addresses
10 * On baremetal JumpHost you will need an RPM based linux (CentOS 7 will do) with the kernel up to date (yum update kernel) + at least 2GB of RAM
11 * Nodes will need to be set to PXE boot first in priority, and off the first NIC, connected to the same VLAN as NIC 1 * of your JumpHost
12 * Nodes need to have BMC/OOB management via IPMI setup
13 * Internet access via first (Admin) or third interface (Public)
14 * No other hypervisors should be running on JumpHost
15
16 ####VM Nodes:
17 * JumpHost with 3 interfaces, configured with IP, connected to separate VLANS
18 * DHCP should not be running in any VLAN.  Foreman will act as a DHCP Server
19 * On baremetal JumpHost you will need an RPM based linux (CentOS 7 will do) with the kernel up to date (yum update kernel) + at least 24GB of RAM
20 * Internet access via the first (Admin) or third interface (Public)
21 * No other hypervisors should be running on JumpHost
22
23 ##How It Works
24
25 ###deploy.sh:
26
27 * Detects your network configuration (3 or 4 usable interfaces)
28 * Modifies a “ksgen.yml” settings file and Vagrantfile with necessary network info
29 * Installs Vagrant and dependencies
30 * Downloads Centos7 Vagrant basebox, and issues a “vagrant up” to start the VM
31 * The Vagrantfile points to bootstrap.sh as the provisioner to takeover rest of the install
32
33 ###bootstrap.sh:
34
35 * Is initiated inside of the VM once it is up
36 * Installs Khaleesi, Ansible, and Python dependencies
37 * Makes a call to Khaleesi to start a playbook: opnfv.yml + “ksgen.yml” settings file
38
39 ###Khaleesi (Ansible):
40
41 * Runs through the playbook to install Foreman/QuickStack inside of the VM
42 * Configures services needed for a JumpHost: DHCP, TFTP, DNS
43 * Uses info from “ksgen.yml” file to add your nodes into Foreman and set them to Build mode
44
45 ####Baremetal Only:
46 * Issues an API call to Foreman to rebuild all nodes
47 * Ansible then waits to make sure nodes come back via ssh checks
48 * Ansible then waits for puppet to run on each node and complete
49
50 ####VM Only:
51 * deploy.sh then brings up 5 more Vagrant VMs
52 * Checks into Foreman and tells Foreman nodes are built
53 * Configures and starts puppet on each node
54
55 ##Execution Instructions
56
57 * On your JumpHost, clone 'git clone https://github.com/trozet/bgs_vagrant.git' to as root to /root/
58
59 ####Baremetal Only:
60 * Edit opnvf_ksgen_settings.yml → “nodes” section:
61
62   * For each node, compute, controller1..3:
63     * mac_address - change to mac_address of that node's Admin NIC (1st NIC)
64     * bmc_ip - change to IP of BMC (out-of-band) IP
65     * bmc_mac - same as above, but MAC address
66     * bmc_user - IPMI username
67     * bmc_pass - IPMI password
68
69   * For each controller node:
70     * private_mac - change to mac_address of node's Private NIC (2nd NIC)
71
72 * Execute deploy.sh via: ./deploy.sh -base_config /root/bgs_vagrant/opnfv_ksgen_settings.yml
73
74 ####VM Only:
75 * Execute deploy.sh via: ./deploy.sh -virtual
76 * Install directory for each VM will be in /tmp (for example /tmp/compute, /tmp/controller1)
77
78 ####Both Approaches:
79 * Install directory for foreman-server is /tmp/bgs_vagrant/ - This is where vagrant will be launched from automatically
80 * To access the VM you can 'cd /tmp/bgs_vagrant' and type 'vagrant ssh'
81 * To access Foreman enter the IP address shown in 'cat /tmp/bgs_vagrant/opnfv_ksgen_settings.yml | grep foreman_url'
82 * The user/pass by default is admin//octopus
83
84 ##Redeploying
85 Make sure you run ./clean.sh for the baremetal deployment with your opnfv_ksgen_settings.yml file as "-base_config".  This will ensure that your nodes are turned off and that your VM is destroyed ("vagrant destroy" in the /tmp/bgs_vagrant directory).
86 For VM redeployment, make sure you "vagrant destroy" in each /tmp/<node> as well if you want to redeploy.  To check and make sure no VMs are still running on your Jumphost you can use "vboxmanage list runningvms".