API Doc
Search Docs...
⌘ K
OverviewDeploymentManagementOperationReferenceGlossary
    ACOS 6.3.0
  • Arcfra Cloud Operating System>
  • CLI command>
  • Managing block storage services

Managing extents

An extent is the basic unit managed by the MetaCluster. A volume is divided into multiple fixed-size extents, which are stored on the ChunkServer. Data recovery, migration, copy-on-write (COW), and other operations are all performed at the extent level. Technical personnel can view and debug the cluster's extents through LExtents and PExtents. LExtents are logical extents, and PExtents are the physical extents stored on disk.

Viewing extents

Viewing detailed information about an LExtent

Procedure

Run the following command on any node in the cluster to view detailed information about a specific LExtent:

zbs-meta lextent show <lextent_id>

Output example

-------------  -------
Logical ID     8
Logical Epoch  8431008
Perf PID       None
Perf Epoch     None
Cap PID        24348
Cap Epoch      8742712
Prioritized    False
-------------  -------

Output note

ParameterDescription
Logical IDThe LExtent ID.
Logical EpochThe LExtent version number.
Perf PIDThe performance tier PExtent ID.
Perf EpochThe performance tier PExtent version number.
Cap PIDThe capacity tier PExtent ID.
Cap EpochThe capacity tier PExtent version number.
PrioritizedWhether it is referenced by a pinned volume.

Viewing the volume that an LExtent belongs to

Procedure

Run the following command on any node in the cluster to view the volume that the LExtent belongs to:

zbs-meta lextent getref <lextent_id>

Output example

-----------------------  ------------------------------------
Pool Name                zbs-images
Volume ID                ef5e94a3-2215-4ed9-814e-d08e393d7648
Volume Name              ef5e94a3-2215-4ed9
Volume Is Snapshot       False
Volume Snapshot Pool ID
Snapshot Name
-----------------------  ------------------------------------

Output note

ParameterDescription
Pool NameThe datastore that the LExtent belongs to.
Volume IDThe ID of the volume that the LExtent belongs to.
Volume NameThe name of the volume that the LExtent belongs to.
Volume Is SnapshotWhether the volume that the LExtent belongs to is a snapshot.
Volume Snapshot Pool IDThe ID of the datastore to which the snapshot containing the LExtent belongs.
Snapshot NameThe name of the snapshot to which the LExtent belongs.

Viewing PExtents in the cluster

Procedure

Run the following command on any node in the cluster to view the PExtents within the specified range:

zbs-meta pextent list [start_id] [end_id] [--show_non_exist] [--show_cap_only] [--show_perf_only]

ParameterDescription
start_idThe starting PExtent ID for the search.
end_idThe ending PExtent ID for the search.
--show_non_existDisplays PExtent IDs that have not been allocated.
--show_cap_onlyDisplays only PExtent IDs in the capacity tier.
--show_perf_onlyDisplays only PExtent IDs in the performance tier.

Note:

As the cluster scales, this operation can be very time-consuming.

Output example

[root@9f29fde8244f zbs-client-py]# zbs-meta pextent list 1 548 --show_non_exist --show_cap_only
  ID  Replica    Alive Replica    Temporary Replica    Ever Exist    Is Garbage      Origin PExtent    Origin Epoch    Expected Replica num    Epoch    Prefer Local  Allocated Space    Resiliency Type    PExtent Type    EC Param    Is Sinkable
----  ---------  ---------------  -------------------  ------------  ------------  ----------------  --------------  ----------------------  -------  --------------  -----------------  -----------------  --------------  ----------  -------------
   1  [4, 2, 7]  [4, 2, 7]        []                   True          False                        0               0                       3        1               2  5.25 MiB           RT_REPLICA         PT_CAP
   2  []         []               []                   False         False                        0               0                       3        2               2  0.00 B             RT_REPLICA         PT_CAP
   3  []         []               []                   False         False                        0               0                       3        3               2  0.00 B             RT_REPLICA         PT_CAP
   4  []         []               []                   False         False                        0               0                       3        4               2  0.00 B             RT_REPLICA         PT_CAP
...

Output note

ParameterDescription
ReplicaThe replica location.
Alive ReplicaThe location of active replicas.
Ever ExistWhether the data actually exists.
Temporary ReplicaFor replicated PExtents, a temporary replica is created when a replica fails.
Is GarbageWhether the data needs to be recycled.
Origin PExtentThe source PExtent.
Origin EpochThe Epoch of the source PExtent.
Expected Replica numThe expected replication factor.
EpochThe version number.
Prefer LocalThe default chunk ID where the PExtent is stored.
Allocated SpaceThe allocated physical space.
Resiliency TypeThe type of redundancy policy.
PExtent TypeWhether it is a capacity PExtent or a performance PExtent.
EC ParamThe EC policy attributes of the EC redundancy policy.
Is SinkableWhether it can be demoted.

Viewing detailed information about a PExtent

Procedure

Run the following command on any node in the cluster to view detailed information about a specific PExtent:

zbs-meta pextent show <pextent_id>

Output example

--------------------  ----------
ID                    5
Replica               [3, 1, 2]
Alive Replica         [3, 1, 2]
Temporary Replica     []
Ever Exist            True
Is Garbage            False
Origin PExtent        0
Origin Epoch          0
Expected Replica num  3
Epoch                 5
Prefer Local          3
Allocated Space       2.25 MiB
Resiliency Type       RT_REPLICA
PExtent Type          PT_PERF
EC Param
Is Sinkable           True
--------------------  ----------

Output note

ParameterDescription
ReplicaThe replica location.
Alive ReplicaThe location of active replicas.
Ever ExistWhether the data actually exists.
Temporary ReplicaFor replicated PExtents, a temporary replica is created when a replica fails.
Is GarbageWhether the data needs to be recycled.
Origin PExtentThe source PExtent.
Origin EpochThe Epoch of the source PExtent.
Expected Replica numThe expected replication factor.
EpochThe version number.
Prefer LocalThe default chunk ID where the PExtent is stored.
Allocated SpaceThe allocated physical space.
Resiliency TypeThe type of redundancy policy.
PExtent TypeWhether it is a capacity PExtent or a performance PExtent.
EC ParamThe EC policy attributes of the EC redundancy policy.
Is SinkableWhether it can be demoted.

Viewing the volume that an extent belongs to

Procedure

Run the following command on any node in the cluster to view the volume that the extent belongs to:

zbs-meta pextent getref <pextent_id> [--show_lextent_only]

ParameterDescription
--show_lextent_onlyShow details only of the associated LExtent. Default: False.

Output example

[root@9f29fde8244f zbs-client-py]# zbs-meta pextent getref 1
-------------  -------
Logical ID           1
Logical Epoch        1
Perf PID       5485175
Perf Epoch     8997306
Cap PID              1
Cap Epoch            1
Prioritized      False
-------------  -------
-----------------------  ------------------------------------
Pool Name                ee8e1b5d-be53-4c7d-80df-d651579c5dd4
Volume ID                f08a4c60-e5b9-4046-b388-ecc23fa8e06c
Volume Name              f08a4c60-e5b9-4046-b388-ecc23fa8e06c
Volume Is Snapshot       False
Volume Snapshot Pool ID
Snapshot Name
-----------------------  ------------------------------------

Output note

ParameterDescription
Logical IDThe LExtent ID.
Logical EpochThe LExtent version number.
Perf PIDThe performance tier PExtent ID.
Perf EpochThe performance tier PExtent version number.
Cap PIDThe capacity tier PExtent ID.
Cap EpochThe capacity tier PExtent version number.
PrioritizedWhether it is referenced by a pinned volume.
Pool NameThe datastore that the extent belongs to.
Volume IDThe ID of the volume that the extent belongs to.
Volume NameThe name of the volume that the extent belongs to.
Volume Is SnapshotWhether the volume that the extent belongs to is a snapshot.
Volume Snapshot Pool IDThe ID of the datastore to which the snapshot containing the extent belongs.
Snapshot NameThe name of the snapshot to which the extent belongs.

Viewing all sub-extents of a specified extent

Procedure

Run the following command on any node in the cluster:

zbs-meta pextent list_children <pextent_id>

Output example

    ID  Replica    Alive Replica    Temporary Replica    Ever Exist    Is Garbage      Origin PExtent    Origin Epoch    Expected Replica num    Epoch    Prefer Local  Allocated Space    Unique Space    Shared Space    Resiliency Type    PExtent Type    EC Param    Is Sinkable
------  ---------  ---------------  -------------------  ------------  ------------  ----------------  --------------  ----------------------  -------  --------------  -----------------  --------------  --------------  -----------------  --------------  ----------  -------------
917439  []         []               []                   False         False                   917343          917343                       2   917439               2  0.00 B             0.00 B          0.00 B          RT_REPLICA         PT_CAP

Output note

ParameterDescription
ReplicaThe replica location.
Alive ReplicaThe location of active replicas.
Ever ExistWhether the data actually exists.
Temporary ReplicaFor replicated PExtents, a temporary replica is created when a replica fails.
Is GarbageWhether the data needs to be recycled.
Origin PExtentThe source PExtent.
Origin EpochThe Epoch of the source PExtent.
Expected Replica numThe expected replication factor.
EpochThe version number.
Prefer LocalThe default chunk ID where the PExtent is stored.
Allocated SpaceThe allocated physical space.
Resiliency TypeThe type of redundancy policy.
PExtent TypeWhether it is a capacity PExtent or a performance PExtent.
EC ParamThe EC policy attributes of the EC redundancy policy.
Is SinkableWhether it can be demoted.

Viewing the virtual machines associated with an extent

Procedure

Run the following command on any node to view the virtual machines associated with a PExtent.

zbs-tool elf get_vm_by_pid <pid>

ParameterDescription
pidThe PExtent ID.

Output example

In an ACOS (AVE) cluster, corresponding virtual machine names will be displayed. In an ACOS (VMware ESXi) cluster, related file names will be displayed. You can use file names to further locate related virtual machines in the VMware management interface.

     ID  Replica    Alive Replica    Temporary Replica    Ever Exist    Affected ZBS Volumes                      Affected VMs
-------  ---------  ---------------  -------------------  ------------  ----------------------------------------  ----------------------------------------------
111111  [2, 1]     [2, 1]           []                   False         ['3848f8a2-dd36-43dc-bd5e-90094f46990x']  ['vm-281bb7c2-5ada-4730-ae7b-9c7da2758091-2']

Output note

ParameterDescription
IDThe PExtent ID.
ReplicaThe expected PExtent replicas.
Alive ReplicaThe active PExtent replicas.
Temporary ReplicaFor replicated PExtents, a temporary replica is created when a replica fails.
Ever ExistWhether the PExtent has ever been allocated (thin-provisioned PExtents exist only after reads/writes).
Affected ZBS VolumesThe IDs of virtual volumes affected by the PExtent. Multiple IDs may be displayed.
Affected VMsThe IDs of virtual machines affected by the PExtent. Multiple IDs may be displayed.
Affected ZBS NFS FilesThe NFS file names corresponding to the virtual volumes affected by the PExtent. Displayed only when the NFS access protocol is used; otherwise, the value is empty.

Searching for PExtents in a specific state

Procedure

Run the following command on any node in the cluster to find PExtents in a specific state:

zbs-meta pextent find <pextent_status> [--start START] [--length Length]

Parameter Description
pextent_status Searches for PExtents in a specified state:
  • dead: PExtents whose replicas are all inaccessible.
  • need_recover: PExtents that require data recovery and are currently being recovered.
  • may_recover: PExtents available for potential data recovery. They are not currently being recovered, but recovery is pending.
  • garbage: PExtents marked for reclamation.
  • need_drain: PExtents that require data demotion.
--start START The starting PExtent ID for the search. Default: 1.
--length LENGTH The number of PExtents to return. Default and maximum: 1024.

Usage example

$ zbs-meta pextent find need_recover

Output example

   ID  Replica    Alive Replica    Temporary Replica    Ever Exist    Is Garbage      Origin PExtent    Origin Epoch    Expected Replica num    Epoch    Prefer Local  Allocated Space    Resiliency Type    PExtent Type    EC Param    Is Sinkable
----  ---------  ---------------  -------------------  ------------  ------------  ----------------  --------------  ----------------------  -------  --------------  -----------------  -----------------  --------------  ----------  -------------
  22  [3, 2]     [3, 2]           []                   True          False                        0               0                       3       14               0  512.00 MiB         RT_REPLICA         PT_PERF                     True
  23  [3, 2]     [3, 2]           []                   False         False                        0               0                       3       15               3  0.00 B             RT_REPLICA         PT_PERF                     True
  24  [3, 2]     [3, 2]           []                   False         False                        0               0                       3       16               3  0.00 B             RT_REPLICA         PT_PERF                     True
  25  [3, 2]     [3, 2]           []                   False         False                        0               0                       3       17               3  0.00 B             RT_REPLICA         PT_PERF                     True

Searching for dead extents and their impact

When a physical disk fails or a node goes offline, some PExtents may lose all active replicas. These PExtents are then marked as dead extents and become inaccessible. Users can use commands to identify dead extents and the affected virtual volumes, virtual machines, etc.

Procedure

Run the following command on any node in the cluster:

zbs-tool abnormal_detect find_dead_extent [--start START] [--length Length]

ParameterDescription
--start START The starting PExtent ID for the search. Default: 1.
--length LENGTHThe number of PExtents to return. Default and maximum: 1024.

Output example

The output differs depending on the virtualization platform:

  • AVE platform

    You can view dead extents, affected virtual volumes, and associated NFS file names, and query the affected virtual machines.

    Example output:

    [root@444541dcac3f zbs-client-py]# zbs-tool abnormal_detect find_dead_extent
    ID  Replica    Alive Replica    Temporary Replica    Ever Exist    Is Garbage      Origin PExtent    Origin Epoch    Expected Replica num    Epoch    Prefer Local  Allocated Space    Resiliency Type    PExtent Type    EC Param    Is Sinkable    Affected ZBS Volumes                      Affected ZBS NFS Files    Affected VMs
    ----  ---------  ---------------  -------------------  ------------  ------------  ----------------  --------------  ----------------------  -------  --------------  -----------------  -----------------  --------------  ----------  -------------  ----------------------------------------  ------------------------  --------------
    139  [1, 3]     []               []                   True          False                        0               0                       2      139               1  0.00 B             RT_REPLICA         PT_PERF                     True           ['e6fd591c-2176-47ed-b50c-51a59cfe4a67']  []                        [example_vm]

    From the above output, you can identify the following key information:

    • The PID of the dead extent is 139.
    • The virtual volume ID affected by the dead extent is e6fd591c-2176-47ed-b50c-51a59cfe4a67;
    • The affected virtual machine is example_vm.
  • VMware ESXi platform

    You can view dead extents, affected virtual volumes, and corresponding NFS file names. You can further locate the affected virtual machines on VMware ESXi using the NFS file names. Example output:

    [root@444541dcac3f zbs-client-py]# zbs-tool abnormal_detect find_dead_extent
    ID  Replica    Alive Replica    Temporary Replica    Ever Exist    Is Garbage      Origin PExtent    Origin Epoch    Expected Replica num    Epoch    Prefer Local  Allocated Space    Resiliency Type    PExtent Type    EC Param    Is Sinkable    Affected ZBS Volumes                      Affected ZBS NFS Files
    ----  ---------  ---------------  -------------------  ------------  ------------  ----------------  --------------  ----------------------  -------  --------------  -----------------  -----------------  --------------  ----------  -------------  ----------------------------------------  ------------------------
    105  [3, 2]     []               []                   True          False                        0               0                       2      105               3  1024.00 KiB        RT_REPLICA         PT_PERF                     True           ['cd74ead0-58a8-42d6-81e3-d1057275046a']  [example_vm.vmdk]

    From the above output, you can identify the following key information:

    • The PID of the dead extent is 105.
    • The virtual volume ID affected by the dead extent is cd74ead0-58a8-42d6-81e3-d1057275046a;
    • The affected virtual volume corresponds to the NFS file example_vm.vmdk. Use this filename to further locate the affected virtual machine on the VMware ESXi virtualization.

Output note

ParameterDescription
IDThe PID of the dead extent.
ReplicaThe expected replicas of the dead extent.
Alive ReplicaThe alive replicas of the dead extent.
Temporary ReplicaFor replicated PExtents, a temporary replica is created when a replica fails.
Ever ExistWhether the dead extent has ever been allocated (thin-provisioned extents exist only after reads or writes).
Is Garbage Whether the dead extent is marked as Garbage. Garbage indicates that the associated virtual volume and snapshots are fully deleted, making this extent no longer useful.
Origin PExtentWhether the dead extent is copied from another extent. If copied, displays the source extent's PID; otherwise, displays as 0.
Origin EpochThe Epoch of the source PExtent.
Expected Replica numThe expected replication factor for the dead extent is determined by its parent object's (virtual volume or snapshot) configuration.
EpochUsed together with PID to exclusively identify the attribute value of an extent.
Prefer LocalThe node ID where the dead extent replica is expected to be allocated, as determined by the replica allocation policy.
Allocated SpaceThe allocated physical space.
Resiliency TypeThe type of redundancy policy.
PExtent TypeWhether it is a capacity PExtent or a performance PExtent.
EC ParamThe EC policy attributes of the EC redundancy policy.
Is SinkableWhether it can be demoted.
Affected ZBS VolumesThe IDs of virtual volumes affected by the dead extent. Multiple IDs may be displayed.
Affected ZBS NFS FilesThe NFS file names corresponding to the virtual volumes affected by the dead extent. Displayed only when the NFS access protocol is used; otherwise, the value is empty.
Affected VMsThe virtual machines affected by the dead extent. Displayed only on AVE platform; multiple virtual machine names may be displayed.

Writing data read from a PExtent

Procedure

Run the following command on any node in the cluster to write data from the specified PExtent_id into output_file, starting at offset and for a length of length:

zbs-meta pextent read -o <output_file> <pextent_id> <offset> <length>

ParameterDescription
output_file The file in which to store the read data.
offsetThe starting offset for reading data (relative to the virtual volume), which must be a multiple of 512.
length The length of data to read, which must be a multiple of 512.

Viewing PExtent properties on a chunk

Procedure

Run the following command on the current node to view the properties of a PExtent located on the chunk.

zbs-chunk extent show <pid>

Output example

pid: 5
epoch: 5
generation: 1783
status: 1
private_blob_num: 3
shared_blob_num: 0
thick_provision: False
perf: True