Uncategorized

vRA 8 / Cloud Assembly – Sample/Simple Pattern

As you know from the previous post, my first book will be published soon. However, not everything could be in one book, so I will also add articles that you can read here.

At first glance, something goes into which vRA was created. Automatic machine provisioning with a specific application.

My environment is as follows:
vCenter with two templates Windows and Linux
two customization files for Windows and Linux

One vRA 8 with vCenter Endpoint and one Project.

At the beginning I created a blueprint which contains one vsphere machine and one network also with vsphere. Blueprint looks in that way

As you already know perfectly in Cloud Assembly, we have Infrastructure as a code which manifests itself in the possibility of creating blueprints using YAML code

So the code looks like this

formatVersion: 1
inputs: {}
resources:
  Cloud_vSphere_Machine_1:
    type: Cloud.vSphere.Machine
    properties:
      image: ''
      cpuCount: 1
      totalMemoryMB: 1024
      networks:
        - network: '${resource.Cloud_vSphere_Network_1.id}'
  Cloud_vSphere_Network_1:
    type: Cloud.vSphere.Network
    properties:
      networkType: existing

As this is a standard and simple blueprint can stop here but I think that what we will have at the end will be better.

So basically I wanna customize this as much as I can, that I’ve change CPU and memory as an Input properties and now we can setup this in request phase.

CPU:
    type: integer
    default: 1
    title: Number of CPU
    description: Number of CPU
  Mem:
    type: integer
    default: 1024
    title: Mem Size
    description: Mem Size

However, the CPU and memory are not everything because we imagine the situation that the client wants to have a choice between Windows and Linux, so we could create two patters and assign an appropriate Image to each of them, but I decided to set the system selection as an option and of course why we need a clean system like we can customize it from vCenter

In my environment I have two images and two customizations so the user can choose himself

image_name:
    type: string
    enum:
      - Win
      - Lin
    default: Win
    title: Image Name
    description: Image Name
  custom_spec:
    type: string
    enum:
      - Win-Stat-192
      - Lin-Stat-192
    default: Win-Stat-192
    title: Customization Name
    description: Customization Name

The next element is the network, we should also give the user a choice, that’s why I used the same maneuver and in the list of choices, it passes values from two network profiles

net_name:
    type: string
    enum:
      - vra
      - lab
    default: vra
    title: Network Name
    description: Network Name

the last element that is in the patter is middleware, in order to show the functionality I chose the web server as true or false

web_server:
    type: boolean
    title: Web Server
    description: Web Server
    default: false

At the very end I transferred all the elements to the Virtual Machine and to the network settings, and full YAML looks like this

formatVersion: 1
inputs:
  image_name:
    type: string
    enum:
      - Win
      - Lin
    default: Win
    title: Image Name
    description: Image Name
  custom_spec:
    type: string
    enum:
      - Win-Stat-192
      - Lin-Stat-192
    default: Win-Stat-192
    title: Customization Name
    description: Customization Name
  CPU:
    type: integer
    default: 1
    title: Number of CPU
    description: Number of CPU
  Mem:
    type: integer
    default: 1024
    title: Mem Size
    description: Mem Size
  net_name:
    type: string
    enum:
      - vra
      - lab
    default: vra
    title: Network Name
    description: Network Name
  web_server:
    type: boolean
    title: Web Server
    description: Web Server
    default: false
resources:
  vSphere_Machine_1:
    type: Cloud.vSphere.Machine
    properties:
      image: '${input.image_name}'
      cpuCount: '${input.CPU}'
      totalMemoryMB: '${input.Mem}'
      networks:
        - network: '${resource.vSphere_Network_1.id}'
      name: '${input.image_name}VM'
      customizationSpec: '${input.custom_spec}'
      web_server: '${input.web_server}'
  vSphere_Network_1:
    type: Cloud.vSphere.Network
    properties:
      networkType: existing
      constraints:
        - tag: '${input.net_name}'

Diagram was not change much but here it is

As our blueprint is completed, we can pass it on to users on the Service Broker portal.

Users can, however, unknowingly choose values that do not match (e.g. Windows and customization for Linux) so I decided to limit the choice of customization only by informing what was chosen by using custom forms and the usual IF parameter.

On the broker portal in the content tab we have the opportunity to create custom forms

Our standard form looks in that way

On Customization Name I’ve marked this field as read only but visible to all

and I’ve setup a Values which depend from what user setup in Image

Now we can request our VM.

however let’s hold on. Who will install our web server? I decided to use here a solution known from earlier versions of vRa, namely workflow in vRO. So I created a subscription to call my pattern after the deposit was completed.

my workflow in vRO may not be extraordinary, but a simple solution thanks to which I achieve what is required, i.e. installed Web Server.

So on Windows we will have IIS and on Linux we will have Apache. If you wanna se my code please left comment here.

And now we can finish the topic of simple workflow and as you can see it is not so scary as it might seem and with a simple configuration we achieve our goal.

To read in the next article I hope that you will still be with me

Share with:


48 Comments on “vRA 8 / Cloud Assembly – Sample/Simple Pattern

    1. Apologize, I should have put more details in my request for code yesterday.

      What a valuable example. I’m very interested in learning how you coded the subscription and payload portion. And how you were successful in coding the ability to select multiple templates deployments through a single catalog. I’m currently involved in a vRa 8 project an would like to work with you in more details if that’s possible. Hope to hear from you soon. Thank you

        1. Hi Friend,

          Can you plz provide the VRO code for install IIS, Apache ?

          Also what will be action code when i want to install SQL DB

  1. Nice article, I would like to see codes for IIS OR database deployment on the windows server and on the Linux server Apache.

  2. Hi, i’d also like to know the code for installing applications. Could you send me the details?

  3. Hi ,
    have written blueprint yaml and we are using ansible for post provisioning task.. the issue is like we are able to create the vm by thru bp deplyment but it is getting stuck after i mean not acknowledging back to vra to get the ansible connection.
    any lead will be appreciated.
    vra 8.0

    Thanks

  4. Hello There. I found your blog using msn. This is a very well written article.
    I’ll be sure to bookmark it and come back to read more
    of your useful info. Thanks for the post. I’ll definitely comeback.

  5. Hello, Neat post. There’s an issue with your web site
    in internet explorer, might test this? IE nonetheless
    is the market chief and a big component of other folks will pass over your great writing because
    of this problem.

  6. Oh my goodness! Amazing article dude! Thank you so much,
    However I am going through problems with your RSS. I don’t understand why I cannot subscribe to
    it. Is there anybody else getting the same RSS problems? Anyone that knows the answer can you kindly respond?
    Thanx!!

  7. I’ve been exploring for a bit for any high-quality articles or weblog posts on this kind of space .
    Exploring in Yahoo I finally stumbled upon this website.

    Studying this info So i am happy to express that I’ve an incredibly good uncanny
    feeling I discovered exactly what I needed. I so much without a doubt will make sure to don?t disregard this web site
    and give it a glance on a constant basis.

  8. Its like you learn my mind! You seem to know so much about this, such as you wrote the e book in it or something.
    I think that you just could do with a few p.c.
    to pressure the message home a bit, but other than that, this is excellent blog.

    An excellent read. I will certainly be back.

  9. Hello there, I discovered your website by means of Google while looking for a comparable subject, your site got here up, it seems great.
    I’ve bookmarked it in my google bookmarks.
    Hi there, simply was aware of your blog via Google, and found that it is truly informative.
    I am going to watch out for brussels. I’ll be grateful when you proceed this in future.
    Numerous other people shall be benefited out of your writing.
    Cheers!

  10. Have you ever considered about including a little bit
    more than just your articles? I mean, what you say is valuable and all.
    However think about if you added some great visuals
    or videos to give your posts more, “pop”! Your content is
    excellent but with images and video clips, this blog could certainly be one of
    the best in its niche. Terrific blog!

  11. Excellent post however I was wanting to know if
    you could write a litte more on this subject? I’d be very thankful if you could
    elaborate a little bit further. Thank you!

  12. hey there and thank you for your information – I’ve definitely picked up something new from right here.
    I did however expertise some technical issues using this web site, since I experienced to reload the site many times previous to I
    could get it to load correctly. I had been wondering if your
    web hosting is OK? Not that I am complaining, but sluggish loading instances times will very
    frequently affect your placement in google and could damage
    your high quality score if advertising and marketing with Adwords.
    Well I am adding this RSS to my e-mail and can look out for much more of your respective interesting content.

    Ensure that you update this again soon.

  13. Hello there, You’ve done a great job. I’ll certainly digg it and personally suggest to my friends.
    I am sure they’ll be benefited from this web
    site.

  14. Excellent goods from you, man. I’ve understand your stuff previous to and you are
    just too great. I really like what you’ve acquired here, really like what
    you are saying and the way in which you say it. You make it entertaining and you
    still care for to keep it smart. I cant wait to read far more from you.
    This is really a wonderful web site.

  15. Hey there would you mind sharing which blog platform you’re working with?

    I’m going to start my own blog in the near future but I’m having a hard time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design and style seems different then most blogs and I’m
    looking for something unique. P.S Apologies for getting off-topic but I had to ask!

  16. Wow that was odd. I just wrote an really long comment but after I clicked submit my comment
    didn’t appear. Grrrr… well I’m not writing all that over again. Regardless, just wanted to say
    superb blog!

  17. An impressive share! I have just forwarded this onto a co-worker who had been conducting a little research on this.

    And he in fact bought me dinner simply because I found it for him…
    lol. So allow me to reword this…. Thank YOU for the meal!!
    But yeah, thanks for spending some time to talk about this matter here on your web site.

  18. Do you mind if I quote a couple of your posts as long as
    I provide credit and sources back to your webpage?
    My blog is in the exact same niche as yours and my users
    would certainly benefit from a lot of the information you present here.
    Please let me know if this alright with you. Appreciate it!

  19. I’m now not certain where you’re getting your information, however
    good topic. I must spend a while finding out more or understanding more.

    Thank you for wonderful info I used to be on the lookout
    for this information for my mission.

  20. Hello There. I discovered your weblog using msn. That is a very
    well written article. I’ll be sure to bookmark it
    and return to learn extra of your useful information. Thank
    you for the post. I will definitely comeback.

  21. Nice post. I was checking constantly this weblog and I’m impressed!

    Very useful info particularly the last section 🙂 I maintain such
    info much. I used to be looking for this particular information for a
    long time. Thank you and good luck.

  22. Right here is the perfect site for anybody who wishes to understand this topic.
    You understand a whole lot its almost tough to argue with you (not that I really will need to…HaHa).
    You definitely put a new spin on a subject that’s been discussed for a long time.
    Great stuff, just wonderful!

  23. Very good website you have here but I was wanting to know if you knew
    of any community forums that cover the same topics discussed in this article?
    I’d really like to be a part of community where I
    can get comments from other knowledgeable individuals that share the same interest.
    If you have any recommendations, please let me know.
    Thanks!

  24. Hi!
    Very good blog, I like it a lot.
    What’s behind the scriptable task “Apache install” for Linux and the action element for installing on Windows? Can you share your code to me?
    Thank you very much in advance!
    BR

Leave a Reply

Your email address will not be published. Required fields are marked *