Showing posts with label openstack. Show all posts
Showing posts with label openstack. Show all posts

Saturday, August 27, 2022

DevStack on Ubuntu 20.04

I need a small IaaS cloud infra for my CMSC291: Modern Distributed Systems class this semester so I decided to set up an OpenStack instance on one of SRG's servers running Ubuntu 20.04. I have used OpenStack in the past so I'm quite comfortable using it.

What is DevStack?

"DevStack is a series of extensible scripts used to quickly bring up a complete OpenStack environment based on the latest versions of everything from git master. It is used interactively as a development environment and as the basis for much of the OpenStack project’s functional testing."

                                                                                    - https://docs.openstack.org/devstack/latest/

[1] I thought the process will be straightforward but unfortunately minor tweaks were needed. Below is the configuration of the host.  

[2] This is the commit hash that worked for me, make sure to checkout this particular commit : d9e2d10d28ebc70129ed90ac9afe11591e7bb7d3


[3] Get the IP address of the host (using ifconfig) and export it as HOST_IP environment variable. Let's say the IP address is 192.168.3.100.

        $export HOST_IP=192.168.3.100

[4] Prepare the local.conf file as described in the doc.

[5] Edit lib/neutron_plugins/ovn_agent

Change OVS_RUNDIR=$OVS_PREFIX/var/run/openvswitch 
to OVS_RUNDIR=$OVS_PREFIX/var/run/ovn

[6] Unstack and Clean.

        $sudo apt install neutron-metadata-agent
    $sudo apt install neutron-openvswitch-agent
    $sudo pip install uwsgi
    $./unstack.sh
    $./clean.sh
    
[7] A few directories need to be removed as well as do some other stuff:

    $sudo rm /var/run/ovn/openvswitch
   $sudo /usr/share/openvswitch/scripts/ovs-ctl restart
   
    edit tools/dbcounter/dbcounter.py



[8] Stack. This may take a while so grab a cup of coffee.


         $./unstack.sh
    $sudo rm -fr /var/run/ovn
    $./stack.sh
        
A successful installation after ~12 minutes!


[9] Launch an instance.




[10] TODO: Configure Floating IP addresses and add glance images.

Friday, June 29, 2018

Enable non-live migration in Openstack Juno on Ubuntu 14.04

Simply change the shell of the nova user to /bin/bash

$sudo usermod -s /bin/bash nova

Thursday, May 14, 2015

Speed up VM startup in OpenStack Juno

By default Nova deletes unused images in compute nodes after 24 hours. If you start an instance in which the image is no longer in the compute node, a transfer of the image from Glance is performed which increases the instance start up time. To override this, simply add the following line in the default section of nova.conf and restart the nova-compute service. The line will disable the removal of unused images from the compute nodes.
remove_unused_base_images = False

Thursday, July 3, 2014

Reset/Reinitialize nova (openstack)

Sometimes the contents of the nova database are not updated properly when instances are deleted through the dashboard. This creates clutter because the instances with ERROR status remain in the dashboard list and cannot be deleted (in my case, no matter how many times I try). Some guides describe how to delete the problematic instances manually by accessing the nova database then deleting the appropriate entries in the affected tables using SQL. If you are working on an experimental system, reinitializing the entire nova database may be easier and faster. Perform the steps below on the controller node. WARNING: This will delete everything in the nova database. This is tested only on the havana version of openstack.

$mysql -u root -p
mysql>drop database nova;
mysql>create database nova; 
mysql>grant all privileges on nova.* to 'nova'@'%' identified by 'yournovapassword';
mysql>grant all privileges on nova.* to 'nova'@'localhost' identified by 'yournovapassword';
mysql>flush privileges;
mysql>exit
$sudo nova-manage db sync
After issuing the above commands, you need to restart all nova services on the controller node.

$sudo service nova-api restart
$sudo service nova-cert restart
$sudo service nova-consoleauth restart
$sudo service nova-scheduler restart
$sudo service nova-conductor restart
$sudo service nova-novncproxy restart
$sudo service nova-network restart

You also need to restart nova-compute on the compute nodes.

$sudo service nova-compute restart

You may need to do the following after:
  • Add custom flavors (nova flavor-create)
  • Add VM networks (nova net-create)
  • Add floating IP pool (nova floating-ip-bulk-create)
  • Edit the security rules for a project to access instances (best done through the dashboard)
*Note: The common cause of being unable to terminate instances is that the hypervisor is unreachable.
References: