[GH-ISSUE #59] Getting a 500 error if any storage pool is stopped when I try to create a new VM. #46

Closed
opened 2026-02-27 16:00:50 +03:00 by kerem · 6 comments
Owner

Originally created by @kimnzl on GitHub (May 25, 2013).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/59

On WebVirtMgr panel v2.0.0 created from a new git clone.

I get a 500 error if any storage pool is stopped when I try to create a new VM.

It might be useful to trap this error and handle it by either telling the user about the problem or by giving the option to start the pool directly from the error page.

Debug:

Environment:

Request Method: GET
Request URL: http://ra.home:81/webvirtmgr/newvm/1/

Django Version: 1.4.5
Python Version: 2.7.4
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'vds')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/var/www81/webvirtmgr/newvm/views.py" in newvm
  140.         all_img = libvirt_func.images_get_storages(conn, all_storages)
File "/var/www81/webvirtmgr/libvirt_func.py" in images_get_storages
  257.         stg.refresh(0)
File "/usr/lib/python2.7/dist-packages/libvirt.py" in refresh
  2441.         if ret == -1: raise libvirtError ('virStoragePoolRefresh() failed', pool=self)

Exception Type: libvirtError at /newvm/1/
Exception Value: Requested operation is not valid: storage pool 'storage' is not active

Originally created by @kimnzl on GitHub (May 25, 2013). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/59 On WebVirtMgr panel v2.0.0 created from a new git clone. I get a 500 error if any storage pool is stopped when I try to create a new VM. It might be useful to trap this error and handle it by either telling the user about the problem or by giving the option to start the pool directly from the error page. Debug: ``` Environment: Request Method: GET Request URL: http://ra.home:81/webvirtmgr/newvm/1/ Django Version: 1.4.5 Python Version: 2.7.4 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'vds') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') Traceback: File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/var/www81/webvirtmgr/newvm/views.py" in newvm 140. all_img = libvirt_func.images_get_storages(conn, all_storages) File "/var/www81/webvirtmgr/libvirt_func.py" in images_get_storages 257. stg.refresh(0) File "/usr/lib/python2.7/dist-packages/libvirt.py" in refresh 2441. if ret == -1: raise libvirtError ('virStoragePoolRefresh() failed', pool=self) Exception Type: libvirtError at /newvm/1/ Exception Value: Requested operation is not valid: storage pool 'storage' is not active ```
kerem closed this issue 2026-02-27 16:00:50 +03:00
Author
Owner

@retspen commented on GitHub (May 27, 2013):

Need only active storage pool for create VM.

<!-- gh-comment-id:18484894 --> @retspen commented on GitHub (May 27, 2013): Need only active storage pool for create VM.
Author
Owner

@kimnzl commented on GitHub (May 27, 2013):

Does that mean you need all the pools active to create VMs?
Or just the one you plan on using for storage?

<!-- gh-comment-id:18488237 --> @kimnzl commented on GitHub (May 27, 2013): Does that mean you need all the pools active to create VMs? Or just the one you plan on using for storage?
Author
Owner

@retspen commented on GitHub (May 27, 2013):

Need at least one where the VM images will be saved. Got to storage page and click button: "Start" or create new storage pool.

<!-- gh-comment-id:18488396 --> @retspen commented on GitHub (May 27, 2013): Need at least one where the VM images will be saved. Got to storage page and click button: "Start" or create new storage pool.
Author
Owner

@kimnzl commented on GitHub (May 30, 2013):

When I have:
storage pool 'default' online (started)
storage pool 'ubuntu1304' offline (stopped)
storage pool 'storage' online (started)
I still get the error. I would expect based on what you have said that this is not what is meant to happen.
As far as I can see from the code all pools would need to be started for it to work and allow for a new VM.
How can a storage location be refreshed 'stg.refresh(0)' if it is not started?

Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/var/www81/webvirtmgr/newvm/views.py" in newvm
  140.         all_img = libvirt_func.images_get_storages(conn, all_storages)
File "/var/www81/webvirtmgr/libvirt_func.py" in images_get_storages
  257.         stg.refresh(0)
File "/usr/lib/python2.7/dist-packages/libvirt.py" in refresh
  2441.         if ret == -1: raise libvirtError ('virStoragePoolRefresh() failed', pool=self)

Exception Type: libvirtError at /newvm/1/
Exception Value: Requested operation is not valid: storage pool 'ubuntu1304' is not active
<!-- gh-comment-id:18667564 --> @kimnzl commented on GitHub (May 30, 2013): When I have: storage pool 'default' online (started) storage pool 'ubuntu1304' offline (stopped) storage pool 'storage' online (started) I still get the error. I would expect based on what you have said that this is not what is meant to happen. As far as I can see from the code all pools would need to be started for it to work and allow for a new VM. How can a storage location be refreshed 'stg.refresh(0)' if it is not started? ``` Traceback: File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/var/www81/webvirtmgr/newvm/views.py" in newvm 140. all_img = libvirt_func.images_get_storages(conn, all_storages) File "/var/www81/webvirtmgr/libvirt_func.py" in images_get_storages 257. stg.refresh(0) File "/usr/lib/python2.7/dist-packages/libvirt.py" in refresh 2441. if ret == -1: raise libvirtError ('virStoragePoolRefresh() failed', pool=self) Exception Type: libvirtError at /newvm/1/ Exception Value: Requested operation is not valid: storage pool 'ubuntu1304' is not active ```
Author
Owner

@retspen commented on GitHub (May 30, 2013):

Fix this bug github.com/retspen/webvirtmgr@86e30ac1e8 Need update

<!-- gh-comment-id:18671405 --> @retspen commented on GitHub (May 30, 2013): Fix this bug https://github.com/retspen/webvirtmgr/commit/86e30ac1e810ed6b36525f782ef9f21e25286120 Need update
Author
Owner

@kimnzl commented on GitHub (May 30, 2013):

Thanks for all your hard work.

<!-- gh-comment-id:18671874 --> @kimnzl commented on GitHub (May 30, 2013): Thanks for all your hard work.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#46
No description provided.