retspen / webvirtcloud

WebVirtCloud is virtualization web interface for admins and users
1.7k stars 370 forks source link

'virConnect' object has no attribute 'getDomainCapabilities' #241

Open markx1916 opened 5 years ago

markx1916 commented 5 years ago

I used the lastest repo build for a docker image.

my libvirtd version is 4.10

libvirtd -V

libvirtd (libvirt) 4.10.0

when I click the instance url ,I got this error : 'virConnect' object has no attribute 'getDomainCapabilities'

anyone meet this issues ?

Request Method: GET

http://10.188.0.20:80/instances/3/1.1.1.1/ 1.11.20 AttributeError 'virConnect' object has no attribute 'getDomainCapabilities' /srv/webvirtcloud/vrtManager/connection.py in get_dom_cap_xml, line 362 /srv/webvirtcloud/venv/bin/python 2.7.6 ['/srv/webvirtcloud', '/srv/webvirtcloud/venv/bin', '/srv/webvirtcloud/venv/lib/python2.7', '/srv/webvirtcloud/venv/lib/python2.7/plat-x86_64-linux-gnu', '/srv/webvirtcloud/venv/lib/python2.7/lib-tk', '/srv/webvirtcloud/venv/lib/python2.7/lib-old', '/srv/webvirtcloud/venv/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/srv/webvirtcloud/venv/local/lib/python2.7/site-packages'] Mon, 10 Jun 2019 07:17:02 +0000

Environment:

Request Method: GET Request URL: http://10.188.0.20:80/instances/3/1.1.1.1/

Django Version: 1.11.20 Python Version: 2.7.6 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'computes', 'console', 'networks', 'storages', 'interfaces', 'nwfilters', 'instances', 'secrets', 'logs', 'accounts', 'create', 'datasource') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.RemoteUserMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback:

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner

  1. response = get_response(request)

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response

  1. response = self._get_response(request)

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view

  1. return view_func(request, *args, **kwargs)

File "/srv/webvirtcloud/instances/views.py" in instance

  1. busses = conn.get_disk_bus_types()

File "/srv/webvirtcloud/vrtManager/connection.py" in get_disk_bus_types

  1. return util.get_xml_path(self.get_dom_cap_xml(), func=get_bus_list)

File "/srv/webvirtcloud/vrtManager/connection.py" in get_dom_cap_xml

  1. return self.wvm.getDomainCapabilities(emulatorbin, arch, machine, virttype)

Exception Type: AttributeError at /instances/3/1.1.1.1/ Exception Value: 'virConnect' object has no attribute 'getDomainCapabilities'

markx1916 commented 5 years ago

also in /var/log/webvirtcloud.log ,I found this :

libvirt: Storage Driver error : Storage volume not found: no storage vol with matching path '/home/vmdata/vm1.1.1.1/1.1.1.1.sys.img' libvirt: Storage Driver error : Storage volume not found: no storage vol with matching path '/home/vmdata/vm1.1.1.1/1.1.1.1.data.img' libvirt: Network Driver error : Network not found: no network with matching name 'br0' Internal Server Error: /instances/3/1.1.1.1/

Traceback (most recent call last): File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response response = self._get_response(request) File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, *callback_kwargs) File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view return view_func(request, args, **kwargs) File "/srv/webvirtcloud/instances/views.py", line 308, in instance busses = conn.get_disk_bus_types() File "/srv/webvirtcloud/vrtManager/connection.py", line 468, in get_disk_bus_types return util.get_xml_path(self.get_dom_cap_xml(), func=get_bus_list) File "/srv/webvirtcloud/vrtManager/connection.py", line 362, in get_dom_cap_xml return self.wvm.getDomainCapabilities(emulatorbin, arch, machine, virttype) AttributeError: 'virConnect' object has no attribute 'getDomainCapabilities'

catborise commented 5 years ago

can you please check version of kvm host's libvirt. image

markx1916 commented 5 years ago

can you please check version of kvm host's libvirt. image

em.. My host libvirt version is also libvirtd (libvirt) 4.10.0, this page you show is working well ,but the page of inside vm is not ok . I have a comment on this line of vrtManager/connection.py , and the page show well ,but some function like clone /resize can not use ,and show 500 error !

return self.wvm.getDomainCapabilities(emulatorbin, arch, machine, virttype)

catborise commented 5 years ago

getDomainCapabilities function available since libvirt version 2. if you are using libvirt 4.10 there shouldnt be a problem.

please run that command on kvm host and webvirtcloud(docker): virsh version

ps: did you restart libvirtd and vm instance after installing new version qemu&libvirt (new version of qemu or libvirt does not activate before stop&start)

markx1916 commented 5 years ago

en,I find out that the docker didn't have a virsh command , I follow the step and install it in a centos os ,that's goes well . maybe some steps missed in the dockerfile ?

I hava restart the libvirt and vm ,but not work .

catborise commented 5 years ago

@Damien9527 thanks damien. I did never use docker because of that i missed the error. The ubuntu image was very old(14.04), i update it to 18.04. Problem solved. in 14.04, libvirt version is 1.22 in 18.04, libvirt version is 4.00

i update the docker file. I will send pull request to retspen