Jump to: navigation, search


Revision as of 20:10, 28 October 2013 by Mriedem (talk | contribs) (Use Cases)


Currently OpenStack supports multiple open source databases as the backend database, for example: MySQL, SQLite, PostgreSQL are the default supported databases for the community. In order to support enterprise customers, we would like to integrate the IBM database product DB2 into OpenStack. This will give OpenStack customers an option for an enterprise level database.
This wiki document provides an overview of how we have enabled DB2, what is needed to enable OpenStack to access DB2 as the backend database and what IBM plans to provide to the OpenStack community with the DB2 support.


Today, the OpenStack community projects do not support DB2 as a backend database. Customers who want to deploy Openstack with DB2 would have to manually apply the Python patch for SQLAlchemy-migrate DB2 support and then configure DB2 manually. IBM also has to maintain and update the SQLAlchemy-migrate changes, and the OpenStack consumers would have to install the IBM changes for each new OpenStack release. Thus, having DB2 support in the OpenStack community code base would facilitate the deployment of OpenStack for enterprise customers using DB2.

Use Cases

  • Deploy Openstack projects (Glance, Keystone, Cinder, Nova, and Neutron) with DB2
  • Install Openstack with DB2 using Devstack

The following items could be implemented in the future:
  • Migrate MySQL database to DB2
  • Migrate DB2 database back to MySQL


IBM will provide the necessary code changes to support migration of nova, glance, cinder, keystone and quantum databases to a DB2 database. The code provided by IBM for the OpenStack services will include enablement of unit/migration test cases for DB2. IBM will also work with the SQLAlchemy and SQLAlchemy-migrate communities to get the necessary support for interacting with DB2 available for download.
To support DB2 database in OpenStack, the following tasks are needed and will be completed by IBM:
  • Update Openstack projects (Glance, Keystone, Cinder, Nova, and Quantum) to support DB2 initialization and access.
Bugs will be opened against each project for checking in the necessary code to support DB2 and patches will be submitted for review against those bugs. The code may be initially submitted before additional test infrastructure (noted below) is in place as the DB2 specific code is not executed unless the database configured in a service's sql_connection string is ibm_db_sa. Until DB2 is integrated into OpenStack's test infrastructure IBM is taking responsibility for managing the impacts of additional migrations upon DB2 functionality.
  • IBM will provide the necessary test infrastructure for DB2.
  • IBM DB2 Express-C will be made freely available for use on the OpenStack Jenkins systems. IBM will also assist in the configuration of DB2 for that system.
  • Third party tests will be provided by IBM to verify proper DB2 functionality with community code and the hardware infrastructure to support the tests will also be provided.

  • In the future, DevStack will be updated to support setup/configuration of DB2 as a backend database.. (Note that the installation of DB2 database may need to be done separately outside of DevStack.)
The following functions need to be implemented in /devstack/lib/databases to support DB2 (these functions currently do not exist for DB2 in Essex or Folsom):
  • recreate_database_xxx
  • install_database_xxx
  • configure_database_xxx
  • database_connection_url_xxx
Note: Before running devstack, the developer also needs to do the followings:
set DB2 as the default database in stackrc:
add a line to localrc:
use_database ibm_db_sa

  • Dependent database access packages
The following packages are needed to support DB2:
  • SQLAlchemy. A Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. Official website: http://www.sqlalchemy.org/
This package is available and can be installed via:
  • sudo pip install SQLAlchemy>=0.7.2 or other versions above it
  • SQLAlchemy currently supports interaction with DB2.
  • SQLAlchemy-migrate. It is an MIT licensed open source project and provides a way to deal with database schema changes in SQLAlchemy projects. Currently, to support DB2, a patch for SQLAlchemy-migrate is needed. The following issue has been submitted to have the patch included in the base code:
After the patch has been installed, run commands to install it:
sudo python setup.py build and sudo python setup.py install
  • The Python driver and wrapper for DB2 and the adapter for SQLAlchemy interface.
Today, this driver/adapter can be downloaded using the following links and then run 'sudo python setup.py build' and 'sudo python setup.py install':

  • Users will need to download/install IBM DB2 Express-C and the IBM Data Server Driver for ODBC and CLI.
DB2 Express-C may be freely downloaded from the following website: http://www.ibm.com/developerworks/downloads/im/db2express/index.html
IBM Data Server Driver for ODBC and CLI may be downloaded from this website: http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.apdv.cli.doc%2Fdoc%2Ft0023867.htm