Description of problem: [root@ykaul-os-glance images(keystone_admin)]$ glance-cache-manage list-cached /usr/bin/glance-cache-manage:40: UserWarning: The 'glance.client' module is deprecated in favor of the 'glanceclient' module provided by python-glanceclient (see http://github.com/openstack/python-glanceclient). from glance import client as glance_client Found 2 cached images... ID Last Accessed (UTC) Last Modified (UTC) Size Hits ------------------------------------ ------------------- ------------------- -------------- ---------- a92439a6-5923-4ca8-98ae-ceabe3c164f6 0.0 1356610380.5 101920768 0 b5379980-341a-454c-a811-5783ab5b9d52 1357651562.16 1357650338.09 283705344 2 The 'Last Accessed' and 'Last Modified' dates are not formatted. Version-Release number of selected component (if applicable): openstack-glance-2012.2.1-1.el6ost.noarch How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Confirmed, it would be a simple matter to convert from seconds since the epoch to iso8601 format before displaying.
- Version Info: ================ $ rpm -q openstack-glance --changelog | grep 893045 - Prints list-cached dates in isoformat rhbz#893045 [tuser1@interceptor ~(keystone_admin)]$ $ rpm -q openstack-glance openstack-glance-2012.2.3-7.el6ost.noarch ================ - Ensure the fix is in: ================ $ egrep -i 'iso8601' /usr/lib/python2.6/site-packages/glance/openstack/common/timeutils.py -A2 import iso8601 -- return iso8601.parse_date(timestr) except iso8601.ParseError as e: raise ValueError(e.message) except TypeError as e: -- def iso8601_from_timestamp(timestamp): """Returns a iso8601 formated date from timestamp""" return isotime(datetime.datetime.utcfromtimestamp(timestamp)) ================ I have these setting enabled ================ # Address to find the registry server . # kashyap enabled this manually registry_host = 0.0.0.0 # Port the registry server is listening on # kashyap enabled this manually registry_port = 9191 [app:glance-pruner] paste.app_factory = glance.image_cache.pruner:app_factory [app:glance-prefetcher] paste.app_factory = glance.image_cache.prefetcher:app_factory [app:glance-cleaner] paste.app_factory = glance.image_cache.cleaner:app_factory [app:glance-queue-image] paste.app_factory = glance.image_cache.queue_image:app_factory ================ Enable the log file ================ $ sudo egrep -i log_file /etc/glance/glance-cache.conf log_file = /var/log/glance/image-cache.log # Send logs to syslog (/dev/log) instead of to file specified by `log_file` $ ================ And, enabled debug/verbose: ================ $ sudo egrep -i 'verbose|debug' /etc/glance/glance-cache.conf| grep -v ^$ | grep -v ^# verbose = True debug = True ================ Restarted all glance services: ================ for j in `for i in $(ls -1 /etc/init.d/openstack-glance-*) ; do $i status | grep running ; done | awk '{print $1}'` ; do service $j restart ; done ================ And I still get this: ================ $ glance-cache-manage list-cached Cache management middleware not enabled on host 0.0.0.0 ================ glance-cache.log is not even present. ================ $ sudo ls /var/log/glance/*.log /var/log/glance/api.log /var/log/glance/registry.log /var/log/glance/scrubber.log ================ Any hints how to "enable" cache management middleware ?
Adding my glance-cache.conf for reference ================ $ sudo cat /etc/glance/glance-cache.conf| grep -v ^$ | grep -v ^# [DEFAULT] verbose = True debug = True log_file = /var/log/glance/image-cache.log image_cache_max_size = 10737418240 registry_host = 0.0.0.0 registry_port = 9191 [app:glance-pruner] paste.app_factory = glance.image_cache.pruner:app_factory [app:glance-prefetcher] paste.app_factory = glance.image_cache.prefetcher:app_factory [app:glance-cleaner] paste.app_factory = glance.image_cache.cleaner:app_factory [app:glance-queue-image] paste.app_factory = glance.image_cache.queue_image:app_factory ================ Commmon glance commads do work: ================ $ glance image-list +--------------------------------------+-----------+-------------+------------------+------------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+-----------+-------------+------------------+------------+--------+ | 40497881-5a89-4c39-b3f7-5d22db2fee51 | fedora-16 | qcow2 | bare | 213581824 | active | | 1e6292f9-82bd-4cdb-969e-c863cb1c6692 | fedora-17 | qcow2 | bare | 251985920 | active | | acc4c853-9153-4e80-b3c8-e253451ae983 | rhel63 | qcow2 | bare | 1074135040 | active | +--------------------------------------+-----------+-------------+------------------+------------+--------+ ================ Setup info: glance, nova, keystone, cinder are configured on a single physical node, manually.
VERIFIED [tuser1@interceptor ~(keystone_admin)]$ glance-cache-manage list-cached No cached images. [tuser1@interceptor ~(keystone_admin)]$ Posting these for reference: ======================================== # sudo cat /etc/glance/glance-cache.conf | grep -v ^$ | grep -v ^# [DEFAULT] verbose = True debug = True log_file = /var/log/glance/image-cache.log image_cache_max_size = 10737418240 registry_host = 0.0.0.0 registry_port = 9191 [app:glance-pruner] paste.app_factory = glance.image_cache.pruner:app_factory [app:glance-prefetcher] paste.app_factory = glance.image_cache.prefetcher:app_factory [app:glance-cleaner] paste.app_factory = glance.image_cache.cleaner:app_factory [app:glance-queue-image] paste.app_factory = glance.image_cache.queue_image:app_factory ========================================
Adding for later reference: glance-cache.conf ======================================== [root@interceptor glance(keystone_admin)]# sudo cat /etc/glance/glance-cache.conf | grep -v ^$ | grep -v ^# [DEFAULT] verbose = True debug = True log_file = /var/log/glance/image-cache.log image_cache_max_size = 10737418240 registry_host = 0.0.0.0 registry_port = 9191 [app:glance-pruner] paste.app_factory = glance.image_cache.pruner:app_factory [app:glance-prefetcher] paste.app_factory = glance.image_cache.prefetcher:app_factory [app:glance-cleaner] paste.app_factory = glance.image_cache.cleaner:app_factory [app:glance-queue-image] paste.app_factory = glance.image_cache.queue_image:app_factory [root@interceptor glance(keystone_admin)]# ========================================
Created attachment 712615 [details] adding glance-api-paste.ini for reference
(In reply to comment #11) > VERIFIED > > [tuser1@interceptor ~(keystone_admin)]$ glance-cache-manage list-cached > No cached images. Kashyap, please verify the initial bug is fixed - that the time and dates are indeed humanly readable.
Some context: ============= So, first we have to queue the image, then call the glance-cache-prefetcher, only then we could this. Thanks to Flavico for providing this esoteric info: -> list the image: ================ $ glance image-list +--------------------------------------+-----------+-------------+------------------+------------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+-----------+-------------+------------------+------------+--------+ | 40497881-5a89-4c39-b3f7-5d22db2fee51 | fedora-16 | qcow2 | bare | 213581824 | active | | 1e6292f9-82bd-4cdb-969e-c863cb1c6692 | fedora-17 | qcow2 | bare | 251985920 | active | | acc4c853-9153-4e80-b3c8-e253451ae983 | rhel63 | qcow2 | bare | 1074135040 | active | +--------------------------------------+-----------+-------------+------------------+------------+--------+ ================ -> queue the image ================ $ glance-cache-manage queue-image 40497881-5a89-4c39-b3f7-5d22db2fee51 Queue image 40497881-5a89-4c39-b3f7-5d22db2fee51 for caching? [y/N] y ================ ================ $ glance-cache-prefetcher Traceback (most recent call last): File "/usr/bin/glance-cache-prefetcher", line 49, in <module> config.parse_cache_args() File "/usr/lib/python2.6/site-packages/glance/common/config.py", line 77, in parse_cache_args return parse_args(args=args, default_config_files=config_files) File "/usr/lib/python2.6/site-packages/glance/common/config.py", line 72, in parse_args default_config_files=default_config_files) File "/usr/lib/python2.6/site-packages/glance/openstack/common/cfg.py", line 1028, in __call__ self._parse_config_files() File "/usr/lib/python2.6/site-packages/glance/openstack/common/cfg.py", line 1498, in _parse_config_files raise ConfigFilesNotFoundError(not_read_ok) glance.openstack.common.cfg.ConfigFilesNotFoundError: Failed to read some config files: /usr/share/glance/glance-cache-dist.conf,/etc/glance/glance-cache.conf ================ Why can't it read, the files still exist. ================ $ sudo ls -al /etc/glance/glance-cache.conf /usr/share/glance/glance-cache-dist.conf -rw-r-----. 1 root glance 493 Mar 19 14:47 /etc/glance/glance-cache.conf -rw-r-----. 1 root glance 116 Mar 14 05:16 /usr/share/glance/glance-cache-dist.conf ================
Sorry about that, some more investigation needed, now VERIFIED: Now they're in readable form ============= # glance-cache-manage list-cached Found 1 cached images... ID Last Accessed (UTC) Last Modified (UTC) Size Hits ------------------------------------ ------------------- ------------------- -------------- ---------- 40497881-5a89-4c39-b3f7-5d22db2fee51 N/A 2013-03-20T09:44:25 213581824 0 ============= Some info: Not only permissions, some keystone parameters are also missing: ============= $ sudo chmod -R a+r /usr/share/glance ============= $ sudo ls -al /etc/glance/glance-cache.conf /usr/share/glance/glance-cache-dist.conf -rw-r--r--. 1 root glance 605 Mar 20 15:14 /etc/glance/glance-cache.conf -rw-r--r--. 1 root glance 116 Mar 14 05:16 /usr/share/glance/glance-cache-dist.conf ============= New glance-cache.conf with updated keystone parameters: ============= $ sudo cat /etc/glance/glance-cache.conf [DEFAULT] verbose = True debug = True log_file = /var/log/glance/image-cache.log image_cache_max_size = 10737418240 registry_host = 0.0.0.0 registry_port = 9191 auth_url = http://127.0.0.1:35357/v2.0/ admin_tenant_name = admin admin_user = admin admin_password = secret [app:glance-pruner] paste.app_factory = glance.image_cache.pruner:app_factory [app:glance-prefetcher] paste.app_factory = glance.image_cache.prefetcher:app_factory [app:glance-cleaner] paste.app_factory = glance.image_cache.cleaner:app_factory [app:glance-queue-image] paste.app_factory = glance.image_cache.queue_image:app_factory =============
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0672.html