RVC使用指南(三)-对象管理
https://mp.weixin.qq.com/s/B3wcxUP-QJRnb_kVIlbZqQ
看了就要关注我,哈哈~
本文介绍了vSAN中与对象管理相关的RVC命令。 这些命令用于故障排除或重新配置对象。
-
vsan.disks_info
-
vsan.disks_stats
-
vsan.cmmds_find
-
vsan.vm_object_info
-
vsan.disk_object_info
-
vsan.object_info
-
vsan.object_reconfigure
-
vsan.vmdk_stats
为了缩短命令,我对环境中的集群、虚拟机和ESXi主机使用了标记。这样可以在示例中使用~cluster、~vm和~esx来代替。
/localhost/DC> mark cluster ~/computers/VSAN-Cluster/
/localhost/DC> mark vm ~/vms/vma.virten.lab
/localhost/DC> mark esx ~/computers/VSAN-Cluster/hosts/esx1.virten.lab/
对象管理
vsan.disks_info [-s] ~host
输出一台主机的物理磁盘信息,包括磁盘类型(SSD或MD),大小和状态。该命令可以识别磁盘是否适合用于vSAN。
-s, --show-adapters: Display adapter information in the state column.
示例1-在已启用HA的群集上禁用VSAN:
/localhost/DC> vsan.disks_info vSAN65/hosts/vesx1.virten.lab/
Gathering disk information for host vesx1.virten.lab
Done gathering disk information
Disks on host vesx1.virten.lab:
+------------------------------------------------+-------+--------+-----------------------------------------------------------------------+
| DisplayName | isSSD | Size | State |
+------------------------------------------------+-------+--------+-----------------------------------------------------------------------+
| Local NVMe Disk (t10.NVMe_Samsung_SSD_950_PRO) | SSD | 256 GB | inUse |
| NVMe Samsung SSD 950 | | | vSAN Format Version: v5 |
| | | | |
| | | | Adapters: |
| | | | vmhba0 (nvme) |
| | | | Samsung Electronics Co Ltd NVMe SSD Controller |
+------------------------------------------------+-------+--------+-----------------------------------------------------------------------+
| Local NVMe Disk (t10.NVMe_Samsung_SSD_950_PRO) | SSD | 512 GB | inUse |
| NVMe Samsung SSD 950 | | | vSAN Format Version: v5 |
| | | | |
| | | | Adapters: |
| | | | vmhba0 (nvme) |
| | | | Samsung Electronics Co Ltd NVMe SSD Controller |
+------------------------------------------------+-------+--------+-----------------------------------------------------------------------+
| Local NVMe Disk (t10.NVMe_Samsung_SSD_950_PRO) | SSD | 512 GB | inUse |
| NVMe Samsung SSD 950 | | | vSAN Format Version: v5 |
| | | | |
| | | | Adapters: |
| | | | vmhba0 (nvme) |
| | | | Samsung Electronics Co Ltd NVMe SSD Controller |
+------------------------------------------------+-------+--------+-----------------------------------------------------------------------+
| Local USB Direct-Access (mpx.vmhba32:C0:T0:L0) | SSD | 16 GB | ineligible (Existing partitions found on disk 'mpx.vmhba0:C0:T0:L0'.) |
| Kingston DataTraveler 2.0 | | | |
| | | | Partition table: |
| | | | 5: 0.24 GB, type = vfat |
| | | | 6: 0.24 GB, type = vfat |
| | | | 7: 0.11 GB, type = coredump |
| | | | 8: 0.28 GB, type = vfat |
| | | | 9: 2.50 GB, type = coredump |
| | | | |
| | | | Adapters: |
| | | | vmhba32 (usb-storage) |
| | | | USB |
+------------------------------------------------+-------+--------+-----------------------------------------------------------------------+
vsan.disks_stats ~cluster|~host
显示主机或集群中使用的磁盘的信息,包括:
-
Disk Type (SSD or MD)
-
Number of components reside on the disk
-
Disk capacity
-
Percentage of used capacity
-
Space reservations (via the ObjectSpaceReservation policy)
-
Health
-
On-disk format
示例1-显示集群中的所有磁盘:
/localhost/DC> vsan.disks_stats ~cluster
Fetching vSAN disk info from vesx3.virten.lab (may take a moment) ...
Fetching vSAN disk info from vesx2.virten.lab (may take a moment) ...
Fetching vSAN disk info from vesx1.virten.lab (may take a moment) ...
Done fetching vSAN disk infos
+---------------------+------------------+-------+------+----------+---------+----------+----------+----------+----------+----------+---------+----------+---------+
| | | | Num | Capacity | | | Physical | Physical | Physical | Logical | Logical | Logical | Status |
| DisplayName | Host | isSSD | Comp | Total | Used | Reserved | Capacity | Used | Reserved | Capacity | Used | Reserved | Health |
+---------------------+------------------+-------+------+----------+---------+----------+----------+----------+----------+----------+---------+----------+---------+
| mpx.vmhba0:C0:T1:L0 | vesx1.virten.lab | SSD | 0 | 5.00 GB | 0.00 % | 0.00 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
| mpx.vmhba0:C0:T3:L0 | vesx1.virten.lab | MD | 3 | 9.99 GB | 6.68 % | 5.51 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
| mpx.vmhba0:C0:T2:L0 | vesx1.virten.lab | MD | 2 | 9.99 GB | 5.36 % | 0.39 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
+---------------------+------------------+-------+------+----------+---------+----------+----------+----------+----------+----------+---------+----------+---------+
| mpx.vmhba0:C0:T1:L0 | vesx2.virten.lab | SSD | 0 | 5.00 GB | 0.00 % | 0.00 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
| mpx.vmhba0:C0:T2:L0 | vesx2.virten.lab | MD | 2 | 9.99 GB | 32.06 % | 30.69 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
| mpx.vmhba0:C0:T3:L0 | vesx2.virten.lab | MD | 3 | 9.99 GB | 10.16 % | 5.51 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
+---------------------+------------------+-------+------+----------+---------+----------+----------+----------+----------+----------+---------+----------+---------+
| mpx.vmhba0:C0:T1:L0 | vesx3.virten.lab | SSD | 0 | 5.00 GB | 0.00 % | 0.00 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
| mpx.vmhba0:C0:T2:L0 | vesx3.virten.lab | MD | 2 | 9.99 GB | 35.77 % | 30.69 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
| mpx.vmhba0:C0:T3:L0 | vesx3.virten.lab | MD | 3 | 9.99 GB | 5.16 % | 0.47 % | N/A | N/A | N/A | N/A | N/A | N/A | OK (v5) |
+---------------------+------------------+-------+------+----------+---------+----------+----------+----------+----------+----------+---------+----------+---------+
vsan.cmmds_find [-t|-u|-o] ~cluster|~host
在只有UUID已知的情况下,显示vSAN中的对象或组件的信息。一个查找对象和对象详细信息的强大命令。可用于主机或集群, 建议针对集群使用,以将UUID解析为可读的名称。
-
-t, --type: CMMDS type, e.g. DOM_OBJECT, LSOM_OBJECT, POLICY, DISK etc.
-
-u, --uuid: UUID of the entry.
-
-o, --owner: UUID of the owning node.
类型:
-
DISK –represents a magnetic disk or flash device
-
DOM_OBJECT – represents composite objects
-
POLICY type – represents a policy
-
LSOM_OBJECT – represents a component
示例1-列出vSAN中的所有磁盘:
/localhost/DC> vsan.cmmds_find ~cluster -t DISK
+---+------+--------------------------------------+------------------+---------+-----------------------------------------------------+
| # | Type | UUID | Owner | Health | Content |
+---+------+--------------------------------------+------------------+---------+-----------------------------------------------------+
| 1 | DISK | 520187e9-9a07-3d0c-04b0-dd5bb0f4df04 | vesx1.virten.lab | Healthy | {"capacity"=>1048576, |
| | | | | | "iops"=>20000, |
| | | | | | "iopsWritePenalty"=>10000000, |
| | | | | | "throughput"=>200000000, |
| | | | | | "throughputWritePenalty"=>0, |
| | | | | | "latency"=>3400000, |
| | | | | | "latencyDeviation"=>0, |
| | | | | | "reliabilityBase"=>10, |
| | | | | | "reliabilityExponent"=>15, |
| | | | | | "mtbf"=>2000000, |
| | | | | | "l2CacheCapacity"=>0, |
| | | | | | "l1CacheCapacity"=>16777216, |
| | | | | | "isSsd"=>1, |
| | | | | | "ssdUuid"=>"520187e9-9a07-3d0c-04b0-dd5bb0f4df04", |
| | | | | | "volumeName"=>"NA", |
| | | | | | "formatVersion"=>"5", |
| | | | | | "devName"=>"mpx.vmhba0:C0:T1:L0:2", |
| | | | | | "ssdCapacity"=>5365546496, |
| | | | | | "rdtMuxGroup"=>0, |
| | | | | | "isAllFlash"=>1, |
| | | | | | "maxComponents"=>0, |
| | | | | | "logicalCapacity"=>0, |
| | | | | | "physDiskCapacity"=>0, |
| | | | | | "dedupScope"=>0, |
| | | | | | "dedupMetadata"=>0, |
| | | | | | "isEncrypted"=>0} |
| 2 | DISK | 52678934-7d90-d712-61c6-6919990a18f3 | vesx1.virten.lab | Healthy | {"capacity"=>10729029632, |
| | | | | | "iops"=>100, |
| | | | | | "iopsWritePenalty"=>10000000, |
[...]
示例2-列出指定ESXi主机中的所有磁盘。使用vsan.host_info标识主机UUID(节点UUID):
/localhost/DC> vsan.host_info ~esx
Fetching host info from vesx1.virten.lab (may take a moment) ...
Product: VMware ESXi 6.5.0 build-5310538
vSAN enabled: yes
Cluster info:
Cluster role: agent
Cluster UUID: 520e0160-c109-abd2-45af-f5378f18f74a
Node UUID: 58a4a441-1c1a-4243-b64c-005056b968bd
Member UUIDs: ["58a4a3da-1284-ce11-70a5-005056b9f17c", "58a4a4f2-c6ed-db2a-0b14-005056b90377", "58a4a441-1c1a-4243-b64c-005056b968bd"] (3)
Node evacuated: no
Storage info:
Auto claim: yes
Disk Mappings:
SSD: Local VMware Disk (mpx.vmhba0:C0:T1:L0) - 5 GB, v5
MD: Local VMware Disk (mpx.vmhba0:C0:T3:L0) - 10 GB, v5
MD: Local VMware Disk (mpx.vmhba0:C0:T2:L0) - 10 GB, v5
FaultDomainInfo:
Hamburg
NetworkInfo:
Adapter: vmk2 (10.100.0.121)
/localhost/DC> vsan.cmmds_find ~cluster -t DISK -o 58a4a441-1c1a-4243-b64c-005056b968bd
+---+------+--------------------------------------+------------------+---------+-----------------------------------------------------+
| # | Type | UUID | Owner | Health | Content |
+---+------+--------------------------------------+------------------+---------+-----------------------------------------------------+
| 1 | DISK | 520187e9-9a07-3d0c-04b0-dd5bb0f4df04 | vesx1.virten.lab | Healthy | {"capacity"=>1048576, |
| | | | | | "iops"=>20000, |
| | | | | | "iopsWritePenalty"=>10000000, |
| | | | | | "throughput"=>200000000, |
| | | | | | "throughputWritePenalty"=>0, |
| | | | | | "latency"=>3400000, |
| | | | | | "latencyDeviation"=>0, |
| | | | | | "reliabilityBase"=>10, |
| | | | | | "reliabilityExponent"=>15, |
| | | | | | "mtbf"=>2000000, |
| | | | | | "l2CacheCapacity"=>0, |
| | | | | | "l1CacheCapacity"=>16777216, |
| | | | | | "isSsd"=>1, |
| | | | | | "ssdUuid"=>"520187e9-9a07-3d0c-04b0-dd5bb0f4df04", |
| | | | | | "volumeName"=>"NA", |
| | | | | | "formatVersion"=>"5", |
| | | | | | "devName"=>"mpx.vmhba0:C0:T1:L0:2", |
| | | | | | "ssdCapacity"=>5365546496, |
| | | | | | "rdtMuxGroup"=>0, |
| | | | | | "isAllFlash"=>1, |
| | | | | | "maxComponents"=>0, |
| | | | | | "logicalCapacity"=>0, |
| | | | | | "physDiskCapacity"=>0, |
| | | | | | "dedupScope"=>0, |
| | | | | | "dedupMetadata"=>0, |
| | | | | | "isEncrypted"=>0} |
| 2 | DISK | 52678934-7d90-d712-61c6-6919990a18f3 | vesx1.virten.lab | Healthy | {"capacity"=>10729029632, |
| | | | | | "iops"=>100, |
| | | | | | "iopsWritePenalty"=>10000000, |
示例3-列出指定ESXi主机的DOM对象:
/localhost/DC> vsan.cmmds_find ~cluster -t DOM_OBJECT -o 58a4a4f2-c6ed-db2a-0b14-005056b90377
+---+------------+--------------------------------------+------------------+---------+---------------------------------------------------------------------+
| # | Type | UUID | Owner | Health | Content |
+---+------------+--------------------------------------+------------------+---------+---------------------------------------------------------------------+
| 1 | DOM_OBJECT | da00a658-f668-f186-af1c-005056b9f17c | vesx3.virten.lab | Healthy | {"type"=>"Configuration", |
| | | | | | "attributes"=> |
| | | | | | {"CSN"=>70, |
| | | | | | "SCSN"=>74, |
| | | | | | "addressSpace"=>273804165120, |
| | | | | | "scrubStartTime"=>1487274202730650, |
| | | | | | "objectVersion"=>5, |
| | | | | | "highestDiskVersion"=>5, |
| | | | | | "muxGroup"=>412332854759424, |
| | | | | | "groupUuid"=>"da00a658-f668-f186-af1c-005056b9f17c", |
| | | | | | "compositeUuid"=>"da00a658-f668-f186-af1c-005056b9f17c", |
| | | | | | "objClass"=>2}, |
| | | | | | "child-1"=> |
| | | | | | {"type"=>"RAID_1", |
| | | | | | "attributes"=>{"scope"=>3}, |
| | | | | | "child-1"=> |
| | | | | | {"type"=>"Component", |
| | | | | | "attributes"=> |
| | | | | | {"capacity"=>[0, 273804165120], |
| | | | | | "addressSpace"=>273804165120, |
| | | | | | "componentState"=>5, |
| | | | | | "componentStateTS"=>1496855824, |
| | | | | | "faultDomainId"=>"58a4a4f2-c6ed-db2a-0b14-005056b90377", |
| | | | | | "lastScrubbedOffset"=>314769408, |
| | | | | | "subFaultDomainId"=>"58a4a4f2-c6ed-db2a-0b14-005056b90377", |
| | | | | | "objClass"=>2}, |
| | | | | | "componentUuid"=>"da00a658-c6d2-6c87-8146-005056b9f17c", |
| | | | | | "diskUuid"=>"522a4211-57ee-f31f-3a84-18a75a0c0ff3"}, |
| | | | | | "child-2"=> |
| | | | | | {"type"=>"Component", |
| | | | | | "attributes"=> |
| | | | | | {"capacity"=>[0, 273804165120], |
| | | | | | "addressSpace"=>273804165120, |
| | | | | | "componentState"=>5, |
| | | | | | "componentStateTS"=>1496855824, |
| | | | | | "faultDomainId"=>"35d7df6e-d3d9-3be2-927d-14acc5f1fc9a", |
| | | | | | "lastScrubbedOffset"=>314703872, |
| | | | | | "subFaultDomainId"=>"58a4a441-1c1a-4243-b64c-005056b968bd", |
| | | | | | "objClass"=>2}, |
| | | | | | "componentUuid"=>"0b4ef658-56ca-6b29-f5fa-005056b9f17c", |
| | | | | | "diskUuid"=>"52678934-7d90-d712-61c6-6919990a18f3"}}, |
| | | | | | "child-2"=> |
| | | | | | {"type"=>"Witness", |
| | | | | | "attributes"=> |
| | | | | | {"componentState"=>5, |
| | | | | | "componentStateTS"=>1496855762, |
| | | | | | "isWitness"=>1, |
| | | | | | "faultDomainId"=>"58a4a3da-1284-ce11-70a5-005056b9f17c", |
| | | | | | "subFaultDomainId"=>"58a4a3da-1284-ce11-70a5-005056b9f17c"}, |
| | | | | | "componentUuid"=>"0e4ef658-2c46-6ba4-c422-005056b9f17c", |
| | | | | | "diskUuid"=>"52e3ae7e-b744-796d-de9f-ff73b0cd4df9"}} |
| 2 | DOM_OBJECT | dc00a658-204b-db99-8337-005056b9f17c | vesx3.virten.lab | Healthy | {"type"=>"Configuration", |
| | | | | | "attributes"=> |
| | | | | | {"CSN"=>60, |
| | | | | | "SCSN"=>63, |
| | | | | | "addressSpace"=>6442450944, |
| | | | | | "scrubStartTime"=>1497097171666092, |
| | | | | | "objectVersion"=>5, |
| | | | | | "highestDiskVersion"=>5, |
| | | | | | "muxGroup"=>412332854759424, |
| | | | | | "groupUuid"=>"da00a658-f668-f186-af1c-005056b9f17c", |
| | | | | | "compositeUuid"=>"dc00a658-204b-db99-8337-005056b9f17c"}, |
| | | | | | "child-1"=> |
| | | | | | {"type"=>"RAID_1", |
| | | | | | "attributes"=>{"scope"=>3}, |
| | | | | | "child-1"=> |
| | | | | | {"type"=>"Component", |
| | | | | | "attributes"=> |
| | | | | | {"addressSpace"=>6442450944, |
| | | | | | "componentState"=>5, |
| | | | | | "componentStateTS"=>1496855782, |
| | | | | | "faultDomainId"=>"58a4a3da-1284-ce11-70a5-005056b9f17c", |
| | | | | | "subFaultDomainId"=>"58a4a3da-1284-ce11-70a5-005056b9f17c"}, |
| | | | | | "componentUuid"=>"dc00a658-0ee2-6a9a-d2a0-005056b9f17c", |
| | | | | | "diskUuid"=>"529873dc-6f15-bf2c-51a2-be0b4f6e755c"}, |
| | | | | | "child-2"=> |
| | | | | | {"type"=>"Component", |
| | | | | | "attributes"=> |
| | | | | | {"addressSpace"=>6442450944, |
| | | | | | "componentState"=>5, |
| | | | | | "componentStateTS"=>1496855782, |
| | | | | | "faultDomainId"=>"58a4a4f2-c6ed-db2a-0b14-005056b90377", |
| | | | | | "subFaultDomainId"=>"58a4a4f2-c6ed-db2a-0b14-005056b90377"}, |
| | | | | | "componentUuid"=>"dc00a658-dc2d-6c9a-f76b-005056b9f17c", |
| | | | | | "diskUuid"=>"526bc1a4-1d10-6783-3216-7fed84c9d71f"}}, |
| | | | | | "child-2"=> |
| | | | | | {"type"=>"Witness", |
| | | | | | "attributes"=> |
| | | | | | {"componentState"=>5, |
| | | | | | "componentStateTS"=>1496855824, |
| | | | | | "isWitness"=>1, |
| | | | | | "faultDomainId"=>"58a4a441-1c1a-4243-b64c-005056b968bd", |
| | | | | | "subFaultDomainId"=>"58a4a441-1c1a-4243-b64c-005056b968bd"}, |
| | | | | | "componentUuid"=>"dc00a658-5eff-6c9a-215e-005056b9f17c", |
| | | | | | "diskUuid"=>"52678934-7d90-d712-61c6-6919990a18f3"}} |
| 3 | DOM_OBJECT | 593d3859-1c83-25fa-6deb-005056b90377 | vesx3.virten.lab | Healthy | {"type"=>"Configuration", |
| | | | | | "attributes"=> |
| | | | | | {"CSN"=>4, |
| | | | | | "addressSpace"=>536870912, |
[...]
示例4-列出指定ESXi主机中的LSOM对象(组件):
/localhost/DC> vsan.cmmds_find ~cluster -t LSOM_OBJECT -o 58a4a4f2-c6ed-db2a-0b14-005056b90377
+---+-------------+--------------------------------------+------------------+---------+-----------------------------------------------------------+
| # | Type | UUID | Owner | Health | Content |
+---+-------------+--------------------------------------+------------------+---------+-----------------------------------------------------------+
| 1 | LSOM_OBJECT | b38df658-6ce8-3939-b551-005056b9f17c | vesx3.virten.lab | Healthy | {"diskUuid"=>"522a4211-57ee-f31f-3a84-18a75a0c0ff3", |
| | | | | | "compositeUuid"=>"b38df658-36af-a138-68a2-005056b9f17c", |
| | | | | | "capacityUsed"=>3292528640, |
| | | | | | "physCapacityUsed"=>2508193792, |
| | | | | | "dedupUniquenessMetric"=>100} |
| 2 | LSOM_OBJECT | b28df658-5a55-9e82-0d22-005056b9f17c | vesx3.virten.lab | Healthy | {"diskUuid"=>"526bc1a4-1d10-6783-3216-7fed84c9d71f", |
| | | | | | "compositeUuid"=>"b28df658-c089-2d82-5649-005056b9f17c", |
| | | | | | "capacityUsed"=>373293056, |
| | | | | | "physCapacityUsed"=>369098752, |
| | | | | | "dedupUniquenessMetric"=>100} |
| 3 | LSOM_OBJECT | da00a658-c6d2-6c87-8146-005056b9f17c | vesx3.virten.lab | Healthy | {"diskUuid"=>"522a4211-57ee-f31f-3a84-18a75a0c0ff3", |
| | | | | | "compositeUuid"=>"da00a658-f668-f186-af1c-005056b9f17c", |
| | | | | | "capacityUsed"=>402653184, |
| | | | | | "physCapacityUsed"=>398458880, |
| | | | | | "dedupUniquenessMetric"=>100} |
| 4 | LSOM_OBJECT | dc00a658-dc2d-6c9a-f76b-005056b9f17c | vesx3.virten.lab | Healthy | {"diskUuid"=>"526bc1a4-1d10-6783-3216-7fed84c9d71f", |
| | | | | | "compositeUuid"=>"dc00a658-204b-db99-8337-005056b9f17c", |
| | | | | | "capacityUsed"=>12582912, |
| | | | | | "physCapacityUsed"=>4194304, |
| | | | | | "dedupUniquenessMetric"=>100} |
| 5 | LSOM_OBJECT | 593d3859-885e-8afa-a085-005056b90377 | vesx3.virten.lab | Healthy | {"diskUuid"=>"526bc1a4-1d10-6783-3216-7fed84c9d71f", |
| | | | | | "compositeUuid"=>"593d3859-1c83-25fa-6deb-005056b90377", |
| | | | | | "capacityUsed"=>12582912, |
| | | | | | "physCapacityUsed"=>4194304, |
| | | | | | "dedupUniquenessMetric"=>100} |
+---+-------------+--------------------------------------+------------------+---------+-----------------------------------------------------------+
vsan.vm_object_info [-c|-p|-i] ~vm
输出虚拟机的vSAN对象信息。此命令等效于vSphere Web Client中的“管理”>“ VM存储策略”选项卡,允许你确定虚拟磁盘的条带数,镜像和见证虚拟磁盘的位置。该命令包含以下信息:
-
Namespace directory (Virtual Machine home directory)
-
Disk backing (Virtual Disks)
-
Component layout (RAID-0, RAID-1)
-
Number of objects (DOM Objects)
-
UUID from objects and components (useful for other commands)
-
Location of object stripes and mirrors
-
Location of object witness
-
Storage Policy (hostFailuresToTolerate, forceProvisioning, stripeWidth, etc.)
-
Resync Status
用法:
-
-c, --cluster: Cluster on which to fetch the object info
-
-p, --perspective-from-host: Host to query object info from
-
-i, --include-detailed-usage: Include detailed usage info
示例1-输出DOM对象的物理位置和组件布局
/localhost/DC> vsan.vm_object_info ~vm
VM vMA:
Namespace directory
DOM Object: b28df658-c089-2d82-5649-005056b9f17c (v5, owner: vesx2.virten.lab, proxy owner: None, policy: spbmProfileId = aa6d5a82-1c88-45da-85d3-3d74b91a5bad, spbmProfileGenerationNumber = 0, stripeWidth = 1, SCSN = 41, hostFailuresToTolerate = 1, forceProvisioning = 0, CSN = 36, spbmProfileName = Virtual SAN Default Storage Policy, cacheReservation = 0, proportionalCapacity = [0, 100])
RAID_1
Component: b28df658-5a55-9e82-0d22-005056b9f17c (state: ACTIVE (5), host: vesx3.virten.lab, md: mpx.vmhba0:C0:T3:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 0.3 GB, proxy component: false)
Component: b28df658-16bd-9f82-d9c4-005056b9f17c (state: ACTIVE (5), host: vesx2.virten.lab, md: mpx.vmhba0:C0:T3:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 0.3 GB, proxy component: false)
Witness: b28df658-707d-a082-ff91-005056b9f17c (state: ACTIVE (5), host: vesx1.virten.lab, md: mpx.vmhba0:C0:T3:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 0.0 GB, proxy component: false)
Disk backing: [vsanDatastore] b28df658-c089-2d82-5649-005056b9f17c/vMA.vmdk
DOM Object: b38df658-36af-a138-68a2-005056b9f17c (v5, owner: vesx2.virten.lab, proxy owner: None, policy: spbmProfileId = aa6d5a82-1c88-45da-85d3-3d74b91a5bad, spbmProfileGenerationNumber = 0, stripeWidth = 1, SCSN = 36, hostFailuresToTolerate = 1, forceProvisioning = 0, CSN = 30, spbmProfileName = Virtual SAN Default Storage Policy, cacheReservation = 0, proportionalCapacity = 100)
RAID_1
Component: b38df658-66b6-3839-295a-005056b9f17c (state: ACTIVE (5), host: vesx2.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 3.1 GB, proxy component: false)
Component: b38df658-6ce8-3939-b551-005056b9f17c (state: ACTIVE (5), host: vesx3.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 3.1 GB, proxy component: false)
Witness: b38df658-0c9d-3a39-9867-005056b9f17c (state: ACTIVE (5), host: vesx1.virten.lab, md: mpx.vmhba0:C0:T3:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 0.0 GB, proxy component: false)
vsan.disk_object_info ~cluster [disk_uuid]
输出一块物理磁盘上的所有对象,当你要标识物理磁盘上的所有对象时,此命令可在故障排除过程中提供帮助。可以使用vsan.cmmds_find命令标识的磁盘UUID。
示例1-使用vsan.cmmds_find获取磁盘UUID并显示此磁盘上的所有对象:
/localhost/DC> vsan.cmmds_find ~cluster -t DISK
+---+------+--------------------------------------+------------------+---------+-----------------------------------------------------+
| # | Type | UUID | Owner | Health | Content |
+---+------+--------------------------------------+------------------+---------+-----------------------------------------------------+
| 1 | DISK | 521eb724-1c85-50bf-0640-65995452ee8b | vesx3.virten.lab | Healthy | {"capacity"=>1048576, |
| | | | | | "iops"=>20000, |
[...]
/localhost/DC> vsan.disk_object_info ~cluster 521eb724-1c85-50bf-0640-65995452ee8b
Physical disk mpx.vmhba0:C0:T1:L0 (521eb724-1c85-50bf-0640-65995452ee8b):
DOM Object: b38df658-36af-a138-68a2-005056b9f17c (v5, owner: vesx2.virten.lab, proxy owner: None, policy: spbmProfileId = aa6d5a82-1c88-45da-85d3-3d74b91a5bad, hostFailuresToTolerate = 1, cacheReservation = 0, proportionalCapacity = 100, spbmProfileGenerationNumber = 0, forceProvisioning = 0, SCSN = 36, CSN = 30, stripeWidth = 1, spbmProfileName = Virtual SAN Default Storage Policy)
Context: Part of VM vMA: Disk: [vsanDatastore] b28df658-c089-2d82-5649-005056b9f17c/vMA.vmdk
RAID_1
Component: b38df658-66b6-3839-295a-005056b9f17c (state: ACTIVE (5), host: vesx2.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 3.1 GB, proxy component: false)
Component: b38df658-6ce8-3939-b551-005056b9f17c (state: ACTIVE (5), host: vesx3.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: **mpx.vmhba0:C0:T1:L0**,
votes: 1, usage: 3.1 GB, proxy component: false)
Witness: b38df658-0c9d-3a39-9867-005056b9f17c (state: ACTIVE (5), host: vesx1.virten.lab, md: mpx.vmhba0:C0:T3:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 0.0 GB, proxy component: false)
DOM Object: da00a658-f668-f186-af1c-005056b9f17c (v5, owner: vesx3.virten.lab, proxy owner: None, policy: spbmProfileId = aa6d5a82-1c88-45da-85d3-3d74b91a5bad, hostFailuresToTolerate = 1, cacheReservation = 0, proportionalCapacity = [0, 100], spbmProfileGenerationNumber = 0, forceProvisioning = 0, SCSN = 74, spbmProfileName = Virtual SAN Default Storage Policy, CSN = 70, stripeWidth = 1, objectVersion = 5)
Context: Part of VM testvm: Namespace directory
RAID_1
Component: da00a658-c6d2-6c87-8146-005056b9f17c (state: ACTIVE (5), host: vesx3.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: **mpx.vmhba0:C0:T1:L0**,
votes: 1, usage: 0.4 GB, proxy component: false)
Component: 0b4ef658-56ca-6b29-f5fa-005056b9f17c (state: ACTIVE (5), host: vesx1.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 0.4 GB, proxy component: false)
Witness: 0e4ef658-2c46-6ba4-c422-005056b9f17c (state: ACTIVE (5), host: vesx2.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0,
votes: 1, usage: 0.0 GB, proxy component: false)
DOM Object: b28df658-c089-2d82-5649-005056b9f17c (v5, owner: vesx2.virten.lab, proxy owner: None, policy: spbmProfileId = aa6d5a82-1c88-45da-85d3-3d74b91a5bad, hostFailuresToTolerate = 1, cacheReservation = 0, proportionalCapacity = [0, 100], spbmProfileGenerationNumber = 0, forceProvisioning = 0, SCSN = 41, CSN = 36, stripeWidth = 1, spbmProfileName = Virtual SAN Default Storage Policy)
Context: Part of VM vMA: Namespace directory
[...]
vsan.object_info [-s|-i] ~cluster [obj_uuid]
输出对象物理位置和配置的信息。命令输出与vsan.vm_object_info非常相似,但是它用于单个对象。
-
-s, --skip-ext-attr: Don't fetch extended attributes
-
-i, --include-detailed-usage: Include detailed usage info
示例1-输出DOM对象的物理位置:
/localhost/DC> vsan.object_info ~cluster 7e62c152-7dfb-c6e5-07b8-001b2193b9a4
Fetching VSAN disk info from vesx1.virten.lab (may take a moment) ...
Fetching VSAN disk info from vesx2.virten.lab (may take a moment) ...
Fetching VSAN disk info from vesx3.virten.lab (may take a moment) ...
Done fetching VSAN disk infos
DOM Object: 7e62c152-7dfb-c6e5-07b8-001b2193b9a4 (owner: vesx1.virten.lab, policy: hostFailuresToTolerate = 1, forceProvisioning = 1, proportionalCapacity = 100)
Witness: c135c452-cd77-0733-1708-001b2193b9a4 (state: ACTIVE (5), host: vesx3.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0)
RAID_1
Component: c135c452-2f04-0533-dbbc-001b2193b9a4 (state: ACTIVE (5), host: vesx1.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0)
Component: 7e62c152-763d-1400-2b06-001b2193b9a4 (state: ACTIVE (5), host: vesx2.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0)
vsan.object_reconfigure [-p] ~cluster [obj_uuid]
使用新策略配置对象。要使用此命令,可以用vsan.cmmds_find或vsan.vm_object_info标识的对象UUID。
-p, --New policy: New policy
可用的策略选项有
-
hostFailuresToTolerate (Number of failures to tolerate)
-
forceProvisioning (If VSAN can't fulfill the policy requirements for an object, it will still deploy it)
-
stripeWidth (Number of disk stripes per object)
-
cacheReservation (Flash read cache reservation)
-
proportionalCapacity (Object space reservation)
注意保留现有策略。始终指定所有选项。必须以以下格式定义策略:
'(("hostFailuresToTolerate" i1) ("forceProvisioning" i1))'
示例1-更改磁盘策略以允许2个主机故障。当前策略为hostFailuresToTolerate = 1,stripeWidth = 1
/localhost/DC> vsan.object_reconfigure ~cluster 5078bd52-2977-8cf9-107c-00505687439c -p '(("hostFailuresToTolerate" i2) ("stripeWidth" i1))'
示例2-禁用强制配置。当前策略为hostFailuresToTolerate = 1,stripeWidth = 1
/localhost/DC> vsan.object_reconfigure ~cluster 5078bd52-2977-8cf9-107c-00505687439c -p '(("hostFailuresToTolerate" i1) ("stripeWidth" i1) ("forceProvisioning" i0))'
示例3-更改磁盘策略以容忍2个主机故障。当前策略为hostFailuresToTolerate = 1,stripeWidth = 1
/localhost/DC> vsan.vm_object_info ~vm
VM perf1:
Namespace directory
[...]
Disk backing: [vsanDatastore] 6978bd52-4d92-05ed-dad2-005056871792/vma.virten.lab.vmdk
DOM Object: 7e78bd52-7595-1716-85a2-005056871792 (owner: esx1.virtenlab, policy: hostFailuresToTolerate = 1, stripeWidth = 2, forceProvisioning = 1)
Witness: aee5bd52-7443-177b-74a8-005056871792 (state: ACTIVE (5), host: esx2.virten.lab, md: mpx.vmhba1:C0:T4:L0, ssd: mpx.vmhba1:C0:T1:L0)
RAID_1
RAID_0
Component: 36debd52-7390-a05d-9225-005056871792 (state: ACTIVE (5), esx3.virten.lab, md: mpx.vmhba1:C0:T2:L0, ssd: mpx.vmhba1:C0:T1:L0)
Component: 36debd52-a9b8-965d-03a6-005056871792 (state: ACTIVE (5), esx3.virten.lab, md: mpx.vmhba1:C0:T4:L0, ssd: mpx.vmhba1:C0:T1:L0)
RAID_0
Component: 7f78bd52-2d59-c558-09f9-005056871792 (state: ACTIVE (5), esx1.virten.lab, md: mpx.vmhba1:C0:T2:L0, ssd: mpx.vmhba1:C0:T1:L0)
Component: 7f78bd52-d827-c458-9d94-005056871792 (state: ACTIVE (5), esx1.virten.lab, md: mpx.vmhba1:C0:T4:L0, ssd: mpx.vmhba1:C0:T1:L0)
/localhost/DC> vsan.object_reconfigure ~cluster 7e78bd52-7595-1716-85a2-005056871792 -p '(("hostFailuresToTolerate" i1) ("stripeWidth" i1) ("forceProvisioning" i1))'
Reconfiguring '7e78bd52-7595-1716-85a2-005056871792' to (("hostFailuresToTolerate" i1) ("stripeWidth" i1) ("forceProvisioning" i1))
All reconfigs initiated. Synching operation may be happening in the background
vsan.vmdk_stats ~cluster|~host ~vm
显示虚拟机和VMDK的读取缓存和容量统计信息。
示例1-显示虚拟机磁盘统计信息:
/localhost/DC> vsan.vmdk_stats ~cluster vSAN65/resourcePool/vms/vMA/
Fetching general information about cluster
Fetching general information about VMs
Fetching information about vSAN objects
Fetching vSAN stats
Done fetching info, drawing table
+---------------------------------------------------------------+-----------+---------------+-----------+----------+----------+
| | Disk Capacity (in GB) | Read Cache (in GB) |
+---------------------------------------------------------------+-----------+---------------+-----------+----------+----------+
| Disk Name | Disk Size | Used Capacity | Data Size | Used | Reserved |
+---------------------------------------------------------------+-----------+---------------+-----------+----------+----------+
| vMA | | | | | |
| [vsanDatastore] b28df658-c089-2d82-5649-005056b9f17c/vMA.vmdk | 3.0 | 6.0 (2.0x) | 4.7 | 0.0 | 0.0 |
+---------------------------------------------------------------+-----------+