Created attachment 1379580 [details] logs Description of problem: Live snapshot creation after previous snapshot restore fails during getQemuImageInfo. It might be an SELinux issue: 2018-01-10 15:22:23.213+0000: 16256: error : virProcessRunInMountNamespace:1159 : internal error: child reported: unable to set security context 'system_u:object_r:virt_content_t:s0' on '/rhev/data-center/mnt/bl ockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/a4268deb-ec58-462d-8872-aab13a4dcced/f64cc3cd-4050-4b34-8c80-d119393a7e4f': No such file or directory Version-Release number of selected component (if applicable): rhvm-4.2.1-0.2.el7.noarch vdsm-4.20.11-1.el7ev.x86_64 Red Hat Enterprise Linux Server 7.5 Beta (Maipo) kernel - 3.10.0-823.el7.x86_64 libvirt-3.9.0-6.el7.x86_64 qemu-kvm-rhev-2.10.0-15.el7.x86_64 sanlock-3.6.0-1.el7.x86_64 selinux-policy-3.13.1-183.el7.noarch How reproducible: Always Steps to Reproduce: 1. Create a VM with a disk resides on block storage 2. Start the VM and create a snapshot 3. Stop the VM and preview+commit the snapshot 4. Start the VM and create a snapshot Actual results: Snapshot creation fails: 2018-01-10 17:23:11,398+0200 INFO (jsonrpc/6) [vdsm.api] FINISH getQemuImageInfo error=Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264'] failed with rc=1 out='' err="qemu-img: Could not open '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264': Could not open '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264': No such file or directory\n" from=::ffff:10.35.161.127,60438, flow_id=682d01bf-79de-4907-9e37-30c6fe9d1755, task_id=87f96d67-ea00-4939-993e-4f39b1d67cf7 (api:50) 2018-01-10 17:23:11,410+0200 ERROR (jsonrpc/6) [storage.TaskManager.Task] (Task='87f96d67-ea00-4939-993e-4f39b1d67cf7') Unexpected error (task:875) Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 882, in _run return fn(*args, **kargs) File "<string>", line 2, in getQemuImageInfo File "/usr/lib/python2.7/site-packages/vdsm/common/api.py", line 48, in method ret = func(*args, **kwargs) File "/usr/lib/python2.7/site-packages/vdsm/storage/hsm.py", line 3110, in getQemuImageInfo info = vol.getQemuImageInfo() File "/usr/lib/python2.7/site-packages/vdsm/storage/volume.py", line 1424, in getQemuImageInfo return self._manifest.getQemuImageInfo() File "/usr/lib/python2.7/site-packages/vdsm/storage/volume.py", line 280, in getQemuImageInfo sc.fmt2str(self.getFormat())) File "/usr/lib/python2.7/site-packages/vdsm/storage/qemuimg.py", line 69, in info out = _run_cmd(cmd) File "/usr/lib/python2.7/site-packages/vdsm/storage/qemuimg.py", line 346, in _run_cmd raise cmdutils.Error(cmd, rc, out, err) Error: Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264'] failed with rc=1 out='' err="qemu-img: Could not open '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264': Could not open '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264': No such file or directory\n" 2018-01-10 17:23:11,414+0200 DEBUG (jsonrpc/6) [storage.TaskManager.Task] (Task='87f96d67-ea00-4939-993e-4f39b1d67cf7') Task._run: 87f96d67-ea00-4939-993e-4f39b1d67cf7 ('1524036d-2ce0-47ff-9f10-f985f96c0d1a', '6ccfd104-5f57-4a83-a24d-9d7a5a5c92c8', '4f9b7679-cc1e-47c2-9e52-969972c4ef3d', '40bc4084-42d4-420f-be02-e0812b4d5264') {} failed - stopping task (task:894) 2018-01-10 17:23:11,415+0200 DEBUG (jsonrpc/6) [storage.TaskManager.Task] (Task='87f96d67-ea00-4939-993e-4f39b1d67cf7') stopping in state preparing (force False) (task:1256) 2018-01-10 17:23:11,416+0200 DEBUG (jsonrpc/6) [storage.TaskManager.Task] (Task='87f96d67-ea00-4939-993e-4f39b1d67cf7') ref 1 aborting True (task:1002) 2018-01-10 17:23:11,417+0200 INFO (jsonrpc/6) [storage.TaskManager.Task] (Task='87f96d67-ea00-4939-993e-4f39b1d67cf7') aborting: Task is aborted: u'Command [\'/usr/bin/qemu-img\', \'info\', \'--output\', \'json\', \'-f\', \'qcow2\', \'/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264\'] failed with rc=1 out=\'\' err="qemu-img: Could not open \'/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264\': Could not open \'/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264\': No such file or directory\\n"' - code 100 (task:1181) libvirt.log: 2018-01-10 15:22:23.213+0000: 16256: error : virProcessRunInMountNamespace:1159 : internal error: child reported: unable to set security context 'system_u:object_r:virt_content_t:s0' on '/rhev/data-center/mnt/bl ockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/a4268deb-ec58-462d-8872-aab13a4dcced/f64cc3cd-4050-4b34-8c80-d119393a7e4f': No such file or directory 2018-01-10 17:23:11,456+02 INFO [org.ovirt.engine.core.vdsbroker.vdsbroker.GetQemuImageInfoVDSCommand] (EE-ManagedThreadFactory-engineScheduled-Thread-21) [682d01bf-79de-4907-9e37-30c6fe9d1755] FINISH, GetQemuI mageInfoVDSCommand, log id: 79d4181a 2018-01-10 17:23:11,456+02 ERROR [org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler] (EE-ManagedThreadFactory-engineScheduled-Thread-21) [682d01bf-79de-4907-9e37-30c6fe9d1755] Unable to get qemu image i nfo from storage: org.ovirt.engine.core.common.errors.EngineException: EngineException: org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException: VDSGenericException: VDSErrorException: Failed to GetQemuImage InfoVDS, error = Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084- 42d4-420f-be02-e0812b4d5264'] failed with rc=1 out='' err="qemu-img: Could not open '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-4 20f-be02-e0812b4d5264': Could not open '/rhev/data-center/mnt/blockSD/1524036d-2ce0-47ff-9f10-f985f96c0d1a/images/4f9b7679-cc1e-47c2-9e52-969972c4ef3d/40bc4084-42d4-420f-be02-e0812b4d5264': No such file or direc tory\n", code = 100 (Failed with error GeneralException and code 100) at org.ovirt.engine.core.bll.VdsHandler.handleVdsResult(VdsHandler.java:118) [bll.jar:] at org.ovirt.engine.core.bll.VDSBrokerFrontendImpl.runVdsCommand(VDSBrokerFrontendImpl.java:33) [bll.jar:] at org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getQemuImageInfoFromVdsm(ImagesHandler.java:833) [bll.jar:] at org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.setQcowCompat(BaseImagesCommand.java:452) [bll.jar:] at org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.setQcowCompatByQemuImageInfo(BaseImagesCommand.java:436) [bll.jar:] at org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.endSuccessfully(BaseImagesCommand.java:394) [bll.jar:] Expected results: Snapshot creation should succeed Additional info: logs
Are you sure it's not yet another dup of the qemu-img bug?
Yes, This bug is about 'qemu-img info' request and bug #1526212 is about 'qemu-img create' request
From our side (ovirt) creation a snapshot involves two qemu-img commands: a. qemu-img create b. qemu-img info With qemu-img version 2.10 (rhel 7.5), we know that a new unsafe option was added and we have to use it, otherwise (as noticed), our code breaks. For `qemu-img create`, qemu guys fixed their code so now we don't have to provide -u option, hence the difference from what seen in BZ 1526212. However, for `qemu-img info` we do have to provide -U (big U, that's not a typo) in order for it to work. I will update my rhel 7.5 environment and check the latest status of qemu fixes/issues. We already started to adapt vdsm code to the new changes: https://gerrit.ovirt.org/supportUnsafeVolumeCreate The patches are still in-work and too updated. For example, the patch that add -u to `qemu-img create` isn't needed anymore.
Created attachment 1386188 [details] logs-2 The bug still occurs with the latest build [1], according to steps to reproduce from the bug description. qemuimg.py +86: if unsafe and _supports_option('info', 'U'): cmd.append('-U') vdsm.log: 2018-01-25 17:49:45,008+0200 ERROR (jsonrpc/7) [storage.Dispatcher] FINISH getQemuImageInfo error=Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', '-U', '/rhev/data-center/mnt/blockSD/582 0c57b-a8fb-4169-9b08-bcf28753c4f6/images/6ed520ab-a9df-4da6-8323-d6a74fb3c17d/c4cb3a27-4d64-43af-8213-ccc0ec4629e4'] failed with rc=1 out='' err="qemu-img: Could not open '/rhev/data-center/mnt/blockSD/5820c57b- a8fb-4169-9b08-bcf28753c4f6/images/6ed520ab-a9df-4da6-8323-d6a74fb3c17d/c4cb3a27-4d64-43af-8213-ccc0ec4629e4': Could not open '/rhev/data-center/mnt/blockSD/5820c57b-a8fb-4169-9b08-bcf28753c4f6/images/6ed520ab-a 9df-4da6-8323-d6a74fb3c17d/c4cb3a27-4d64-43af-8213-ccc0ec4629e4': No such file or directory\n" (dispatcher:86) Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/vdsm/storage/dispatcher.py", line 73, in wrapper result = ctask.prepare(func, *args, **kwargs) File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 108, in wrapper return m(self, *a, **kw) File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 1189, in prepare raise self.error Error: Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', '-U', '/rhev/data-center/mnt/blockSD/5820c57b-a8fb-4169-9b08-bcf28753c4f6/images/6ed520ab-a9df-4da6-8323-d6a74fb3c17d/c4cb3a27-4d64 -43af-8213-ccc0ec4629e4'] failed with rc=1 out='' err="qemu-img: Could not open '/rhev/data-center/mnt/blockSD/5820c57b-a8fb-4169-9b08-bcf28753c4f6/images/6ed520ab-a9df-4da6-8323-d6a74fb3c17d/c4cb3a27-4d64-43af- 8213-ccc0ec4629e4': Could not open '/rhev/data-center/mnt/blockSD/5820c57b-a8fb-4169-9b08-bcf28753c4f6/images/6ed520ab-a9df-4da6-8323-d6a74fb3c17d/c4cb3a27-4d64-43af-8213-ccc0ec4629e4': No such file or directory \n" [1] vdsm-4.20.17-1.el7ev.x86_64 libvirt-3.9.0-7.el7.x86_64 qemu-kvm-rhev-2.10.0-18.el7.x86_64 rhvm-4.2.1.3-0.1.el7.noarch
The is not about RHEL 7.5. I am able to reproduce also on RHEL 7.5 hosts. It seems that this might be related to resent changes in the Vm Xml area. We are still investigating. Elad, Can you please confirm that the issue is reproducible also on RHEL 7.4 hosts?
(In reply to Ala Hino from comment #5) > The is not about RHEL 7.5. > I am able to reproduce also on RHEL 7.5 hosts. > It seems that this might be related to resent changes in the Vm Xml area. > We are still investigating. > > Elad, > Can you please confirm that the issue is reproducible also on RHEL 7.4 hosts? So many typos ... Correction: The issue is *not* about RHEL 7.5. I am able to reproduce on RHEL 7.4 hosts as well.
Created attachment 1388988 [details] logs-7.4 Reproduce with RHEL7.4: vdsm-4.20.17-1.el7ev.x86_64 libvirt-daemon-3.2.0-14.el7_4.7.x86_64 qemu-kvm-rhev-2.9.0-16.el7_4.14.x86_64 2018-01-31 16:25:38,505+0200 ERROR (jsonrpc/5) [storage.TaskManager.Task] (Task='9b84ab3a-aeb8-4f18-a3fc-8be0390de62d') Unexpected error (task:875) Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 882, in _run return fn(*args, **kargs) File "<string>", line 2, in getQemuImageInfo File "/usr/lib/python2.7/site-packages/vdsm/common/api.py", line 48, in method ret = func(*args, **kwargs) File "/usr/lib/python2.7/site-packages/vdsm/storage/hsm.py", line 3110, in getQemuImageInfo info = vol.getQemuImageInfo() File "/usr/lib/python2.7/site-packages/vdsm/storage/volume.py", line 1442, in getQemuImageInfo return self._manifest.getQemuImageInfo() File "/usr/lib/python2.7/site-packages/vdsm/storage/volume.py", line 283, in getQemuImageInfo unsafe=True) File "/usr/lib/python2.7/site-packages/vdsm/storage/qemuimg.py", line 91, in info out = _run_cmd(cmd) File "/usr/lib/python2.7/site-packages/vdsm/storage/qemuimg.py", line 408, in _run_cmd raise cmdutils.Error(cmd, rc, out, err) Error: Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', u'/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8 -ae4b-9f665c92e937'] failed with rc=1 out='' err="qemu-img: Could not open '/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b- 9f665c92e937': Could not open '/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b-9f665c92e937': No such file or directory\n" 2018-01-31 16:25:38,506+0200 INFO (jsonrpc/5) [storage.TaskManager.Task] (Task='9b84ab3a-aeb8-4f18-a3fc-8be0390de62d') aborting: Task is aborted: u'Command [\'/usr/bin/qemu-img\', \'info\', \'--output\', \'json \', \'-f\', \'qcow2\', u\'/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b-9f665c92e937\'] failed with rc=1 out=\'\' err="qem u-img: Could not open \'/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b-9f665c92e937\': Could not open \'/rhev/data-center/m nt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b-9f665c92e937\': No such file or directory\\n"' - code 100 (task:1181) 2018-01-31 16:25:38,507+0200 ERROR (jsonrpc/5) [storage.Dispatcher] FINISH getQemuImageInfo error=Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', u'/rhev/data-center/mnt/blockSD/fca89e97 -5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b-9f665c92e937'] failed with rc=1 out='' err="qemu-img: Could not open '/rhev/data-center/mnt/blockSD/fca89e97-5ca1- 45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b-9f665c92e937': Could not open '/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4 cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b-9f665c92e937': No such file or directory\n" (dispatcher:86) Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/vdsm/storage/dispatcher.py", line 73, in wrapper result = ctask.prepare(func, *args, **kwargs) File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 108, in wrapper return m(self, *a, **kw) File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 1189, in prepare raise self.error Error: Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', u'/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8 -ae4b-9f665c92e937'] failed with rc=1 out='' err="qemu-img: Could not open '/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b- 9f665c92e937': Could not open '/rhev/data-center/mnt/blockSD/fca89e97-5ca1-45d3-af17-d468e588f15b/images/178317d2-c43f-4cfe-8f42-d8b7aa6e2426/ea946c67-a523-4ce8-ae4b-9f665c92e937': No such file or directory\n" 2018-01-31 16:25:38,508+0200 INFO (jsonrpc/5) [jsonrpc.JsonRpcServer] RPC call Volume.getQemuImageInfo failed (error 100) in 0.21 seconds (__init__:573) 2018-01-31 16:25:38,729+0200 INFO (jsonrpc/6) [vdsm.api] START getVolumeInfo(sdUUID=u'fca89e97-5ca1-45d3-af17-d468e588f15b', spUUID=u'6bbc327e-6f30-4429-a696-70b75a49f507', imgUUID=u'6a4deeb2-044b-44d0-88b0-d9d 1ce71c145', volUUID=u'bbb1bc17-4b8f-4acb-82ed-dfa788b06b07', options=None) from=::ffff:10.35.161.8,43388, flow_id=6fa089ce-2846-4c98-baf5-04b2decff659, task_id=a8c6b66b-603f-46c5-a41d-10b4e2e8d8c5 (api:46) 2018-01-31 16:25:38,731+0200 INFO (jsonrpc/6) [storage.VolumeManifest] Info request: sdUUID=fca89e97-5ca1-45d3-af17-d468e588f15b imgUUID=6a4deeb2-044b-44d0-88b0-d9d1ce71c145 volUUID = bbb1bc17-4b8f-4acb-82ed-df a788b06b07 (volume:238)
As this issue might be related to recent changes done in Vm Xml area, moving the bug to fromani for further investigations.
Ok, eventually I managed to look into this and found the issue. When we restore a snapshot, Engine sends the XML with the updated drive informations (this also applies on committed snapshots). Vdsm updates the drive information with the data from new XML: type, path, format. However, the drive UUIDs are NOT updated: this is a Vdsm bug. In the vm.conf based flow this step was done implicitely, now we need to do explicitely, replacing the drive metadata. It seems Engine sends already what Vdsm needs, so we just need a Vdsm patch.
It seems that the fixes are not included in the latest vdsm build (v4.20.19): https://gerrit.ovirt.org/gitweb?p=vdsm.git;a=shortlog;h=cdb1914376270dfd105eea3a16f253ecbf5e47c0 For example commit cdb1914376270dfd105eea3a16f253ecbf5e47c0 was merged after v4.20.19 Moving back to MODIFIED
(In reply to Elad from comment #11) > It seems that the fixes are not included in the latest vdsm build (v4.20.19): > > https://gerrit.ovirt.org/gitweb?p=vdsm.git;a=shortlog; > h=cdb1914376270dfd105eea3a16f253ecbf5e47c0 > > For example commit cdb1914376270dfd105eea3a16f253ecbf5e47c0 was merged after > v4.20.19 > > Moving back to MODIFIED Could you please point to the change-ids (like I1caadb601c7312e49fbe5c390104c15d61579ca3) you believe are not part of the tag? AFAICT Tag 4.20.19 looks good and includes all the needed patches: tag 4.20.19 is on top of change-id I1caadb601c7312e49fbe5c390104c15d61579ca3, which is the last of the series.
Tested according to the steps in the description. Second snapshot creation succeeded after first snapshot restore. Used: vdsm-4.20.20-1.el7ev.x86_64 libvirt-3.9.0-14.el7.x86_64 qemu-kvm-rhev-2.10.0-21.el7.x86_64 rhvm-4.2.2.2-0.1.el7.noarch
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018. Since the problem described in this bug report should be resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.