Archive for June, 2011

Shang Wu

OpenStack – Changing the database to MySQL from Sqllite

Again, following the documentationon OpenStack Dashboard with Mysql Database

I ran into issues when I directly copy and paste the:

‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘NAME’: ‘dashboarddb’,
‘USER’: ‘nova’,
‘PASSWORD’: ‘mygreatsecret’,
‘HOST’: ‘localhost’,
‘default-character-set’: ‘utf8’,

into my /opt/osdb/openstack-dashboard/local/

I am getting the error message like:

(.dashboard-venv)root@nova-stack:/opt/osdb/openstack-dashboard# sudo tools/ dashboard/ syncdb
Creating table auth_permission
Creating table auth_group_permissions
Traceback (most recent call last):
File “dashboard/”, line 11, in
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/”, line 438, in execute_manager
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/”, line 379, in execute
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/”, line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/”, line 220, in execute
output = self.handle(*args, **options)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/”, line 351, in handle
return self.handle_noargs(**options)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/commands/”, line 95, in handle_noargs
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/db/backends/”, line 15, in execute
return self.cursor.execute(sql, params)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/db/backends/mysql/”, line 86, in execute
return self.cursor.execute(query, args)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/”, line 174, in execute
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/”, line 36, in defaulterrorhandler
_mysql_exceptions.OperationalError: (1142, “ALTER command denied to user ‘nova’@’localhost’ for table ‘auth_group_permissions'”)

At the last line, it looks like the Mysql issue. So, I comment out the USER line from the config and ran the command:

sudo tools/ dashboard/ syncdb

And everything is working as expected…

Shang Wu

After struggling with the Openstack dashboard yesterday, I was able to bring up the dashboard interface. But just when I thought this is the end……. Boom! I can’t login to the system!

According to the CSS documentation, as soon as I use the command:

sudo tools/ dashboard/ syncdb

I should be asked to create the password. Looking at the wiki page from OpenStack DashBoard, it should look like this:

You just installed Django’s auth system, which means you don’t have any superusers defined.
Would you like to create one now? (yes/no): *YES*
Username (Leave blank to use ‘root’): *ENTER YOUR NOVA_USERNAME (The name of the Nova admin user you created) FROM NOVARC*
Password (again): *REPEAT YOUR PASSWORD*

But instead, I got (whether using the code from Github or Launchpad, I got the same result):

shang@shang:~/openstack-dashboard/openstack-dashboard$ sudo tools/ dashboard/ syncdb
SELECT name FROM sqlite_master
WHERE type=’table’ AND NOT name=’sqlite_sequence’
ORDER BY name; args=()
Creating tables …
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE “django_content_type”.”app_label” = contenttypes ORDER BY “django_content_type”.”name” ASC; args=(‘contenttypes’,)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE (“django_content_type”.”model” = contenttype AND “django_content_type”.”app_label” = contenttypes ); args=(‘contenttype’, ‘contenttypes’)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE “django_content_type”.”app_label” = sessions ORDER BY “django_content_type”.”name” ASC; args=(‘sessions’,)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE (“django_content_type”.”model” = session AND “django_content_type”.”app_label” = sessions ); args=(‘session’, ‘sessions’)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE “django_content_type”.”app_label” = messages ORDER BY “django_content_type”.”name” ASC; args=(‘messages’,)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE “django_content_type”.”app_label” = comments ORDER BY “django_content_type”.”name” ASC; args=(‘comments’,)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE (“django_content_type”.”model” = comment AND “django_content_type”.”app_label” = comments ); args=(‘comment’, ‘comments’)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE (“django_content_type”.”model” = commentflag AND “django_content_type”.”app_label” = comments ); args=(‘commentflag’, ‘comments’)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE “django_content_type”.”app_label” = sites ORDER BY “django_content_type”.”name” ASC; args=(‘sites’,)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE (“django_content_type”.”model” = site AND “django_content_type”.”app_label” = sites ); args=(‘site’, ‘sites’)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE “django_content_type”.”app_label” = markup ORDER BY “django_content_type”.”name” ASC; args=(‘markup’,)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE “django_content_type”.”app_label” = django_openstack ORDER BY “django_content_type”.”name” ASC; args=(‘django_openstack’,)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE “django_content_type”.”app_label” = mailer ORDER BY “django_content_type”.”name” ASC; args=(‘mailer’,)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE (“django_content_type”.”model” = message AND “django_content_type”.”app_label” = mailer ); args=(‘message’, ‘mailer’)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE (“django_content_type”.”model” = dontsendentry AND “django_content_type”.”app_label” = mailer ); args=(‘dontsendentry’, ‘mailer’)
DEBUG:django.db.backends:(0.000) SELECT “django_content_type”.”id”, “django_content_type”.”name”, “django_content_type”.”app_label”, “django_content_type”.”model” FROM “django_content_type” WHERE (“django_content_type”.”model” = messagelog AND “django_content_type”.”app_label” = mailer ); args=(‘messagelog’, ‘mailer’)
Installing custom SQL …
Installing indexes …
No fixtures found.

Apparently, I am not the only one has this issue. From the Openstack-operators mailing list, the answer to that question is to use bzr command below to reverse to the previous version, and everything will work fine:

bzr revert -r 46

and it did! I am able to login to the Openstack Dashboard now.

So to conclude, you do need to use the bzr command to get the code, but need to use the command above to fix the code and get it going after that.


Shang Wu

Update notes from Jun 28th, 2011: I encounter some issues after using the code from GitHub. Thus, I switch back to use bzr and get it working after that. Please refer to part 2, for more detail information.

I have been trying to install OpenStack these days just to see how different it is than Eucalyptus. Like many others, back when I was still using Eucalyptus, the book/documentation from is fantastic. At least, that was how I use to get started at the beginning.

This time around, checking on the CSS website, I found they also have the documentation for OpenStack (They are great, aren’t they?!) That is where I will base my article about OpenStack today.

The article is still great and helpful like before. However, there were some changes made on the OpenStack Dashboard side as they have moved to Github after the article has been published. That is why if you follow the session about Nova Dashboard, you will run into problems.

To be more specific, if you use the bzr command:

sudo bzr branch lp:openstack-dashboard /opt/osdb

to download the openstack-dashboard to /opt/osdb, you will soon find out that the size for your is zero.

To workaround this problem, you will need to use the following command at your preferred directory:

git clone

After this, you will have “almost” everything you need and continue on with the article now.

Shang Wu

[How-To] Changing your default language in Ubuntu.

Today, I got asked by someone how to change the default language in Ubuntu. So, I took some time to do a screenshot and wrote a simple instruction, hope this will be useful.

Step 0: Make sure you are connected to the Internet

Step 1: Select Language Support from System > Administration

Step 2: Ignore or Install the first dialog

Step 3: Click on Install / Remove Languages

Step 4: Find your preferred language and click the check box, then Apply Changes

Step 5. Log out the current session and go back to the login page

Step 6. Click on your user name entry and type in your password

Step 7: Before you click on the login button, select your preferred language at the bottom

Step 8: Click Login now to Enter the system with your new language environment.

Shang Wu

[How-To] Upgrade Kernel 3.0 on your Ubuntu Natty system

Update on July 27, 2011: The official 3.0 kernel can be found at:

After upgrade to Natty, my Toshiba Satellite U300 had problem suspend/hibernate. As soon as I close my lid of my laptop, the system will go into suspend, and the system is freezed after that. A bug report was filed, if anyone is having similar problem, feel free to take a look at my bug report #788436. Unfortunately, other than filed the bug report, I have not spend enough time to investigate the issue.

Yesterday, I saw Andy’s post about the new kernel 3.0. I thought this might be the cure for the issue. Today I took some time to give that a try, and it WORKED!!

Here is what you need to do, if you want to update your system to kernel 3.0 as well:

1. Download the dependency(module-init-tools) for the kernel 3.0
i386 from the following URL:


2. Install the module-init-tools on your computer by double click on the packages!

3.Select the proper architecture for your system, and download the kernel 3.0 package (linux-image and linux-header) onto your computer from below


4. Double click on the two packages that you download and install them via the software center.

5. When finish, reboot your system! You should be on the kernel 3.0 from now on! Enjoy~

6. In case you want to verify if the installation is successful or not, you can open a terminal and run the following command:

uname -r

If you see the output like:


Then you are on the kernel 3.0!!

Create a new blog