Skip to content

Instantly share code, notes, and snippets.

@venkataanil
Last active June 28, 2021 15:19
Show Gist options
  • Select an option

  • Save venkataanil/da7c62517cdfb458e46dcd444a203d6a to your computer and use it in GitHub Desktop.

Select an option

Save venkataanil/da7c62517cdfb458e46dcd444a203d6a to your computer and use it in GitHub Desktop.
curl -o rhos-release-latest.noarch.rpm http://download-node-02.eng.bos.redhat.com/rcm-guest/puddles/OpenStack/rhos-release/rhos-release-latest.noarch.rpm
yum install -y rhos-release-latest.noarch.rpm
rhos-release --help
rhos-release 16-director -p passed_phase2
yum update -y; reboot
=======================================
sudo yum install git gcc libffi-devel openssl-devel python3-virtualenv libselinux-python3 tmux -y
#install kvm and libvirt
sudo yum install qemu-kvm libvirt libvirt-python3 libguestfs-tools virt-install -y
#sudo yum install libguestfs libguestfs-tools-c libguestfs-tools-xfs python-lxml wget libselinux-python expect -y
sudo yum install libguestfs libguestfs-tools-c python3-lxml wget libselinux-python3 expect -y
systemctl enable libvirtd
systemctl start libvirtd
tmux new -s osp
useradd stack
passwd stack
echo "stack ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/stack
chmod 0440 /etc/sudoers.d/stack
su - stack
ssh-keygen
create authorized_keys and add stack user public key in authorized_keys
sudo cp -r ~/.ssh /root/
git clone https://github.com/redhat-openstack/infrared.git
cd infrared
virtualenv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools
pip install .
infrared plugin add all
# undercloud, controller VMs, compute is baremetal
cp plugins/virsh/defaults/topology/network/4_nets_3_bridges_hybrid.yml ~/5_nets_4_bridges_hybrid.yml
#And edit it like below
cat ~/5_nets_4_bridges_hybrid.yml
---
networks:
net1:
name: br-ctlplane
forward: bridge
nic: eno2
ip_address: 192.168.24.150
netmask: 255.255.255.0
net2:
name: br-isolate
forward: bridge
nic: eno1
net3:
name: br-tenant
forward: bridge
nic: ens7f0
net4:
name: br-external
forward: bridge
nic: ens7f1
net5:
external_connectivity: yes
name: "management"
ip_address: "172.16.0.1"
netmask: "255.255.255.0"
forward: nat
dhcp:
range:
start: "172.16.0.2"
end: "172.16.0.100"
subnet_cidr: "172.16.0.0/24"
subnet_gateway: "172.16.0.1"
floating_ip:
start: "172.16.0.101"
end: "172.16.0.150"
nodes:
undercloud:
interfaces:
- network: "br-ctlplane"
bridged: yes
- network: "br-isolate"
bridged: yes
- network: "br-tenant"
bridged: yes
- network: "br-external"
bridged: yes
- network: "management"
external_network:
network: "management"
controller:
interfaces:
- network: "br-ctlplane"
bridged: yes
- network: "br-isolate"
bridged: yes
- network: "br-tenant"
bridged: yes
- network: "br-external"
bridged: yes
- network: "management"
external_network:
network: "management"
cp -r ~/infrared/plugins/tripleo-overcloud/vars/deployment/files/virt_4nics ~/
1. Remove linux bond from virt_4nics/network/four-nics-vlans/compute.yaml.j2
2. Remove ControlPlaneDefaultRoute
ir virsh --host-address=<ip_address> --topology-nodes undercloud:1,controller:1 --host-key ~/.ssh/id_rsa --host-memory-overcommit True --image-url http://download.eng.pek2.redhat.com/released/RHEL-8/8.2.0/BaseOS/x86_64/images/rhel-guest-image-8.2-290.x86_64.qcow2 --topology-network ~/5_nets_4_bridges_hybrid.yml -vv 2>&1 | tee log_virsh1
infrared tripleo-undercloud --version 16.1 --build passed_phase2 --images-task rpm --images-update no -vv
Add only baemetal nodes to ~/overcloud_instackenv.json
Add "name": "compute-0" in this ~/overcloud_instackenv.json as we will be using "--specific-node-ids" in the below command
ir tripleo-overcloud --version 16.1 --introspect yes --tagging no --deploy no --network-protocol ipv4 --network-backend 'geneve,vlan' --network-ovn true --overcloud-templates=nova-resize-on-the-same-host,octavia,l3_fip_qos --specific-node-ids true --hybrid ~/overcloud_instackenv.json --deployment-files ~/virt_4nics -vv 2>&1 | tee log_oc2
#undercloud, controller and compute all are VMs
ir virsh --host-address=<ip_address> --topology-nodes undercloud:1,controller:1,compute:1 --host-key ~/.ssh/id_rsa --host-memory-overcommit True --image-url http://download.eng.pek2.redhat.com/released/RHEL-8/8.2.0/BaseOS/x86_64/images/rhel-guest-image-8.2-290.x86_64.qcow2 --topology-network 4_nets -vv
infrared tripleo-undercloud --version 16.1 --build passed_phase2 --images-task rpm --images-update no -vv
ir tripleo-overcloud --version 16.1 --introspect yes --tagging yes --deploy yes --network-protocol ipv4 --network-backend 'geneve,vlan' --network-ovn true --overcloud-templates=nova-resize-on-the-same-host,octavia,l3_fip_qos --deployment-files virt_4nics -vv 2>&1 | tee log_oc2
#infrared virsh --host-address f04-h02-000-1029u.rdu2.scalelab.redhat.com --host-key ~/.ssh/id_rsa --topology-nodes controller:3,compute:100 --topology-network ~/4_nets_multi_hypervisor_1029u.yml --host-memory-overcommit True
plugins/virsh
infrared virsh --generate-answers-file virsh_prov.ini
Add below to vish_pov.ini
[virsh]
host-key = ~/.ssh/id_rsa
host-address = <hostname my.host.address>
topology-nodes = undercloud:1,controller:1,compute:2
host-user = root
# note don't add below disk-poll line if your "/" directory has sufficient space i.e > 400GB
# disk-pool = /home/stack/infrared/images
host-memory-overcommit = True
update ./infrared/plugins/virsh/defaults/topology/nodes/controller.yml, compute.yml and undercloud.yml with below settings
cpu: "4"
memory: "16384"
disks:
disk1:
# note don't add below path line if your "/" directory has sufficient space i.e > 400GB
path: "/home/stack/infrared/images"
size: "40G"
./infrared/plugins/tripleo-undercloud/vars/topology/undercloud.yml
add hostname in /etc/hostname
infrared virsh --from-file=virsh_prov.ini
infrared plugin add plugins/tripleo-undercloud
infrared tripleo-undercloud --version 13 --images-task rpm
infrared plugin add plugins/tripleo-overcloud
infrared tripleo-overcloud --deployment-files virt --version 13 --introspect yes --tagging yes --deploy yes
================== check for deployment =======================
[root@gprfc050 ~]# su - stack
Last login: Fri Mar 1 01:41:54 EST 2019 on pts/2
[stack@gprfc050 ~]$ ls
infrared
[stack@gprfc050 ~]$ cd infrared/
[stack@gprfc050 infrared]$ ls
ansible.cfg docs infrared.cfg.example Makefile releasenotes setup.py tox-check-any_errors_fatal.py tox.ini
ansible.cfg.example etc ir-commands.log plugins requirements.txt test-requirements.txt tox-check-plugin_registry.py virsh_prov.ini
ansible-template.cfg infrared LICENSE README.rst setup.cfg tests tox-gate.sh
[stack@gprfc050 infrared]$ source .venv/bin/activate
(.venv) [stack@gprfc050 infrared]$ ls
ansible.cfg docs infrared.cfg.example Makefile releasenotes setup.py tox-check-any_errors_fatal.py tox.ini
ansible.cfg.example etc ir-commands.log plugins requirements.txt test-requirements.txt tox-check-plugin_registry.py virsh_prov.ini
ansible-template.cfg infrared LICENSE README.rst setup.cfg tests tox-gate.sh
(.venv) [stack@gprfc050 infrared]$ virsh list
Id Name State
----------------------------------------------------
(.venv) [stack@gprfc050 infrared]$ sudo virsh list
Id Name State
----------------------------------------------------
2 undercloud-0 running
8 compute-0 running
9 controller-0 running
(.venv) [stack@gprfc050 infrared]$ ir
usage: ir [-h] [--version] [--no-log-commands]
{workspace,plugin,ssh,virsh,tripleo-undercloud,tripleo-overcloud}
...
ir: error: too few arguments
(.venv) [stack@gprfc050 infrared]$ ir ssh undercloud-0
[WARNING]: Found both group and host with same name: hypervisor
Warning: Permanently added 'gprfc050.sbu.lab.eng.bos.redhat.com,10.16.154.147' (ECDSA) to the list of known hosts.
Warning: Permanently added '172.16.0.84' (ECDSA) to the list of known hosts.
Last login: Fri Mar 1 04:52:35 2019 from 172.16.0.1
[stack@undercloud-0 ~]$ ls
container_images.yaml hiera_override.yaml overcloud_deploy.sh stackrc undercloud_deploy.sh virt
core_puddle_version instackenv.json overcloud_install.log tempest-deployer-input.conf undercloud_install.log
deploy_info.sh overcloud_deployment_64.log overcloudrc undercloud.conf undercloud-passwords.conf
[stack@undercloud-0 ~]$ source stackrc
(undercloud) [stack@undercloud-0 ~]$ nova list
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
| e8ea48c1-5cbb-433c-8d1b-5c7ce6cb1f0a | compute-0 | ACTIVE | - | Running | ctlplane=192.168.24.14 |
| f88819d9-4bc1-4738-af4d-8cb9e076807b | controller-0 | ACTIVE | - | Running | ctlplane=192.168.24.9 |
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
(undercloud) [stack@undercloud-0 ~]$ source overcloudrc
(overcloud) [stack@undercloud-0 ~]$ neutron net-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
(overcloud) [stack@undercloud-0 ~]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment