New in vRealize Automation 7 is the ability to create software installation components as part of the new converged blueprint design canvas. If you have been following VMware for some time this is actually a lot of the same code that once was Application Director and then Application services. In this guide I will walk you through the feature as well as explain how the functionality works. At the end you will have a working Hello World Blueprin. With these skills you should be able to build more complex blueprints from there.
- How to create a vRealize Automation 7 Linux Template Part 1
- How to create a vRealize Automation 7 Linux Template Part 2
- A quite place where you will not be interrupted
At this point you should have already completed Part 1 and 2 of my guides above.
Login to the vRA portal as an admin that has the infrastructure Architect and Software Architect roles!
Once logged in go to the design tab and software components and let’s edit that HelloWorld script we created earlier
Now let’s create a new property, only this time we are going to use a binding property that is populated when the VM get’s provisioned in vRA, go to the properties screen and click new and create the new property my_ip
Pro-Tip: The binding properties must use an underscore in the name for example my_ip will work but my-ip will not.
Now click next and let’s add to our script to include this new property, click the blue text next to the install Lifecycle stage to open the editor
After my IP address is add a space then use the drop down to select and enter the new property we just created
Normally that is all we would need to do but since we used a binding property we will now need to make some changes in our Blueprint. Open the blueprint we crated in Part II of the guide and click on the HelloWorld Blueprint then the Properties Tab
Now type a ~ after resources and you should see the list of resources and select CentOS_6 (The machine resource)
Now type ~ again and you should see all the properties available from the Machine once it provisions to vSphere. Select ip_address
Fire off a new request, and remember to enter text for the user input we created in Part II of my guide
Ok smarty pants, easy enough but what if I want to pass properties between two VM’s in the same blueprint? Let’s do that then. Go back and edit the Hello World Software Component and add a new property web_ip
Now go to the blueprint and drag and drop another CentOS VM onto the canvas and name it Web.
Make sure you setup the build information the same as you did for the CentOS_6 machine we already created
Now click the HelloWorld_1 component and then go to the properties tab and bind the web_ip to the Web servers ip address as shown
Why are we doing this? When building blueprints with multiple machines that you want to install and configure applications on there may be properties you need from one machine to complete the installation on another. For example if I am building a Web server I may need the IP address or host name of the Database Server so that I can install the application and instantiate the database tables.
Click finish and fire off another request like before. Then SSH in and cat the contents of /tmp/myscript.log again
Last tip is to stagger the build process. This is done with dependency mapping. Dragging arrows from a software component to a machine tells vRA to wait until that machine is built before starting the next machine.
For example, you may want the database server to be built and installed before you start to build the Web Server.
So there you have it! Remember if you create a great blueprint pay it forward and share it in VMware Sample Exchange!
Excellent work Ryan! This is what I’ve been looking for.
There is however a small problem. If you want to deploy multiple instances for the machine resource the value of my_ip is the ip address of the first provisioned instance to all of them. For example if I need web1, web2, and web3 the vaule is the ip address of web1 to all of them :). I would be interested to learn how one can deal with this.
I had the exact same issue. In this release the clustered node feature that is needed for this to work properly is not yet implemented. You have two options, in the canvas you can create a separate Web1, Web 2 and Web3 and then us web1_ip etc. and it should work as expected. If you want to just create one web node and allow the requester to choose how many web servers they want at request time I found this workaround. In your script just add this line:
#Get My IP adress and store as variable
my_ip=$(hostname -I | cut -f1 -d’ ‘)
Now you can use $my_ip in your script and it will be the IP of that web server. Unfortunately it won’t allow you to bind it to another server in the canvas. That is planned for future release.
admin7. desember 2008Morbi at felis. Susspndiese ligula. Aliquam nisl arcu, vehicula vitae, hendrerit ut, sodales eu, augue. Sed tristique pretium risus. Ut luctus, dui quis commodo luctus, quam nulla ultricies lorem, eu ornare nulla metus at leo. Praesent rhoncus sapien sit amet mauris. Aenean commodo erat eu eros. Morbi tristique, risus sed consequat bibendum, enim augue tincidunt quam, ac semper libero velit vitae eros.
There needs to be an official Twitter hashtag or account to disseminate these rules.You know, something to follow so I don’t have to keep thinking: “Was that one of the ru&21?l#82es; and miss a chance at 1 or 2 other drinks while I was back on the last drinkable offense.
Ryan, how would you access other variables such as ones you created as a Property Definition?
Pingback: vRA 7 Software Components Computed Values Explained – VMtoCloud.com
Pingback: vRealize 7 Application Services – Windows Agent Install – ValCo Labs
thanks for this blog.
Do you know how vRA learns the IP addresses though? I’m exactly using the use case above (3 nodes with software configuration happening on each one based on their ip address).
However, it seems that instead of using the value of “VirtualMachine.Network0.IPaddress” for example, it uses the IP address it seems to use the IP address detected from the vmware tools.
In my case, the IP address has been discovered before the VM was ready and it got a 169.254.X.X
Reading your content is pure pleasure for me, it deserves to go viral, you need some initial traffic only.
If you want to know how to get it search for: blackhatworren’s strategies
What if we wanted to use the requester’s domain username in the software component? I would like to do things like add them to the RDP users group, add them to the list of SQL server admins, etc. I’ve played around a bit with the blueprint trying to find something like it in the list of available values, but everything seems to be machine specific.
The domain users name is held in a custom property named VirtualMachine.Admin.Owner you can pass custom properties to software components by using binding properties. This guide shows how to do that with a drop down list but you could just skip that part and bind VirtualMachine.Admin.Owner to a software component property. -> https://www.vmtocloud.com/how-to-use-drop-down-lists-with-vra-software-components/
Thanks! I found a way to do it by parsing the XML after the guest is created, but it seems messy when compared to doing something like this. I am having problems however getting it to work. I’m a little unclear on what names/values I should be specifying and where I should be doing it. Right now I have a property called “Machine_Owner” in my software component that is Overrideable and Required. I created a blueprint with a machine and gave it a custom property named “VirtualMachine.Admin.Owner” with a blank value, overriadeable. I then added the software component and bound the “Machine_Owner” property value to the “BlueprintName~VirtualMachine.Admin.Owner”. Every time I try to request the item though, I get an instant failure. I’ve tried a few different variations but to no avail.
have you ever found out how this works – i’m attempting the same thing to no avail….
Ryan, how would you access other variables such as ones you created as a Property Definition’s?
Hi, is anybody here interested in online job?
It’s simple survey filling. Even 10$ per survey (ten minutes duration).
If you are interested, send me e-mail to hans.orloski[@]gmail.com
I often visit your website and have noticed that you don’t
update it often. More frequent updates will give your blog higher authority & rank in google.
I know that writing articles takes a lot of time, but you can always help yourself with
miftolo’s tools which will shorten the time of creating an article to a couple of seconds.
i like this example and was wondering if you could help me out – i’m trying to send the value of the deployments owner to a software component, any thoughts on that?