Showing posts with label blueprint. Show all posts
Showing posts with label blueprint. Show all posts

Tuesday, May 15, 2018

NSX integration with vRealize Automation 7.4 - part 2

In part 1 of this post we presented the configuration at vRA level. In this post we'll see how to create a service in the Service Catalog for  programmatic NSX consumption.

First let's remember the main concepts of vRealize Automation service catalog:

  • catalog items are published in the service catalog for user consumption e.g Linux VM or 3 tier web app
  • catalog items can be grouped under different services: QA, Test&Dev, Web Apps, Linux Servers
  • a user is allowed to request a service item based on his entitlements; Entitlements define who has access to catalog items and what actions he can do 

For start, we'll create a service called Linux VMs and a new Entitlement called Allow Linux VMs. We'll entitle all users of the business group to the Linux VMs service. Using services in the entitlement instead of individual items we make sure that every new item mapped to this service will be automatically accessible to the users.

Administration > Catalog Management > Services

Administration > Catalog Management > Entitlements




Next we'll create a blueprint that deploys vSphere VMs. There are several ways to provision vSphere VMs, we will use linked clones because they are very fast and use deltas to keep the changes (which is good in labs). To use linked clones we need to create a golden image: a VM configured to the desired state.

First create the VM: deploy it from an existing template or create it from scratch. VM hostname and networking details will be configured at deployment during guest OS customization. For this to work we need VMware tools installed in the VM and a customization specification created in vCenter Server. 


No other special configuration is needed for the VM.

Optional step (vRA agent installation): if you don't plan to run scripts inside the guest OS of the vRA manged VM, you can skip this step. The installation should be pretty easy since VMware already provides a script that can handle it. Go to vRA appliance URL and download the script on your Linux VM:

 wget  https://vra_app_fqdn/software/download/prepare_vra_template_linux.tar.gz --no-check-certificate

Then extract the script from the archive and run it:

tar -xvzf prepare_vra_template_linux.tar.gz
cd prepare_vra_template_linux
./prepare_vra_template.sh  

Choose default agent type (vSphere), add the address of vRealize Appliance, manager service, accept the key fingerprints for the certificates, set the download timeout, and install JRE (if not already in the VM)




Now we have a VM with all the utils inside (VMware tools and optionally vRA agent) and we create the snapshot that will be the base for linked clones.

At this point we login to vRA portal and we start working on our service creation. Go to Design > Blueprints. Start creating a New blueprint. Type the name of the blueprint, assign an unique ID or leave the automatically generated one, limit the number of deployments per request (if you want). Add lease days to control the spawn of deployed VMs (especially for temporary environments) and add a period of time you want the item to be archived before deleting (when lease expires).

Since this is for demo, I've added a default lease of 1 day and no archival (automatic deletion after lease expires). On NSX Settings tab, choose the NSX transport zone and if you want to isolate the VMs deployed from this blueprint (allow only internal traffic between VMs).







Pressing OK button will take you to the canvas. From Machine Types category, drag and drop vSphere (vCenter) Machine


From Network&Security category, drag and drop On-Demand Routed Network


Select the vSphere__vCenter__Machine_1 components form the canvas and fill in the configuration details. Add the number of instances that can be deployed in a request 


Add build information: how the VM will be created (linked clone), where to clone it from, what customization specification to use:


Type the VM consumed resources: number of CPUs, memory, storage. Take care when configuring these values: if you allow 10 instances in a deployment, each instance with a maximum of 8 vCPU and 32 GB of RAM you may end up with a deployment using 80 vCPU and 320 GB of RAM. This is a good moment when approval workflows come into place.



Finally we need to connect the VM to the network. But first we'll configure the network component. On canvas select the On-Demand_Routed_Network_1 components and choose the parent network profile (profile that has been created in part 1) 


Go back to vSphere component, go to Network tab and click New. From drop down box select the network name

Lastly, add a custom property for the VM to define the operating system that is being used


At this moment we've configured how to create the VM, how to create the network and linked the VM to the network. Press Finish and then Publish the blueprint:


Once the blueprint has been published, it will appear under Administration > Catalog Management > Catalog Items. Select the new catalog item, press Configure and map it to the service created earlier at the beginning of the post. 


The service will appear in the Catalog tab and you can press Request to deploy a new instance of it. To see what is happening, go to Requests tab, select the request, press View Details and when the request details open press Execution Information


Here you will see that the vxlan has been created on demand and DLR reconfigured. Also the VM has been created and mapped to the new vxlan. The process can also be monitored in vCenter Server


After the provisioning finished successfully, the components will be displayed in Items tab from where they can be managed using day 2 operations.

Monday, August 14, 2017

New and cool features in vRealize Automation 7.3 - parameterized blueprints

vRealize Automation 7.3 has been released for a few months, but only last week I got time to update the lab and take a more serious look at it. And I really liked what I saw.

One of the first features that I saw made me smile because I remembered the times when clients requested it and I was going through the processes of explaining that it is possible, but it will need some customization and some workflow development. Now, in 7.3 there are parameterized blueprints which allows to define t-shirt sizes for VMs, It also provides image parameters - how that image is being built. This way the configuration of the VM can be hidden from the service consumer and using image parameters organization policies can be implemented without the need to create new blueprints. You could have only one Windows template that provides 2012, 2012 R2 and 2016 as simple as selecting from a drop down menu. 

In the end, the user gets the possibility to select whatever OS version is entitled to and the t-shirt size of that deployment.   

Let's see how we can get to this nice item request screen.

First we define the parameters. In vRA portal, go to Administration -> Property Dictionary -> Component Profiles. There are two component profiles already defined: Image and Size. 

We need to edit each one. By default, the component profiles have no values defined. Edit Size profile where we will configure CPU, memory, storage for vSphere virtual machines to be used in blueprints. Go to Value sets tab and press New:

Type in a display name (what the service consumer will see in the request form), a description (optional), configure the values for CPU, memory and storage and select the status (by default it is active and it can be used in blueprints). Press Save if you want to add more value sets or Finish to save and exit. Once a value set has been defined, it can be edited, deactivated or deleted.

Now let's define value sets for Image component profile and configure the build information for vSphere VMs. It is the same build information that traditionally configured at each blueprint's level, but this time it is defined as a series of parameters. Edit Image component profile, go to Value Sets tab and press New:

Type in the name display name, a description and then select how to build the VM. In my case, I've  selected Linked Clone and filled in the necessary parameters: VMware template to clone from, the snapshot to use, customization specification name. All other options existing in a blueprint still available:  create, clone, NetApp flex clone. 

Once we have defined the value sets and made them active, we can use them in blueprints. 

Go to Design - Blueprints and there is the choice to either modify and existing blue print or create a new one. I will modify an existing blueprint, since I want to reduce blueprint sprawl :-) 
Go to Design - Blueprints - Edit, in the blueprint select the vSphere machine component and on the tab go to  Profiles.

By default, no component profiles are selected, press Add and select which component profiles to use: Size, Image or both. 

Press OK and select from each component profile the value sets to use for this particular blueprint. I've used only two of the t-shirt sizes (large and xlarge) and selected large to be the default one:

Press Finish to save and exit. Since the blueprint was already published, we can go directly to Catalog and request the Item using the new t-shirt sizes. For a new item, you need first to publish it, map it to a service and ensure the users are entitled to request the item.