-
Notifications
You must be signed in to change notification settings - Fork 19
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
Configuration parameter in Volumen.create() #111
Comments
See here for an example of how to define a plugin: https://github.com/xapi-project/xapi-storage/blob/master/python/examples/volume/org.xen.xapi.storage.simple-file/sr.py#L42-L58 That is for an SR plugin though, a Volume plugin takes a URI not a configuration (but you can encode the configuration you need into the URI). It is just the documentation that takes you to the wrong place: when you click Volume.create it takes you to the docs about SR.create (because they're both called create). If you scroll down you should be able to see the actual Volume.create API. And see the example here might also be useful for getting started: https://github.com/xapi-project/xapi-storage/tree/master/python/examples |
Thanks Edwin for your answer. If I understand you correctly, I should encode the configuration into a URI and parse it during volumen.create(). The issue is that, for a given SR, I require to pass a specific configuration for each invocation to volumen.create(), i.e., volumen.create() is invoked multiple times for a SR. For the moment, we are relying on a workaround by using the description field, which is unique for each volumen.create() (see this here). The description is used to define the directory that is going to be shared between the guest and the host. We know this information only when volumen.create() is called. However, I was wondering if there is a better way to do this. Maybe I am missing something from the overall architecture of the plugin. |
Hello Edwin, I did not hear from you for a while. In the following days, I am going to submit a PR to the specification to add a configuration field at the volumen.create() method. If you have a better way to do it, feel free to let me know. |
I think you're approaching this from the wrong direction. It is the responsibility of the Storage Management plugin to tell the caller where the volume is so that it can be correctly attached to the VM, specifically the datapath plugin must provide this information when the attach and/or activate operations are performed. |
See the example SR/volume plugins . It should be possible to encode the configuration that you need in the URI that you return, based on the parameters that you receive. That is what the example plugin and our own SR plugin does. Your plugin is the only one processing this URI, so you get to define what each parameter would mean (although if there is a standard/RFC for URIs for your particular SR it'd probably be best to follow that). If you need configuration specific to the volume then you can use attributes for that, see the |
Thanks both for your answers. As Edwin proposed, I am going to use |
I have fixed this issue by modifying the way the volume driver is triggered to create vdis. Roughly speaking, I let the user create symlinks in a special folder that the volume driver uses to trigger the creation of the vdis. To do so, the user issues a |
Hello, for a volumen plugin I require to have a configuration field in which I need to pass some parameters. The spec defines it here, however, I can't find it in the implementation. My plan would be to add it but I would like to ask if you had the same problem, and in that case, how did you approach it.
Regads,
The text was updated successfully, but these errors were encountered: