Virtualization Plugins

 View Only
  • 1.  Issue with virtual.configure

    Posted 07-01-2019 03:26:00 PM
      |   view attached
    Having issues provisioning a new VDB?  Getting unexpected output error (see attached).  It looks like it's how I am returning values but cannot figure out why?  I removed everything down to the basic where it was just returning things and still errored?  I looked at online documentation but it's a bit confusing.  So I'm not sure if I just have my input parms reversed, or incorrect output parms?  I've tried numerous combinations but keep getting the same error.

    The online documentation for First Plugin shows 'configure_new_vdb(virtual_source, snapshot, repository).  I do not see this documented under plugin operations?

    Under plugin operations I see Signature 'def configure(virtual_source, snapshot, repository)' but then in it's example I see 'def configure(virtual_source, repository, snapshot)'?  I see snapshot and repository reversed throughout the various calls which is confusing and likely to cause issues down the road.

    Questions:
    - Where are all the possible definitions for each plugin defined?  And where/when to use configure_new_vdb versus configure?  Which should I use if I want to make changes after mounting?  I assume configure, but it's unclear then what configure_new_vdb is for?  I assume reconfigure is for existing vdb's, what about when creating new?
    - What are the correct input parms for configure()?  Doco is inconsistent.  

    https://developer.delphix.com/References/Plugin_Operations/#virtual-source-configure

    - Any other insight as to what my problem may be?

    Tried:

    @plugin.virtual.configure()
    def configure_new_vdb(virtual_source, snapshot, repository):
    mount_location=virtual_source.parameters.mount_location
    name = "VDB mounted at {}".format(mount_location)
    return SourceConfigDefinition(path=mount_location, name=name)

    @plugin.virtual.reconfigure()
    def reconfigure_existing_vdb(virtual_source, repository, source_config, snapshot):
    return source_config

    Also tried:

    @plugin.virtual.configure()
    def configure (virtual_source, repository, snapshot):
    source_config = SourceConfigDefinition()
    return source_config

    @plugin.virtual.reconfigure()
    def reconfigure_existing_vdb(virtual_source, repository, snapshot):
    return source_config

    Thanks!

    ------------------------------
    Paul Jauquet
    Senior Data Services Consultant
    Axis Technology, LLC
    ------------------------------


  • 2.  RE: Issue with virtual.configure
    Best Answer

    Posted 07-01-2019 04:11:00 PM
    Hi Paul,

    Please find the answers to your questions below:

    Where are all the possible definitions for each plugin defined?
    You can find all possible definitions for plugins at: https://developer.delphix.com/References/Plugin_Operations/.

    And where/when to use configure_new_vdb versus configure?
    In our documentation, we defined the method name of configure as "configure_new_vdb". In practice, the plugin author has the freedom to name this method whatever they want, so long as the decorator is defined as the plugin operation they want to implement.
    @plugin.virtual.configure()
    def configure_new_vdb(virtual_source, repository, snapshot):

    Which should I use if I want to make changes after mounting?  I assume configure, but it's unclear then what configure_new_vdb is for?  I assume reconfigure is for existing vdb's, what about when creating new?
    You may assume that the mount is present during configure(), so this is where you would want to make your changes after mounting. When provisioning a new VDB, you want to define a method with the virtual.configure() decorator. Configure is called during provision and refresh.
    For existing VDBs, you want to define a method with the virtual.reconfigure() decorator. Reconfigure is called during rollback and enable.


    - What are the correct input parms for configure()?  Doco is inconsistent.  

    https://developer.delphix.com/References/Plugin_Operations/#virtual-source-configure

    Looks like you found an inconsistency between our documentation and API. The correct input params for configure() and reconfigure() are:
    @plugin.virtual.configure()
    def my_configure_implementation(virtual_source, repository, snapshot):
    and
    @plugin.virtual.reconfigure()
    def my_reconfigure_implementation(virtual_source, source_config, repository, snapshot):


    Let me know if this doesn't make sense or if there is anything else you need.



    ------------------------------
    Jeff Ngo
    Senior Member of Technical Staff II
    Delphix
    ------------------------------



  • 3.  RE: Issue with virtual.configure

    Posted 07-01-2019 05:04:00 PM

    Thanks for the clarification on the method naming.  That helped.

    Question.  Why would the virtual.configure() plugin module return source_config?  I'd think it would return virtual_config since you are configuring the VDB, and not the original source?  Or is this so that future VDB's can be created off this VDB as the source?  I'd appreciate some clarification on this, and it may help to explain in the documentation as well.  Thanks.



    ------------------------------
    Paul Jauquet
    Senior Data Services Consultant
    Axis Technology, LLC
    ------------------------------



  • 4.  RE: Issue with virtual.configure

    Posted 07-01-2019 05:52:00 PM
    Good question -- I understand your confusion. To explain, we are actually treating SourceConfig as a generic object which can be used to define properties of any source (whether the source is linked or virtual).

    Please see: https://developer.delphix.com/References/Glossary/#source-config

    In the future, we may consider creating a clear distinction between linked and virtual source configs if there is enough difference to warrant a change.

    Hope this helps.

    ------------------------------
    Jeff Ngo
    Senior Member of Technical Staff II
    Delphix
    ------------------------------



  • 5.  RE: Issue with virtual.configure

    Posted 07-02-2019 05:12:00 PM
    Hi Paul,

    Taking another look at the error message, it seems like the SourceConfigDefinition that you had returned in configure_new_vdb() did not include all of the required properties.
    @plugin.virtual.configure()
    def configure_new_vdb(virtual_source, snapshot, repository):
    mount_location=virtual_source.parameters.mount_location
    name = "VDB mounted at {}".format(mount_location)
    return SourceConfigDefinition(path=mount_location, name=name)
    "name" and "path" are specified but "conffile" is missing from the SourceConfigDefinition.

    ------------------------------
    Jeff Ngo
    Senior Member of Technical Staff II
    Delphix
    ------------------------------



  • 6.  RE: Issue with virtual.configure

    Posted 07-02-2019 05:44:00 PM
    Yes, noticed that and resolved it shortly after the initial response which clarified some of my questions.  I had not realized that I needed to basically create a new source_config object for the VDB to return.  Good to go now.  Thanks!

    ------------------------------
    Paul Jauquet
    Senior Data Services Consultant
    Axis Technology, LLC
    ------------------------------