-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc improvement #5
Conversation
- Also, remove unused variables Signed-off-by: Vicente Cheng <[email protected]>
Signed-off-by: Vicente Cheng <[email protected]>
- We need to use the command executor from go-common Signed-off-by: Vicente Cheng <[email protected]>
- use the executor to get an accurate command output - Improve the delete lv that can delete lv w/o vg name Signed-off-by: Vicente Cheng <[email protected]>
- Now we use the user-define volume group on the StorageClass. That will give more flexibility for creating lv with different vg Signed-off-by: Vicente Cheng <[email protected]>
- After we support user-defined vg name, we could drop the vgname and device pattern. - Now we support generic ephemeral volume and drop the csi ephemeral volume support. Signed-off-by: Vicente Cheng <[email protected]>
Signed-off-by: Vicente Cheng <[email protected]>
- Execute lvextend multiple times will get EIO if size not change. We need to add pre-check for avoiding that. Signed-off-by: Vicente Cheng <[email protected]>
0a0f703
to
f2f2def
Compare
Signed-off-by: Vicente Cheng <[email protected]>
1509a84
to
6b2de1d
Compare
Hi @tserong, @bk201, You also need to build the image from this PR to test manually. |
|
e26de43
to
b226de6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR, there is one point I want to double-confirm:
As creating a new LV from a snapshot, the actual logic here is to create a device and copy the data from the snapshot LV to it.
However, for dm-thin, there is a way to make the original device and new device (which is created from a snapshot) share underlying blocks until one of them receives write, and the break-sharing will be triggered, this introduces better space efficiency. We can have this with dmsetup
:
//creating a new source dm-thin device
sudo dmsetup message /dev/mapper/thin-pool 0 "create_thin 0"
sudo dmsetup create thin-device --table "0 20971520 thin /dev/mapper/thin-pool 0"
//taking a snapshot for the source device
sudo dmsetup message /dev/mapper/thin-pool 0 "create_snap 0 1"
//creating a new dm-thin device from the snapshot
sudo dmsetup create thin-device-snap --table "0 20971520 thin /dev/mapper/thin-pool 1"
After some searching on LVM, it seems LVM doesn't provide such a mechanism, only dmsetup
does. Do you have any thoughts on this?
Update: we can use LVM to have this
//creating thin-pool
sudo lvcreate --size 10G --thinpool vg_thin/pool_thin
// creating dm-thin LV
sudo lvcreate --thin --name thin_lv1 --virtualsize 5G vg_thin/pool_thin
//taking snapshot for the LV
sudo lvcreate --snapshot --name thin_lv1_snap /dev/vg_thin/thin_lv1
//activating a dm-thin LV from the snapshot
sudo lvchange -ay -K vg_thin/thin_lv1_snap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general, just a couple of questions
Dockerfile.dapper
Outdated
@@ -1,11 +1,11 @@ | |||
|
|||
FROM registry.suse.com/bci/golang:1.22 | |||
FROM golang:1.22-bookworm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bci/golang:1.22
image lacks some cross-platform packages. I need these packages to build the cross-platform binary.
So I changed to Bookworm, that is, to have all cross-platform packages to build.
@@ -116,7 +116,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol | |||
} | |||
|
|||
lvmType := req.GetParameters()["type"] | |||
if !(lvmType == "linear" || lvmType == "mirror" || lvmType == "striped") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why drop the "linear" and "mirror" types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we thought the linear was similar to dm-thin and the mirror would not use too much, we removed these two and focused on the striped and dm-thin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks.
Hi @Vicente-Cheng |
b226de6
to
d35e274
Compare
Thanks for the reminder! After discussed with @WebberHuang1118, the new clone from snapshot would utilize the dm-thin pros. e.g. (like above example, we already create a snapshot)
That is the new behavior for the dm-thin snapshot clone. Thanks! |
d3824a8
to
57ed509
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a few small naming discrepancies in command line arguments. Otherwise LGTM in general (note: I haven't tried testing the snapshot functionality myself)
- fix volume expansaion - update deploy/charts for snapshot Signed-off-by: Vicente Cheng <[email protected]>
Signed-off-by: Vicente Cheng <[email protected]>
- support clone from PVC or Snapshot - remove resource limit because clone pod need more memory Signed-off-by: Vicente Cheng <[email protected]>
- also bump google.golang.org/grpc v1.64.1 Signed-off-by: Vicente Cheng <[email protected]>
- also drop linear/mirror Signed-off-by: Vicente Cheng <[email protected]>
Signed-off-by: Vicente Cheng <[email protected]>
Signed-off-by: Vicente Cheng <[email protected]>
- also correct the description of command Signed-off-by: Vicente Cheng <[email protected]>
e04ed47
to
94e7c8c
Compare
The commit 4e3dacd of this PR also related to harvester/harvester#6568 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR.
Mainly changes for this PR as below:
Related issue: harvester/harvester#5724