open-iscsi / tcmu-runner

A daemon that handles the userspace side of the LIO TCM-User backstore.
Apache License 2.0
189 stars 148 forks source link

Take a further look at qcow2 snapshot support #32

Open agrover opened 8 years ago

agrover commented 8 years ago

31 mentioned behavior with snapshots is still not clear. Find out the gaps and either just document them (e.g. "don't use with snapshotted images" would be an ok result) or alternatively implement the support if it's feasible.

Zouuup commented 6 years ago

Well, i have tested it few times with rbd based or qcow2 based snapshot, latest HEAD causes filesystem corruption on snapshot image, anyone working on this?

mikechristie commented 6 years ago

I do not think anyone is working on qcow snapshot support. @bgly might be working on qcow though.

What do you mean you are having issues with rbd? What is your workflow? What commands did you run? There are some people starting to work on that now:

https://github.com/ceph/ceph-iscsi-cli/issues/71 https://github.com/ceph/ceph-iscsi-cli/pull/70

Zouuup commented 6 years ago

I'm not using ceph-iscsi-cli, i'm using targetcli with tcmu-runner, i have no idea why these people are experiencing this read only issue. also it worth noting that Qcow1 doesn't have any "functionality" issues with a lun on snapshot file, but performance is really bad. (80% reduced)

mikechristie commented 6 years ago

I'm not using ceph-iscsi-cli, i'm using targetcli with tcmu-runner, i have no idea why these people are experiencing this read only issue.

There is no one working on targetlci+tcmu-runner+rbd snapshot support. The preferred method for rbd support is using the ceph-iscsi-* tools.

For the targetcli+runner+rbd case, what commands are you running and what is your setup?

Zouuup commented 6 years ago

Interesting, i thought ceph-iscsi-cli is simply calls ceph-iscsi-gw which calls targetcli directly, is that wrong?

nothing very exciting: targetcli add backstore using user:rbd (or user:qcow) creating luns and acls and stuff like that.

mikechristie commented 6 years ago

Interesting, i thought ceph-iscsi-cli is simply calls ceph-iscsi-gw which calls targetcli directly, is that wrong?

It calls rbd-target-api which calls rtslib on multiple nodes, so you go the idea. The difference between running targetcli directly is that it sets up the target and tcmu-runner device and rbd so it has correct settings for HA. For snapshots and HA setups, we at the very least need to fix exclusive lock handling like in those issues/PRs above.

For your snapshot example if you just take a snapshot then export it with as the targetcli/tcmu-runner device, it should work ok. You should be able to reads with no problem.

If you are doing IO to an image exported with targetcli/tcmu-runner and then take a snapshot while IO is running on it, then export the snapshot with targetcli/tcmu-runner then it might and might not work. There is no code to make sure IOs are flushed from a initiator side buffer when the snap is taken.

If you are doing something like stopping IO to the image so all initiator side IO is flushed, then taking a snapshot and then exporting it then that should work ok.