bug fix: typo in bottlenecks naming (reporting page)
[releng.git] / prototypes / puppet-infracloud / deploy_on_baremetal.md
1 How to deploy Infra Cloud on baremetal
2 ==================================
3
4 Install bifrost controller
5 --------------------------
6 First step for deploying Infra Cloud is to install the bifrost controller. This can be virtualized, doesn't need to be on baremetal.
7 To achieve that, first we can create a virtual machine with libvirt, with the proper network setup. This VM needs to share one physical interface (the PXE boot one), with the servers for the controller and compute nodes.
8 Please follow documentation on: [https://git.openstack.org/cgit/openstack/bifrost/tree/tools/virsh_dev_env/README.md](https://git.openstack.org/cgit/openstack/bifrost/tree/tools/virsh_dev_env/README.md) to get sample templates and instructions for creating the bifrost VM.
9
10 Once the **baremetal** VM is finished, you can login by ssh and start installing bifrost there. To proceed, follow this steps:
11
12  1. Change to root user, install git
13  2. Clone releng project (cd /opt, git clone https://gerrit.opnfv.org/gerrit/releng)
14  3. cd /opt/releng/prototypes/puppet-infracloud
15  4. Copy hiera to the right folder (cp hiera/common_baremetal.yaml /var/lib/hiera/common.yaml)
16  5. Ensure hostname is properly set ( hostnamectl set-hostname baremetal.opnfvlocal , hostname -f )
17  6. Install puppet and modules ( ./install_puppet.sh , ./install_modules.sh )
18  7. Apply puppet to install bifrost (puppet apply manifests/site.pp --modulepath=/etc/puppet/modules:/opt/releng/prototypes/puppet-infracloud/modules)
19
20  With these steps you will have a bifrost controller up and running.
21
22 Deploy baremetal servers
23 --------------------------
24 Once you have bifrost controller ready, you need to use it to start deployment of the baremetal servers.
25 On the same bifrost VM, follow these steps:
26
27  1. Source bifrost env vars: source /opt/stack/bifrost/env-vars
28  2. Export baremetal servers inventory:  export BIFROST_INVENTORY-SOURCE=/opt/stack/baremetal.json 
29  3. Change active directory: cd /opt/stack/bifrost/playbooks
30  3. Enroll the servers: ansible-playbook -vvv -i inventory/bifrost_inventory.py enroll-dynamic.yaml -e @/etc/bifrost/bifrost_global_vars
31  4. Deploy the servers:  ansible-playbook -vvv -i inventory/bifrost_inventory.py deploy-dynamic.yaml -e @/etc/bifrost/bifrost_global_vars
32  5. Wait until they are on **active** state, check it with: ironic node-list
33
34 In case of some server needing to be redeployed, you can reset it and redeploy again with:
35
36  1. ironic node-set-provision-state <name_of_server> deleted
37  2. Wait and check with ironic node-list until the server is on **available** state
38  3. Redeploy again: ansible-playbook -vvv -i inventory/bifrost_inventory.py deploy-dynamic.yaml -e @/etc/bifrost/bifrost_global_vars
39
40 Deploy baremetal servers
41 --------------------------
42 Once all the servers are on **active** state, they can be accessed by ssh and InfraCloud manifests can be deployed on them, to properly deploy a controller and a compute.
43 On each of those, follow that steps:
44
45  1. ssh from the bifrost controller to their external ips: ssh root@172.30.13.90
46  2. cd /opt, clone releng project (git clone https://gerrit.opnfv.org/gerrit/releng)
47  3. Copy hiera to the right folder ( cp hiera/common_baremetal.yaml /var/lib/hiera/common.yaml)
48  4. Install modules: ./install_modules.sh
49  5. Apply puppet: puppet apply manifests/site.pp --modulepath=/etc/puppet/modules:/opt/releng/prototypes/puppet-infracloud/modules
50
51 Once this has been done on controller and compute, you will have a working cloud. To start working with it, follow that steps:
52
53  1. Ensure that controller00.opnfvlocal resolves properly to the external IP (this is already done in the bifrost controller)
54  2. Copy releng/prototypes/puppet-infracloud/creds/clouds.yaml to $HOME/.config/openstack/clouds.yaml
55  3. Install python-openstackclient
56  4. Specify the cloud you want to use: export OS_CLOUD=opnfvlocal
57  5. Now you can start operating in your cloud with openstack-client: openstack flavor list
58