联想SureSAS 112新创建的卷无法正常读写处理

在对联想SureSAS112控制器进行固件升级和重启后,遇到卷故障。通过清理残余的不可写缓存数据,解决了控制器警告并恢复了卷的读写功能。涉及的命令包括clearcache和卷状态检查。

背景:在测试的联想SureSAS 112上进行控制器固件升级和降级测试,期间出现故障,无法升级成功。在物理重启存储后,两个控制器之间可能没有进行正常同步,导致一个卷故障,无法正常读写。由于该卷为测试卷,没有生产数据,因此手工进行了删除。

然而,后来将新创建的卷映射给主机后,主机也还是无法读写。从存储上看,卷的状态是正常的:在这里插入图片描述
但是在“system event”中,出现了告警信息 “Controller A WARNING Unwritable write-back cache data exists for a volume. (vdisk: unknown name, volume: unknown name, SN: 00c0ff1b2c40000050e5a35301000000) It comprises 98% of cache space. ”,如下所示:
在这里插入图片描述
可能是微码升级和物理重启存储时导致之前已经删除的故障卷的cache数据无法正常写入磁盘,导致之前的故障卷出故障。而新建的卷的名称和删除前相同,同时cache也被数据占用了98%的空间,导致新创建的卷也不能正常读写。

查看存储的help命令帮助,列表中包含以下命令:
clear cache - Clears unwritable cache data from both controllers

于是使用命令clear cache清除了存储中残留的无效cache数据,卷立即恢复了,可以正常读写。

注意:这个命令只能在卷没有数据时执行,否则清除cache数据会导致卷数据丢失,产生严重后果。

附录:SureSAS 112命令列表

# help
abort replication - Aborts the current replication operation on the specified secondary volume
abort scrub - Aborts a scrub operation for specified vdisks or disks
abort verify - Aborts the verify vdisk operation for specified vdisks
abort volumecopy - Aborts copying a volume
add replication-volume - Adds an existing secondary volume to a replication set
clear cache - Clears unwritable cache data from both controllers
clear disk-metadata - Clears metadata from leftover disks
clear events - For use by or with direction from a service technician
clear expander-status - For use by or with direction from a service technician
convert master-to-std - Converts a specified master volume into a standard volume; that is, it disables the volume from accepting snapshots
convert std-to-master - Converts a standard volume to a master volume; that is, it enables the volume for snapshots and associates it with an existing snap pool
create certificate - Creates or removes a custom security certificate
create chap-record - For iSCSI, creates a CHAP record to authenticate login requests
create host-wwn-name - Deprecated; use "create host"
create host - Creates a host entry with an associated nickname
create master-volume - Creates a volume that is enabled for snapshots
create remote-system - Creates a persistent association with a remote storage system
create replication-set - Creates a replication set from a specified standard or master volume
create schedule - Schedules a task to run automatically
create snap-pool - Creates a snap pool to use for snapshot data
create snapshots - Creates a snapshot of each specified source volume
create task - Creates a task that can be scheduled
create user - Creates a user account
create vdisk - Creates a vdisk using the specified RAID level, disks, and spares
create volume-set - Creates a specified number of volumes in a vdisk
create volume - Creates a volume in a vdisk
delete all-master-volumes - Deletes all master volumes associated with a specified snap pool
delete all-snapshots - Deletes all snapshots associated with a specified volume
delete chap-records - For iSCSI, deletes a specified CHAP record or all CHAP records
delete global-spare - Deletes specified global spare disks
delete host-wwn-name - Deprecated; use "delete host"
delete host - Deletes a discovered or manually created host
delete iscsi-host - Deprecated; use "delete host"
delete master-volume - Deletes a master volume
delete remote-system - Deletes the persistent association with a remote system
delete replication-set - Dissolves a replication set
delete schedule - Deletes a task schedule
delete snap-pool - Deletes a snap pool
delete snapshot-write-data - Deletes data written to a standard snapshot after it was created
delete snapshot - Deletes specified snapshots
delete task - Deletes a task
delete user - Deletes a user account
delete vdisk-spare - Deletes specified spares that are assigned to a vdisk
delete vdisks - Deletes specified vdisks
delete volumes - Deletes specified volumes
dequarantine - Removes a vdisk from quarantine
detach replication-volume - Prepares a secondary volume to be physically removed from a system
expand snap-pool - Expands a snap pool
expand vdisk - Adds disks to a vdisk 
expand volume - Expands a standard volume
export snapshot - Exports a replication snapshot on the local system to a new standard snapshot
help - Provides tips for viewing help and using command shortcuts
map volume - Maps specified volumes using settings that override the volumes' default mapping
meta - In XML API format only, shows all property metadata for objects
ping - Tests communication with a remote host
reattach replication-volume - Reattaches a secondary volume to its replication set
release volume - Clears host registrations and releases persistent reservations for all or specified volumes
remote - Runs a command on a remote system that is associated with the local system
remove replication-volume - Removes a secondary volume from a replication set
replicate snapshot - Initiates a replication operation using an existing snapshot as the data source
replicate volume - Creates a replication snapshot of the specified volume and initiates a replication operation
rescan - This command forces rediscovery of disks and enclosures in the storage system
reset all-statistics - Resets performance statistics for both controllers
reset controller-statistics - Resets performance statistics for controllers
reset disk-error-statistics - Resets error statistics for all or specified disks
reset disk-statistics - Resets performance statistics for disks
reset host-channel-link - Deprecated; use "reset host-link"
reset host-link - Resets specified controller host ports (channels)
reset host-port-statistics - Resets performance statistics for controller host ports
reset smis-configuration - Resets the SMI-S configuration files
reset snapshot - Deletes the data in a standard snapshot and resets it to the current data in the associated master volume
reset vdisk-statistics - Resets performance statistics for all or specified vdisks
reset volume-statistics - Resets performance statistics for all or specified volumes
restart - Restarts the Storage Controller or Management Controller in a controller module
restore defaults - For use by or with direction from a service technician
resume replication - Resumes a suspended replication operation on the specified secondary volume
rollback master-volume - Rolls back (reverts) the data on a master volume to the data that exists in a specified snapshot
scrub disks - Analyzes specified disks to find and fix disk errors
scrub vdisk - Analyzes specified vdisks to find and fix disk errors
set advanced-settings - Sets advanced system configuration options
set auto-write-through-trigger - Sets the trigger conditions that cause the controller to change the cache policy from write-back to write-through
set awt - See help for "set auto-write-through-trigger"
set cache-parameters - Sets a volume's cache options
set chap-record - For iSCSI, changes an originator's CHAP record
set cli-parameters - Sets options that control CLI behavior
set controller-date - Sets date and time parameters for the system
set debug-log-parameters - For use by or with direction from a service technician
set disk-parameters - Sets parameters that affect disk operation
set drive-parameters - Deprecated; use "set disk-parameters"
set email-parameters - Sets SMTP notification parameters for events and managed logs
set enclosure - Sets an enclosure's name, location, rack number, and rack position
set expander-fault-isolation - For use by or with direction from a service technician
set expander-phy - For use by or with direction from a service technician
set global-spare - Deprecated; use "set spares"
set host-name - Changes the nickname of a host entry
set host-parameters - Sets controller host-port parameters for communication with attached hosts
set host-wwn-name - Deprecated; use "set host-name"
set iscsi-host - Deprecated; use "set host-name"
set iscsi-parameters - For iSCSI, changes system-wide iSCSI parameters
set job-parameters - Sets parameters for background vdisk scrub, partner firmware upgrade, and other jobs
set led - Changes the state of the identification LED on a specified disk or enclosure
set network-parameters - Sets parameters for controller module network ports
set ntp-parameters - Sets Network Time Protocol (NTP) parameters for the system
set output-format - Deprecated; use "set cli-parameters"
set password - Sets a user's password for system interfaces (such as the CLI)
set priorities - Sets snapshot-retention priorities for a specified snap pool
set prompt - Sets the prompt for the current CLI session
set protocols - Enables or disables management services and protocols
set remote-system - Changes remote-system credentials stored on the local system
set replication-primary-volume - Changes the primary volume for a replication set
set replication-volume-parameters - Sets parameters for a specified replication volume
set schedule - Changes parameters for a specified schedule
set snap-pool-policy - Sets the recovery policy that determines the action taken when a specified snap pool's error and critical threshold levels are reached
set snap-pool-threshold - Sets the percentages of snap-pool space used that trigger the warning and error threshold policies
set snmp-parameters - Sets SNMP parameters for event notification
set spares - Creates or deletes spare disks for redundant (RAID 1, 3, 5, 6, 10, 50) vdisks
set system - Sets the system's name, contact, location, and description
set task - Changes parameters for a TakeSnapshot, ReplicateVolume, or VolumeCopy task
set user - Changes user preferences for the session or permanently
set vdisk-spare - Deprecated; use "set spares"
set vdisk - Changes parameters for a specified vdisk
set volume - Changes a volume's name and identifying information
show advanced-settings - Shows the settings for advanced system-configuration options
show auto-write-through-trigger - Shows the system's write-through trigger settings
show awt - See help for "show auto-write-through-trigger"
show cache-parameters - Shows cache settings and status for the system and optionally for a volume
show certificate - Shows the status of the system's security certificate
show channels - Deprecated; use "show ports"
show chap-records - For iSCSI, shows all CHAP records or the record for a specific originator
show cli-parameters - Shows the current CLI session preferences
show configuration - Shows system configuration information
show controller-date - Shows the system's current date and time
show controller-statistics - Shows live performance statistics for controller A, B, or both
show controllers - Shows information about each controller module in the storage system
show debug-log-parameters - For use by or with direction from a service technician
show disk-parameters - Shows disk settings
show disk-statistics - Shows live or historical performance statistics for disks
show disks - Shows information about disks in the storage system
show drive-parameters - Deprecated; use "show disk-parameters"
show email-parameters - Shows email (SMTP) notification settings for events and managed logs
show enclosure-status - Deprecated; use "show enclosures", "show frus", or "show sensor-status"
show enclosures - Shows information about the enclosures in the storage system
show events - Shows events logged by each controller in the storage system
show expander-status - For use by or with direction from a service technician
show fans - Shows information about each fan in the storage system
show frus - Shows FRU (field-replaceable unit) information for the storage system
show host-maps - Shows mapping information for volumes that are mapped to all hosts or to a specified host
show host-parameters - Shows information about host ports on both controllers
show host-port-statistics - Shows live performance statistics for each controller host port
show host-wwn-names - Deprecated; use "show hosts"
show hosts - Shows hosts that volumes can be mapped to
show inquiry - Shows inquiry data for each controller module
show iscsi-parameters - For iSCSI, shows system-wide iSCSI parameters
show job-parameters - Shows parameters for background vdisk scrub, partner firmware upgrade, and other jobs
show license - Shows the status of licensed features in the storage system
show lun-maps - Deprecated; use "show volume-maps"
show master-volumes - Shows information about all master volumes, or ones associated with a specified controller or snap pool
show network-parameters - Shows the settings and health of each controller module's network port
show ntp-status - Shows the status of the use of Network Time Protocol (NTP) in the system
show output-format - Deprecated; use "show cli-parameters"
show port-wwn - Deprecated; use "show ports"
show ports - Shows information about host ports on both controllers
show power-supplies - Shows information about each power supply in the storage system
show priorities - Shows snapshot-retention priorities for a specified snap pool
show protocols - Shows which management services and protocols are enabled or disabled
show redundancy-mode - Shows the redundancy status of the system
show refresh-counters - In XML API format only, shows when the data represented by the basetype was last updated
show remote-systems - Shows information about remote systems associated with the local system
show replication-images - Shows information about replication images for a specified replication volume
show replication-sets - Shows information about replication sets on the local system
show replication-volumes - Shows information about volumes in replication sets
show sas-link-health - Shows the condition of SAS expansion-port connections
show schedule-details - Shows information about a specified task schedule
show schedules - Shows information about all task schedules
show sensor-status - Shows the status of each environmental sensor in each enclosure
show shutdown-status - Shows whether each Storage Controller is active or shut down
show snap-pools - Shows information about snap pools owned by a specified controller or both controllers
show snapshots - Shows information about snapshots for a specified controller, master volume, or snap pool
show snmp-parameters - Shows SNMP settings for event notification
show system-parameters - Shows the current settings for the storage system
show system - Shows information about the system
show task-details - Shows information about a specified task
show tasks - Shows information about all tasks
show unwritable-cache - Shows the percentage of unwritable cache data in the system
show users - Shows configured user accounts
show vdisk-statistics - Shows live or historical performance statistics for vdisks
show vdisks - Shows information for all or specified vdisks
show versions - See help for "versions"
show volume-maps - Shows mapping information for a specified volume or for all volumes
show volume-names - Shows volume names and serial numbers
show volume-reservations - Shows persistent reservations for all or specified volumes
show volume-statistics - Shows live performance statistics for all or specified volumes
show volumecopy-status - Shows information about in-progress volume copy operations
show volumes - Shows volume information for all or specified vdisks
shutdown - Shuts down the Storage Controller in a controller module
start vdisk - Restarts a vdisk that was stopped in order to move its disks into this system
stop vdisk - Stops a vdisk to prepare its disks for removal
suspend replication - Suspends the current replication operation on the specified secondary volume
test - Sends a test message to configured destinations for event notification and managed logs
trust - Enables an offline vdisk to be brought online for emergency data recovery
unmap volume - Deletes explicit mappings or the default mapping for specified volumes
verify links - Verifies host-port links
verify remote-link - Verifies host-port links between the local system and a specified remote system
verify vdisk - Analyzes redundant vdisks to find and fix inconsistencies between their redundancy data and their user data
versions - Shows firmware and hardware version information for each controller module
volumecopy - Copies a standard, master, or snapshot volume to a new standard volume
<think>好的,用户之前问过Kubernetes的本地持久化,现在又问本地持久化是否支持动态配置(Dynamic Provisioning)。我需要先确认用户对Dynamic Provisioning的理解程度。动态配置是指在创建PVC时自动创建PV,而不需要手动预先配置PV。对于本地持久化来说,传统的做法是手动创建PV,但用户可能想知道是否有自动化方法。 首先,我应该回顾Kubernetes官方文档中的相关信息。记得在旧版本中,本地不支持动态配置,需要手动管理。但后来社区开发了一个Local Volume Provisioner,属于SIG-Storage项目的一部分。这个Provisioner可以监控特定目录,当发现新的存储设备时自动创建PV。因此,现在是可以实现动态配置的,但需要额外配置Provisioner。 接下来,用户可能需要知道如何实现这一点。需要分步骤说明:安装Provisioner、配置存储类、创建PVC等。还要注意节点标签和路径的配置,以及动态配置的限制,比如仍然依赖节点本地存储,无法跨节点迁移,节点故障时的处理等。 还要比较静态配置和动态配置的区别,让用户明确两者的适用场景。动态配置适合有多个本地磁盘或频繁需要分配的场景,而静态配置适合固定配置的情况。同时,要提醒用户节点亲和性和数据持久性的问题,确保他们了解潜在的风险,比如节点故障导致数据不可用,需要备份策略。 可能用户的实际场景是在生产环境中部署有状态应用,比如数据库或消息队列,需要高性能的本地存储,同时希望减少手动管理PV的工作量。因此,动态配置可以简化运维,但需要正确设置Provisioner和存储类。 需要确保回答结构清晰,分点说明,提供配置示例,并强调注意事项。还要验证所有信息是否正确,比如Provisioner的GitHub链接是否有效,存储类配置的参数是否正确。可能用户会进一步询问如何部署Provisioner,所以提供示例YAML片段会有帮助。 最后,总结本地持久化的动态配置现状,说明通过Provisioner可以实现,但需要了解其限制,并建议根据实际需求选择合适的配置方式。</think>### Kubernetes 本地持久化(Local Persistent Volume)是否支持动态配置(Dynamic Provisioning)? #### **直接回答** **是的,Kubernetes 本地持久化(Local Persistent Volume)可以通过 [Local Volume Provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner) 实现动态配置(Dynamic Provisioning)**,但需要额外部署组件并配置存储类(StorageClass)。 **核心限制**是:动态配置仅适用于预先划分好的本地磁盘或目录,无法像云存储(如 AWS EBS)那样完全按需创建存储设备。 --- #### **实现原理** 1. **Local Volume Provisioner** 由 Kubernetes SIG-Storage 维护的组件,部署为 DaemonSet,监控节点上指定的目录(如 `/mnt/disks`)。 - 当发现新目录或设备时,自动创建对应的 PV。 - 当目录/设备被删除时,自动清理 PV。 2. **存储类(StorageClass)** 需定义存储类,并指定绑定模式(`WaitForFirstConsumer`),确保 Pod 调度到正确节点后再绑定 PV。 --- #### **配置步骤** ##### 1. **部署 Local Volume Provisioner** ```yaml # 示例:Local Volume Provisioner 配置(部分) apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: local-storage provisioner: kubernetes.io/no-provisioner volumeBindingMode: WaitForFirstConsumer ``` ```yaml # DaemonSet 配置(核心部分) apiVersion: apps/v1 kind: DaemonSet metadata: name: local-volume-provisioner spec: template: spec: containers: - name: provisioner image: k8s.gcr.io/sig-storage/local-volume-provisioner:v2.5.0 volumeMounts: - mountPath: /mnt/disks # 监控此目录 name: local-disks volumes: - name: local-disks hostPath: path: /mnt/disks # 节点本地存储路径 ``` ##### 2. **创建 PVC(自动触发 PV 生成)** ```yaml apiVersion: v1 kind: PersistentVolumeClaim metadata: name: dynamic-local-pvc spec: storageClassName: local-storage accessModes: - ReadWriteOnce resources: requests: storage: 10Gi ``` --- #### **动态配置的限制** 1. **依赖预先划分的存储** - 需运维人员在节点上预先创建目录(如 `/mnt/disks/disk1`)或挂载磁盘。 - Provisioner 仅负责发现目录并生成 PV,不负责底层存储设备的创建。 2. **节点亲和性不可变** - PV 始终绑定到特定节点,Pod 必须调度到该节点。 - 若节点故障,PVC 无法自动迁移到其他节点。 3. **容量管理** - 需人工确保节点本地存储容量充足,无自动扩容机制。 --- #### **动态 vs 静态配置对比** | **特性** | **动态配置** | **静态配置** | |------------------------|----------------------------------------------|----------------------------------| | **PV 创建方式** | 自动发现目录并生成 PV | 手动定义 PV YAML | | **灵活性** | 适合多磁盘节点,批量管理 | 适合固定存储设备 | | **运维成本** | 需部署 Provisioner,但减少手动操作 | 完全手动管理 | | **适用场景** | 节点有多个本地磁盘或频繁创建/删除 PVC 的环境 | 少量固定本地存储需求 | --- #### **注意事项** 1. **数据持久性风险** - 若节点宕机,本地数据可能丢失,需配合备份方案(如定期快照)。 2. **调度策略优化** - 使用 `topology-aware` 调度(如 `volumeBindingMode: WaitForFirstConsumer`)避免 Pod 调度冲突。 3. **资源清理** - 删除 PVC 时,动态生成的 PV 会根据回收策略(`persistentVolumeReclaimPolicy`)处理,通常设为 `Delete` 或 `Retain`。 --- #### **总结** - **支持动态配置**:通过 Local Volume Provisioner 可实现,但需预先划分存储目录。 - **核心价值**:减少手动创建 PV 的工作量,适合多节点、多磁盘环境。 - **推荐场景**:边缘计算、高性能数据库集群等需要本地存储且需批量管理的场景。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值