openebs / lvm-localpv

Dynamically provision Stateful Persistent Node-Local Volumes & Filesystems for Kubernetes that is integrated with a backend LVM2 data storage stack.
Apache License 2.0
251 stars 96 forks source link

Change lvm-driver's base image to CentOS, logic volume can't be created successfully. #301

Closed styshoo closed 4 months ago

styshoo commented 4 months ago

What steps did you take and what happened: In fact, it's not a bug.
Now lvm-drvier image uses Alpine as base image. In my project , I have to use other os image as base image(such as CentOS, OpenEuler). After installing some software(lvm2, device mapper, util-linux), but I can't create logic volume successfully.

What did you expect to happen: Logic volume can be successfully created.

The output of the following commands will help us better understand what's going on: In the lvm-driver container, I use lvcreate command to create logic volume, but error occurs:

# lvcreate -y -L 4M lvmvg  -n test1
  /dev/lvmvg/test1: not found: device not cleared
  Aborting. Failed to wipe start of new LV.

I add -vvv to the lvcreate command, the detail log shows as following :

Udev is not running. Not using udev synchronisation code.

As a result, I get two method to create lv in CentOS base image.

However, I'm not sure whether these two methods have any potential risks.

My question is: Udev it not running in Alpine container, udev_sync and udev_rules is also set to 1, why lv can be created successfully?