Skip to content

Instantly share code, notes, and snippets.

@shannonmitchell
Created September 26, 2019 20:41
Show Gist options
  • Save shannonmitchell/6a7c6555b59ca754840183a01a6f7894 to your computer and use it in GitHub Desktop.
Save shannonmitchell/6a7c6555b59ca754840183a01a6f7894 to your computer and use it in GitHub Desktop.
Basic tripleo-quickstart
###############################################
# Set up tripleo-quickstart test environment
###############################################
# Download the quickstart script
git clone https://github.com/openstack/tripleo-quickstart
cd tripleo-quickstart
# Install some deps not done with the installer
yum -y install tmux
yum -y groupinstall "Development Tools"
# Install requirements
tmux
./quickstart.sh --install-deps
# Set up the layout
cat <<EOF > config/nodes/3ctlr_2comp.yml
node_count: 5
enable_pacemaker: true
run_tempest: true
overcloud_nodes:
- name: control_0
flavor: control
virtualbmc_port: 6230
- name: control_1
flavor: control
virtualbmc_port: 6231
- name: control_2
flavor: control
virtualbmc_port: 6232
- name: compute_0
flavor: compute
virtualbmc_port: 6233
- name: compute_1
flavor: compute
virtualbmc_port: 6234
topology_map:
Controller:
scale: 3
Compute:
scale: 2
EOF
# Set up root to be able to login into itself with ssh keys
ssh-keygen
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
# Start it in a tmux session
tmux
./quickstart.sh --no-clone --teardown all --clean \
--requirements quickstart-extras-requirements.txt \
--playbook quickstart-extras.yml \
--nodes config/nodes/3ctlr_2comp.yml \
--release queens \
127.0.0.2
# --tags all \
#### OUTPUT TAIL####
Access the undercloud by:
ssh -F /root/.quickstart/ssh.config.ansible undercloud
Follow the documentation in the link below to complete your deployment.
Note, by default only the undercloud has been installed.
https://docs.openstack.org/tripleo-docs/latest/install/basic_deployment/basic_deployment_cli.html#upload-images
For fully automated deployments please refer to:
https://docs.openstack.org/tripleo-quickstart/latest/getting-started.html
TripleO's cheat sheet is available at:
http://superuser.openstack.org/articles/new-tripleo-quick-start-cheatsheet/
#### END OUTPUT TAIL ####
# SSH into the undercloud box
ssh -F /root/.quickstart/ssh.config.ansible undercloud
# Check out: https://docs.openstack.org/tripleo-docs/latest/install/basic_deployment/basic_deployment_cli.html#upload-images
# (it looks like the images have been uploaded and the nodes registered to ironic already)
# Fix a naming issue with quickstart
cp /home/stack/containers-prepare-parameter.yaml /home/stack/containers-default-parameters.yaml
# Run the deploy
tmux
. stackrc
./overcloud-prep-containers.sh
# Enable PCS in place of keepalived by adding control-scale, puppet-macemaker and ntp-server arguments
vi overcloud-deploy.sh
...
l -e /home/stack/inject-trust-anchor.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/disable-telemetry.yaml --validation-warnings-fatal -e /home/stack/overcloud-topology-config.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/config-download-environment.yaml --config-download --verbose -e /home/stack/overcloud-selinux-config.yaml -e /usr/share/openstack-tripleo-heat-templates/ci/environments/ovb-ha.yaml \
--control-scale 3 \
-e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml \
--ntp-server pool.ntp.org \
"$@" && status_code=0 || status_code=$?
...
##############################################################
# Fix an issue with the tripleO quickstart controller routing
##############################################################
# The route for the br-ex looks off. I should have checked connectivity before to make
# sure the 192.168.23.0/24 is being routed out of the proper interface.
# From https://docs.openstack.org/tripleo-docs/latest/install/advanced_deployment/network_isolation.html
mkdir /home/stack/templates
openstack overcloud roles generate -o /home/stack/templates/roles_data.yaml Controller Compute CephStorage BlockStorage ObjectStorage
cp /usr/share/openstack-tripleo-heat-templates/network_data.yaml ~/templates/network_data.yaml
/usr/share/openstack-tripleo-heat-templates/tools/process-templates.py \
-p /usr/share/openstack-tripleo-heat-templates \
-r ~/templates/roles_data.yaml \
-n ~/templates/network_data.yaml \
-o ~/generated-openstack-tripleo-heat-templates --safe
mkdir /home/stack/templates/nic-configs
cp generated-openstack-tripleo-heat-templates/network/config/single-nic-vlans/controller.yaml /home/stack/templates/nic-configs/
vi /home/stack/network-environment.yaml
{
"resource_registry": {
"OS::TripleO::Controller::Net::SoftwareConfig": "/home/stack/templates/nic-configs/controller.yaml"
},
"parameter_defaults": {
"NetworkDeploymentActions": ['CREATE','UPDATE'],
"ControlPlaneDefaultRoute": "192.168.24.1",
"ControlPlaneSubnetCidr": "24",
"DnsServers": [
"8.8.8.8",
"8.8.4.4"
],
"EC2MetadataIp": "192.168.24.1",
"ExternalAllocationPools": [
{
"end": "10.0.0.250",
"start": "10.0.0.4"
}
],
"ExternalInterfaceDefaultRoute": "10.0.0.1",
"ExternalNetCidr": "10.0.0.1/24",
"NeutronExternalNetworkBridge": "",
"PublicVirtualFixedIPs": [
{
"ip_address": "10.0.0.5"
}
]
}
}
# Change the get_file and add the last two route lines in the proper places
vi /home/stack/templates/nic-configs/controller.yaml
...
get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh
params:
$network_config:
network_config:
- type: ovs_bridge
name: bridge_name
use_dhcp: false
dns_servers:
get_param: DnsServers
addresses:
- ip_netmask:
list_join:
- /
- - get_param: ControlPlaneIp
- get_param: ControlPlaneSubnetCidr
routes:
- ip_netmask: 169.254.169.254/32
next_hop:
get_param: EC2MetadataIp
- ip_netmask: 192.168.23.0/24
next_hop: 192.168.24.1
...
###########################
# Run the overcloud deploy
###########################
# Run the deploy script
./overcloud-deploy.sh
# Fix the damn /etc/hosts(how fucking hard would it be for redhat to automate this?)
sudo su -
. /home/stack/stackrc
openstack server list | awk '/overcloud/{print $8" "$4}' | sed -e 's/ctlplane=//g' | sed -e 's/overcloud-\(.*$\)/overcloud-\1 \1/g' >> /etc/hosts
#########################
# Running tempest tests
#########################
Using manual steps from here: https://docs.openstack.org/tripleo-docs/latest/install/basic_deployment/tempest.html
. /home/stack/overcloudrc
openstack role create --or-show Member
openstack network create public \
--external \
--provider-network-type flat \
--provider-physical-network datacentre
openstack subnet create ext-subnet \
--subnet-range 192.168.24.0/24 \
--allocation-pool start=192.168.24.150,end=192.168.24.250 \
--gateway 192.168.24.1 \
--no-dhcp \
--network public
sudo yum -y install openstack-tempest wget
tempest init tempest_workspace
tempest workspace list
cd /home/stack/tempest_workspace/
discover-tempest-config --out etc/tempest.conf \
--deployer-input ~/tempest-deployer-input.conf \
--network-id $(openstack network show public -f value -c id) \
--image http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img \
--debug \
--remove network-feature-enabled.api_extensions=dvr \
--create \
auth.use_dynamic_credentials true \
auth.tempest_roles Member \
network-feature-enabled.port_security true \
compute-feature-enabled.attach_encrypted_volume False \
network.tenant_network_cidr 192.168.0.0/24 \
compute.build_timeout 500 \
volume-feature-enabled.api_v1 False \
validation.image_ssh_user cirros \
validation.ssh_user cirros \
network.build_timeout 500 \
volume.build_timeout 500 \
object-storage-feature-enabled.discoverability False \
service_available.swift False \
compute-feature-enabled.console_output true \
orchestration.stack_owner_role Member
tempest cleanup --init-saved-state
tempest run --smoke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment