[Openstack] Logic for putting project_id on volume

Ricardo Carrillo Cruz emaildericky at gmail.com
Mon Apr 18 10:18:39 UTC 2011


Hi guys

I'm doing this rough code to list the volumes by project:

volumes = db.volume_get_all_by_project(ctxt, project)

for v in volumes:
    print v.name, v.user_id, v.project_id

However, I get this odd result:


root at dormammu-VirtualBox:/home/dormammu/src/nova/lp731341/bin#
euca-create-volume -s 1 -z nova
VOLUME  vol-00000001    1       creating (admin, None, None, None)
 2011-04-18T10:08:44Z
root at dormammu-VirtualBox:/home/dormammu/src/nova/lp731341/bin#
./nova-manage volume list admin
2011-04-18 12:09:06,579 DEBUG nova.utils [-] backend <module
'nova.db.sqlalchemy.api' from
'/home/dormammu/src/nova/lp731341/nova/db/sqlalchemy/api.pyc'> from
(pid=2137) __get_backend
/home/dormammu/src/nova/lp731341/nova/utils.py:427
volume-00000001 admin admin
root at dormammu-VirtualBox:/home/dormammu/src/nova/lp731341/bin#
./nova-manage volume list lol
2011-04-18 12:09:12,795 DEBUG nova.utils [-] backend <module
'nova.db.sqlalchemy.api' from
'/home/dormammu/src/nova/lp731341/nova/db/sqlalchemy/api.pyc'> from
(pid=2144) __get_backend
/home/dormammu/src/nova/lp731341/nova/utils.py:427
volume-00000001 admin admin

volume_get_all_by_project does not check the project_id passed exists
(not a big deal), however I'm more concerned that no matter what
project_id is used, it will always return the 'admin' project volumes
.

Is this a bug?
Is there a way to specify to euca-create-volume what project should
the volume set to?

Regards




More information about the Openstack mailing list