Skip to content

Instantly share code, notes, and snippets.

@fmount
Last active January 26, 2022 12:45
Show Gist options
  • Save fmount/16ee01733cc936588543d5a5e75b937a to your computer and use it in GitHub Desktop.
Save fmount/16ee01733cc936588543d5a5e75b937a to your computer and use it in GitHub Desktop.
Deploy a standalone OpenStack via TripleO
export IP=192.168.24.2
export NETMASK=24
export INTERFACE=eth1
function gen_cont {
openstack tripleo container image prepare default \
--output-env-file "$HOME"/containers-prepare-parameters.yaml
}
function gen_config {
cat <<EOF > "$HOME"/standalone_parameters.yaml
parameter_defaults:
CloudName: $IP
ControlPlaneStaticRoutes: []
Debug: true
DeploymentUser: $USER
DnsServers:
- 1.1.1.1
- 8.8.8.8
DockerInsecureRegistryAddress:
- $IP:8787
NeutronPublicInterface: $INTERFACE
# domain name used by the host
NeutronDnsDomain: localdomain
# re-use ctlplane bridge for public net, defined in the standalone
# net config (do not change unless you know what you're doing)
NeutronBridgeMappings: datacentre:br-ctlplane
NeutronPhysicalBridge: br-ctlplane
# enable to force metadata for public net
#NeutronEnableForceMetadata: true
StandaloneEnableRoutedNetworks: false
StandaloneHomeDir: $HOME
StandaloneLocalMtu: 1500
# Needed if running in a VM, not needed if on baremetal
NovaComputeLibvirtType: qemu
EOF
}
function dd_ceph (){
sudo dd if=/dev/zero of=/var/lib/ceph-osd.img bs=1 count=0 seek=7G
sudo losetup /dev/loop2 /var/lib/ceph-osd.img
sudo pvcreate /dev/loop2
sudo vgcreate ceph_vg /dev/loop2
sudo lvcreate -n ceph_lv_data -l +100%FREE ceph_vg
}
function deploy (){
scn="$1"
sudo openstack tripleo deploy \
--templates \
--local-ip=192.168.24.1/24 \
-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" \
-e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml \
-e /usr/share/openstack-tripleo-heat-templates/ci/environments/scenario00"$scn"-standalone.yaml \
--output-dir "$HOME" \
--standalone
}
dd_ceph
gen_config
gen_cont
deploy 4
export OS_CLOUD=standalone
openstack endpoint list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment