hep-gc / cloudscheduler

Apache License 2.0
5 stars 2 forks source link

avoid traceback when multiple networks found #284

Closed rseuster closed 4 years ago

rseuster commented 4 years ago

I just setup hephy in csv2a, we not see this traceback:

2020-01-16 21:02:43,750 - csmain       - 2659539 - ERROR - Multiple possible networks found, use a Network ID to be more specific. (HTTP 409) (Request-ID: req-1f9c6154-4c2b-42f3-ab9c-1ef59ccbaaaa)
2020-01-16 21:02:43,751 - csmain       - 2659539 - ERROR - Disable cloud hephy due to exception(later).
Traceback (most recent call last):
  File "/opt/cloudscheduler/cloudscheduler/openstackcloud.py", line 196, in vm_create
    security_groups=self.default_security_groups, max_count=num)
  File "/usr/lib/python3.6/site-packages/novaclient/v2/servers.py", line 1373, in create
    return self._boot(response_key, *boot_args, **boot_kwargs)
  File "/usr/lib/python3.6/site-packages/novaclient/v2/servers.py", line 810, in _boot
    return_raw=return_raw, **kwargs)
  File "/usr/lib/python3.6/site-packages/novaclient/base.py", line 364, in _create
    resp, body = self.api.client.post(url, body=body)
  File "/usr/lib/python3.6/site-packages/keystoneauth1/adapter.py", line 381, in post
    return self.request(url, 'POST', **kwargs)
  File "/usr/lib/python3.6/site-packages/novaclient/client.py", line 78, in request
    raise exceptions.from_response(resp, body, url, method)
novaclient.exceptions.Conflict: Multiple possible networks found, use a Network ID to be more specific. (HTTP 409) (Request-ID: req-1f9c6154-4c2b-42f3-ab9c-1ef59ccbaaaa)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/cloudscheduler/cloudscheduler/csmain", line 414, in main
    image=use_image)
  File "/opt/cloudscheduler/cloudscheduler/openstackcloud.py", line 240, in vm_create
    raise novaclient.exceptions.Conflict
TypeError: __init__() missing 1 required positional argument: 'code'
2020-01-16 21:02:43,751 - csmain       - 2659539 - INFO - No Flavor Slots for atlas-cern, target alias: hephy-uibk.
2020-01-16 21:02:43,752 - csmain       - 2659539 - DEBUG - provider: 8 used:8
colsond commented 4 years ago

This is something we've seen in the past, csv2 is unable to boot VMs when no network is defined and there is multiple to choose from. I can clean up the trace stack and put a cleaner log message but either way you aren't going to get a VM.

rseuster commented 4 years ago

Thanks, csv2 shouldn't through a traceback for well known error conditions. I know that you don't get a VM, that was not the point of this report ;)

rseuster commented 4 years ago

closing