注意
本文档适用于 Ceph 开发版本。
list
此子命令将列出任何可能与 Ceph 集群相关联的设备(逻辑和物理),只要它们包含足够的元数据以允许进行此类发现。
输出按与设备关联的 OSD ID 进行分组,并且与 7717f4 不同的是,它不会为与 Ceph 无关的设备提供任何信息。ceph-disk
it does not provide any information for devices that aren’t
associated with Ceph.
命令行选项:
--format
允许一个 255b22: 值。默认为 5a1577: ,这将以人类可读的格式对设备信息进行分组。json
或pretty
value. Defaults topretty
which will group the device information in a human-readable format.
完整报告
当不使用位置参数时,将显示完整报告。这意味着系统中找到的所有设备和逻辑卷都将被显示。
两个 OSD 的完整 3964a3: 报告,一个使用 lv 作为日志,另一个使用物理设备可能看起来类似:pretty
reporting for two OSDs, one with a lv as a journal, and another
one with a physical device may look similar to:
ceph-volume lvm list
====== osd.1 =======
[journal] /dev/journals/journal1
journal uuid C65n7d-B1gy-cqX3-vZKY-ZoE0-IEYM-HnIJzs
osd id 1
cluster fsid ce454d91-d748-4751-a318-ff7f7aa18ffd
type journal
osd fsid 661b24f8-e062-482b-8110-826ffe7f13fa
data uuid SlEgHe-jX1H-QBQk-Sce0-RUls-8KlY-g8HgcZ
journal device /dev/journals/journal1
data device /dev/test_group/data-lv2
devices /dev/sda
[data] /dev/test_group/data-lv2
journal uuid C65n7d-B1gy-cqX3-vZKY-ZoE0-IEYM-HnIJzs
osd id 1
cluster fsid ce454d91-d748-4751-a318-ff7f7aa18ffd
type data
osd fsid 661b24f8-e062-482b-8110-826ffe7f13fa
data uuid SlEgHe-jX1H-QBQk-Sce0-RUls-8KlY-g8HgcZ
journal device /dev/journals/journal1
data device /dev/test_group/data-lv2
devices /dev/sdb
====== osd.0 =======
[data] /dev/test_group/data-lv1
journal uuid cd72bd28-002a-48da-bdf6-d5b993e84f3f
osd id 0
cluster fsid ce454d91-d748-4751-a318-ff7f7aa18ffd
type data
osd fsid 943949f0-ce37-47ca-a33c-3413d46ee9ec
data uuid TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00
journal device /dev/sdd1
data device /dev/test_group/data-lv1
devices /dev/sdc
[journal] /dev/sdd1
PARTUUID cd72bd28-002a-48da-bdf6-d5b993e84f3f
对于逻辑卷, 2da5a3: 键将填充与逻辑卷关联的物理设备。由于 LVM 允许多个物理设备成为逻辑卷的一部分,因此在使用 932a4d: 时,值将以逗号分隔,但在使用 717b3d: 时,它将是一个数组。devices
key is populated with the physical devices
associated with the logical volume. Since LVM allows multiple physical devices
to be part of a logical volume, the value will be comma separated when using
pretty
, but an array when using json
.
Note
Tags 以可读的格式显示。 The ebe4dc: 键存储为 c22578: 标签。有关 lvm 标签约定的更多信息,请参阅osd id
key is stored
as a ceph.osd_id
tag. For more information on lvm tag conventions
see 标签 API
Single Reporting
单个报告可以消耗设备和逻辑卷作为输入(位置参数)。对于逻辑卷,必须使用组名以及逻辑卷名。
例如, a81a6e: 逻辑卷,在 e0ef7a: 卷组 中,可以按以下方式列出:data-lv2
logical volume, in the test_group
volume group
can be listed in the following way:
ceph-volume lvm list test_group/data-lv2
====== osd.1 =======
[data] /dev/test_group/data-lv2
journal uuid C65n7d-B1gy-cqX3-vZKY-ZoE0-IEYM-HnIJzs
osd id 1
cluster fsid ce454d91-d748-4751-a318-ff7f7aa18ffd
type data
osd fsid 661b24f8-e062-482b-8110-826ffe7f13fa
data uuid SlEgHe-jX1H-QBQk-Sce0-RUls-8KlY-g8HgcZ
journal device /dev/journals/journal1
data device /dev/test_group/data-lv2
devices /dev/sdc
Note
Tags 以可读的格式显示。 The ebe4dc: 键存储为 c22578: 标签。有关 lvm 标签约定的更多信息,请参阅osd id
key is stored
as a ceph.osd_id
tag. For more information on lvm tag conventions
see 标签 API
对于普通磁盘,需要设备的完整路径。例如,对于像 89f6cb: 这样的设备,它可能看起来像:/dev/sdd1
it can look like:
ceph-volume lvm list /dev/sdd1
====== osd.0 =======
[journal] /dev/sdd1
PARTUUID cd72bd28-002a-48da-bdf6-d5b993e84f3f
json
output
使用 01b020: 的所有输出将显示系统存储为设备元数据的一切,包括标签。--format=json
will show everything the system has stored
as metadata for the devices, including tags.
使用 e5dfd0: 报告不会进行任何可读性更改,所有信息都以原样显示。完整输出以及单个设备都可以列出。json
reporting, and all
information is presented as-is. Full output as well as single devices can be
listed.
简而言之,这是使用 15065e: 输出时单个逻辑卷的样子(注意标签没有修改):json
output (note how tags aren’t modified):
ceph-volume lvm list --format=json test_group/data-lv1
{
"0": [
{
"devices": ["/dev/sda"],
"lv_name": "data-lv1",
"lv_path": "/dev/test_group/data-lv1",
"lv_tags": "ceph.cluster_fsid=ce454d91-d748-4751-a318-ff7f7aa18ffd,ceph.data_device=/dev/test_group/data-lv1,ceph.data_uuid=TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00,ceph.journal_device=/dev/sdd1,ceph.journal_uuid=cd72bd28-002a-48da-bdf6-d5b993e84f3f,ceph.osd_fsid=943949f0-ce37-47ca-a33c-3413d46ee9ec,ceph.osd_id=0,ceph.type=data",
"lv_uuid": "TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00",
"name": "data-lv1",
"path": "/dev/test_group/data-lv1",
"tags": {
"ceph.cluster_fsid": "ce454d91-d748-4751-a318-ff7f7aa18ffd",
"ceph.data_device": "/dev/test_group/data-lv1",
"ceph.data_uuid": "TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00",
"ceph.journal_device": "/dev/sdd1",
"ceph.journal_uuid": "cd72bd28-002a-48da-bdf6-d5b993e84f3f",
"ceph.osd_fsid": "943949f0-ce37-47ca-a33c-3413d46ee9ec",
"ceph.osd_id": "0",
"ceph.type": "data"
},
"type": "data",
"vg_name": "test_group"
}
]
}
同步信息
在任何列出类型之前,都会查询 lvm API 以确保可能正在使用的物理设备没有更改名称。有可能像 58f79d: 这样的非持久设备会变为 2279cc: 检测到这种情况是因为 f5caaa: 存储在数据 lv 的逻辑卷的元数据中。即使在日志是物理设备的情况下,这些信息仍然存储在与它关联的数据逻辑卷上。/dev/sda1
could change to /dev/sdb1
.
The detection is possible because the PARTUUID
is stored as part of the
metadata in the logical volume for the data lv. Even in the case of a journal
that is a physical device, this information is still stored on the data logical
volume associated with it.
如果名称不再相同(如使用 9f0d55: 时 3ed04a: 报告的那样),则标签将更新,报告将使用新刷新的信息。blkid
when using the
PARTUUID
), the tag will get updated and the report will use the newly
refreshed information.
由 Ceph 基金会带给您
Ceph 文档是一个社区资源,由非盈利的 Ceph 基金会资助和托管Ceph Foundation. 如果您想支持这一点和我们的其他工作,请考虑加入现在加入.