ceph / ceph-helm

Curated applications for Kubernetes
Apache License 2.0
108 stars 36 forks source link

Fix device occasionally not exist after doing parted #58

Closed zenglg closed 6 years ago

zenglg commented 6 years ago

I use parted command to do some tests:

parted -s /dev/sdd print > /dev/null;  for i in `seq 1 1000` ;
> do ls -alh /dev/sdd13 >/dev/null || echo $i: not found sdd13 ; done

Occasionally, the test maybe faild like:

ls: cannot access /dev/sdd13: No such file or directory
1: not found sdd13

And, through the udevadm monitor output:

KERNEL[1126040.921247] remove   /devices/pci0000:00/0000:00:01.0/0000:02:00.0/host0/target0:0:3/0:0:3:0/block/sdd/sdd13 (block)
KERNEL[1126040.927888] change   /devices/pci0000:00/0000:00:01.0/0000:02:00.0/host0/target0:0:3/0:0:3:0/block/sdd (block)
KERNEL[1126040.928020] add      /devices/pci0000:00/0000:00:01.0/0000:02:00.0/host0/target0:0:3/0:0:3:0/block/sdd/sdd13 (block)
UDEV  [1126040.929398] remove   /devices/pci0000:00/0000:00:01.0/0000:02:00.0/host0/target0:0:3/0:0:3:0/block/sdd/sdd13 (block)
UDEV  [1126040.942840] change   /devices/pci0000:00/0000:00:01.0/0000:02:00.0/host0/target0:0:3/0:0:3:0/block/sdd (block)
UDEV  [1126040.957819] add      /devices/pci0000:00/0000:00:01.0/0000:02:00.0/host0/target0:0:3/0:0:3:0/block/sdd/sdd13 (block)

Seems like, the device is lost after being removed by udev(or kernel), and, reappear after being added.

Add udevadm settle to make sure all current udev event be handled.

By the way, the directory of '/run/udev' must be mounted in the container, or the command of udevadm settle would not work well.

Signed-off-by: Linggang Zeng linggang.zeng@easystack.cn

rootfs commented 6 years ago

thanks