VMware Cloud Community
mcfadyenj
Hot Shot
Hot Shot
Jump to solution

vco configurations

hi all,

pretty new to vco. Starting to get a little more adventurous now and wanting to clarify my understanding of things.

I am planning to do some bulk cloning etc.

would i be correct in my understand that I should load machine data into "configurations" as arrays and then loop throug the arrays to repeat the same workflow for each configuration array item?

configs would contain things like

template to use for clone

servername

ip address

nic config

disk config

then rinse and repeat for each box? the data for each config will be sourced from xml.

Am i heading about this the right way?

0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Welcome !

Configuration elements are meant to be information related to the environment your vCO server operate. For example you would create an install workflow setting a configuration element attribute with a vmfolder and a resource pool to deploy your VMs in these on your environment with using these config element attributes in your workflows instead of regular attributes (hardcoded) or inputs (so you do not have to set these everytime you start a workflow).

Now if you would send to me your workflow the vmfolder and RP you have set in your environment would be cleared and I would have to specify these once for my environment by setting them manualy or by running your provided install workflow and then your workflow would use these automatically.

In your case since you already have XML files:

  • if these are static what you want to do is to import these as a resource element.
  • If these are generated each time you want to use the filereader objects

Then you can extract the XML to a Properties (property list) and start the clone workflow passing these properties.

In the library there are some clone from properties workflows.

You can update us on your progress and if you have any issue people here will certainly be able to help you learning best practices.

Christophe.

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 vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

0 Kudos
6 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Welcome !

Configuration elements are meant to be information related to the environment your vCO server operate. For example you would create an install workflow setting a configuration element attribute with a vmfolder and a resource pool to deploy your VMs in these on your environment with using these config element attributes in your workflows instead of regular attributes (hardcoded) or inputs (so you do not have to set these everytime you start a workflow).

Now if you would send to me your workflow the vmfolder and RP you have set in your environment would be cleared and I would have to specify these once for my environment by setting them manualy or by running your provided install workflow and then your workflow would use these automatically.

In your case since you already have XML files:

  • if these are static what you want to do is to import these as a resource element.
  • If these are generated each time you want to use the filereader objects

Then you can extract the XML to a Properties (property list) and start the clone workflow passing these properties.

In the library there are some clone from properties workflows.

You can update us on your progress and if you have any issue people here will certainly be able to help you learning best practices.

Christophe.

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 vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
mcfadyenj
Hot Shot
Hot Shot
Jump to solution

thanks for the tip. I am at home now and don't have access to the wf / actions I created.

But I had already completed loading the xml into properties I thought I then needed to move into configs as a 2nd step.

For interests sake I think I will have a crack at it just to understand the technology a little more. It would be considerably easier if the xml plugin supported xpath lookups.

is there anywhere I can make enhancement requests etc

I figured this would make the xml plugin more versatile.

XmlElement:     add    .selectNode("//test/test[@Name='test']")

XmlElement:     add    .selectNodes("//test/test")

0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

I have just replied to you on your comment on vCOTeam.

XPath is supported in vCO. Unfortunately we are missing examples in the library.

I may post a code snippet later this week when I finaly get some free time.

Christophe

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 vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
tschoergez
Leadership
Leadership
Jump to solution

Hi!

Just for later reference I will add the link here, too:

You can find an example accessing XML-data (easier?) via the E4X-language-part of Javascript here

http://www.vcoportal.de/examples/xml-handling-the-e4x-way/

If you need more examples (or want to share your solution of course :smileysilly: ) just ask...

Regards,

Joerg

0 Kudos
mcfadyenj
Hot Shot
Hot Shot
Jump to solution

i have no issues sharing my code ill post it when i get into work tomorrow. no vpn from home.

this vco looks like a nice little niche market to be in. I know 3-4 companies here who have attempted it and given up due to complexity.

I am doing something along the lines of this

var xmlmanager = new XmlManager();

var xmldoc = new XmlDocument();

xmldoc = xmlmanager.load(inputfile)

var xmlnode = xmldoc.getElementsByTagName("//test")

var xmlnodes = xmlnode.getChildNodes()

var props = new properties();

for (i=0; i > xmlnodes.length;i++)

{

     var currentNode = xmlnodes[i];

     var propertyName = currentNode.getAttribute("Name");

     var value = currentNode.getAttribute("Value")

     props.add(propertyName, value);     

}

note: this is from memory so it may not work if you try it but its will be similar.

0 Kudos
mcfadyenj
Hot Shot
Hot Shot
Jump to solution

example of xml read into props

attached is a action / workflow required to test the functionality.

there is also an example xml that gets read into properties hashtable. intention is to use this xml to build os / app / config layer of large scale sdlc solutions.

it was never intended for vco originally as I never knew of the product until a few weeks ago.

0 Kudos