# Openstack

## Compute Setup

```bash
export VM_NAME="openstack-test"
export VM_DISK_PATH=/var/lib/libvirt/images/openstack-test.qcow2

# Download the fedora server image
sudo curl \
-o $VM_DISK_PATH \
https://download.fedoraproject.org/pub/fedora/linux/releases/43/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2

# Install
virt-install \
--name "${VM_NAME}" \
--boot uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no \
--cpu host-passthrough --vcpus sockets=1,cores=8,threads=2 \
--ram=8192 \
--os-variant=fedora41 \
--network bridge:virbr0 \
--graphics none \
--import --disk "path=${VM_DISK_PATH},bus=virtio" \
--cloud-init disable=yes,user-data="active/software_virsh/cloud-init/user-data,meta-data=active/software_virsh/cloud-init/meta-data"
```

SSH into the server

```bash
sudo dnf update
sudo dnf install mysql-server
sudo systemctl enable --now mariadb
sudo mysql_secure_installation
sudo mysql -u root -p

# Note, I'm using 'keystone' as the password here. Change this.
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
IDENTIFIED BY 'keystone';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
IDENTIFIED BY 'keystone';
exit

sudo dnf install openstack-keystone httpd uwsgi-plugin-python3
```