osuosl / vagrant-ganeti

Vagrant files for a Ganeti tutorial and/or Ganeti testing environment
28 stars 13 forks source link

Exception Type: GanetiApiError at /vm/add #8

Open natea opened 11 years ago

natea commented 11 years ago

When I try to add a new vm, I get this error:

Environment:

Request Method: POST
Request URL: http://localhost:8000/vm/add

Django Version: 1.4.8
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.formtools',
 'django.contrib.messages',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'registration',
 'ganeti_web',
 'object_permissions',
 'object_log',
 'south',
 'haystack',
 'muddle',
 'muddle.shots',
 'muddle_users',
 'include_strip_tag',
 'django_tables2')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'ganeti_web.middleware.PermissionDeniedMiddleware')

Traceback:
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/views/generic/base.py" in view
  48.             return self.dispatch(request, *args, **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  25.             return bound_func(*args, **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  20.                 return view_func(request, *args, **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/ganeti_web/views/generic.py" in dispatch
  28.         return super(LoginRequiredMixin, self).dispatch(*args, **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/ganeti_web/views/generic.py" in dispatch
  84.             **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/contrib/formtools/wizard/views.py" in dispatch
  223.         response = super(WizardView, self).dispatch(request, *args, **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
  69.         return handler(request, *args, **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/contrib/formtools/wizard/views.py" in post
  286.                 return self.render_done(form, **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/venv/lib/python2.7/site-packages/django/contrib/formtools/wizard/views.py" in render_done
  328.         done_response = self.done(final_form_list, **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/ganeti_web/forms/virtual_machine.py" in done
  1322.             vm = template_to_instance(template, hostname, owner)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/ganeti_web/backend/templates.py" in template_to_instance
  148.                                          **kwargs)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/ganeti_web/util/client.py" in CreateInstance
  492.                                  content=body)
File "/Users/nateaune/Dropbox/code/ganeti_webmgr/ganeti_web/util/client.py" in _SendRequest
  253.             raise GanetiApiError(str(r.status_code), code=r.status_code)

Exception Type: GanetiApiError at /vm/add
Exception Value: 401
``
natea commented 11 years ago

The cluster is working fine:

vagrant@node1:~$ sudo gnt-cluster verify
Submitted jobs 31, 32
Waiting for job 31 ...
Sun Oct 20 19:04:33 2013 * Verifying cluster config
Sun Oct 20 19:04:33 2013 * Verifying cluster certificate files
Sun Oct 20 19:04:33 2013 * Verifying hypervisor parameters
Sun Oct 20 19:04:33 2013 * Verifying all nodes belong to an existing group
Waiting for job 32 ...
Sun Oct 20 19:04:33 2013 * Verifying group 'default'
Sun Oct 20 19:04:33 2013 * Gathering data (1 nodes)
Sun Oct 20 19:04:34 2013 * Gathering disk information (1 nodes)
Sun Oct 20 19:04:34 2013 * Verifying configuration file consistency
Sun Oct 20 19:04:34 2013 * Verifying node status
Sun Oct 20 19:04:34 2013 * Verifying instance status
Sun Oct 20 19:04:34 2013 * Verifying orphan volumes
Sun Oct 20 19:04:34 2013 * Verifying N+1 Memory redundancy
Sun Oct 20 19:04:34 2013 * Other Notes
Sun Oct 20 19:04:34 2013 * Hooks Results
natea commented 11 years ago

Once I added the admin user 'vagrant' and password 'vagrant', then to the cluster, then I was able to create the VM without getting the error. It should probably check if you have defined a un/pw and not let you attempt to create a VM until you've filled in that info.

natea commented 11 years ago

oops.. re-opening as a reminder to more gracefully handle the error.

pramttl commented 11 years ago

@natea,

Its seems that your issue is more applicable to Ganeti Web Manager than vagrant-ganeti. You could add this on the GWM issue tracker or discuss this on freenode at #ganeti_webmgr for quick answers.

I'l look into this.