VMware Cloud Community
salil3
Contributor
Contributor

Right way of creating a vRO plugin

Hi All,

As part of our plugin development we have created our workflows using vRO client. Now the question comes is, what's the right way create a vRO plugin out of these workflows so same can be shipped to the customers?

The approach we are thinking of so far in this direction is:

1. Created a eclipse project for vRO plugin using maven

2. Command that let us import the workflows from vRO appliance. Do we have any such command?

3. Create a plugin using mvn install

Please let me know if that's the right approach to create a plugin from workflows and also request you to help with the commands if there are any.

Thanks and Regards,

Salil

10 Replies
iiliev
VMware Employee
VMware Employee

Hi Salil,

If what you want to ship to customers is only a content (workflows, actions, resources, etc) then the right approach would be to ship them as a package. Writing a plug-in just for content is not necessary; plug-in is needed if you want to provide both content and some way to communicate with a 3-rd party system which requires some Java code.

The manual steps to bundle your content as a package are the following:

  • Launch vRO Java client and switch its perspective from 'Run' to Design' using dropdown at the top.
  • Select 'Packages' tab in the left pane.
  • Right-click and add a package
  • Open the package for edit
  • Select 'Workflows' tab at the top
  • Click one of the 'Select workflows' buttons and pick up the workflows you want to add to the package
  • Optionally, repeat the same for other element types you want to add to the package - actions, resources, configurations, etc.
  • Click 'Save and close' button
  • Right-click on the package and select 'Export package' command. It will generate a file with extension .package that you can ship to your customers

On the customer side, they will need to

  • Launch vRO client and go to Design perspective
  • Go to Packages tab
  • Right-click and select 'Import package' command.
0 Kudos
sanjaysy
Contributor
Contributor

Hi IIian,


I agree with you for that fact that we can have package instead of a Plugin if it's only content but are there any ways to do the following tasks as it's being shipped to customer?


i) locking down the workflows

ii) creating signing certificate

iii) how do handle up gradation when we want to release next version of vRO workflows(plugin)

Thanks

Sanjay

0 Kudos
iiliev
VMware Employee
VMware Employee

For point i) and ii), we provide a Maven plug-in (maven-o11n-package-plugin) and Maven archetype to generate package skeleton (o11n-package-archetype). All you need is to deploy a recent vRO 7.x appliance, open its home page in a browser, and click on 'Develop with the Orchestrator Server' link. There you'll find Maven commands to generate plugin/package skeleton.

For convenience, I attached sample package skeleton generated against vRO 7.2 environment. Unzip it on your disk and change the following in the pom.xml file:

  • vco.version property - in the sample pom.xml it is set to 7.2; change to match the version of your vRO appliance (eg. 7.0.1)
  • keystore.location and keystore.password - change appropriately to point to keystore you want to use to sign the package content
  • url - change te IP address within the url to match the IP of your vRO appliance
  • allowedMask - defines permissions over the content. By default, it is set to vef (short for view/edit/forward); if you want to 'lock the workflows, change it to vf (thus removing 'edit' flag)

The sample package contains a single Hello World workflow; you can add/remove your own workflows to it. Note that the sample workflow is stored as plain file(s) in XML format. This is kind of recommended practice - instead of keeping the workflows as binary content in vRO database, you keep them as XML files in a version control system like Git and 'assemble' a package during build time. You can design your workflows in vRO client, add them to a package, and export the package content as XML by right-clicking on it and executing 'Expand package to folder' command.

For the point iii), do you mean how to increase the version? Version of any workflow can be increased on the 'General' tab when the workflow is selected in vRO client.

The package itself can have version/build number in its file name. When the user imports the new package version, it will be asked which workflows to import/overwrite (vRO knows the currently installed workflow version and the version of the same workflow in the new package).

0 Kudos
sanjaysy
Contributor
Contributor

thanks for that information IIian, I did create package project using vRO archetype and was able to build it using maven build. but facing some issue while importing workflows package which I have created by right clicking on

vRO package and exporting it as Exapnd Package to Folder as my package has so many action modules and folder structure itself is very different from the one we have for plugin project(shown in attached snapshot), so I am just wondering how we can import workflows along with their associated actions, resources etc in plugin package. hope you tell me how I can import these workflows individually or Package as a whole..

thanks

sanjay

0 Kudos
iiliev
VMware Employee
VMware Employee

After you successfully build the project with Maven, you need to import the produced package into vRO. Launch vRO client, switch the perspective from Run to Design with the dropdown at the top, select Packages tab in the left panel (fifth from the left, orange-ish), right-click and select Import package... menu command. Browse to the target\com.dell.storage.vro-1.0.0-SNAPSHOT.package file and import it. The package named com.dell.storage.vro should appear in the list.

Then, select it and open it for edit.(Ctrl+E, or right-click > Edit). In the central panel, select one of the tabs (Workflows, Actions, etc.), and use one of the insert buttons on the top (list search or tree browsing) to add the corresponding workflows, actions, etc. to your package.

After you finish with adding all content you want to be part of your package, click Save and close button, select your package again in the list, right-click and select Expand package to folder... menu command. Navigate to the folder of your package project, and click Save button. This should export the content elements you added in vRO client as XML files. Verify in the project explorer that the files are there, and build the project again with Maven to produce *.package file with the new content included.

0 Kudos
sanjaysy
Contributor
Contributor

Hi IIian,

Yes, I was able to build the package adding the required workflows and actions. I have one more question to ask you, if I want to package the plugin as .DAR file (which the customer can install going to

vRO control center -> Manage Plugin -> Browse the .DAR file and say Install) what are the steps to be followed and what's Maven archetype I have to select.

my plugin is bundle of workflows which does some storage provisioning operations like create/delete/resize Datastores,  provision VMs on storage etc and some configuration workflows that connects to REST hosts to do all these operations. I appreciate your help on this

Thanks

Sanjay

0 Kudos
iiliev
VMware Employee
VMware Employee

Usually, plug-ins in DAR/VMOAPP format contain both content (workflows/actions/resources/etc.) and custom Java code that exposes 3rd-party system API as vRO scripting objects.

If you only need to distribute some content, then the package is the proper way to do so.

If for some reason you still want to distribute a DAR/VMOAPP file that contains only content, then you can use any of the archetypes (eg. o11n-plugin-archetype-simple) and remove the stuff related to exposing scripting objects.

0 Kudos
sanjaysy
Contributor
Contributor

Hi IIian,

When I include my  workflows inside the package, the dependent workflows which are built in workflows also getting pulled into the  package automatically, as these are vRO built in workflows and will be available in each instance of the vRO, I don't want to bundle these workflows inside my package, so is there way I can avoid  these workflows getting into my package?

Thanks

Sanjay

0 Kudos
iiliev
VMware Employee
VMware Employee

AFAIK, there is no option to disable auto pulling of dependent elements into the package, but you can manually remove them afterwards.

0 Kudos
chaitragm
Contributor
Contributor

How to achieve this in vRO 8.0 , ie buiding package while buidling plugin ? vRO 8.0 doesn't have the option to export to folder.