Skip to content

Instantly share code, notes, and snippets.

@fmount
Created Mar 31, 2021
Embed
What would you like to do?
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 (){
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 pvcreate /dev/loop3
vgcreate ceph_vg /dev/loop3
sudo vgcreate ceph_vg /dev/loop3
sudo lvcreate -n ceph_lv_wal -l 375 ceph_vg
sudo lvcreate -n ceph_lv_db -l 375 ceph_vg
sudo lvcreate -n ceph_lv_data -l 1041 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