Bug 1656815
| Summary: | [downstream clone - 4.2.8] vdsm fails with Invalid index metadata (invalid magic: 0) when trying to add a VM lease | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | RHV bug bot <rhv-bugzilla-bot> |
| Component: | vdsm | Assignee: | Vojtech Juranek <vjuranek> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Yosi Ben Shimon <ybenshim> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 4.2.7 | CC: | bugs, dfodor, germano, gveitmic, lsurette, mmartinv, mtessun, nsoffer, srevivo, tnisan, vjuranek, ycui |
| Target Milestone: | ovirt-4.2.8 | Keywords: | ZStream |
| Target Release: | --- | Flags: | lsvaty:
testing_plan_complete-
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | v4.20.45 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1654417 | Environment: | |
| Last Closed: | 2019-02-14 14:57:31 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1654417 | ||
| Bug Blocks: | |||
|
Description
RHV bug bot
2018-12-06 11:48:52 UTC
(In reply to Miguel Martin from comment #0) The failure to add a lease is expected, the xleases volume index is invalid: InvalidMetadata: Invalid index metadata (invalid magic: 0), the index must be formatted or rebuilt from storage: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\... According to Miguel, the entire volume is empty and was never used. It looks like a volume that was created but not formatted, or wiped by someone. There are 2 issues: 1. Why the xleases volume is wiped? Is this a bug in the system failing to format the volume and leaving the domain with unformatted volume, or a user error? 2. There is no easy way to recover from this situation. Migual: - Can you explain here what is the workaround, or link to an support article about this? - Please attach vdsm logs since this domain was created until this error. (Originally by Nir Soffer) (In reply to Miguel Martin from comment #0) The failure to add a lease is expected, the xleases volume index is invalid: InvalidMetadata: Invalid index metadata (invalid magic: 0), the index must be formatted or rebuilt from storage: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\... According to Miguel, the entire volume is empty and was never used. It looks like a volume that was created but not formatted, or wiped by someone. There are 2 issues: 1. Why the xleases volume is wiped? Is this a bug in the system failing to format the volume and leaving the domain with unformatted volume, or a user error? 2. There is no easy way to recover from this situation. Migual: - Can you explain here what is the workaround, or link to an support article about this? - Please attach vdsm logs since this domain was created until this error. (Originally by Nir Soffer) Germano, please review the patches, and maybe get other people from the team to review them. Lets me explain the solution: - https://gerrit.ovirt.org/c/69189 - implement rebuilding index from storage contents. We assume that sanlock leases on storage are the truth. - https://gerrit.ovirt.org/c/69190 - wire up Lease.rebuild_leases so it can be used from vdsm-client. This is a safe way to rebuild the leases, but it will work only on the SPM, and only if the domain is active, and only if vdsm is running. This is safe operation. - https://gerrit.ovirt.org/c/69193 - allow rebuilding on any host even if vdsm is not running. This goes directly to storage and is like "sanlock direct xxx" commands, or like writing to storage directly with dd. This is dangerous and require that the storage domain is not active! - https://gerrit.ovirt.org/c/69069 - allow formatting the index, dropping all entries. This is even more dangerous than rebuilding the index. However this does not drop the sanlock leases on storage, so you can rebuild the index after formatting. These patches give support lot of power, but this also means you are responsible when you use these commands incorrectly. (Originally by Nir Soffer) *** Bug 1654419 has been marked as a duplicate of this bug. *** (Originally by Miguel Martin Villamuelas) Hi Nir! (In reply to Nir Soffer from comment #2) > Germano, please review the patches, and maybe get other people from the team > to review them. Done. > These patches give support lot of power, but this also means you are > responsible when you use these commands incorrectly. I can see it ;) Nice tool, will certainly be useful. Thanks! (Originally by Germano Veit Michel) Tested using: ovirt-engine-4.2.8.2-0.1.el7ev.noarch vdsm-4.20.46-1.el7ev.x86_64 vdsm-client-4.20.46-1.el7ev.noarch Reproduced according to the steps in comment #14 & #15 https://bugzilla.redhat.com/show_bug.cgi?id=1654417#c14 Actual result: Failed to create a new VM while the xleases is corrupted and the rebuild/format did fixed the issue. So after rebuild/format, a VM could be created successfully. But there were exceptions in the VDSM logs (same as the one in the bug description): 2019-01-15 17:46:27,027+0200 INFO (jsonrpc/0) [vdsm.api] FINISH lease_info error=Invalid index metadata (invalid magic: 0), the index must be formatted or rebuilt from storage: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' from=::1,34358, task_id=ff8b33cb-a082-4848-b606-f6b2c9efab21 (api:50) 2019-01-15 17:46:27,029+0200 ERROR (jsonrpc/0) [storage.TaskManager.Task] (Task='ff8b33cb-a082-4848-b606-f6b2c9efab21') 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 lease_info 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 3693, in lease_info info = dom.lease_info(lease.lease_id) File "/usr/lib/python2.7/site-packages/vdsm/storage/sd.py", line 671, in lease_info with self.external_leases_volume() as vol: File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/usr/lib/python2.7/site-packages/vdsm/storage/sd.py", line 659, in external_leases_volume vol = xlease.LeasesVolume(backend) File "/usr/lib/python2.7/site-packages/vdsm/storage/xlease.py", line 516, in __init__ self._md = self._index.read_metadata() File "/usr/lib/python2.7/site-packages/vdsm/storage/xlease.py", line 819, in read_metadata return IndexMetadata.fromebytes(data) File "/usr/lib/python2.7/site-packages/vdsm/storage/xlease.py", line 331, in fromebytes raise InvalidMetadata("invalid magic: %s" % magic, data) InvalidMetadata: Invalid index metadata (invalid magic: 0), the index must be formatted or rebuilt from storage: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' According to comment #14 here: https://bugzilla.redhat.com/show_bug.cgi?id=1654417#c14 : * when you run `vdsm-client -f lease Lease info` you should see very similar output to one described in this BZ (without exception, just messages that command failed and index must be rebuild and lots of \x00) The exception is here. python exception in the log is fine (actually even better as it proves you tested the scenario end-to-end:-), it's not present when you test it only with vdsm-client. (In reply to Vojtech Juranek from comment #13) > python exception in the log is fine (actually even better as it proves you > tested the scenario end-to-end:-), it's not present when you test it only > with vdsm-client. So, in that case, I'm moving this bug to VERIFIED as this is the expected result. sync2jira sync2jira |