RVC使用指南(五)-性能服务
https://mp.weixin.qq.com/s/I02MCxMMEVR0tUsb6Jg4Hg
看了就要关注我,哈哈~
本文讨论与vSAN性能服务相关的命令。这些命令用于启用和配置vSAN性能服务,并收集与性能相关的信息。
-
vsan.perf.cluster_info
-
vsan.perf.resync_dashboard
-
vsan.perf.stats_object_create
-
vsan.perf.stats_object_info
-
vsan.perf.stats_object_delete
-
vsan.perf.stats_object_setpolicy
vsan.perf.cluster_info ~cluster
vSAN性能服务监视Virtual SAN群集,主机,磁盘和VM的性能。在启用Virtual SAN性能服务之前,请确保正确配置了群集并且没有未解决的运行状况问题。vsan.perf.cluster info命令使你可以知道是否存在未解决的问题。
示例1-显示主机信息
> vsan.perf.cluster_info ~cluster +------------------+--------------+--------+ | Hostname | Role | Issues | +------------------+--------------+--------+ | vesx2.virten.lab | Agent | None | | vesx1.virten.lab | Agent | None | | vesx3.virten.lab | CMMDS Master | None | +------------------+--------------+--------+
vsan.perf.resync_dashboard [-r] ~cluster|~host
此命令显示正在进行镜像同步时发生的情况。如果主机发生故障或进入维护模式,则应在此处查看重新同步状态。该命令可以运行一次,也可以使用刷新时间。
-r, --refresh-rate: Refresh interval (in sec). Default is no refresh
示例1-数据同步仪表板
> vsan.perf.resync_dashboard ~cluster Querying all objects in the system from vesx1.virten.lab ... Got all the info, computing table ... +-----------+-----------------+---------------+ | VM/Object | Syncing objects | Bytes to sync | +-----------+-----------------+---------------+ +-----------+-----------------+---------------+ | Total | 0 | 0.00 GB | +-----------+-----------------+---------------+
示例2-将主机置于维护模式后的数据同步仪表板。每10秒刷新一次:
> vsan.perf.resync_dashboard --refresh-rate 10 ~cluster Querying all VMs on VSAN ... Querying all objects in the system from esx1.virten.local ... Got all the info, computing table ... +-----------+-----------------+---------------+ | VM/Object | Syncing objects | Bytes to sync | +-----------+-----------------+---------------+ +-----------+-----------------+---------------+ | Total | 0 | 0.00 GB | +-----------+-----------------+---------------+ Querying all objects in the system from esx1.virten.local ... Got all the info, computing table ... +-----------------------------------------------------------------+-----------------+---------------+ | VM/Object | Syncing objects | Bytes to sync | +-----------------------------------------------------------------+-----------------+---------------+ | vm1 | 1 | | | [vsanDatastore] 5078bd52-2977-8cf9-107c-00505687439c/vm1.vmx | | 0.17 GB | +-----------------------------------------------------------------+-----------------+---------------+ | Total | 1 | 0.17 GB | +-----------------------------------------------------------------+-----------------+---------------+ Querying all objects in the system from esx1.virten.local ... Got all the info, computing table ... +--------------------------------------------------------------------+-----------------+---------------+ | VM/Object | Syncing objects | Bytes to sync | +--------------------------------------------------------------------+-----------------+---------------+ | vm1 | 1 | | | [vsanDatastore] 5078bd52-2977-8cf9-107c-00505687439c/vm1.vmx | | 0.34 GB | | debian | 1 | | | [vsanDatastore] 6978bd52-4d92-05ed-dad2-005056871792/debian.vmx | | 0.35 GB | +--------------------------------------------------------------------+-----------------+---------------+ | Total | 2 | 0.69 GB | +--------------------------------------------------------------------+-----------------+---------------+ [...]
vsan.perf.stats_object_create [-p|-o] ~cluster
Virtual SAN Performance Service收集的所有统计信息都存储在Stats DB对象中。该命令创建数据库对象并启用vSAN性能服务。
-
-p, --policy-str: Policy, expressed as string, e.g. vSAN format
-
-o, --policy: Policy, reference to SPBM profile
策略定义对象在Virtual SAN中的存储方式。可用值为:
-
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)
示例1-使用默认策略创建vSAN Stats数据库:
> vsan.perf.stats_object_create ~cluster Creating vSAN Stats DB object, which will enable vSAN Performance Service ... Task: Enable vSAN performance service New progress: 1% Task result: success
示例2-使用自定义策略创建vSAN Stats数据库:
> vsan.perf.stats_object_create -p '(("hostFailuresToTolerate" i1) ("stripeWidth" i1))' ~cluster VirtualMachineDefinedProfileSpec( profileData: {:extensionKey=>"com.vmware.vim.sps", :objectData=>"((\"hostFailuresToTolerate\" i1) (\"stripeWidth\" i1))"}, profileId: "" ) Creating vSAN Stats DB object, which will enable vSAN Performance Service ... Task: Enable vSAN performance service New progress: 1% Task result: success
vsan.perf.stats_object_info ~cluster
Virtual SAN Performance Service收集的所有统计信息都存储在Stats DB对象中。此命令显示vSAN Stats DB对象信息,包括:
-
Object UUID
-
SPBM Profile
-
vSAN Policy
-
vSAN Object Health
-
DOM Object Info (Size / Distribution)
示例1-显示vSAN Stats DB对象信息:
> vsan.perf.stats_object_info ~cluster/ Directory Name: .vsan.stats vSAN Object UUID: 4d537859-b8d2-fe65-fa7f-005056b9f17c SPBM Profile: None vSAN Policy: CSN: 3, hostFailuresToTolerate: 1, stripeWidth: 1 vSAN Object Health: healthy DOM Object: 4d537859-b8d2-fe65-fa7f-005056b9f17c (v5, owner: vesx3.virten.lab, proxy owner: None, policy: CSN = 3, stripeWidth = 1, hostFailuresToTolerate = 1) RAID_1 Component: 4d537859-00d1-8766-75d4-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: 4d537859-5c18-8a66-b254-005056b9f17c (state: ACTIVE (5), host: vesx1.virten.lab, md: mpx.vmhba0:C0:T2:L0, ssd: mpx.vmhba0:C0:T1:L0, votes: 1, usage: 0.3 GB, proxy component: false) Witness: 4d537859-aaf2-8b66-898d-005056b9f17c (state: ACTIVE (5), host: vesx2.virten.lab, md: mpx.vmhba0:C0:T3:L0, ssd: mpx.vmhba0:C0:T1:L0, votes: 1, usage: 0.0 GB, proxy component: false) Extended attributes: Address space: 273804165120B (255.00 GB) Object class: vmnamespace Object path: /vmfs/volumes/vsan:520e0160c109abd2-45aff5378f18f74a/ Object capabilities: NONE
vsan.perf.stats_object_delete ~cluster
Virtual SAN Performance Service收集的所有统计信息都存储在Stats DB对象中。该命令删除数据库对象并禁用vSAN性能服务。
示例1-删除vSAN Stats数据库:
> vsan.perf.stats_object_delete ~cluster/ Deleting vSAN Stats DB object, which will stop vSAN Performance Service ... Task: Disable vSAN performance service New progress: 1% New progress: 50% Task result: success
vsan.perf.stats_object_setpolicy [-p|-o] ~cluster
Virtual SAN Performance Service收集的所有统计信息都存储在Stats DB对象中。此命令更改数据库对象的策略。
-
-p, --policy-str: Policy, expressed as string, e.g. vSAN format
-
-o, --policy: Policy, reference to SPBM profile
策略定义对象在Virtual SAN中的存储方式。可用值为:
-
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)
示例1-更改vSAN Stats数据库策略:
> vsan.perf.stats_object_setpolicy -p '(("hostFailuresToTolerate" i1) ("stripeWidth" i0))' ~cluster VirtualMachineDefinedProfileSpec( profileData: {:extensionKey=>"com.vmware.vim.sps", :objectData=>"((\"hostFailuresToTolerate\" i1) (\"stripeWidth\" i0))"}, profileId: "" ) true