How to assign network ID for the servers in context ?

Asked by longling zhang

create-snapshot-and-attach-volume.json
{% set flavor_name = flavor_name or "m1.tiny" %}
{% set image_name = image_name or "^cirros.*-disk$" %}
{
    "CinderVolumes.create_snapshot_and_attach_volume": [
        {
            "args": {
                "volume_type": false,
                "size": {
                    "min": 1,
                    "max": 5
                }
            },
            "runner": {
                "type": "constant",
                "times": 4,
                "concurrency": 2
            },
            "context": {
                "users": {
                    "tenants": 2,
                    "users_per_tenant": 1
                },
                "servers": {
                    "image": {
                        "name": "{{image_name}}"
                    },
                    "flavor": {
                        "name": "{{flavor_name}}"
                    },
                    "nics": [{"net-id": "423634d6-fa63-43e2-aeed-70f9e02a44ab"}],
                    "servers_per_tenant": 2
                }
            }
        },
        {
            "args": {
                "volume_type": true,
                "size": {
                    "min": 1,
                    "max": 5
                }
            },
            "runner": {
                "type": "constant",
                "times": 4,
                "concurrency": 2
            },
            "context": {
                "users": {
                    "tenants": 2,
                    "users_per_tenant": 1
                },
                "servers": {
                    "image": {
                        "name": "{{image_name}}"
                    },
                    "flavor": {
                        "name": "{{flavor_name}}"
                    },
                    "nics": [{"net-id": "423634d6-fa63-43e2-aeed-70f9e02a44ab"}],
                    "servers_per_tenant": 2
                }
            }
        }

    ]
}

when I run the Scenario,always raise the error ValueError: nics must be a list
How to assign network ID for the servers in context ?

Question information

Language:
English Edit question
Status:
Expired
For:
Rally Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andriy Kurilin (andreykurilin) said :
#1

strange... your sample should work. Can you share the full trace

Revision history for this message
longling zhang (longing) said :
#2

 rally -v task start create-snapshot-and-attach-volume.json --task-args-file /opt/rally/args.json
Option "verbose" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
Running Rally version 0.8.2~dev122
--------------------------------------------------------------------------------
Preparing input task
--------------------------------------------------------------------------------

Task is:

{
    "CinderVolumes.create_snapshot_and_attach_volume": [
        {
            "args": {
                "volume_type": false,
                "size": {
                    "min": 1,
                    "max": 5
                }
            },
            "runner": {
                "type": "constant",
                "times": 4,
                "concurrency": 2
            },
            "context": {
                "users": {
                    "tenants": 2,
                    "users_per_tenant": 1
                },
                "servers": {
                    "image": {
                        "name": "cirros"
                    },
                    "flavor": {
                        "name": "m1.tiny"
                    },
                    "nics": [{"net-id": "423634d6-fa63-43e2-aeed-70f9e02a44ab"}],
                    "servers_per_tenant": 2
                }
            }
        },
        {
            "args": {
                "volume_type": true,
                "size": {
                    "min": 1,
                    "max": 5
                }
            },
            "runner": {
                "type": "constant",
                "times": 4,
                "concurrency": 2
            },
            "context": {
                "users": {
                    "tenants": 2,
                    "users_per_tenant": 1
                },
                "servers": {
                    "image": {
                        "name": "cirros"
                    },
                    "flavor": {
                        "name": "m1.tiny"
                    },
                    "nics": [{"net-id": "423634d6-fa63-43e2-aeed-70f9e02a44ab"}],
                    "servers_per_tenant": 2
                }
            }
        }

    ]
}

Task syntax is correct :)
2017-03-21 10:51:18.765 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Task validation.
2017-03-21 10:51:18.842 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Task validation of scenarios names.
2017-03-21 10:51:18.848 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Task validation of scenarios names.
2017-03-21 10:51:18.848 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Task validation of syntax.
2017-03-21 10:51:18.888 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Task validation of syntax.
2017-03-21 10:51:18.889 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Task validation of semantic.
2017-03-21 10:51:19.381 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Enter context: `users`
2017-03-21 10:51:20.490 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Enter context: `users`
2017-03-21 10:51:21.590 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Exit context: `users`
2017-03-21 10:51:25.273 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Exit context: `users`
2017-03-21 10:51:25.275 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Task validation of semantic.
2017-03-21 10:51:25.275 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Task validation.
Task config is valid :)
--------------------------------------------------------------------------------
Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94: started
--------------------------------------------------------------------------------

Benchmarking... This can take a while...

To track task status use:

        rally task status
        or
        rally task detailed

Using task: dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94
2017-03-21 10:51:25.475 26159 INFO rally.api [-] Benchmark Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 on Deployment 0995d3cc-9dd9-479e-b9e6-21bc86da0389
2017-03-21 10:51:25.485 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Benchmarking.
2017-03-21 10:51:26.119 26159 INFO rally.task.engine [-] Running benchmark with key:
{
  "kw": {
    "runner": {
      "type": "constant",
      "times": 4,
      "concurrency": 2
    },
    "args": {
      "volume_type": false,
      "size": {
        "min": 1,
        "max": 5
      }
    },
    "context": {
      "users": {
        "tenants": 2,
        "users_per_tenant": 1
      },
      "servers": {
        "image": {
          "name": "cirros"
        },
        "flavor": {
          "name": "m1.tiny"
        },
        "nics": [
          {
            "net-id": "423634d6-fa63-43e2-aeed-70f9e02a44ab"
          }
        ],
        "servers_per_tenant": 2
      }
    }
  },
  "name": "CinderVolumes.create_snapshot_and_attach_volume",
  "pos": 0
}
2017-03-21 10:51:26.154 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Enter context: `users`
2017-03-21 10:51:27.492 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Enter context: `users`
2017-03-21 10:51:27.492 26159 INFO rally.plugins.openstack.context.nova.servers [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Enter context: `Servers`
2017-03-21 10:51:28.828 26159 INFO rally.plugins.openstack.context.nova.servers [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Exit context: `Servers`
2017-03-21 10:51:29.927 26159 INFO rally.plugins.openstack.context.nova.servers [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Exit context: `Servers`
2017-03-21 10:51:29.931 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Exit context: `users`
2017-03-21 10:51:31.657 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Exit context: `users`
2017-03-21 10:51:32.200 26159 INFO rally.task.engine [-] Load duration is: 0.0
2017-03-21 10:51:32.200 26159 INFO rally.task.engine [-] Full runner duration is: 0.0
2017-03-21 10:51:32.201 26159 INFO rally.task.engine [-] Full duration is: 5.516755
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine [-] nics must be a list
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine Traceback (most recent call last):
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/task/engine.py", line 454, in run
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine with context.ContextManager(context_obj):
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/task/context.py", line 190, in __enter__
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine self.setup()
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/task/context.py", line 173, in setup
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine ctx.setup()
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/common/logging.py", line 197, in wrapper
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine result = f(self, *args, **kwargs)
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/plugins/openstack/context/nova/servers.py", line 119, in setup
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine **kwargs)
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/task/atomic.py", line 84, in func_atomic_actions
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine f = func(self, *args, **kwargs)
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/plugins/openstack/scenarios/nova/utils.py", line 599, in _boot_servers
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine **kwargs)
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/novaclient/v2/servers.py", line 1376, in create
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine self._validate_create_nics(nics)
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/novaclient/v2/servers.py", line 1296, in _validate_create_nics
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine raise ValueError('nics must be a list')
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine ValueError: nics must be a list
2017-03-21 10:51:32.380 26159 ERROR rally.task.engine
2017-03-21 10:51:32.696 26159 INFO rally.task.engine [-] Running benchmark with key:
{
  "kw": {
    "runner": {
      "type": "constant",
      "times": 4,
      "concurrency": 2
    },
    "args": {
      "volume_type": true,
      "size": {
        "min": 1,
        "max": 5
      }
    },
    "context": {
      "users": {
        "tenants": 2,
        "users_per_tenant": 1
      },
      "servers": {
        "image": {
          "name": "cirros"
        },
        "flavor": {
          "name": "m1.tiny"
        },
        "nics": [
          {
            "net-id": "423634d6-fa63-43e2-aeed-70f9e02a44ab"
          }
        ],
        "servers_per_tenant": 2
      }
    }
  },
  "name": "CinderVolumes.create_snapshot_and_attach_volume",
  "pos": 0
}
2017-03-21 10:51:32.712 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Enter context: `users`
2017-03-21 10:51:34.018 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Enter context: `users`
2017-03-21 10:51:34.019 26159 INFO rally.plugins.openstack.context.nova.servers [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Enter context: `Servers`
2017-03-21 10:51:35.037 26159 INFO rally.plugins.openstack.context.nova.servers [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Exit context: `Servers`
2017-03-21 10:51:35.755 26159 INFO rally.plugins.openstack.context.nova.servers [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Exit context: `Servers`
2017-03-21 10:51:35.756 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Starting: Exit context: `users`
2017-03-21 10:51:37.418 26159 INFO rally.plugins.openstack.context.keystone.users [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Exit context: `users`
2017-03-21 10:51:38.751 26159 INFO rally.task.engine [-] Load duration is: 0.0
2017-03-21 10:51:38.752 26159 INFO rally.task.engine [-] Full runner duration is: 0.0
2017-03-21 10:51:38.752 26159 INFO rally.task.engine [-] Full duration is: 4.708539
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine [-] nics must be a list
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine Traceback (most recent call last):
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/task/engine.py", line 454, in run
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine with context.ContextManager(context_obj):
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/task/context.py", line 190, in __enter__
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine self.setup()
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/task/context.py", line 173, in setup
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine ctx.setup()
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/common/logging.py", line 197, in wrapper
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine result = f(self, *args, **kwargs)
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/plugins/openstack/context/nova/servers.py", line 119, in setup
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine **kwargs)
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/task/atomic.py", line 84, in func_atomic_actions
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine f = func(self, *args, **kwargs)
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/rally/plugins/openstack/scenarios/nova/utils.py", line 599, in _boot_servers
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine **kwargs)
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/novaclient/v2/servers.py", line 1376, in create
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine self._validate_create_nics(nics)
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine File "/opt/rally/lib/python2.7/site-packages/novaclient/v2/servers.py", line 1296, in _validate_create_nics
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine raise ValueError('nics must be a list')
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine ValueError: nics must be a list
2017-03-21 10:51:38.828 26159 ERROR rally.task.engine
2017-03-21 10:51:38.910 26159 INFO rally.task.engine [-] Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 | Completed: Benchmarking.

--------------------------------------------------------------------------------
Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94: finished
--------------------------------------------------------------------------------

test scenario CinderVolumes.create_snapshot_and_attach_volume
args position 0
args values:
{
  "runner": {
    "type": "constant",
    "times": 4,
    "concurrency": 2
  },
  "hooks": [],
  "args": {
    "volume_type": false,
    "size": {
      "min": 1,
      "max": 5
    }
  },
  "sla": {},
  "context": {
    "users": {
      "tenants": 2,
      "users_per_tenant": 1
    },
    "servers": {
      "image": {
        "name": "cirros"
      },
      "flavor": {
        "name": "m1.tiny"
      },
      "nics": [
        {
          "net-id": "423634d6-fa63-43e2-aeed-70f9e02a44ab"
        }
      ],
      "servers_per_tenant": 2
    }
  }
}

--------------------------------------------------------------------------------
Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 has 0 error(s)
--------------------------------------------------------------------------------

+-----------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+--------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+--------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| total | n/a | n/a | n/a | n/a | n/a | n/a | n/a | 0 |
+--------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+

Load duration: 0.0
Full duration: 5.516755

HINTS:
* To plot HTML graphics with this data, run:
        rally task report dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 --out output.html

* To generate a JUnit report, run:
        rally task report dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 --junit --out output.xml

* To get raw JSON output of task results, run:
        rally task results dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94

--------------------------------------------------------------------------------

test scenario CinderVolumes.create_snapshot_and_attach_volume
args position 0
args values:
{
  "runner": {
    "type": "constant",
    "times": 4,
    "concurrency": 2
  },
  "hooks": [],
  "args": {
    "volume_type": true,
    "size": {
      "min": 1,
      "max": 5
    }
  },
  "sla": {},
  "context": {
    "users": {
      "tenants": 2,
      "users_per_tenant": 1
    },
    "servers": {
      "image": {
        "name": "cirros"
      },
      "flavor": {
        "name": "m1.tiny"
      },
      "nics": [
        {
          "net-id": "423634d6-fa63-43e2-aeed-70f9e02a44ab"
        }
      ],
      "servers_per_tenant": 2
    }
  }
}

--------------------------------------------------------------------------------
Task dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 has 0 error(s)
--------------------------------------------------------------------------------

+-----------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+--------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+--------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| total | n/a | n/a | n/a | n/a | n/a | n/a | n/a | 0 |
+--------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+

Load duration: 0.0
Full duration: 4.708539

HINTS:
* To plot HTML graphics with this data, run:
        rally task report dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 --out output.html

* To generate a JUnit report, run:
        rally task report dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94 --junit --out output.xml

* To get raw JSON output of task results, run:
        rally task results dd0229ec-bcbb-4fb6-a5aa-ff1f10174c94

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Adrian Gomez (gomadn) said :
#4

Hello,

I found the same issue in my rally deployment.

I'm running the version 0.8.2~dev71

Maybe you found some solution to this problem with the "CinderVolumes.create_snapshot_and_attach_volume" scenario since you discover this?

Thanks in advance!