mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-04-25 23:45:56 +03:00
[GH-ISSUE #189] Can't create image file #129
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/webvirtcloud#129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ssbaksa on GitHub (Sep 26, 2018).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/189
I have all 3 latest versions of webvirtcloud (retspen, catborise and bandic007) and on all of them I have the same error when I try to create image file on local or shared file system. Error screen is shown although image file was created.
That file can't be erased using web interface and user and group assignment of that file is wrong.
Error: cannot unlink file '/mnt/storage/images/1a1a.img': Permission denied
-rw-r--r-- 1 messagebus crontab 10739318784 Sep 26 13:20 1a1a.img
file should be created as root:root.
Older versions did all that without problem.
Environment:
Request Method: POST
Request URL: http://172.17.252.168:80/compute/2/storage/hulk/
Django Version: 1.11.14
Python Version: 2.7.12
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',
'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
41. response = get_response(request)
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
187. 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
185. 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
23. return view_func(request, *args, **kwargs)
File "/srv/webvirtcloud/storages/views.py" in storage
158. messages.success("Image file {} is created successfully".format(data['name']+".img"))
Exception Type: TypeError at /compute/2/storage/hulk/
Exception Value: success() takes at least 2 arguments (1 given)
@catborise commented on GitHub (Sep 26, 2018):
hi,
one parameter was missing i added to /srv/webvirtcloud/storages/views.py
messages.success("Image file {} is created successfully".format(data['name']+".img"))
to
messages.success(request, _("Image file {} is created successfully".format(data['name']+".img")))
i send to my repo this fix. but it will be merge later to main repo.(also you can change it manually)
The other issue is related with users.
Normally libvirt uses qemu user whose id is 107
we will create it with that user. I think your user with id=107 is different.
later, i will it choosable but for now you can change it with manually on code.
edit /srv/webvirtcloud/storage.py and find 107 then change it with 0
@ssbaksa commented on GitHub (Sep 26, 2018):
Hi,
Great! I will try it tomorow.
As for users and groups. This is normal installation of Ubuntu 16.04 server.
It looks to me that crontab hijacked group Id and user Id was hijacked by
messagebus.
This is the fact on all 8 servers installed with Ubuntu 16.04.
I am not enforcing user and group Id using qemu.conf so I relay on what is
done by WebVirtCloud.
The user for QEMU processes run by the system instance. It can be
specified as a user name or as a user id. The qemu driver will try to
parse this value first as a name and then, if the name doesn't exist,
as a user id.
Since a sequence of digits is a valid user name, a leading plus sign
can be used to ensure that a user id will not be interpreted as a user
name.
Some examples of valid values are:
user = "qemu" # A user named "qemu"
user = "+0" # Super user (uid=0)
user = "100" # A user named "100" or a user with uid=100
#user = "root"
The group for QEMU processes run by the system instance. It can be
specified in a similar way to user.
#group = "root"
Whether libvirt should dynamically change file ownership
to match the configured user/group above. Defaults to 1.
Set to 0 to disable file ownership changes.
#dynamic_ownership = 1
messagebus❌107:112::/var/run/dbus:/bin/false
crontab❌107:
syslog❌108:
netdev❌109:
lxd❌110:testlab
kvm❌111:
messagebus❌112:
uuidd❌113:
mlocate❌114:
ssh❌115:
libvirtd❌116:testlab
On 26 September 2018 at 15:26, catborise notifications@github.com wrote:
@catborise commented on GitHub (Sep 27, 2018):
i check ubuntu 16.04, yes, it is different. there is not any qemu user but libvirt-qemu and it's id is different(not reserved as on centos/rhel)
i add a parameter to settings.py, you can change it whatever you want. 0=root, or libvirt-bin=64055(it is up to os)
latest changes in my repo.
i will make a pull request to retspen... 1 week later may they merge to main repo...
after you check, please give feedback
thanks
@ssbaksa commented on GitHub (Sep 27, 2018):
Hi,
Thank you for quick response. I have puled last changes this morning and it
works as expected now.
I will test ownership changes today and report my findings.
If you need to test something, just ping me. I have around 15 servers
running different versions of WebVirtCloud (some of them old WebVirt
Manager) and more than 60 servers under Openstack but I prefer pure libvirt
with WVC (or Virsh) over OpenStack.
Br
Sasa
On 27 September 2018 at 08:50, catborise notifications@github.com wrote:
@ssbaksa commented on GitHub (Sep 27, 2018):
Hi,
I have tested it on newly installed server and it works but, I have one
suggestion. It will be good to have separated config for UID and GID
becasue user (libvirt-qemu) uses UID 64055 as default and default group for
that user is kvm with GID 111.
Br
Sasa
On 27 September 2018 at 09:31, Saša-Stjepan Bakša ssbaksa@gmail.com wrote:
@catborise commented on GitHub (Sep 27, 2018):
okey @ssbaksa , i will do it. you can close the issue
for now i am workin on instances tab for host. in a few days it will be done
thanks.
have a nice day
@ssbaksa commented on GitHub (Sep 27, 2018):
Thank you for great support.
Br
Sasa
On Thu, 27 Sep 2018, 16:09 catborise, notifications@github.com wrote: