Shang Wu

Previous, I had some trouble to run Openstack on my test machine. With the help from CSSOSS documentation I was able to see the resources are all up and ready, waiting to be used. But, after I download the tarball images from Ubuntu image store and registered to my openstack. I was not able to get the instances start running.

The error message that I got when I run euca-describe-instances, the isntances status starts from Launching switch to Failed to Spawn almost immediately. Looking through the logs (nova-compute.log), it tells me that the kvm needs to be enabled which I have done so already… So, the issue is somewhere else. But in any case, you are getting the same error, this might be the first thing that you need to check.

To check if your kvm extension is enabled, you can run:

sudo kvm-ok

If it is enabled, the message will look like:

KVM acceleration can be used

Shang Wu

After yesterday’s little trick, now I have my dashboard up and running.

The portal looks like the Eucalyptus admin page without the image store and where to configure the instance type. That is our mission today. Find out where to configure the instance type.

By default, the few instance type looks like the following:

m1.medium – 4096M, 2CPU, 40G Space
m1.large – 8192M, 4CPU, 80G Space
m1.tiny – 512M, 1CPU, 0G Space
m1.xlarge – 16384M, 8CPU, 160G Space
m1.small – 2048M, 1CPU, 20G Space

Which for my testing purpose, I would like to customise it. In Eucalyptus, it used to let user change it directly on the web page. But in OpenStack, I think we will need to use the command line to create/delete the instance types.

First, let’s take a look at what you have already from the command line:

sudo nova-manage instance_type list

which, not surprisingly, you should have the output looks similar to the table above. But, a little surprise that you won’t see in the webpage is the FlavorID, which might gives you a little trouble later.

m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
k1.small: Memory: 1024MB, VCPUS: 1, Storage: 8GB, FlavorID: 8, Swap: 2GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB

Second, let’s take a look at the help with the nova-manage instance_type create command which we use it to create the instance type:

instance_type create: Creates instance types / flavors
arguments: name memory vcpus local_gb flavorid [swap] [rxtx_quota] [rxtx_cap]

So, to create a “s1.small” (this name could be anything) instance type with 1024M memory, 1 CPU, 5000M storage with flavorID 7, you need:

sudo nova-manage instance_type create s1.small 1024 1 5000 7

with the return of

s1.small created

Then, we want to delete this instance type. Similar command is called but change from create to delete to remove the entry:

sudo nova-manage instance_type delete s1.small

Now, the final twist, if you want to create another entry using the same command which should work, right? Instead, you will get an Unknown error. Doesn’t really tell you much here, does it?

Later I found out the issue is the FlavorID that I mention earlier. Even you delete the entry, the FlavorID cannot be reuse. If you try to use the flavor list command, you still won’t see the deleted entry.

sudo nova-manage flavor list

So, if you are getting the Unknown error, look into the /var/log/nova/nova-manage.log file for clues, but this might be the reason why!

Shang Wu

Again, following the documentationon OpenStack Dashboard with Mysql Database

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

DATABASES = {
‘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/local_settings.py

I am getting the error message like:

(.dashboard-venv)root@nova-stack:/opt/osdb/openstack-dashboard# sudo tools/with_venv.sh dashboard/manage.py syncdb
Creating table auth_permission
Creating table auth_group_permissions
Traceback (most recent call last):
File “dashboard/manage.py”, line 11, in
execute_manager(settings)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/__init__.py”, line 438, in execute_manager
utility.execute()
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/__init__.py”, line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/base.py”, 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/base.py”, line 220, in execute
output = self.handle(*args, **options)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/core/management/base.py”, 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/syncdb.py”, line 95, in handle_noargs
cursor.execute(statement)
File “/opt/osdb/openstack-dashboard/.dashboard-venv/lib/python2.7/site-packages/django/db/backends/util.py”, 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/base.py”, 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/cursors.py”, 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/connections.py”, 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/with_venv.sh dashboard/manage.py 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/with_venv.sh dashboard/manage.py 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*
E-mail address: *ENTER YOUR EMAIL ADDRESS*
Password: *MAKE UP A PASSWORD*
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/with_venv.sh dashboard/manage.py syncdb
^[3DEBUG:django.db.backends:(0.001)
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.

Enjoy!

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 http://cssoss.wordpress.com 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 run_tests.sh is zero.

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

git clone https://github.com/4P/openstack-dashboard.git

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

Shang Wu

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

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

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-oneiric/

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:

https://launchpad.net/ubuntu/oneiric/i386/module-init-tools/3.13-1ubuntu1

amd64:

https://launchpad.net/ubuntu/oneiric/amd64/module-init-tools/3.13-1ubuntu1

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
i386:

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-rc4-oneiric/linux-headers-3.0.0-0300rc4-generic_3.0.0-0300rc4.201106210911_i386.deb

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-rc4-oneiric/linux-image-3.0.0-0300rc4-generic_3.0.0-0300rc4.201106210911_i386.deb

amd64:

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-rc4-oneiric/linux-image-3.0.0-0300rc4-generic_3.0.0-0300rc4.201106210911_amd64.deb

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-rc4-oneiric/linux-headers-3.0.0-0300rc4-generic_3.0.0-0300rc4.201106210911_amd64.deb

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~

(Optional)
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:

3.0.0-0300rc4-generic

Then you are on the kernel 3.0!!

Shang Wu

Quick Tips on UbuntuOne

Yesterday, I was having some issue syncing the file to UbuntuOne. It turns out to be a disk space issue in the end, but during the process I learned couple tricks that is quite useful for troubleshooting UbuntuOne. So, I thought someone else might be interested in this as well:

UbuntuOne lesson 101:

To enable debug logging you need to:

1) Quit syncdaemon

killall ubuntuone-syncdaemon

2) Append the following lines in the ~/.config/ubuntuone/syncdaemon.conf

[__main__]

level = DEBUG

3) Then, the logging can be found in ~/.cache/ubuntuone/log/syncdaemon.log

UbuntuOne lesson 102:

Using the following command to see the current file transfering status:

u1sdtool –current-transfers

UbuntuOne lesson 103:

To request a “rescan” on a specific folder

u1sdtool –refresh /full/path/to/folder

Shang Wu

I’m new!

Hi All,

I have been with Canonical for almost 3 years now. Just started this blog and intend to talk about mainly the Ubuntu related issues, solutions, tips and tricks that I pick up here and there. Hope that will be helpful for somebody.

Since I just got my new toy HTC Hero last December, perhaps you will see some of that here too!

Cheers,



Create a new blog