Bug #58331
opencephadm gather-facts fails enumerating wwid of hyper-v disks.
0%
Description
When running "cephadm gather-facts" on a ceph cluster deployed to hyper-v based virtual machines the script fails with the error below due to the wwid value of the hyper-v virtual disks.
Traceback (most recent call last):
File "/usr/sbin/cephadm", line 9468, in <module>
main()
File "/usr/sbin/cephadm", line 9456, in main
r = ctx.func(ctx)
File "/usr/sbin/cephadm", line 8625, in command_gather_facts
print(host.dump())
File "/usr/sbin/cephadm", line 8613, in dump
k: getattr(self, k) for k in dir(self)
File "/usr/sbin/cephadm", line 8615, in <dictcomp>
and isinstance(getattr(self, k), (float, int, str, list, dict, tuple))
File "/usr/sbin/cephadm", line 8266, in hdd_list
return self._dev_list(devs)
File "/usr/sbin/cephadm", line 8246, in _dev_list
disk_wwid = read_file(['/sys/block/{}/device/wwid'.format(dev)]).strip()
File "/usr/sbin/cephadm", line 8095, in read_file
content = f.read().strip()
File "/usr/lib64/python3.6/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbd in position 16: invalid start byte
Problematic code is here - line 8532
https://github.com/ceph/ceph/blob/514895cdfa394fd764ec67da8c002116fac20139/src/cephadm/cephadm.py
Example of the wwid value below.
t10.MSFT \207M-&H'\233\027M-DKM-*\003\213\222@M-;8\027$
This casues the cluster to always be in a warning state.