Skip to content

Instantly share code, notes, and snippets.

@radut
Forked from lbragstad/bgmccollum-directions
Created August 19, 2023 00:46
Show Gist options
  • Save radut/a32f987214a5c2b11a928c5697cea69c to your computer and use it in GitHub Desktop.
Save radut/a32f987214a5c2b11a928c5697cea69c to your computer and use it in GitHub Desktop.
Deploying OpenStack Queens with OpenStack-Ansible (Manual)
# git clone https://git.openstack.org/openstack/openstack-ansible /opt/openstack-ansible
# cd /opt/openstack-ansible
# git checkout 17.0.7
# scripts/bootstrap-ansible.sh
# scripts/bootstrap-aio.sh
# cd /opt/openstack-ansible/playbooks
# openstack-ansible setup-hosts.yml
# openstack-ansible setup-infrastructure.yml
# openstack-ansible setup-openstack.yml
# Decide a Range of IP Address Your Router Will Manage, and a Range of IP Address Neutron Will Manage
# Adjust To Accomodate For Any Static Assignments (Such as 192.168.1.1 for Your Router)
# Ensure These IP Address Ranges, and Any Static Assignments Do Not Overlap
#
# For Example:
#
# Home Network Subnet: 192.168.1.0/24
# Router Static: 192.168.1.1
# Laptop Static: 192.168.1.2
# OSA-AIO Static: 192.168.1.3
# Router DHCP Range: 192.168.1.4-199
# Neutron Allocation Pool: 192.168.1.200-249
#
# Re-Configure Router DHCP Range Settings (refer to manufacturers documentation)
# If Something Is Using an IP Address from Neutron Allocation Pool, Release / Renew DHCP or Reboot Device
# An IP Address from Your Router Updated DHCP Range Should Be Assigned
# From OSA-AIO Host, Attach to Utility Container
lxc-attach -n `lxc-ls -1 | grep util`
# Source Admin Credentials
source ~/openrc
# Observe Neutron Resources Created by Tempest
openstack network list
+--------------------------------------+---------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+---------+--------------------------------------+
| 8d0d3da7-2dcd-4ddc-9f69-c62e18d9540c | public | da2100a9-bcac-4d67-848b-f451aa1779b3 |
| ec436c94-fc2b-4640-a52a-6e38ee8e728c | private | 3a996849-6b66-4d6e-bf38-40e056331fe6 |
+--------------------------------------+---------+--------------------------------------+
openstack subnet list
+--------------------------------------+----------------+--------------------------------------+-----------------+
| ID | Name | Network | Subnet |
+--------------------------------------+----------------+--------------------------------------+-----------------+
| 3a996849-6b66-4d6e-bf38-40e056331fe6 | private-subnet | ec436c94-fc2b-4640-a52a-6e38ee8e728c | 192.168.74.0/28 |
| da2100a9-bcac-4d67-848b-f451aa1779b3 | public-subnet | 8d0d3da7-2dcd-4ddc-9f69-c62e18d9540c | 172.29.248.0/22 |
+--------------------------------------+----------------+--------------------------------------+-----------------+
openstack router list
+--------------------------------------+--------+--------+-------+-------------+-------+----------------------------------+
| ID | Name | Status | State | Distributed | HA | Project |
+--------------------------------------+--------+--------+-------+-------------+-------+----------------------------------+
| 9dd5445c-aa72-4c4a-b5f8-6c2659a80da5 | router | ACTIVE | UP | False | False | 108ce416d8374beeb3b5dbeb0943710a |
+--------------------------------------+--------+--------+-------+-------------+-------+----------------------------------+
# Delete Neutron Resouces Created by Tempest
openstack router unset --external-gateway router
openstack router remove subnet router private-subnet
openstack router delete router
openstack network delete public
openstack network delete private
# Exit Back to OSA-AIO Host
exit
# Find primary network interface (eth0, ens3, etc...)
PRIMARY_INTERFACE=`awk '/ -A POSTROUTING -o / { print $8 }' /etc/network/interfaces.d/osa_interfaces.cfg`
echo $PRIMARY_INTERFACE
# Move IP Configuration (Address, Netmask, Gateway, and DNS Name Servers) of $PRIMARY_INTERFACE to br-vlan
# Edit: /etc/network/interfaces (Interfaces File and Primary Interface Name May Differ)
=== REPLACE ===
auto eth0
iface eth0 inet manual
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
=== WITH ===
auto eth0
iface eth0 inet manual
=== END REPLACE ===
# Edit: /etc/network/interfaces.d/osa_interfaces.cfg
=== REPLACE ===
# Add an additional address to br-vlan
iface br-vlan inet static
address 172.29.248.1
netmask 255.255.252.0
=== WITH ===
# Add an additional address to br-vlan
iface br-vlan inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
=== END REPLACE ===
# Add $PRIMARY_INTERFACE to bridge_ports for br-vlan...
# Edit: /etc/network/interfaces.d/osa_interfaces.cfg
=== REPLACE ===
bridge_ports br-vlan-veth
=== WITH ===
bridge_ports br-vlan-veth eth0
=== END REPLACE ===
# Prevent IPTables Rules Providing NAT and Checksum Filling From Being Created
# Edit: /etc/network/interfaces.d/osa_interfaces.cfg
=== DELETE ===
# To ensure ssh checksum is correct
up /sbin/iptables -A POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
down /sbin/iptables -D POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
# To provide internet connectivity to instances
up /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
down /sbin/iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
=== END DELETE ===
# Delete Active IPTables Rules Providing NAT and Checksum Filling
iptables -t nat -D POSTROUTING -o $PRIMARY_INTERFACE -j MASQUERADE
iptables -D POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
# Reboot OSA-AIO Host to Apply Newtork Configuration Changes
reboot
# From "Laptop" Ensure OSA-AIO Host is Reachable
ping -c 3 192.168.1.3
ssh [email protected]
# From OSA-AIO Host, Attach to Utility Container
lxc-attach -n `lxc-ls -1 | grep util`
# Source Admin Credentials
source ~/openrc
# Create Neutron Resources
openstack network create --share --provider-network-type flat --provider-physical-network flat home
subnet create --subnet-range 192.168.1.0/24 --allocation-pool start=192.168.1.200,end=192.168.1.249 --dns-nameserver 192.168.1.1 --gateway 192.168.1.1 --no-dhcp --network home home-subnet
# Create Instance with Config Drive (Adjust Security Groups as Necessary to allow SSH and Ping)
openstack server create --image ubuntu --flavor m1.small --network home --config-drive True --key-name keypair instance
openstack server list
+--------------------------------------+----------+--------+--------------------+--------+----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+----------+--------+--------------------+--------+----------+
| b3d4f2fc-609d-49f3-9a13-2bd226c00a95 | instance | ACTIVE | home=192.168.1.205 | ubuntu | m1.small |
+--------------------------------------+----------+--------+--------------------+--------+----------+
# Exit Back to OSA-AIO Host
exit
# From "Laptop"
ping -c 3 192.168.1.205
ssh -i keypair.pem [email protected]
# ip link set eno1 down
# ip link set eno1 name eth1
# ip link set rename3 down
# ip link set rename3 name eth0
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth1
iface eth1 inet manual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment