SovLabs Support

Submit a Ticket My Tickets
Welcome
Login

Dynamically select a lifecycle profile


Overview

In this how to, we will run through how to use your existing modules and have them defined in a Lifecycle profile in the modules and scripts area. 

This will allow you to create a single Lifecycle profile that will apply multiple configurations such as:

  • Naming Standard
  • IPAM
  • DNS
  • Active Directory
  • Notifications
  • and so forth


Scenario 1

The first scenario will be a single blueprint that has a single lifecycle profile that applies a default configuration of:

  • IPAM
  • AD configuration
  • Naming Standard


Scenario 2

The second scenario we will leverage a property on your blueprint to apply a different lifecycle profile that contains different IPAM, AD Configuration and Naming Standard to either a production server opposed to a Non production server.


Considerations

  • Have licensed the Lifecycle Toolkit
  • Have licensed any other modules you wish to use in the Lifecycle Toolkit
  • Have configured other modules and these are already working
  • You have already configured lifecycle profile and associated configurations following the documentation (see Additional Information for links)
  • Understand where to check for workflow runs in vRO
  • Have configured / know how to configure an EBS (Subscription)



Procedure


Configuring a subscription (AS required)


Depending on what you are trying to achieve and when in the lifecycle you need your lifecycle profile to run, you may need to configure a EBS (Subscription) to run at a different point compared to the defaults that SovLabs have configured.

  1. In your vRA Catalog, search for lifecycle and then click request on Manage Lifecycle EBS - SovLabs Modules

  2. In the Action drop down leave this as Create, in the Lifecycle drop down, you will need to select at which stage of the lifecycle you want this to execute. For example this example, I will leave Machine Building

  3. In the Priority field, you will enter at which stage you want this subscription to trigger. If you check under the Current Machine Building EBS.  You will see different module priorities.  If you needed this to run before DNS machineBuilding but After IPAM machineBuilding, you would set the priority between 1200 and 1300, so 1250 could be useful.

  4. In the timeout (mins) field, the default is 180 minutes, Depending on what you were doing, you could make this lower. I will leave this as default for now.

  5. Click on Submit

Linking a subscription (AS Required)


To link a subscription to a lifecycle profile, you need to reference them when creating your lifecycle profile.  Below is information on where this is linked.

  1. From within your lifecycle profile after you have selected the module/s to trigger and/or scripts to run. You would click on the lifecycle state you set your EBS (Subscription) for.  In this example it is a machineBuilding phase.

  2. From within this area, you will now see you have the EBS (Subscription) you created with a priority of 1250, you would select against which module you need to run at your designated priority.  For example, I want the AD to run earlier, so, i would place a check next to the 1250 profile within the AD module.

  3. Click on Submit

Scenario 1


Configuring your Lifecycle profile

  1. In your vRA org select Catalog and search for Add Lifecycle profile - SovLabs Modules, click on request


  2. Give your Lifecycle profile and name then click on Modules and Scripts


  3.  Under Modules and Scripts, in this example we will select the appropriate AD profile, IPAM Profile and Naming Standard and click on Submit.

  4.  You have now create your Lifecycle profile and we will use this profile to add to a blueprint.


Adding your Lifecycle profile to your blueprint

  1. Open your blueprint you want to add your Lifecycle profile too and click on Properties → Property Groups

  2. Click on Add

  3. On the pop up window, find the profile you created (It will begin with SovLabs-LCProfile-<Tenant>_<Profile Name>, select your profile and click OK

  4. Now you will see your Lifecycle Profile on your blueprint. 

  5. Click on Finish. Make sure your blueprint is published.


Deploying your blueprint


To validate this all worked, check the naming, AD and IPAM profiles that were in your Lifecycle profile and that these align with your deployment. Deploy from your newly updated or created blueprint.

  1. In this example
  2. AD profile 
    1. {% if Environment == 'P'  %}OU=Prod,OU=dduri,OU=build,DC=sovlabs,DC=net{% else %}OU=NonProd,OU=dduri,OU=build,DC=sovlabs,DC=net{% endif %}


  3. IPAM = Subnet of [10.30.58.0/24] | DNS Suffix : infoblox824.sovlabs.net
  4. Naming Standard
    1. {{Naming_Team | downcase}}{{Naming_Environments | downcase}}{{DataCenter}}{{Naming_AppName | downcase}}{{Naming_ServerType | downcase}}{{sequence.Naming_ServerName}}


  5. In vRO check against naming, ipam and ActiveDirectory workflows to see that the Lifecycle Profile properties have applied.
    1. IPAM


    2. Active Directory

    3. Naming

  6. You have deployed a Machine that has multiple attributes but you only needed to add one item to your blueprint properties instead of 3.



Scenario 2


This scenario follows on from the first scenario.  Please take this time to build a second Lifecycle profile that you will be using.  In this example I have a prod and non prod profile that will have different IPAM profiles.  My Active Directory module already selects between production and non production folders so this will remain the same.


Configuring a property group to use a templated item

  1. Click on Administration → Property Dictionary → Property Groups

  2. On the right, find a LCProfile as we will copy one of them. Highlight one and click Copy

  3. In the new profile we are creating, Provide a Name for it and a matching description

  4. In the properties box, you will see "SovLabs_LCProfile".  The value next to it is a single profile, we will want to amend this to reference a dynamic value, This could be anything you wish, but make it meaningful.  I will make my value {{ SovLabs_LCProfile }} (Don't forget the Squiggly brackets, see the additional information section for links on how to use the property toolkit)

  5. Click on OK to save your newly created dynamic Lifecycle profile property group

Configuring your blueprint to choose between Lifecycle profiles


  1. Open your blueprint and go to properties → Custom properties

  2. Click on the New button to create a new custom property and type in a new property that starts with SovLabs_CreateProperties_ (This is part of the property toolkit, See additional information for links) . In this example I have named my custom property SovLabs_CreateProperties_LCPSelect

  3. In the value section.  We are going to provide an IF state that if the environment selected is production, then, apply the production production lifecycle profile, else, apply the non-prod lifecycle profile.

    1. The code breakdown is below
      1. {"name""<Name of Lifecycle Property Group Dynamic Value>","value""{% if <Named value on your blue print> == '<Value you want it to equal>' %}<Prod server profile>{% else %}<Non prod server profile>{% endif %}"}


    2. The code I will be using in this example has the Dynamic value we created in the Lifecycle profile property group and the production and non production Lifecycle profiles we created earlier.
      1. {"name""SovLabs_LCProfile","value""{% if Naming_Environments == 'P' %}Prod_Server_Profile{% else %}NonProd_Server_Profile{% endif %}"}


  4. Click on Property Groups and remove and existing Lifecycle profiles you may have, then, click on Add.

  5. Find the Lifecycle profile property group you created earlier that has the template dynamic value and click OK

  6. Now you have added the dynamic Lifecycle property group to your blueprint, click on OK

  7. Your blueprint will now apply the appropriate Lifecycle profile depending on your Production or Non production selection.


Results from deploying your blueprint in the lifecycle profile


The below shows you the behavior of your Lifecycle profile when you select a production server or a non production server.  You will see that the Naming standard and IPAM are different between the two.  AD Placement is common as this already has logic built in to place my machine in the correct OU for production and non production.

  1. Lifecycle Components Toolkit → Lifecycle Components Toolkit machineRequested
    1. production

    2. Non Production

  2. The completed jobs in vRA for the production and non production servers. You will see that the names provided have a different format and the IP Address ranges are different. This depicts that different profiles have applied.
    1. Production

    2. Non Production



Additional information


Setting up vraCafe endpoint and EBS: http://docs.sovlabs.com/latest/vRA/7.5/modules/vra-toolkits/lifecycle-toolkit/setup/

SovLabs Template Engine: http://docs.sovlabs.com/latest/vRA/7.5/framework/sovlabs-template-engine/basics/intro/

SovLabs Property Toolkit Usage: http://docs.sovlabs.com/latest/vRA/7.5/modules/vra-toolkits/property-toolkit/usage/

SovLabs Property Toolkit Examples: http://docs.sovlabs.com/latest/vRA/7.5/modules/vra-toolkits/property-toolkit/examples/

SovLabs Lifecycle Toolkit setup: http://docs.sovlabs.com/latest/vRA/7.5/modules/vra-toolkits/lifecycle-toolkit/setup/


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.