nova cloudpipe-create PROJECT_NAME fails

Asked by Christian Parpart

Hey,

I was following a few guides on how to setup a cloudpipe image and how to proceed.
However, executing the command `nova cloudpipe-create production` (production is the name of my project/tenant)
fails with 500 and writes the following into my nova-scheduler.log:

2012-06-01 17:41:41 ERROR nova.rpc.amqp [req-895ca733-3f5a-4be8-bd63-cecb71d7e8d3 project-vpn production] Returning exception 'NoneType' object has no attribute 'get' to caller
2012-06-01 17:41:41 ERROR nova.rpc.amqp [req-895ca733-3f5a-4be8-bd63-cecb71d7e8d3 project-vpn production] ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 252, in _process_data\n rval = node_func(context=ctxt, **node_args)\n', ' File "/usr/lib/python2.7/dist-packages/nova/scheduler/manager.py", line 115, in run_instance\n context, ex, *args, **kwargs)\n', ' File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__\n self.gen.next()\n', ' File "/usr/lib/python2.7/dist-packages/nova/scheduler/manager.py", line 105, in run_instance\n return self.driver.schedule_run_instance(*args, **kwargs)\n', ' File "/usr/lib/python2.7/dist-packages/nova/scheduler/multi.py", line 78, in schedule_run_instance\n return self.drivers[\'compute\'].schedule_run_instance(*args, **kwargs)\n', ' File "/usr/lib/python2.7/dist-packages/nova/scheduler/filter_scheduler.py", line 72, in schedule_run_instance\n *args, **kwargs)\n', ' File "/usr/lib/python2.7/dist-packages/nova/scheduler/filter_scheduler.py", line 194, in _schedule\n filter_properties)\n', ' File "/usr/lib/python2.7/dist-packages/nova/scheduler/host_manager.py", line 218, in filter_hosts\n if host.passes_filters(filter_fns, filter_properties):\n', ' File "/usr/lib/python2.7/dist-packages/nova/scheduler/host_manager.py", line 156, in passes_filters\n if not filter_fn(self, filter_properties):\n', ' File "/usr/lib/python2.7/dist-packages/nova/scheduler/filters/affinity_filter.py", line 41, in host_passes\n affinity_uuids = scheduler_hints.get(\'different_host\', [])\n', "AttributeError: 'NoneType' object has no attribute 'get'\n"]

Is this my fault or is this a bug?
In the first case, how can I fix / work around this ?

Many thanks,
Christian Parpart.

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Christian Parpart
Solved:
Last query:
Last reply:
Revision history for this message
Vish Ishaya (vishvananda) said :
#1

This is a bug. Looks like affinity filters + cloudpipe is broken.

Fix is easy:

diff --git a/nova/scheduler/filters/affinity_filter.py b/nova/scheduler/filters/affinity_filter.py
index e6e7a11..34c8e95 100644
--- a/nova/scheduler/filters/affinity_filter.py
+++ b/nova/scheduler/filters/affinity_filter.py
@@ -35,7 +35,7 @@ class DifferentHostFilter(AffinityFilter):

     def host_passes(self, host_state, filter_properties):
         context = filter_properties['context']
- scheduler_hints = filter_properties['scheduler_hints']
+ scheduler_hints = filter_properties['scheduler_hints'] or {}
         me = host_state.host

         affinity_uuids = scheduler_hints.get('different_host', [])
@@ -54,7 +54,7 @@ class SameHostFilter(AffinityFilter):

     def host_passes(self, host_state, filter_properties):
         context = filter_properties['context']
- scheduler_hints = filter_properties['scheduler_hints']
+ scheduler_hints = filter_properties['scheduler_hints'] or {}
         me = host_state.host

         affinity_uuids = scheduler_hints.get('same_host', [])
@@ -68,7 +68,7 @@ class SameHostFilter(AffinityFilter):

 class SimpleCIDRAffinityFilter(AffinityFilter):
     def host_passes(self, host_state, filter_properties):
- scheduler_hints = filter_properties['scheduler_hints']
+ scheduler_hints = filter_properties['scheduler_hints'] or {}

         affinity_cidr = scheduler_hints.get('cidr', '/24')
         affinity_host_addr = scheduler_hints.get('build_near_host_ip')

also, you need to use the project_id/tenant_id not the project name. Nova doesn't keep track of project names.

Revision history for this message
Christian Parpart (trapni) said :
#2

Hey, many thanks for your reply, however, your very last statement worries me:

> "also, you need to use the project_id/tenant_id not the project name. Nova doesn't keep track of project names."

you actually mean the keystone's tenant_id, right? because there is still a projects table in the nova database, which I filled initially, also (I did not know the impact of that table anyway <-- I'm still somewhat new to all around OpenStack :-)

Many thanks,
Christian.

Revision history for this message
Vish Ishaya (vishvananda) said :
#3

Yes the tenant_id from keystone. The project table in nova is only there to support migration from deprecated auth. It can safely remain empty along with the users table

Revision history for this message
Christian Parpart (trapni) said :
#4

Many thanks for this side-note :-)