willonit
Hot Shot
Hot Shot

Simple XaaS Items with objectless plugins

Jump to solution

Here is my scenario, I've a workflow to create and remove DNS records with powershell plugin. I want that to be requested through XaaS and create an item that a user can then manage. And by manage I mean delete. I've tried serveral different ways to implement this, returning different types to be my Custom Resource. I'll save you from all the details of each attempt but I couldn't get it to work the way I wanted.

I want to be able to make a request with XaaS that then becomes an item with properties of that item. Those properties can then be passed to Resource Actions to go off and do other things. This could apply to SSH, SQL, Powershell, and probably a few other standard plugins that dont actually create and object that the vRO plugin sees. In my case its a DNS record, but it could be a number of other kinds of tasks, switchport, fileshare, LUN, zoneset, something else with ssh, etc. I should have a way to have an item with those properties. Sadly, I think I may be stuck with Dynamic Types here, but doesnt that limit me to REST or SOAP?

The last thing I tried was to create resource elements with the properties I needed. I was hoping I could use the object to run actions to get the data I need to populate the details form. I don't think this is a great solution, but I was out of ideas. When I request that workflow, it fails in vRA eventhough the workflow is successful in vRO. No logs to be found. 

Anyone have any ideas?

GrantOrchardVMware‌ said you might, SeanKohler

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee

with regards to Dynamic Types - no, you are not limited to Rest/Soap as I illustrated here: SQL Plug-in + DynamicTypes = Simple CMDB for vCAC - Part 2

You'll just need to have your workflows built to manipulate your records and provide unique identifiers, etc as I did for SQL in that article series. A similar approach may be taken with anything you are able to write workflows for Smiley Wink

- Good Luck!

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

10 Replies
Burke-
VMware Employee
VMware Employee

with regards to Dynamic Types - no, you are not limited to Rest/Soap as I illustrated here: SQL Plug-in + DynamicTypes = Simple CMDB for vCAC - Part 2

You'll just need to have your workflows built to manipulate your records and provide unique identifiers, etc as I did for SQL in that article series. A similar approach may be taken with anything you are able to write workflows for Smiley Wink

- Good Luck!

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
SeanKohler
Expert
Expert

I guess I owe him more money then.

So I have been looking into possibly learning how to create my own vRO plugins to install/register with vRO: in the hope I could create my own inventory objects that are then extensible as Custom Resources in vRA.  I didn't come across a lot of documentation of how to do so, and tabled it for other work efforts... but your question really makes we want to pick it back up again.

The only way that I know of for you to get your desired inventory into vRA (as a Resource that can have Custom Resources, and a Dispose option for deletion) is to do it through Dynamic Types.  In particular, using Dynamic types against SQL/Postgres table rows like the CMDB example (only with column metadata that relates to your resource).

>>> but doesnt that limit me to REST or SOAP?

How so?  As far as getting inventory in place it is a measure of running a provision request in vRA that runs workflow with an output of your dynamic type object.  Once you have the inventory item, any resource action can be built off of the item.  (not saying this is not a lot of work, however)  The resource actions are built on top of vRO workflows... which can take metadata from the resource and use it in any plugin in vRO.  (AD plugin, Powershell, SSH, SQL, etc)

Resource Elements == Configuration Elements?

Configuration Elements should work, and have been something I have been considering too.  I will go see if I can figure out something and get back with you. Config Elements are the parent level of a collection of attributes.  I don't think there is a limit to the number of Config Elements, but when you are talking a DNS entry per element... well... that could be ummm interesting.

>> use the object to run actions to get the data I need to populate the details form

Yeah I do this in a couple places (e.g. to show custom properties from a business group on a business group XaaS inventory item)

What I think VMware needs to give us is a quick ability to have rows in a table be able to be used as vRA CustomResources (provisioned of course) where the data columns are the metadata fields for the resource, but without the need to do it through Dynamic Types... which I still contend isn't fully baked.

SeanKohler
Expert
Expert

Yeah... so I think this might be big for you.  I have some actions laying around that can manipulate/read the configuration elements and attributes.  But the behavior of Configuration Elements in vRA inventory is quite nice.  If you have an attribute called "name" and "description" it takes those by default for the metadata.  The rest of the fields can be pulled as metadata in the form through External vRO resource actions. (the actions I have take configElement Name and attribute and return the string value)

Setup

The Resource

CE5.jpgCE6.jpg

The Workflow

CE7.jpg

The Service Blueprint (provision) - points to the above workflow.

CE8.jpg

The Resource Action (dispose) - points to the above workflow. (renamed to Ghost)

CE9.jpg

Result

Note: in vRA 7, you can have subfilter rollup for custom resources in the Items inventory.  This means we do not need to have big long lists in "System" or "Dynamic Types"... we can have tree (parent/child) rollups.

CE1.jpg

CE2.jpg

CE3.jpg

CE4.jpg

CE10.jpg

CE11.jpg

0 Kudos
SeanKohler
Expert
Expert

So that is just the manipulation of the inventory item in vRA.  To create inventory in this methodology we need a way to manage configuration elements.  (and likely a way to audit configuration elements that exist VS their inventory resources in vRA, but we can look that over later)

I have a collection of actions that perform CRUD operations on Configuration Elements.

I don't have time to bundle them today, but if you are interested in pursuing this methodology... I can post them tomorrow.

With regard to Configuration Element and CE Attribute capacity... VCO Script... Create ConfigurationElement in ConfigurationElementCategory

0 Kudos
SeanKohler
Expert
Expert

Sorry. I guess I do not have a create for the CE, only their attributes.  I know it can be done because I have seen it done.  We would need to figure that out for this to be viable.

0 Kudos
willonit
Hot Shot
Hot Shot

Awesome information!! Thank you Burke-‌ and SeanKohler‌!

I will admit, I don't know much about dynamic types. I associated that with the dynamic types generator so that's why I thought I was stuck with REST/SOAP. I think in this case I don't even need relationships and such just one type. Now if I understand correctly, dynamic types creates boiler plate workflows for you that you populate with your logic (eg. get by ID). I'll need to go back and take a closer look at the CMDB example.

Configuration Element \= Resource Element

That sounds correct that you can't create configuration elements. I tried that first because it is a key value pair structure but they appear to be read only, probably for good reason so people don't do stuff like this. It is more for configuration constants. Resource elements are like icons, text file, and such. I pulled some of the logic from the guest script manager package to write and read new resources. Now, this is a terrible way of going about it anyways because that would be a lot of little text files, but like I said, I was out of ideas.

I'll give dynamic types another go. That was the closest I got to the intended result anyways. Thanks again for all the help.

0 Kudos
SeanKohler
Expert
Expert

‌Well I will soon have a method on the way that will show how to create config elements, and I don't think they need to be viewed as strictly constants. We have (quite successfully) leveraged "pre-created" config elements as variables. For example, I have element attributes that hold all resource actions for an entitlement which is then bound to a workflow that builds an entitlement (making it constant), but then I present an ASD form to be able to read and "update" the element from outside vRO (making it variable). The element when used in workflow execution IS a static constant, but it WAS also variable out of band from the execution. Configuration Element attribute values are also variable without automation to do so... they are just modified manually, with ready access to vRO.

A DNS record is a constant while it lives. And it is variable when you want to update it. The way I see it, configuration elements may be quite useful (and simple) to hold these values as long as we can workout a lifecycle for the Element.

So the question becomes, why hasn't VMware provided CRUD operations for these elements outside of the REST API?  If they had, we could find other creative methods to leverage the product beyond the notion of preconceived semantics.

  • We built them for X, so you can only use them for X
    • Well can I try to use them for Y?
  • NO.
    • Why not?
  • Well we can't support that.
    • I understand, but if it works... I will let you know.

If you really think about it, what is the fear/risk? Performance? Data size? Corruption? Is that above and beyond the risk we already maintain? Risks often remedied by more compute, storage and DB backups. I threw 1million attributes in a configuration element, and it didn't even phase vRO.

Tom O'Rourke's team already have mechanisms to create Configuration Elements. Even though you are looking into the dynamic types route (which is a fine route), I want to see if I can understand if Configuration Elements as vRA inventory bring us any value. If you don't mind, I would just follow up here in your thread?

0 Kudos
willonit
Hot Shot
Hot Shot

Update: Burke-‌, your DB package was perfect. I ran that, made workflows including that dynamic type and everything is working great. One thing I still can't get is how to make those types and relations on my own. Do you have any references or documentation on that? I tried to reverse engineer a bit but couldn't get it to work the same. I feel like dynamic types are very powerful and valuable but there is a high barrier of entry to get going with them. Thank you to you, cdecanini‌, and others for releasing packages to help break that barrier.


SeanKohler, I agree with you about configuration elements. As to why VMware won't provide CRUD methods...well I'll add it to my list of whys. I guess the only thing I would say is vRA shouldn't really be a system of record even though I'd like to use it as such sometimes. Now that I have this working, I'm quite happy with the database backend. PM me if you want to work more with config elements offline. It would be great to get more followup on that topic.

0 Kudos
SeanKohler
Expert
Expert

‌>>I'm quite happy with the database backend.

Definitely. We played around with it in Lab. I had some troubles with a real CMDB Postgres table (as seen in the comments)... but we certainly liked the value proposition.


As an aside... I think we need Burke and team to make it even easier with some more examples. How about database tables of DNS entries? Just make it happen in Dynamic types on DB tables so we can run with it! Share your findings in your blogs if you wish. For those involved enough and smart enough to do it, I assure you it isn't a waste of time. Also, I kind of wonder who is supposed to be making Dynamic Types easier to work with? Who is completing the TODOs in Dynamic Types?

>> PM me if you want to work more with config elements offline.

Yeah, I have not dropped this. I ran into a little trouble today, but I know this is doable. I will reach out soon.

0 Kudos
willonit
Hot Shot
Hot Shot

SeanKohler‌ Found this poking around vRO the other day. Looks to be new in 7.createConfigElement.png

0 Kudos