disk ID changement is not handled by local-storage
lifecycle/rotten
### Version used
local-storage-operator.v4.12.0-202305101515 (channel stable).
### Steps to replicate :
Create a localvolume :
```yaml
apiVersion: local.storage.openshift.io/v1
kind: LocalVolume
metadata:
name: infra-1-sdb-prom-core
namespace: openshift-local-storage
spec:
logLevel: Normal
managementState: Managed
nodeSelector:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- cat-fch8-infra-1
storageClassDevices:
- devicePaths:
- /dev/sdb
fsType: xfs
storageClassName: local-storage-prom-core
volumeMode: Filesystem
tolerations:
- effect: NoExecute
operator: Exists
key: node-role.kubernetes.io/infra
```
Create a PVC (cluster-monitoring config in Openshift will do it for us. We just specify the storageClass)...
All is working perfectly.
We migrate our control-plane and infra nodes VM in our Nutanix cluster frome site A to site B. VM are powered on.
The migration change the UUID/SERIAL of disk attached.
### Current :
After a few minutes, all is working on cluster except monitoring stack with local-storage PVC :
2 symlink (first is linked to an id (disk serial number) which doesn't exists anymore on host. It blinks red.
```shell
[core@cat-fch8-infra-1 ~]$ ll /mnt/local-storage/local-storage-prom-core/
total 0
lrwxrwxrwx. 1 root root 80 Aug 25 17:03 scsi-1NUTANIX_NFS_3_0_20023_ee3e4928_d368_4a67_b2dd_d18fdbf99650 -> /dev/disk/by-id/scsi-1NUTANIX_NFS_3_0_20023_ee3e4928_d368_4a67_b2dd_d18fdbf99650
lrwxrwxrwx. 1 root root 79 Sep 11 12:48 scsi-1NUTANIX_NFS_3_0_7705_f084d7d7_958c_4756_9dc1_6298abbf942e -> /dev/disk/by-id/scsi-1NUTANIX_NFS_3_0_7705_f084d7d7_958c_4756_9dc1_6298abbf942e
```
The disk sdb is present on host ...
```shell
[core@cat-fch8-infra-1 ~]$ lsblk -o NAME,SERIAL
NAME SERIAL
sda NFS_3_0_7690_b9a6cf2e_fc17_4c0e_896e_ef9df859e41a
├─sda1
├─sda2
├─sda3
└─sda4
sdb NFS_3_0_7705_f084d7d7_958c_4756_9dc1_6298abbf942e
sr0 QM00001
```
... But there is no disk mounted on the VM :
```shell
[core@cat-fch8-infra-1 ~]$ sudo df -h | grep local
```
We have now 2 PVs instead of 1. The new one si in "Available" state :
```shell
openshift@cat-fch8-bastion ~]$ oc get pv -l storage.openshift.com/owner-name=infra-1-sdb-prom-core
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
local-pv-7c13822d 15Gi RWO Delete Bound openshift-monitoring/prometheus-k8s-db-prometheus-k8s-0 local-storage-prom-core 16d
local-pv-812b91bb 15Gi RWO Delete Available local-storage-prom-core 3h13m
```
### Expected :
Promtheus pods are running. Their PVC (from openshift-monitoring) is linked to a PV which is linked to the disk mounted on sddb on host and local-storage operator manage the ID/SERIAL change of disk.
关闭于 2024-02-11 4 条评论