Installing OpenStack in Azure
I recently started a new job where I am working with OpenStack and Kubernetes. I was curious about what it would take to stand up an OpenStack test environment, so I fired up a VM in Azure and went to town.
The VM I created was a CentOS 7 based VM with 4 cores and 16GB of RAM (D4s_v3), and I gave it 120GB of standard SSD storage.
In order to make things easier in the future, I set up a DNS label for the VM and then when I was ready to connect ot it I set up my
~/.ssh/config to use
azure-openstack as an alias for my DNS name for the server, using the private key and username to align with what I set up for the VM.
Next I had to do some basic housekeeping on the VM to prepare for OpenStack. To make things easier, I ran
sudo su - to elevate my priveleges and then ran the following:
# Make sure that only iptables will be used systemctl disable firewalld NetworkManager systemctl stop firewalld NetworkManager systemctl start network systemctl enable network # Install the openstack and epel repositories yum install -y epel-release centos-release-openstack-stein # Upgrade all the things yum upgrade -y # And just to be on the safe side... reboot
Once the VM came back up, it was time to get OpenStack up and running. To do this, I used PackStack, once again running as root:
yum install -y openstack-packstack
There is now a
packstack command available. The next thing I did was to generate an answers file so that I could tweak the setup:
Now I edited the file, changing the
CONFIG_DEFAULT_PASSWORD (I used a 30 character alpha-numeric password generated by KeePass) along with with the following:
CONFIG_DEFAULT_PASSWORD=(30 character alpha-numeric password generated by KeePass) CONFIG_KEYSTONE_ADMIN_PW=(30 character alpha-numeric password generated by KeePass) CONFIG_KEYSTONE_DEMO_PW=(30 character alpha-numeric password generated by KeePass) CONFIG_CINDER_VOLUMES_SIZE=4G CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth0
Now to actually intialize PackStack using the answers file:
This ran for quite some time (~20 minutes). Once it was done I changed the virtualization type for Nova to KVM by uncommenting
/etc/nova/nova.conf and commenting the line that says
virt_type=qemu. To pick up the change I had to run:
systemctl restart openstack-nova-compute.service
Now there should be a nice shiny dashboard waiting for you, in my case, at http://10.0.1.4/dashboard. Except, that’s internal to Azure’s network, so I needed to enable SSH tunneling. I disconnected my SSH session and started a new one with tunneling:
ssh azure-openstack -L 5000:localhost:80
Now I was able to get to my dashboard at http://localhost:5000 and login as “demo” with the password I had set in my answer file, which was enough to verify the basic installation was valid.