Skip to content
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

Add target save and restore functionality #9

Merged
merged 1 commit into from
May 17, 2022

Conversation

sskaur
Copy link
Contributor

@sskaur sskaur commented Feb 14, 2022

This commit adds functionality to persist a gateway's state of SPDK and restore from it upon restarting. Relevant information for a restore is stored in a ceph object's OMAP.

Signed-off-by: Sandy Kaur [email protected]

@trociny
Copy link
Contributor

trociny commented Feb 15, 2022

Another thing to discuss. Do we really want to have a possibility to have several bdev per namespace? Is there a use case for this? Otherwise we could combine two commands bdev_rbd_create and subsystem_add_ns into one and would need to deal with "internal" bdev name (we could just pass the image spec to subsystem_add_ns).

The same question is actually about subsystem, i.e. if we want several namespaces per subsystem, though I can image this may be useful indeed.

@PepperJo
Copy link

Another thing to discuss. Do we really want to have a possibility to have several bdev per namespace? Is there a use case for this? Otherwise we could combine two commands bdev_rbd_create and subsystem_add_ns into one and would need to deal with "internal" bdev name (we could just pass the image spec to subsystem_add_ns).

The same question is actually about subsystem, i.e. if we want several namespaces per subsystem, though I can image this may be useful indeed.

Yes, both are desired. Multi-attach, i.e. same rbd bdev for two different namespaces although rare is a use-case for us.

@trociny
Copy link
Contributor

trociny commented Feb 15, 2022

I think we could do it this way:

nvme_gw_cli.py create_bdev -p rbd -i test will not return the bdev_name (like "Ceph0") to the user.
And instead of the current version:

nvme_gw_cli.py create_namespace -n nqn.2016-06.io.spdk:cnode1 -b Ceph0

we will use something like:

nvme_gw_cli.py create_namespace -n nqn.2016-06.io.spdk:cnode1 -p rbd -i test

And the gateway will keep internally the mapping between the current bdev names and image specs, while in the persistent config it will store image spec (bdev) -> list of namespaces mapping.

And, actually, the gateway might not provide create_bdev command. The bdev could be created automatically if it does not exist yet for this image.

@sskaur
Copy link
Contributor Author

sskaur commented Mar 4, 2022

And the gateway will keep internally the mapping between the current bdev names and image specs, while in the persistent config it will store image spec (bdev) -> list of namespaces mapping.

For now I've gone ahead to require the --bdev name parameter for create_bdev in the cli as discussed. I'm open to changing this later if people think that's appropriate.

Copy link
Contributor

@trociny trociny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general LGTM. There are some comments that might be address in this PR or in another PRs. I have plans to play with it and then may be will have some other comments.

And hope some other people will review and comment too.

Copy link
Contributor

@trociny trociny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments about omap keys naming.

@sskaur
Copy link
Contributor Author

sskaur commented Mar 16, 2022

I added ability to delete namespace, host, and listeners but the python SPDK RPC does not seem to have a method to delete a transport. @trociny I've created issues to keep track of comments that I didn't address in these new changes. You may want to comment on those issues to expand on what I've written.

@PepperJo
Copy link

PepperJo commented Apr 1, 2022

I added ability to delete namespace, host, and listeners but the python SPDK RPC does not seem to have a method to delete a transport. @trociny I've created issues to keep track of comments that I didn't address in these new changes. You may want to comment on those issues to expand on what I've written.

We discussed in the past if create_transport is even necessary. We could implicitly create the transport on create_listener. The only problem I see is that the create_transport allows to specify options that are shared by all listeners. We don't use them yet but might want to in the future. On the other hand these transport specific features could also be part of the static config as they cannot be changed anyway (once initialized) but might be daemon-process/machine specific.

@PepperJo
Copy link

PepperJo commented Apr 1, 2022

One other thing that we probably need to move to the static config of the daemon is the ip used for the listener since obviously it cannot be shared between GW nodes (in a group) or we have to add a GW node id for these kind of local options.

This was referenced Apr 4, 2022
@sskaur
Copy link
Contributor Author

sskaur commented Apr 5, 2022

@idryomov Do you mind taking a look at the status of this PR? I believe it is ready for final review/approval. Some topics brought up in this PR have spawned issues for further discussion before addressing in future PRs.

See: #10, #11, #12, #13, #14

Copy link
Contributor

@idryomov idryomov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, but I don't understand why allow_any_host and disable_allow_any_host were kept at the protocol level.

This commit adds functionality to persist a gateway's state of SPDK and
restore from it upon restarting. Relevant information for a restore is
stored in a ceph object's OMAP.

Signed-off-by: Sandy Kaur <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants