###### tags: `Documentation`
# Tripleo Standalone Manual Deployment
Documenting working steps for Tripleo Manual Standalone Deployment for master(Usurri) branch.
- This documentation cover both ceph and non-ceph based deployment.
---
## System Requirement
- At least 8GB of RAM, 4 vCPU and 80GB of disk, 2 NICs and CentOS8(For master(Ussuri) branch). Your system must have two network interfaces and a base operating system installed.
---
## Example network configuration:-
- First nic assigned to the default network 192.168.122.0/24
- Second nic assigned to the management network 192.168.25.0/24
You can define management n/w on KVM host:-
~~~
# cat << EOF > /tmp/management.xml
<network>
<name>management</name>
<ip address="192.168.25.250" netmask="255.255.255.0"/>
</network>
EOF
#virsh net-define /tmp/management.xml
# virsh net-start management
# virsh net-autostart management
~~~
---
## Prerequisites
- Before you deploy Standalone deployment, ensure that your system is up to date and install necessary packages:-
~~~
[root@all-in-one]# dnf update
[root@all-in-one]# dnf install -y dnf-utils
[root@all-in-one]# dnf install network-scripts
~~~
# :bulb:
FYI.. Network scripts are deprecated in Red Hat Enterprise Linux/Centos 8.
https://www.golinuxcloud.com/unit-network-service-not-found-rhel-8-linux/
- Faced an issue during network service start(service failed to start) because of conflict b/w network service and NetworkManager during task which ensure network service is enabled.
~~~
TASK [tripleo_bootstrap : Deploy network-scripts required for deprecated network service] ***
TASK [tripleo_bootstrap : Ensure network service is enabled] *******************
~~~
Workaround better manually install network-scripts in intitial step and configure static IP on first interface(enp1s0 is as per my lab, use interface name according to environment).
~~~
[root@all-in-one]# cat /etc/sysconfig/network-scripts/ifcfg-enp1s0
TYPE="Ethernet"
BOOTPROTO="static"
NAME="enp1s0"
UUID="ac3f313b-1a24-474a-b583-b040bba52077"
DEVICE="enp1s0"
ONBOOT="yes"
IPADDR=192.168.122.87
NETMASK=255.255.255.0
GATEWAY=192.168.122.1
DNS1=192.168.122.1
NM_CONTROLLED=no
~~~
~~~
[root@all-in-one]# systemctl start network
[root@all-in-one]# systemctl enable network
~~~
~~~
[root@all-in-one]$ reboot
~~~
---
## Preparation for deployment
Before you can begin configuring, deploying, and testing your all-in-one environment, you must configure a non-root user and install the necessary packages and dependencies:
- **Create a non-root user** on the standalone host:
~~~
[root@all-in-one]# useradd stack
~~~
- Set the **password for the stack user**:
~~~
[root@all-in-one]# passwd stack
~~~
- **Disable password requirements** when using sudo as the stack user:
~~~
[root@all-in-one]# echo "stack ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/stack
[root@all-in-one]# chmod 0440 /etc/sudoers.d/stack
~~~
- **Ensure a fully qualified hostname has been configured** on the host being deployed on. For example:
~~~
sudo hostnamectl set-hostname standalone.localdomain
sudo hostnamectl set-hostname standalone.localdomain --transient
~~~
- Log in as the non-root user on the all-in-one host:
~~~
$ ssh stack@<all-in-one>
~~~
- Download and install the latest python3-tripleo-repos RPM from the current-tripleo RDO repository.
From here: https://trunk.rdoproject.org/centos8-master/component/tripleo/current-tripleo/
~~~
[stack@all-in-one]$ sudo dnf install -y https://trunk.rdoproject.org/centos8-master/component/tripleo/current/python3-tripleo-repos-0.0.1-0.20200403215916.b361925.el8.noarch.rpm
~~~
- Run tripleo-repos to install the appropriate repositories.
**Non Ceph**
~~~
[stack@all-in-one]$ sudo -E tripleo-repos current-tripleo-dev
~~~
**With Ceph**
~~~
[stack@all-in-one]$ sudo -E tripleo-repos current-tripleo-dev ceph
~~~
- Install the TripleO command line interface (CLI):
~~~
[stack@all-in-one]$ sudo dnf install -y python3-tripleoclient
~~~
---
### Ceph only steps preparation steps(Don't execute if you don't want ceph)
- Install the packages necessary to deploy Ceph.
~~~
stack@standalone ~]$ sudo dnf install -y ceph-ansible util-linux lvm2
~~~
- Create a block device with logical volumes to be used as an OSD.
~~~
sudo dd if=/dev/zero of=/var/lib/ceph-osd.img bs=1 count=0 seek=7G
sudo losetup /dev/loop3 /var/lib/ceph-osd.img
sudo pvcreate /dev/loop3
sudo vgcreate vg2 /dev/loop3
sudo lvcreate -n data-lv2 -l 597 vg2
sudo lvcreate -n db-lv2 -l 597 vg2
sudo lvcreate -n wal-lv2 -l 597 vg2
~~~
- Create a systemd service that restores the device on startup.
~~~
cat <<EOF > /tmp/ceph-osd-losetup.service
[Unit]
Description=Ceph OSD losetup
After=syslog.target
[Service]
Type=oneshot
ExecStart=/bin/bash -c '/sbin/losetup /dev/loop3 || \
/sbin/losetup /dev/loop3 /var/lib/ceph-osd.img ; partprobe /dev/loop3'
ExecStop=/sbin/losetup -d /dev/loop3
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
~~~
- To persist the change across reboot enable the ceph-osd-losetup.service
~~~
stack@standalone ~]$ sudo mv /tmp/ceph-osd-losetup.service /etc/systemd/system/
stack@standalone ~]$ sudo systemctl enable ceph-osd-losetup.service
~~~
- Create a directory to back up the ceph-ansible fetch directory.
~~~
stack@standalone ~]$ sudo mkdir /root/ceph_ansible_fetch
~~~
---
### Template Preparation:
##### Things to note for template prepration:-
- You must configure the DnsServers parameter in templates with your DNS address. You can find this address in the /etc/resolv.conf file:-
~~~
stack@standalone ~]$ cat /etc/resolv.conf
192.168.122.1
~~~
- **Find the correct second interface name**(naming is not always eth* based). for eg: enp2s0 in below snippet:-
~~~
stack@standalone ~]$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:ac:65:43 brd ff:ff:ff:ff:ff:ff
3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master ovs-system state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:c3:39:84 brd ff:ff:ff:ff:ff:ff
~~~
- Use the NtpServer parameter to define the time source that you want to use:
~~~
NtpServer: clock.redhat.com
~~~
- If you want to use the standalone in a virtual environment, you must define the virtualization type with the StandaloneExtraConfig parameter:
~~~
StandaloneExtraConfig:
NovaComputeLibvirtType: qemu
~~~
---
### Preperation for installation:
##### Generating YAML files for the Standalone deployment
- Generate the containers-prepare-parameters.yaml file that contains the default ContainerImagePrepare parameters:
~~~
$ openstack tripleo container image prepare default --output-env-file $HOME/containers-prepare-parameters.yaml
~~~
- Export the environment variables that the deployment command uses. In this example, deploy the standalone environment with the **enp2s0** interface that has the IP address **192.168.25.2** on the management network:
~~~
stack@standalone ~]$ export IP=192.168.25.2
stack@standalone ~]$ export NETMASK=24
stack@standalone ~]$ export INTERFACE=enp2s0
~~~
- Create the $HOME/standalone_parameters.yaml file and configure basic parameters for your all-in-one Red Hat OpenStack Platform environment, including network configuration and some deployment options. In this example, network interface enp2s0 is the interface on the management network that you use to deploy OpenStack. enp2s0 has the IP address 192.168.25.2:
~~~
stack@standalone ~]$ cat <<EOF > $HOME/standalone_parameters.yaml
parameter_defaults:
CloudName: $IP
ControlPlaneStaticRoutes: []
Debug: true
DeploymentUser: $USER
DnsServers:
- 192.168.122.1
- 1.1.1.1
- 8.8.8.8
DockerInsecureRegistryAddress:
- $IP:8787
NeutronPublicInterface: $INTERFACE
NeutronDnsDomain: localdomain
NeutronBridgeMappings: datacentre:br-ctlplane
NeutronPhysicalBridge: br-ctlplane
StandaloneEnableRoutedNetworks: false
StandaloneHomeDir: $HOME
StandaloneLocalMtu: 1500
NtpServer: clock.redhat.com
StandaloneExtraConfig:
NovaComputeLibvirtType: qemu
EOF
~~~
---
### Ceph only steps (Generating YAML files for ceph)
* Create an additional environment file which directs ceph-ansible to use the block device with logical volumes and fecth directory backup created earlier. In the same file pass additional Ceph parameters for the OSD scenario and Ceph networks. Set the placement group and replica count to values which fit the number of OSDs being used, e.g. 32 and 1 are used for testing with only one OSD.
~~~
cat <<EOF > $HOME/ceph_parameters.yaml
parameter_defaults:
CephAnsibleDisksConfig:
osd_scenario: lvm
osd_objectstore: bluestore
lvm_volumes:
- data: data-lv2
data_vg: vg2
db: db-lv2
db_vg: vg2
wal: wal-lv2
wal_vg: vg2
LocalCephAnsibleFetchDirectoryBackup: /root/ceph_ansible_fetch
CephAnsibleExtraConfig:
cluster_network: 192.168.25.0/24
public_network: 192.168.25.0/24
CephPoolDefaultPgNum: 32
CephPoolDefaultSize: 1
EOF
~~~
---
### Execute the Deployment(Non Ceph)
- Run the deploy command. Ensure that you include all .yaml files relevant to your environment:
~~~
[stack@standalone ~]$ sudo openstack tripleo deploy \
--templates \
--local-ip=$IP/$NETMASK \
-e /usr/share/openstack-tripleo-heat-templates/environments/standalone/standalone-tripleo.yaml \
-r /usr/share/openstack-tripleo-heat-templates/roles/Standalone.yaml \
-e $HOME/containers-prepare-parameters.yaml \
-e $HOME/standalone_parameters.yaml \
--output-dir $HOME \
--standalone
~~~
### Ceph based deployment
Include the Ceph environment files in the deploy command:
~~~
sudo openstack tripleo deploy \
--templates \
--local-ip=$IP/$NETMASK \
-e /usr/share/openstack-tripleo-heat-templates/environments/standalone/standalone-tripleo.yaml \
-e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible.yaml \
-r /usr/share/openstack-tripleo-heat-templates/roles/Standalone.yaml \
-e $HOME/containers-prepare-parameters.yaml \
-e $HOME/standalone_parameters.yaml \
-e $HOME/ceph_parameters.yaml \
--output-dir $HOME \
--standalone
~~~
---
### Postchecks
- After a successful deployment, you can use the clouds.yaml configuration file in the /home/$USER/.config/openstack directory to query and verify the OpenStack services:
~~~
[stack@all-in-one]$ export OS_CLOUD=standalone
[stack@all-in-one]$ openstack endpoint list
~~~
---
### References
<!-- Put the link to this slide here so people can follow -->
RHOSP 16 OSP Doc: https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.0/html-single/
Upstream Docs: https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/deployment/standalone.html
Emilien Doc: https://my1.fr/blog/developer-workflow-with-tripleo/
Wesley Ansible Doc: https://gitlab.cee.redhat.com/whayutin/ansible-kvm-vm
---
### Other Related Links
https://hackmd.io/OAoW3fJkR72u5n-MTTBRzA?view#Deploy-standalone-using-tripleo-operator-ansible
### Thank you! :sheep: