VMs cannot start with ISO attached

Description

This issue occurs whether you upload the iso, or pick one from your storage.

Error: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor_base.py", line 166, in start
if self.domain.create() < 0:
File "/usr/lib/python3/dist-packages/libvirt.py", line 1353, in create
raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2021-12-16T13:19:24.439817Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/mnt/tank/backups/proxmox-backup-server_2.1-1.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}: Could not open '/mnt/tank/backups/proxmox-backup-server_2.1-1.iso': Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 151, in call_method
result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self,
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1267, in _call
return await methodobj(*prepared_call.args)
File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1263, in nf
return await func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1131, in nf
res = await f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_lifecycle.py", line 42, in start
await self.middleware.run_in_thread(self._start, vm['name'])
File "/usr/lib/python3/dist-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py", line 62, in _start
self.vms[vm_name].start(vm_data=self._vm_from_name(vm_name))
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor_base.py", line 175, in start
raise CallError('\n'.join(errors))
middlewared.service_exception.CallError: [EFAULT] internal error: process exited while connecting to monitor: 2021-12-16T13:19:24.439817Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/mnt/tank/backups/proxmox-backup-server_2.1-1.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}: Could not open '/mnt/tank/backups/proxmox-backup-server_2.1-1.iso': Permission denied

Problem/Justification

None

Impact

None

Activity

Show:

Daniel ReidDecember 20, 2021 at 4:03 PM

Understood, but I think thats part of the issue, its just telling you permission denied when it allowed you to upload to whatever directory you want, without the check in place.

 

I see the github issue linked to this case, and I think that check would go a long way to prevent future problems. Even if it simply told you "this directory doesnt have the correct permissions"

Andrew WalkerDecember 20, 2021 at 11:48 AM
Edited

Permissions for each path component is needed. If any parent directory lacks "other - execute" (or grants execute via ACL to user), then permission will be denied.

Daniel ReidDecember 19, 2021 at 3:50 PM
Edited

I tried using it with owned by root, then also uploading one to that same directory using the VM upload tool. Here are the permissions on the file :

rwxrwxrwx 1 libvirt-qemu libvirt-qemu 788215808 Dec 15 17:41 proxmox-backup
server_2.1-1.iso

I then uploaded that same file to my ix-systems dataset, and it worked fine after that.

Bug ClerkDecember 19, 2021 at 3:43 PM

WaqarDecember 19, 2021 at 3:39 PM

libvirt by default automatically changes the ownership of the iso file in this case to make sure it is able to read from the file. So a file with 600 for example perms would still work. The only case where this wouldn't work is if the perms were 000 for the iso file. Can you confirm the ownership/perms of the iso file when this was failing please ? Thanks!

Complete

Details

Assignee

Reporter

Labels

Impact

Medium

Time remaining

0m

Fix versions

Affects versions

Priority

Katalon Platform

Created December 16, 2021 at 1:21 PM
Updated July 1, 2022 at 5:50 PM
Resolved December 20, 2021 at 4:22 PM