Colorado bug fix: ci path did not change
[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. Enroll the servers: ansible-playbook -vvv -i inventory/bifrost_inventory.py enroll-dynamic.yaml -e @/etc/bifrost/bifrost_global_vars
30  4. Deploy the servers:  ansible-playbook -vvv -i inventory/bifrost_inventory.py deploy-dynamic.yaml -e @/etc/bifrost/bifrost_global_vars
31  5. Wait until they are on **active** state, check it with: ironic node-list
32
33 In case of some server needing to be redeployed, you can reset it and redeploy again with:
34
35  1. ironic node-set-provision-state <name_of_server> deleted
36  2. Wait and check with ironic node-list until the server is on **available** state
37  3. Redeploy again: ansible-playbook -vvv -i inventory/bifrost_inventory.py deploy-dynamic.yaml -e @/etc/bifrost/bifrost_global_vars
38
39 Deploy baremetal servers
40 --------------------------
41 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.
42 On each of those, follow that steps:
43
44  1. ssh from the bifrost controller to their external ips: ssh root@172.30.13.90
45  2. cd /opt, clone releng project (git clone https://gerrit.opnfv.org/gerrit/releng)
46  3. Copy hiera to the right folder ( cp hiera/common_baremetal.yaml /var/lib/hiera/common.yaml)
47  4. Install modules: ./install_modules.sh
48  5. Apply puppet: puppet apply manifests/site.pp --modulepath=/etc/puppet/modules:/opt/releng/prototypes/puppet-infracloud/modules
49
50 Once this has been done on controller and compute, you will have a working cloud. To start working with it, follow that steps:
51
52  1. Ensure that controller00.opnfvlocal resolves properly to the external IP (this is already done in the bifrost controller)
53  2. Copy releng/prototypes/puppet-infracloud/creds/clouds.yaml to $HOME/.config/openstack/clouds.yaml
54  3. Install python-openstackclient
55  4. Specify the cloud you want to use: export OS_CLOUD=opnfvlocal
56  5. Now you can start operating in your cloud with openstack-client: openstack flavor list
57