Custom Search

Monday, May 27, 2013

Sles How to install qemu from tarball

Sles How to install qemu 1.2 from tarball 
1) Install dependencies
# zypper ar http://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/11.4/repo/oss/ "os114"

# ls /etc/zypp/repos.d/
convirt-dep.repo  os114.repo

# zypper install gcc

# zypper install zlib-devel

# zypper install glib2-devel

2) Install qemu-1.2

# wget http://wiki.qemu.org/download/qemu-1.2.0.tar.bz2

# tar xfj qemu-1.2.0.tar.bz2

# cd qemu-1.2.0

# ./configure && make qemu-img

3) Create a symbolic link
# rm /usr/bin/qemu-img

# ln -s  ~/saju-dir/qemu-1.2.0/qemu-img /usr/bin/qemu-img

4) Test
# qemu-img convert -O qcow2 test1.vmdk output.xm

Wednesday, May 22, 2013

How to use qemu-img to convert disk raw vmdk

* I am using Ubuntu 12.04 LTS
* I Installed qemu-1.2.0 from tarball
#sudo apt-get install libglib2.0-dev
#wget http://wiki.qemu.org/download/qemu-1.2.0.tar.bz2
#tar xfj qemu-1.2.0.tar.bz2
#cd qemu-1.2.0
#./configure && make qemu-img
http://serverfault.com/questions/429478/conversion-of-a-vmdk-image-with-qemu-img-failed-with-error-while-reading-sector


1)
How to Convert vmdk disk to raw disk

============================
#qemu-img convert -O raw ubuntu-12.04.vmdk ubuntu-12.04.xm

2)
How to Convert vmdk disk to qcow2 disk
==============================

#qemu-img convert -O qcow2 ubuntu-12.04.vmdk ubuntu-12.04.xm

3)
How to Convert raw disk to vmdk disk
============================

#qemu-img convert -O vmdk ubuntu-12.04.xm buntu-12.04.vmdk

4)
How to Convert qcow2 disk to vmdk disk
==============================

#qemu-img convert -O vmdk ubuntu-12.04.xm buntu-12.04.vmdk
  

Supported image file formats:
====================

raw
   Raw disk image format (default). This format has the advantage of
   being simple and easily exportable to all other emulators. If your
   file system supports holes (for example in ext2 or ext3 on Linux or
   NTFS on Windows), then only the written sectors will reserve space.
   Use "qemu-img info" to know the real size used by the image or "ls
   -ls" on Unix/Linux.

qcow2:
   QEMU image format, the most versatile format. Use it to have
   smaller images (useful if your filesystem does not supports holes,
   for example on Windows), optional AES encryption, zlib based
   compression and support of multiple VM snapshots.

   Supported options:

   "backing_file"
       File name of a base image (see create subcommand)

   "backing_fmt"
       Image format of the base image

   "encryption"
       If this option is set to "on", the image is encrypted.

       Encryption uses the AES format which is very secure (128 bit
       keys). Use a long password (16 characters) to get maximum
       protection.

   "cluster_size"
       Changes the qcow2 cluster size (must be between 512 and 2M).
       Smaller cluster sizes can improve the image file size whereas
       larger cluster sizes generally provide better performance.

   "preallocation"
       Preallocation mode (allowed values: off, metadata). An image
       with preallocated metadata is initially larger but can improve
       performance when the image needs to grow.

qcow:
   Old QEMU image format. Left for compatibility.

   Supported options:

   "backing_file"
       File name of a base image (see create subcommand)

   "encryption"
       If this option is set to "on", the image is encrypted.

cow:
  User Mode Linux Copy On Write image format. Used to be the only
   growable image format in QEMU. It is supported only for
   compatibility with previous versions. It does not work on win32.

vdi: 
  VirtualBox 1.1 compatible image format.

vmdk:
   VMware 3 and 4 compatible image format.

   Supported options:

   "backing_fmt"
       Image format of the base image

   "compat6"
       Create a VMDK version 6 image (instead of version 4)

vpc:
 VirtualPC compatible image format (VHD).

cloop:
   Linux Compressed Loop image, useful only to reuse directly
   compressed CD-ROM images present for example in the Knoppix CD-
   ROMs.





How to Convert qcow2 disk to vmdk disk

Use the command qemu-img to Convert qcow2 to vmdk
#qemu-img convert -O vmdk ubuntu-12.04.xm buntu-12.04.vmdk

How to Convert raw disk to vmdk disk

Use the command qemu-img to Convert raw to vmdk
#qemu-img convert -O vmdk ubuntu-12.04.xm buntu-12.04.vmdk

How to Convert vmdk disk to qcow2 disk

Use the command qemu-img to Convert vmdk to qcow2
#qemu-img convert -O qcow2 ubuntu-12.04.vmdk ubuntu-12.04.xm

How to Convert vmdk disk to raw disk

Use the command qemu-img to Convert vmdk to raw
#qemu-img convert -O raw ubuntu-12.04.vmdk ubuntu-12.04.xm

Sunday, May 5, 2013

Horizon login failed: curl os-floating-ips request hung

Error Log From Horizon
----------------------------------------

Horizon login failed curl os-floating-ips request hung

REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"

Solution
--------------

0)
Your /etc/keystone/keystone.conf file should contain the following lines if it is properly configured to use the database backend.
[catalog]
driver = keystone.catalog.backends.sql.Catalog

1)
#cd install_dir/horizon
#source .venv/bin/activate
#export OS_SERVICE_TOKEN="ADMIN"
#export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0

2)
#keystone service-list

3)
http://docs.openstack.org/trunk/openstack-network/admin/content/keystone.html
#keystone service-create --name quantum --type network --description 'OpenStack Networking Service'

4)
#keystone service-list

5)
#keystone endpoint-list

6)
#keystone endpoint-create \
--region RegionOne \
--service-id 185976c6a994466e820451df73294b99 \
--publicurl "http://localhost:9696/" \
--adminurl "http://localhost:9696/" \
--internalurl "http://localhost:9696/"


7)
#keystone endpoint-list

(.venv)saju@saju-VirtualBox:~/ops_manual/horizon$ keystone service-list
+----------------------------------+----------+----------+------------------------------+
|                id                |   name   |   type   |         description          |
+----------------------------------+----------+----------+------------------------------+
| abad2df5eb564c07adbf6dc8958dfd99 |  glance  |  image   |        Image Service         |
| 008711821700476984af78121941320e | keystone | identity |       Identity Service       |
| 3dca0574e07143d3a11fb5107851933f |   nova   | compute  |       Compute Service        |
| 185976c6a994466e820451df73294b99 | quantum  | network  | OpenStack Networking Service |
+----------------------------------+----------+----------+------------------------------+
(.venv)saju@saju-VirtualBox:~/ops_manual/horizon$

8)
#cd install_dir/keystone
#source .venv/bin/activate
#./bin/keystone-all --debug

9)
#cd install_dir/horizon
#source .venv/bin/activate
#python manage.py runserver

10)
*Goto Horizon and try to login again
http://127.0.0.1:8000/auth/login/

How to kill all services
-------------------------------------
#sudo killall -9 python


Complete Error Log from Keystone
---------------------------------------------------------

#./bin/Keystone-all --debug

2013-05-05 01:37:38    DEBUG [eventlet.wsgi.server] (7413) accepted ('127.0.0.1', 34444)

2013-05-05 01:37:38    DEBUG [keystone.common.wsgi] arg_dict: {}
2013-05-05 01:37:38     INFO [access] 127.0.0.1 - - [04/May/2013:20:07:38 +0000] "POST http://127.0.0.1:5000/v2.0/tokens HTTP/1.0" 200 1133
2013-05-05 01:37:38    DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [05/May/2013 01:37:38] "POST /v2.0/tokens HTTP/1.1" 200 1263 0.223209

2013-05-05 01:37:38    DEBUG [eventlet.wsgi.server] (7413) accepted ('127.0.0.1', 34445)

2013-05-05 01:37:38    DEBUG [keystone.common.wsgi] arg_dict: {}
2013-05-05 01:37:38     INFO [access] 127.0.0.1 - - [04/May/2013:20:07:38 +0000] "GET http://127.0.0.1:5000/v2.0/tenants HTTP/1.0" 200 133
2013-05-05 01:37:38    DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [05/May/2013 01:37:38] "GET /v2.0/tenants HTTP/1.1" 200 262 0.025544

2013-05-05 01:37:38    DEBUG [eventlet.wsgi.server] (7413) accepted ('127.0.0.1', 34446)

2013-05-05 01:37:38    DEBUG [keystone.common.wsgi] arg_dict: {}
2013-05-05 01:37:38     INFO [access] 127.0.0.1 - - [04/May/2013:20:07:38 +0000] "POST http://127.0.0.1:5000/v2.0/tokens HTTP/1.0" 200 3603
2013-05-05 01:37:38    DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [05/May/2013 01:37:38] "POST /v2.0/tokens HTTP/1.1" 200 3733 0.109027

2013-05-05 01:37:38    DEBUG [eventlet.wsgi.server] (7413) accepted ('127.0.0.1', 40971)

2013-05-05 01:37:38    DEBUG [keystone.common.wsgi] arg_dict: {}
2013-05-05 01:37:38     INFO [access] 127.0.0.1 - - [04/May/2013:20:07:38 +0000] "POST http://localhost:35357/v2.0/tokens HTTP/1.0" 200 3603
2013-05-05 01:37:38    DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [05/May/2013 01:37:38] "POST /v2.0/tokens HTTP/1.1" 200 3733 0.122912

2013-05-05 01:37:39    DEBUG [eventlet.wsgi.server] (7413) accepted ('127.0.0.1', 40975)

2013-05-05 01:37:39    DEBUG [keystone.common.wsgi] arg_dict: {'token_id': u'ac4649b428931f810f6f6c059159d495'}
2013-05-05 01:37:39    DEBUG [keystone.policy.backends.rules] enforce admin_required: {'tenant_id': u'7daefbb63e404763a9081954dacff2a9', 'user_id': u'26fc766cef74414eb9cb0b57d06a0642', u'roles': [u'admin']}
2013-05-05 01:37:39     INFO [access] 127.0.0.1 - - [04/May/2013:20:07:39 +0000] "GET http://127.0.0.1:35357/v2.0/tokens/ac4649b428931f810f6f6c059159d495 HTTP/1.0" 200 3645
2013-05-05 01:37:39    DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [05/May/2013 01:37:39] "GET /v2.0/tokens/ac4649b428931f810f6f6c059159d495 HTTP/1.1" 200 3775 0.040125

Complete Error Log from Horizon
-------------------------------------------------------

DEBUG:openstack_auth.backend:Beginning user authentication for user "admin".
DEBUG:openstack_auth.backend:Authentication completed for user "admin".
[04/May/2013 20:07:38] "POST /auth/login/ HTTP/1.1" 302 0
[04/May/2013 20:07:39] "GET / HTTP/1.1" 302 0
novaclient connection created using token "ac4649b428931f810f6f6c059159d495" and url "http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9"

REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-simple-tenant-usage?start=2013-05-01T00:00:00&end=2013-05-04T20:07:39.041445&detailed=1 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-simple-tenant-usage?start=2013-05-01T00:00:00&end=2013-05-04T20:07:39.041445&detailed=1 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-simple-tenant-usage?start=2013-05-01T00:00:00&end=2013-05-04T20:07:39.041445&detailed=1 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-simple-tenant-usage?start=2013-05-01T00:00:00&end=2013-05-04T20:07:39.041445&detailed=1 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-simple-tenant-usage?start=2013-05-01T00:00:00&end=2013-05-04T20:07:39.041445&detailed=1 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-simple-tenant-usage?start=2013-05-01T00:00:00&end=2013-05-04T20:07:39.041445&detailed=1 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-simple-tenant-usage?start=2013-05-01T00:00:00&end=2013-05-04T20:07:39.041445&detailed=1 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-9406225d-f867-4381-91a8-04c8a77a05fa', 'content-type': 'application/json', 'content-length': '21'}
RESP BODY: {"tenant_usages": []}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-9406225d-f867-4381-91a8-04c8a77a05fa', 'content-type': 'application/json', 'content-length': '21'}
RESP BODY: {"tenant_usages": []}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-9406225d-f867-4381-91a8-04c8a77a05fa', 'content-type': 'application/json', 'content-length': '21'}
RESP BODY: {"tenant_usages": []}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-9406225d-f867-4381-91a8-04c8a77a05fa', 'content-type': 'application/json', 'content-length': '21'}
RESP BODY: {"tenant_usages": []}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-9406225d-f867-4381-91a8-04c8a77a05fa', 'content-type': 'application/json', 'content-length': '21'}
RESP BODY: {"tenant_usages": []}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-9406225d-f867-4381-91a8-04c8a77a05fa', 'content-type': 'application/json', 'content-length': '21'}
RESP BODY: {"tenant_usages": []}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-9406225d-f867-4381-91a8-04c8a77a05fa', 'content-type': 'application/json', 'content-length': '21'}
RESP BODY: {"tenant_usages": []}

novaclient connection created using token "ac4649b428931f810f6f6c059159d495" and url "http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9"

REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-6223db6b-9c6c-4b98-8dc8-52cd9641245e', 'content-type': 'application/json', 'content-length': '356'}
RESP BODY: {"quota_set": {"injected_file_content_bytes": 10240, "metadata_items": 128, "volumes": 10, "gigabytes": 1000, "ram": 51200, "floating_ips": 10, "key_pairs": 100, "injected_file_path_bytes": 255, "instances": 10, "security_group_rules": 20, "injected_files": 5, "cores": 20, "fixed_ips": -1, "id": "7daefbb63e404763a9081954dacff2a9", "security_groups": 10}}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-6223db6b-9c6c-4b98-8dc8-52cd9641245e', 'content-type': 'application/json', 'content-length': '356'}
RESP BODY: {"quota_set": {"injected_file_content_bytes": 10240, "metadata_items": 128, "volumes": 10, "gigabytes": 1000, "ram": 51200, "floating_ips": 10, "key_pairs": 100, "injected_file_path_bytes": 255, "instances": 10, "security_group_rules": 20, "injected_files": 5, "cores": 20, "fixed_ips": -1, "id": "7daefbb63e404763a9081954dacff2a9", "security_groups": 10}}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-6223db6b-9c6c-4b98-8dc8-52cd9641245e', 'content-type': 'application/json', 'content-length': '356'}
RESP BODY: {"quota_set": {"injected_file_content_bytes": 10240, "metadata_items": 128, "volumes": 10, "gigabytes": 1000, "ram": 51200, "floating_ips": 10, "key_pairs": 100, "injected_file_path_bytes": 255, "instances": 10, "security_group_rules": 20, "injected_files": 5, "cores": 20, "fixed_ips": -1, "id": "7daefbb63e404763a9081954dacff2a9", "security_groups": 10}}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-6223db6b-9c6c-4b98-8dc8-52cd9641245e', 'content-type': 'application/json', 'content-length': '356'}
RESP BODY: {"quota_set": {"injected_file_content_bytes": 10240, "metadata_items": 128, "volumes": 10, "gigabytes": 1000, "ram": 51200, "floating_ips": 10, "key_pairs": 100, "injected_file_path_bytes": 255, "instances": 10, "security_group_rules": 20, "injected_files": 5, "cores": 20, "fixed_ips": -1, "id": "7daefbb63e404763a9081954dacff2a9", "security_groups": 10}}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-6223db6b-9c6c-4b98-8dc8-52cd9641245e', 'content-type': 'application/json', 'content-length': '356'}
RESP BODY: {"quota_set": {"injected_file_content_bytes": 10240, "metadata_items": 128, "volumes": 10, "gigabytes": 1000, "ram": 51200, "floating_ips": 10, "key_pairs": 100, "injected_file_path_bytes": 255, "instances": 10, "security_group_rules": 20, "injected_files": 5, "cores": 20, "fixed_ips": -1, "id": "7daefbb63e404763a9081954dacff2a9", "security_groups": 10}}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-6223db6b-9c6c-4b98-8dc8-52cd9641245e', 'content-type': 'application/json', 'content-length': '356'}
RESP BODY: {"quota_set": {"injected_file_content_bytes": 10240, "metadata_items": 128, "volumes": 10, "gigabytes": 1000, "ram": 51200, "floating_ips": 10, "key_pairs": 100, "injected_file_path_bytes": 255, "instances": 10, "security_group_rules": 20, "injected_files": 5, "cores": 20, "fixed_ips": -1, "id": "7daefbb63e404763a9081954dacff2a9", "security_groups": 10}}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-6223db6b-9c6c-4b98-8dc8-52cd9641245e', 'content-type': 'application/json', 'content-length': '356'}
RESP BODY: {"quota_set": {"injected_file_content_bytes": 10240, "metadata_items": 128, "volumes": 10, "gigabytes": 1000, "ram": 51200, "floating_ips": 10, "key_pairs": 100, "injected_file_path_bytes": 255, "instances": 10, "security_group_rules": 20, "injected_files": 5, "cores": 20, "fixed_ips": -1, "id": "7daefbb63e404763a9081954dacff2a9", "security_groups": 10}}

RESP: [200] {'date': 'Sat, 04 May 2013 20:07:39 GMT', 'x-compute-request-id': 'req-6223db6b-9c6c-4b98-8dc8-52cd9641245e', 'content-type': 'application/json', 'content-length': '356'}
RESP BODY: {"quota_set": {"injected_file_content_bytes": 10240, "metadata_items": 128, "volumes": 10, "gigabytes": 1000, "ram": 51200, "floating_ips": 10, "key_pairs": 100, "injected_file_path_bytes": 255, "instances": 10, "security_group_rules": 20, "injected_files": 5, "cores": 20, "fixed_ips": -1, "id": "7daefbb63e404763a9081954dacff2a9", "security_groups": 10}}

novaclient connection created using token "ac4649b428931f810f6f6c059159d495" and url "http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9"

REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"


REQ: curl -i http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-floating-ips -X GET -H "X-Auth-Project-Id: 7daefbb63e404763a9081954dacff2a9" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ac4649b428931f810f6f6c059159d495"

Recoverable error Unable to communicate with identity service: coercing to Unicode: need string or buffer, NoneType found

Error Log From Horizon
----------------------------------------

Recoverable error: Unable to communicate with identity service: {"error": {"message": "coercing to Unicode: need string or buffer, NoneType found", "code": 400, "title": "Bad Request"}}. (HTTP 400)

Error Log From Keystone
------------------------------------------

return os.stat(filename).st_mtime
TypeError: coercing to Unicode: need string or buffer, NoneType found

Solution
-------------

1)
###Start Keystone in debug mode and check error
#cd install_dir/keystone
#source .venv/bin/activate
#./bin/Keystone-all --debug

2)
###Copy policy.json to /etc/Keystone/
#cd install_dir/nova
#sudo cp etc/Keystone/policy.json /etc/Keystone/

3)
##Retart Keystone in debug mode and check error
#cd install_dir/Keystone
#source .venv/bin/activate
#./bin/Keystone-all --debug


Complete Error Log from Keystone
---------------------------------------------------------

#./bin/Keystone-all --debug

2013-05-05 00:01:45    DEBUG [keystone.common.wsgi] arg_dict: {}
2013-05-05 00:01:45    DEBUG [keystone.policy.backends.rules] enforce admin_required: {'tenant_id': u'7daefbb63e404763a9081954dacff2a9', 'user_id': u'26fc766cef74414eb9cb0b57d06a0642', u'roles': [u'admin']}
2013-05-05 00:01:45    ERROR [keystone.common.wsgi] coercing to Unicode: need string or buffer, NoneType found
Traceback (most recent call last):
  File "/home/saju/ops_manual/keystone/keystone/common/wsgi.py", line 236, in __call__
    result = method(context, **params)
  File "/home/saju/ops_manual/keystone/keystone/identity/controllers.py", line 41, in get_all_projects
    self.assert_admin(context)
  File "/home/saju/ops_manual/keystone/keystone/common/wsgi.py", line 304, in assert_admin
    self.policy_api.enforce(context, creds, 'admin_required', {})
  File "/home/saju/ops_manual/keystone/keystone/common/manager.py", line 47, in _wrapper
    return f(*args, **kw)
  File "/home/saju/ops_manual/keystone/keystone/policy/backends/rules.py", line 94, in enforce
    enforce(credentials, action, target)
  File "/home/saju/ops_manual/keystone/keystone/policy/backends/rules.py", line 81, in enforce
    init()
  File "/home/saju/ops_manual/keystone/keystone/policy/backends/rules.py", line 55, in init
    reload_func=_set_rules)
  File "/home/saju/ops_manual/keystone/keystone/common/utils.py", line 52, in read_cached_file
    mtime = os.path.getmtime(filename)
  File "/home/saju/ops_manual/keystone/.venv/lib/python2.7/genericpath.py", line 54, in getmtime
    return os.stat(filename).st_mtime
TypeError: coercing to Unicode: need string or buffer, NoneType found
2013-05-05 00:01:45     INFO [access] 127.0.0.1 - - [04/May/2013:18:31:45 +0000] "GET http://localhost:35357/v2.0/tenants HTTP/1.0" 400 121
2013-05-05 00:01:45    DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [05/M

Complete Error Log from Horizon
-------------------------------------------------------

This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.

 Authentication required 

Unauthorized: Unauthorized (HTTP 401)
Traceback (most recent call last):
  File "/home/saju/ops_manual/horizon/openstack_dashboard/usage/base.py", line 112, in get_quotas
    self.quotas = quotas.tenant_quota_usages(self.request)
  File "/home/saju/ops_manual/horizon/horizon/utils/memoized.py", line 33, in __call__
    value = self.func(*args)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/usage/quotas.py", line 116, in tenant_quota_usages
    disabled_quotas=disabled_quotas):
  File "/home/saju/ops_manual/horizon/openstack_dashboard/usage/quotas.py", line 99, in get_tenant_quota_data
    tenant_id=tenant_id)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/usage/quotas.py", line 76, in _get_quota_data
    quotasets.append(getattr(nova, method_name)(request, tenant_id))
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/nova.py", line 470, in tenant_quota_get
    return QuotaSet(novaclient(request).quotas.get(tenant_id))
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/novaclient/v1_1/quotas.py", line 37, in get
    return self._get("/os-quota-sets/%s" % (tenant_id), "quota_set")
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/novaclient/base.py", line 140, in _get
    _resp, body = self.api.client.get(url)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/novaclient/client.py", line 230, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/novaclient/client.py", line 227, in _cs_request
    raise e
Unauthorized: Unauthorized (HTTP 401)
Creating a new keystoneclient connection to http://localhost:35357/v2.0.
Request returned failure status: 400
Recoverable error: Unable to communicate with identity service: {"error": {"message": "coercing to Unicode: need string or buffer, NoneType found", "code": 400, "title": "Bad Request"}}. (HTTP 400)
[04/May/2013 18:28:56] "GET /admin/ HTTP/1.1" 200 8435
[04/May/2013 18:28:56] "GET /i18n/js/horizon/ HTTP/1.1" 200 2158
[04/May/2013 18:28:56] "GET /static/dashboard/img/logo.png HTTP/1.1" 200 5093
[04/May/2013 18:28:57] "GET /static/bootstrap/img/glyphicons-halflings.png HTTP/1.1" 200 4352
[04/May/2013 18:28:57] "GET /static/dashboard/fonts/Anivers_Regular-webfont.woff HTTP/1.1" 200 29432

openstack ConfigNotFound: Could not find config at policy.json

Error Log from nova
----------------------------------

openstack ConfigNotFound: Could not find config at policy.json

Error Log from Horizon and Keystone
--------------------------------------------------------------
Unauthorized: Unauthorized (HTTP 401)

Solution
--------------

1)
###Start nova in debug mode and check error
#cd install_dir/nova
#source .venv/bin/activate
./bin/nova-all --debug

2)
###Copy policy.json to /etc/nova/
#cd install_dir/nova
#sudo cp etc/nova/policy.json /etc/nova/

3)
###Retart nova in debug mode and check error
#cd install_dir/nova
#source .venv/bin/activate
#./bin/nova-all --debug

Complete Error Log
---------------------------------

#./bin/nova-all --debug

2013-05-05 00:07:43 4264 INFO nova.osapi_compute.wsgi.server [-] (4264) accepted ('127.0.0.1', 46947)

2013-05-05 00:07:43 4264 ERROR nova.api.openstack [-] Caught error: Could not find config at policy.json
2013-05-05 00:07:43 4264 TRACE nova.api.openstack Traceback (most recent call last):
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/home/saju/ops_manual/nova/nova/api/openstack/__init__.py", line 78, in __call__
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     return req.get_response(self.application)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     application, catch_exc_info=False)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     app_iter = application(self.environ, start_response)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     return resp(environ, start_response)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py", line 450, in __call__
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     return self.app(env, start_response)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     resp = self.call_func(req, *args, **self.kwargs)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     return self.func(req, *args, **kwargs)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/home/saju/ops_manual/nova/nova/api/auth.py", line 117, in __call__
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     service_catalog=service_catalog)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/home/saju/ops_manual/nova/nova/context.py", line 70, in __init__
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     self.is_admin = policy.check_is_admin(self.roles)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/home/saju/ops_manual/nova/nova/policy.py", line 106, in check_is_admin
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     init()
2013-05-05 00:07:43 4264 TRACE nova.api.openstack   File "/home/saju/ops_manual/nova/nova/policy.py", line 61, in init
2013-05-05 00:07:43 4264 TRACE nova.api.openstack     raise exception.ConfigNotFound(path=FLAGS.policy_file)
2013-05-05 00:07:43 4264 TRACE nova.api.openstack ConfigNotFound: Could not find config at policy.json
2013-05-05 00:07:43 4264 TRACE nova.api.openstack
2013-05-05 00:07:43 4264 INFO nova.api.openstack [-] http://localhost:8774/v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 returned with HTTP 500
2013-05-05 00:07:43 4264 DEBUG nova.api.openstack.wsgi [-] Returning 500 to user: The server has either erred or is incapable of performing the requested operation. __call__ /home/saju/ops_manual/nova/nova/api/openstack/wsgi.py:1173
2013-05-05 00:07:43 4264 INFO nova.osapi_compute.wsgi.server [-] 127.0.0.1 - - [05/May/2013 00:07:43] "GET /v2/7daefbb63e404763a9081954dacff2a9/os-quota-sets/7daefbb63e404763a9081954dacff2a9 HTTP/1.1" 500 271 0.002859

Saturday, May 4, 2013

Glance Error communicating with http://localhost:9292 [Errno 111] Connection refused

Error Log
----------------

CommunicationError: Error communicating with http://localhost:9292 [Errno 111] Connection refused

Solution
-------------

1) Goto http://127.0.0.1:9292 and check whether glance service is running

2)
cd install_dir/glance
mkdir /etc/glance
sudo cp etc/glance-api.conf /etc/glance/
sudo cp etc/glance-api-paste.ini /etc/glance/

3)
#glance-control --help
##Start Glance##
#glance-control all start
#sudo glance-control all status

4)
Debug "glance-api" If glance service nor running on http://127.0.0.1:9292.
#source .venv/bin/activate
#sudo glance-api --debug
This command will show the error message
For Example:
No such file or directory: '/var/log/glance/api.log'

5)
#sudo mkdir /var/log/glance/

7)
Goto http://127.0.0.1:9292 and check whether glance service is running

8)
Goto Horizon and check
http://127.0.0.1:8000/admin/images/images/

How to debug glance-api
----------------------------------------

(.venv)saju@saju-VirtualBox:~/ops_manual/glance$ sudo glance-api --debug
Traceback (most recent call last):
  File "/usr/local/bin/glance-api", line 7, in
    execfile(__file__)
  File "/opt/stack/glance/bin/glance-api", line 54, in
    log.setup('glance')
  File "/opt/stack/glance/glance/openstack/common/log.py", line 331, in setup
    _setup_logging_from_conf(product_name)
  File "/opt/stack/glance/glance/openstack/common/log.py", line 378, in _setup_logging_from_conf
    filelog = logging.handlers.WatchedFileHandler(logpath)
  File "/usr/lib/python2.7/logging/handlers.py", line 392, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/__init__.py", line 902, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 925, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: '/var/log/glance/api.log'
(.venv)saju@saju-VirtualBox:~/ops_manual/glance$

Complete Error Log
--------------------------------

glanceclient connection created using token "5fbf4fdf68cb0b65a2bc4479354582c0" and url "http://localhost:9292"
curl -i -X GET -H 'X-Auth-Token: 5fbf4fdf68cb0b65a2bc4479354582c0' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://localhost:9292/v1/images/detail?limit=21
ERROR:django.request:Internal Server Error: /admin/images/images/
Traceback (most recent call last):
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 38, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 86, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 54, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 38, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 48, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 155, in get
    handled = self.construct_tables()
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 146, in construct_tables
    handled = self.handle_table(table)
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 118, in handle_table
    data = self._get_data_dict()
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 182, in _get_data_dict
    self._data = {self.table_class._meta.name: self.get_data()}
  File "/home/saju/ops_manual/horizon/openstack_dashboard/dashboards/admin/images/views.py", line 57, in get_data
    exceptions.handle(self.request, msg)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/dashboards/admin/images/views.py", line 53, in get_data
    paginate=True)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/glance.py", line 78, in image_list_detailed
    images = list(itertools.islice(images_iter, request_size))
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/glanceclient/v1/images.py", line 149, in paginate
    images = self._list(url, "images")
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/glanceclient/common/base.py", line 53, in _list
    resp, body = self.api.json_request('GET', url)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/glanceclient/common/http.py", line 222, in json_request
    resp, body_iter = self._http_request(url, method, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/glanceclient/common/http.py", line 192, in _http_request
    raise exc.CommunicationError(message=message)
CommunicationError: Error communicating with http://localhost:9292 [Errno 111] Connection refused
[04/May/2013 10:32:27] "GET /admin/images/images/ HTTP/1.1" 500 193040

Openstack Horizon Invalid service catalog service image [Fixed]

Error Log
----------------

raise exceptions.ServiceCatalogException(service_type)
ServiceCatalogException: Invalid service catalog service: image

Solution
-------------

1)
Your /etc/keystone/keystone.conf file should contain the following lines if it is properly configured to use the database backend.
[catalog]
driver = keystone.catalog.backends.sql.Catalog

2)
#cd install_dir/horizon
#source .venv/bin/activate
#export OS_SERVICE_TOKEN="ADMIN"
#export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0

3)
#keystone service-list

4)
#keystone service-create --name=glance --type=image --description="Image Service"

4)
#keystone service-list

5)
#keystone endpoint-list

6)
#keystone --token ADMIN \
 --endpoint http://localhost:35357/v2.0/ \
 endpoint-create \
 --region RegionOne \
 --service-id=abad2df5eb564c07adbf6dc8958dfd99 \
 --publicurl=http://localhost:9292 \
 --internalurl=http://localhost:9292 \
 --adminurl=http://localhost:9292

7)
#keystone endpoint-list

8)
#cd install_dir/keystone
#source .venv/bin/activate
#./bin/keystone-all

9)
#cd install_dir/horizon
#source .venv/bin/activate
#python manage.py runserver

10)
*Goto Horizon and try to login again
http://127.0.0.1:8000/auth/login/
http://127.0.0.1:8000/admin/images/images/

Reference link
-----------------------

http://docs.openstack.org/trunk/openstack-compute/install/yum/content/defining-services.html
http://docs.openstack.org/trunk/openstack-compute/install/yum/content/keystone-service-endpoint-create.html



Complete Error Log
--------------------------------

ERROR:django.request:Internal Server Error: /admin/images/images/
Traceback (most recent call last):
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 38, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 86, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 54, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 38, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 48, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 155, in get
    handled = self.construct_tables()
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 146, in construct_tables
    handled = self.handle_table(table)
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 118, in handle_table
    data = self._get_data_dict()
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 182, in _get_data_dict
    self._data = {self.table_class._meta.name: self.get_data()}
  File "/home/saju/ops_manual/horizon/openstack_dashboard/dashboards/admin/images/views.py", line 57, in get_data
    exceptions.handle(self.request, msg)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/dashboards/admin/images/views.py", line 53, in get_data
    paginate=True)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/glance.py", line 73, in image_list_detailed
    images_iter = glanceclient(request).images.list(page_size=request_size,
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/glance.py", line 39, in glanceclient
    o = urlparse.urlparse(url_for(request, 'image'))
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/base.py", line 166, in url_for
    raise exceptions.ServiceCatalogException(service_type)
ServiceCatalogException: Invalid service catalog service: image
[04/May/2013 09:57:31] "GET /admin/images/images/ HTTP/1.1" 500 195747
WARNING:django.request:Not Found: /favicon.ico
WARNING:django.request:Not Found: /favicon.ico

Friday, May 3, 2013

Openstack ImportError: No module named iso8601 [Fixed]

Error Log
----------------
ImportError: No module named iso8601

Solution
-------------
#sudo apt-get install python-iso8601

Complete Error Log
--------------------------------
(.venv)saju@saju-desktop:~/openstk_manual/keystone$ sudo ./bin/keystone-manage pki_setup
Traceback (most recent call last):
  File "./bin/keystone-manage", line 17, in
    from keystone import cli
  File "/home/saju/openstk_manual/keystone/keystone/cli.py", line 27, in
    from keystone.openstack.common import jsonutils
  File "/home/saju/openstk_manual/keystone/keystone/openstack/common/jsonutils.py", line 43, in
    from keystone.openstack.common import timeutils
  File "/home/saju/openstk_manual/keystone/keystone/openstack/common/timeutils.py", line 25, in
    import iso8601
ImportError: No module named iso8601
(.venv)saju@saju-desktop:~/openstk_manual/keystone$


Success: sudo ./bin/keystone-manage pki_setup
----------------------------------------------------------------------------
(.venv)saju@saju-desktop:~/openstk_manual/keystone$ sudo ./bin/keystone-manage pki_setup
Generating RSA private key, 1024 bit long modulus
.++++++
................++++++
e is 65537 (0x10001)
Generating RSA private key, 1024 bit long modulus
.......................++++++
.......++++++
e is 65537 (0x10001)
Using configuration from /etc/keystone/ssl/certs/openssl.conf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'US'
stateOrProvinceName   :PRINTABLE:'Unset'
localityName          :PRINTABLE:'Unset'
organizationName      :PRINTABLE:'Unset'
commonName            :PRINTABLE:'www.example.com'
Certificate is to be certified until May  1 08:18:41 2023 GMT (3650 days)

Write out database with 1 new entries
Data Base Updated
(.venv)saju@saju-desktop:~/openstk_manual/keystone$

Openstack ImportError: No module named oslo.config [Fixed]

Error Log
---------------
ImportError: No module named oslo.config

Solution
-------------
1) 
Download http://mirror.pnl.gov/ubuntu//pool/main/o/oslo-config/python-oslo.config_1.1.0-0ubuntu1_all.deb
http://packages.ubuntu.com/raring/all/python-oslo.config/download

2)
Install python-oslo.config
#sudo dpkg -i python-oslo.config_1.1.0-0ubuntu1_all.deb

Complete Error Log
--------------------------------(.venv)saju@saju-desktop:~/openstk_manual/keystone$ sudo ./bin/keystone-manage pki_setup
Traceback (most recent call last):
  File "./bin/keystone-manage", line 17, in
    from keystone import cli
  File "/home/saju/openstk_manual/keystone/keystone/cli.py", line 22, in
    from oslo.config import cfg
ImportError: No module named oslo.config
(.venv)saju@saju-desktop:~/openstk_manual/keystone$

Horizon Keystone ServiceCatalogException: Invalid service catalog service: compute

Error Log from Horizon
---------------------------------------

raise exceptions.ServiceCatalogException(service_type)
ServiceCatalogException: Invalid service catalog service: compute

Solution
-------------- 

0)
Your /etc/keystone/keystone.conf file should contain the following lines if it is properly configured to use the database backend.
[catalog]
driver = keystone.catalog.backends.sql.Catalog

1)
#cd install_dir/horizon
#source .venv/bin/activate
#export OS_SERVICE_TOKEN="ADMIN"
#export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0

2)
#keystone service-list

3)
#keystone service-create --name=nova --type=compute --description="Compute Service"

4)
#keystone service-list

5)
#keystone endpoint-list

6)
#keystone endpoint-create \
 --region RegionOne \
 --service-id=3dca0574e07143d3a11fb5107851933f \
 --publicurl='http://localhost:8774/v2/%(tenant_id)s' \
 --internalurl='http://localhost:8774/v2/%(tenant_id)s' \
 --adminurl='http://localhost:8774/v2/%(tenant_id)s'

7)
#keystone endpoint-list

8)
#cd install_dir/keystone
#source .venv/bin/activate
#./bin/keystone-all

9)
#cd install_dir/horizon
#source .venv/bin/activate
#python manage.py runserver

10)
*Goto Horizon and try to login again
http://127.0.0.1:8000/auth/login/

Reference link
-----------------------

http://docs.openstack.org/trunk/openstack-compute/install/yum/content/defining-services.html
http://docs.openstack.org/trunk/openstack-compute/install/yum/content/keystone-service-endpoint-create.html

Complete Error Log from Horizon
--------------------------------------------------------

DEBUG:openstack_auth.backend:Beginning user authentication for user "admin".
DEBUG:openstack_auth.backend:Authentication completed for user "admin".
[02/May/2013 19:11:47] "POST /auth/login/ HTTP/1.1" 302 0
[02/May/2013 19:11:47] "GET / HTTP/1.1" 302 0
ERROR:django.request:Internal Server Error: /admin/
Traceback (most recent call last):
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 38, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 86, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 54, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 38, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/decorators.py", line 86, in dec
    return view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 48, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 155, in get
    handled = self.construct_tables()
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 146, in construct_tables
    handled = self.handle_table(table)
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 118, in handle_table
    data = self._get_data_dict()
  File "/home/saju/ops_manual/horizon/horizon/tables/views.py", line 182, in _get_data_dict
    self._data = {self.table_class._meta.name: self.get_data()}
  File "/home/saju/ops_manual/horizon/openstack_dashboard/dashboards/admin/overview/views.py", line 41, in get_data
    data = super(GlobalOverview, self).get_data()
  File "/home/saju/ops_manual/horizon/openstack_dashboard/usage/views.py", line 33, in get_data
    self.usage.summarize(*self.usage.get_date_range())
  File "/home/saju/ops_manual/horizon/openstack_dashboard/usage/base.py", line 98, in summarize
    _('Unable to retrieve usage information.'))
  File "/home/saju/ops_manual/horizon/openstack_dashboard/usage/base.py", line 95, in summarize
    self.usage_list = self.get_usage_list(start, end)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/usage/base.py", line 130, in get_usage_list
    return api.nova.usage_list(self.request, start, end)
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/nova.py", line 487, in usage_list
    novaclient(request).usage.list(start, end, True)]
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/nova.py", line 255, in novaclient
    (request.user.token.id, url_for(request, 'compute')))
  File "/home/saju/ops_manual/horizon/openstack_dashboard/api/base.py", line 166, in url_for
    raise exceptions.ServiceCatalogException(service_type)
ServiceCatalogException: Invalid service catalog service: compute
[02/May/2013 19:11:47] "GET /admin/ HTTP/1.1" 500 214050

Horizone Keystone Unable to communicate with identity service Unable to sign token

Log from Horizon
-----------------------

DEBUG:openstack_auth.backend:Beginning user authentication for user "admin".
DEBUG:openstack_auth.backend:Authorization Failed: Unable to communicate with identity service: {"error": {"message": "Unable to sign token.", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
[02/May/2013 12:17:25] "POST /auth/login/ HTTP/1.1" 200 4453
[02/May/2013 12:17:25] "GET /i18n/js/horizon/ HTTP/1.1" 200 2158

Log from Keystone
-------------------------

2013-05-02 17:45:59    ERROR [keystone.common.cms] Signing error: Unable to load certificate - ensure you've configured PKI with 'keystone-manage pki_setup'
2013-05-02 17:45:59  WARNING [keystone.common.wsgi] Unable to sign token.

Solution
-----------

#cd install_dir/keystone
#source .venv/bin/activate


#./bin/keystone-manage pki_setup

#sudo chown saju:root -R /etc/keystone/ssl/


#./bin/keystone-all

Horizon Keystone EmptyCatalog The service catalog is empty

Error Log from Horizon
-------------------------------

raise exceptions.EmptyCatalog('The service catalog is empty.')
EmptyCatalog: The service catalog is empty.

Solution
-----------

1)
Your /etc/keystone/keystone.conf file should contain the following lines if it is properly configured to use the database backend.
[catalog]
driver = keystone.catalog.backends.sql.Catalog
     
2)
#cd install_dir/horizon
#source .venv/bin/activate
#export OS_SERVICE_TOKEN="ADMIN"
#export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0

3)
#keystone service-list

4)
#keystone service-create --name=keystone --type=identity --description="Identity Service"

5)
#keystone service-list

6)
#keystone endpoint-list

7)
#keystone endpoint-create \
 --region RegionOne \
 --service-id=008711821700476984af78121941320e \
 --publicurl=http://localhost:5000/v2.0 \
 --internalurl=http://localhost:5000/v2.0 \
 --adminurl=http://localhost:35357/v2.0

8)
#keystone endpoint-list

9)
#cd install_dir/keystone
#source .venv/bin/activate
#./bin/keystone-all

10)
#cd install_dir/horizon
#source .venv/bin/activate
#python manage.py runserver

11)
*Goto Horizon and try to login again
http://127.0.0.1:8000/auth/login/


Reference link
------------------
http://docs.openstack.org/trunk/openstack-compute/install/yum/content/defining-services.html
http://docs.openstack.org/trunk/openstack-compute/install/yum/content/keystone-service-endpoint-create.html

Complete Error log from Horizon
-------------------------------------------

DEBUG:openstack_auth.backend:Beginning user authentication for user "admin".
ERROR:django.request:Internal Server Error: /auth/login/
Traceback (most recent call last):
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/decorators/debug.py", line 69, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 89, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/openstack_auth/views.py", line 60, in login
    extra_context=extra_context)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/decorators/debug.py", line 69, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 89, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/contrib/auth/views.py", line 36, in login
    if form.is_valid():
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/forms/forms.py", line 124, in is_valid
    return self.is_bound and not bool(self.errors)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/forms/forms.py", line 115, in _get_errors
    self.full_clean()
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/forms/forms.py", line 271, in full_clean
    self._clean_form()
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/forms/forms.py", line 299, in _clean_form
    self.cleaned_data = self.clean()
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/views/decorators/debug.py", line 34, in sensitive_variables_wrapper
    return func(*args, **kwargs)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/openstack_auth/forms.py", line 57, in clean
    auth_url=region)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 45, in authenticate
    user = backend.authenticate(**credentials)
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/openstack_auth/backend.py", line 128, in authenticate
    client.service_catalog.url_for())
  File "/home/saju/ops_manual/horizon/.venv/local/lib/python2.7/site-packages/keystoneclient/service_catalog.py", line 66, in url_for
    raise exceptions.EmptyCatalog('The service catalog is empty.')
EmptyCatalog: The service catalog is empty.
[02/May/2013 18:17:19] "POST /auth/login/ HTTP/1.1" 500 172058

Thursday, May 2, 2013

keystone Invalid OpenStack Identity credentials

Error Log
------------
1)
Expecting authentication method via
  either a service token, --os-token or env[OS_SERVICE_TOKEN],
  or credentials, --os-username or env[OS_USERNAME].

2)
Invalid OpenStack Identity credentials


Solution
-----------
saju@saju-desktop:~/openstk_manual/horizon$
saju@saju-desktop:~/openstk_manual/horizon$ source .venv/bin/activate
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ keystone tenant-list
Expecting authentication method via
  either a service token, --os-token or env[OS_SERVICE_TOKEN],
  or credentials, --os-username or env[OS_USERNAME].

(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ export OS_SERVICE_TOKEN="my-dummy-token"
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ keystone tenant-list
Invalid OpenStack Identity credentials.

(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ export OS_SERVICE_TOKEN="ADMIN1"
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ keystone tenant-list
Invalid OpenStack Identity credentials.

(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ export OS_SERVICE_TOKEN="ADMIN"
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ keystone tenant-list

(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ keystone tenant-create --name=admin
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |                                  |
|   enabled   |               True               |
|      id     | 188fce18647d4a1a9f68d132f820b8cd |
|     name    |              admin               |
+-------------+----------------------------------+
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$ keystone tenant-list
+----------------------------------+-------+---------+
|                id                |  name | enabled |
+----------------------------------+-------+---------+
| 188fce18647d4a1a9f68d132f820b8cd | admin |   True  |
+----------------------------------+-------+---------+
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$
(.venv)saju@saju-desktop:~/openstk_manual/horizon$

openstack_auth.backend:Authorization Failed: [Errno 111] Connection refused

Error Log
-------------
DEBUG:openstack_auth.backend:Authorization Failed: [Errno 111] Connection refused

Solution
-----------
a) check whether "keystone" service is running or not

b) Do following steps, if "keystone" service is not running

#cd keystone
#Activate virtualenv
#source .venv/bin/activate
#Run keystone service
#./bin/keystone-all

openstack_auth.backend:Authorization Failed An unexpected error prevented the server from fulfilling your request. (OperationalError) no such table

Error Log
-------------
DEBUG:openstack_auth.backend:Authorization Failed: Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (OperationalError) no such table: user u'SELECT user.id AS user_id, user.name AS user_name, user.domain_id AS user_domain_id, user.password AS user_password, user.enabled AS user_enabled, user.extra AS user_extra \\nFROM user \\nWHERE user.name = ? AND user.domain_id = ?' (u'admin', 'default')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)

Solution
-----------
#cd keystone

#Activate virtualenv
#source .venv/bin/activate

#Sync database
#./bin/keystone-manage db_sync

#Run keystone service
#./bin/keystone-all

OR

Following lines are missing in vim /etc/keystone/keystone.conf
[sql]
connection = mysql://root:password@127.0.0.1/keystone?charset=utf8