Skip to content

Instantly share code, notes, and snippets.

@ramielrowe
Last active October 1, 2015 18:28
Show Gist options
  • Select an option

  • Save ramielrowe/1d3980ff61bd649ef31b to your computer and use it in GitHub Desktop.

Select an option

Save ramielrowe/1d3980ff61bd649ef31b to your computer and use it in GitHub Desktop.
#!/bin/sh
# Install initial dependencies
apt-get update && apt-get install git vim lvm2 -y
# Set up SSDs for LVM
parted /dev/sdb -s mklabel gpt
parted -a optimal /dev/sdb mkpart primary ext2 0% 100%
parted /dev/sdb set 1 lvm on
parted /dev/sdc -s mklabel gpt
parted -a optimal /dev/sdc mkpart primary ext2 0% 100%
parted /dev/sdc set 1 lvm on
# Set up LVM
pvcreate /dev/sdb1
pvcreate /dev/sdc1
vgcreate devstack /dev/sdb1
# Set up large volume for devstack's home dir
lvcreate -L 500G -n stack_home devstack
mkfs.ext4 /dev/devstack/stack_home
# Mount devstack's home dir on boot
echo "/dev/devstack/stack_home /opt/stack ext4 errors=remount-ro 0 1" >> /etc/fstab
mkdir /opt/stack
mount /opt/stack
# Create stack user
git clone https://github.com/openstack-dev/devstack.git
cd devstack
./tools/create-stack-user.sh
# Set up authorized ssh keys
mkdir /opt/stack/.ssh
cp /root/.ssh/authorized_keys /opt/stack/.ssh/authorized_keys
chown -R stack:stack /opt/stack
echo "Stack user set up, please disconnect and reconnect as the stack user."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment