SovLabs Support

Submit a Ticket My Tickets
Welcome
Login

Adding multiple IP/DNS reservations without adding additional network cards to your blueprint

Overview

This how to will cover using the AIP (Additional IP) feature to create additional IP / DNS reservations without the need to add extra network cards to your virtual machine.  

NOTE:  This feature will reserve additional IP Addresses and DNS entries against your virtual machine.  Upon destroying that virtual machine those additional IP Addresses and DNS entries will be cleaned up. 
This feature DOES NOT add the IP addresses to your VMNIC on your Virtual Machine or within your Operating System.


Considerations

  • Using SovLabs IPAM/DNS module
  • Using SovLabs module 2020.7.0 and above
  • Property toolkit licensed to create dynamic profiles (If required)


Scenarios

Scenario 1

This will be a single additional IP Address being added to your VM and registered into your IPAM/DNS.  This is the simplest way to utilize this feature


Scenario 2

A drop down selection of 0 - 5 additional IP Addresses to be added to your VM that will automatically generate the unique name .  This will require property toolkit to be licensed.

I will be creating the following to make the selection dynamic

  • Property definition that is a drop down to select additional IPs 0 → 5
  • Property group starting with SVL_ to trigger the property toolkit which contains:
    • The property definition with the additional IPs to assign and display on the blueprint
    • SovLabs_CreateProperties property toolkit functionality to run a script to loop through how many additional IPs to reserve
    • The IPAM profile to use for these extra IPs (You can make this dynamic to select the appropriate ipam provider or use a different ipam provider than your vmnic0)
      • NOTE:  Please look up the name of your IPAM profile before hand

Procedure

Scenario 1


Setting up the custom properties

  1. In your VM blueprint, go to Properties (1) → Custom Properties (2) and click on New (3)


  2. Under Name, Enter SovLabs_Additional_IP_<Unique_NAME> for example SovLabs_Additional_IP_ExtraIP1


  3. In the value, enter the name of your IPAM profile you wish to use then click on OK
    NOTE:  The IPAM profile does not have to be the same as the one used for the VM itself.


  4. Click on Finish


  5. You can now deploy your VM and review the IPAM workflow. You will see that it runs the original ip and finds the extra value added to the blueprint. And checks both IP Addresses.
    2020-02-19 13:47:05.702] [I] Found existing property SovLabs_Additional_IP_ExtraIP1 on virtual machine prodExtra1ap01
    [2020-02-19 13:47:05.709] [I] Updating entity id (guid'6fdfd677-f1a7-4af9-8137-f183d02f0b1d') existing property: 'SovLabs_Additional_IP_ExtraIP1', value: 'Infoblox824_ipam' on virtual machine prodExtra1ap01

    [2020-02-19 13:47:06.936] [I] getNextIp operating with : provider:Infoblox824_Endpoint, type:Fixed IP
    [2020-02-19 13:47:06.938] [D] createNicSpecificProperties Hostname : prodExtra1ap01
    [2020-02-19 13:47:06.940] [D] Hostname is basename :prodExtra1ap01
    [2020-02-19 13:47:06.942] [D] Custom Property found: Appending/Replacing Nic Suffix label of ExtraIP1 to prodExtra1ap01-ExtraIP1
    [2020-02-19 13:47:06.943] [D] createIpamNicSpecificProperties created property SovLabs_Network_ExtraIP1.Hostname : ''prodExtra1ap01-ExtraIP1'

    [2020-02-19 13:47:09.212] [I] Checking 10.11.12.102 to see if it is reachable.
    [2020-02-19 13:47:14.219] [I] IP 10.11.12.102 in use : false
    [2020-02-19 13:47:14.225] [I] Checking 10.11.12.103 to see if it is reachable.
    [2020-02-19 13:47:19.228] [I] IP 10.11.12.103 in use : false
  6. You DNS will also register and look similar to the below
    2020-02-19 13:47:54.827] [I] validateDNSForEntry : Checking if SovLabs_Network_ExtraIP1.Hostname is empty.
    [2020-02-19 13:47:54.828] [I] Hostname is nic/interface specific.
    [2020-02-19 13:47:54.830] [I] Verifying DNS entries for Hostname: prodExtra1ap01-ExtraIP1.mydomain.net, IP Address: 10.11.12.103, Domain: mydomain.net
    [2020-02-19 13:47:54.832] [I] validateDNSForEntry : nic ExtraIP1 added forward=true; nic ExtraIP1 added reverse=true
    [2020-02-19 13:47:54.834] [I] Verifying DNS entries for Hostname: prodExtra1ap01-ExtraIP1.mydomain.net, IP Address: 10.11.12.103, Domain: mydomain.net
  7. In your IPAM Solution you will see entries created for both IP Addresses (In this example it is infoblox)


You can choose to add more than one additional IP address as long as the Names are unique for example:


Scenario 2


Creating your property definition (Drop down selection)

  1. Go to Administration (1) → Property Dictionary (2) → Property Definition (3) and click on New (4)


  2. Provide a name (1) and a Label (2)
  3. Select the Data Type (1) as String and required can be yes or no.  (If you select Yes, the person MUST select a number from the drop down)



  4. Set the Display As (1) as DropDown, values (2) as Static List and then click New (3) and enter name/value pairs or 0 → 5


  5. Once done you can click on OK to save your Property Definition.

Creating you property group and template text

  1. Click on Administration (2) → Property Dictionary (2) → Property Groups (3)  and then click on New (4)


  2. Provide a Name (Which will update the ID). Since this will use the property toolkit it must begin with SVL_. In this example I have named it SVL_Add_NICS_Scenario2


  3. In the properties area, click on NEW


  4. We will add the property definition you created here, for this example in the name field (1) enter IP_Counter, Leave the value field (2) blank and place a check in "Show in Request" (3) then click OK (4)



  5. We will now add a new value for our ipam profile.. I repeated the above except for placing a check in the "Show in Request". For this example I set my name to IPAMProfile and the value is the value of the ipam profile i wish to use.


  6. The last item we will create is the new property using the SovLabs_CreateProperties property toolkit feature.  Type the name as SovLabs_CreateProperties_<NAME> (Where name is your unique name for this property. In this example it is VIP)



  7. In the value field.  This is where we can use our template engine code.  This example is a mix of unless and for loops.  The code reads as follows:
    Unless the number you select 0, then run the following
    Set the value of "c" to equal your IP_Counter value (This is the drop down we created) and make this an absolute number
    For every item between 1 and c (c being the number you selected in your drop down) create the following name/value pairs "SovLabs_Additional_IP_VIP_{{i}} (Where i is the current value, the first value is 1 so this will be 1)","{{IPAMProfile}} (This is your ipam profile that you nominate)
    If i is less than c (The value you selected in the drop down) repeat but this time it will be the next value which is 2, and it will continue to loop until the value you selected exceed the value assigned to c.
    It will end and close the if statement and then close the for loop
    If the value you selected was 0 it will create the value pair of "Additional IPs","NONE" and end your script

    {% unless IP_Counter == '0' %}{% assign c = IP_Counter|abs%}[{% for i in (1..c) %}["SovLabs_Additional_IP_VIP{{ i }}","{{IPAMProfile}}"]{%if i < c %},{%endif%}{%endfor%}]{%else%}["Additional_IPs","None"]{%endunless%}


    Then click OK (Your field should look similar to the below image)



  8. You should now have 3 values in your SVL_ property group like below.  


  9. Click on OK to save your group


  10. You now have a property group ready to be added to your blueprint


Adding your property group for use on your blueprint

  1. Go to your Design and select the blueprint you wish to use for adding additional IP addresses dynamically
  2. In your blueprint,click on the VM then click on Properties (1) → Property Groups (2) → and then click on Add (3)


  3. In the list, look for the SVL_ property that you created earlier.  In this example I will place a check next to SVL_Add_NICS_Scenario2 (1) then click on OK (2)


  4. Now you will see on your blueprint the property group (1). You can click on Finish (2) to save your blueprint


  5. Now if you go to your catalog and request your blueprint. You will see on the blueprint you have an extra drop down box



  6. If i submit this blueprint.  I will see the following in the Property Toolkit machineRequested workflow (You will see that the 2 additional IP names and ipam have been created)
    [2020-02-20 20:27:41.796] [D] Searching for SovLabs_CreateProperties
    [2020-02-20 20:27:41.800] [W] Unable to parse property SovLabs_CreateProperties_VIPS :SyntaxError: Unexpected token in object literal Will try to apply templating to the value {% unless IP_Counter == '0' %}{% assign c = IP_Counter|abs%}[{% for i in (1..c) %}["SovLabs_Additional_IP_VIP{{ i }}","{{IPAMProfile}}"]{%if i < c %},{%endif%}{%endfor%}]{%else%}["Additional_IPs","None"]{%endunless%}
    [2020-02-20 20:27:41.805] [I] Processing : [["SovLabs_Additional_IP_VIP1","Infoblox824_ipam"],["SovLabs_Additional_IP_VIP2","Infoblox824_ipam"]]
    [2020-02-20 20:27:41.807] [I] Array PROP: ["SovLabs_Additional_IP_VIP1", "Infoblox824_ipam"]
    [2020-02-20 20:27:41.810] [I] Array PROP: ["SovLabs_Additional_IP_VIP2", "Infoblox824_ipam"]
    [2020-02-20 20:27:41.822] [D] Processing Properties: [{"name":"SovLabs_Additional_IP_VIP1","value":"Infoblox824_ipam","hidden":false,"runtime":false,"encrypted":false,"doNotUpdate":false},{"name":"SovLabs_Additional_IP_VIP2","value":"Infoblox824_ipam","hidden":false,"runtime":false,"encrypted":false,"doNotUpdate":false}]
    [2020-02-20 20:27:41.844] [D] SovLabs Property Toolkit found some tags so NOT skipping!
    [2020-02-20 20:27:41.966] [I] Found existing property SovLabs_Additional_IP_VIP1 on virtual machine dduri-001403
    [2020-02-20 20:27:41.970] [I] Updating entity id (guid'ebcea931-47ce-42cf-adce-151d5b3bbf25') existing property: 'SovLabs_Additional_IP_VIP1', value: 'Infoblox824_ipam' on virtual machine dduri-001403
    [2020-02-20 20:27:42.102] [I] Found existing property SovLabs_Additional_IP_VIP2 on virtual machine dduri-001403
    [2020-02-20 20:27:42.105] [I] Updating entity id (guid'ebcea931-47ce-42cf-adce-151d5b3bbf25') existing property: 'SovLabs_Additional_IP_VIP2', value: 'Infoblox824_ipam' on virtual machine dduri-001403
  7. In the IPAM machineBuilding workflow you will see the following
    [2020-02-20 20:29:18.986] [I] Found existing property SovLabs_Additional_IP_VIP1 on virtual machine prodDocoap01
    [2020-02-20 20:29:18.989] [I] Updating entity id (guid'ebcea931-47ce-42cf-adce-151d5b3bbf25') existing property: 'SovLabs_Additional_IP_VIP1', value: 'Infoblox824_ipam' on virtual machine prodDocoap01
    [2020-02-20 20:29:19.105] [D] Version was inconsistent in resource, but content was consistent. Continuing.
    [2020-02-20 20:29:19.134] [D] Version was inconsistent in resource, but content was consistent. Continuing.
    [2020-02-20 20:29:19.186] [I] Found existing property SovLabs_Additional_IP_VIP2 on virtual machine prodDocoap01
    [2020-02-20 20:29:19.190] [I] Updating entity id (guid'ebcea931-47ce-42cf-adce-151d5b3bbf25') existing property: 'SovLabs_Additional_IP_VIP2', value: 'Infoblox824_ipam' on virtual machine prodDocoap01
    [2020-02-20 20:29:19.296] [D] Version was inconsistent in resource, but content was consistent. Continuing.
    [2020-02-20 20:29:19.319] [D] Version was inconsistent in resource, but content was consistent. Continuing.
    [2020-02-20 20:29:19.374] [I] Found existing property SovLabs_IPAMProfile_nic0 on virtual machine prodDocoap01
    [2020-02-20 20:29:19.376] [I] Updating entity id (guid'ebcea931-47ce-42cf-adce-151d5b3bbf25') existing property: 'SovLabs_IPAMProfile_nic0', value: 'Infoblox824_ipam' on virtual machine prodDocoap01
    [2020-02-20 20:29:20.399] [D] Custom Property found: Appending/Replacing Nic Suffix label of VIP2 to prodDocoap01-VIP2
    [2020-02-20 20:29:20.401] [D] createIpamNicSpecificProperties created property SovLabs_Network_VIP2.Hostname : ''prodDocoap01-VIP2'
    2020-02-20 20:29:20.675] [D] IP: 10.30.58.105
    [2020-02-20 20:29:20.678] [D] Getting IPAM Profile Infoblox824_ipam
    [2020-02-20 20:29:20.876] [D] Custom Property found: Appending/Replacing Nic Suffix label of VIP1 to prodDocoap01-VIP1
    [2020-02-20 20:29:20.877] [D] createIpamNicSpecificProperties created property SovLabs_Network_VIP1.Hostname : ''prodDocoap01-VIP1'
    [2020-02-20 20:29:21.222] [D] IP: 10.30.58.106
    [2020-02-20 20:29:24.086] [I] Checking 10.30.58.104 to see if it is reachable.
    [2020-02-20 20:29:29.092] [I] IP 10.30.58.104 in use : false
    [2020-02-20 20:29:29.097] [I] Checking 10.30.58.105 to see if it is reachable.
    [2020-02-20 20:29:34.102] [I] IP 10.30.58.105 in use : false
    [2020-02-20 20:29:34.108] [I] sa length1
    [2020-02-20 20:29:34.109] [I] Checking 10.30.58.106 to see if it is reachable.
    [2020-02-20 20:29:39.112] [I] IP 10.30.58.106 in use : false
    [2020-02-20 20:29:39.117] [I] sa length1
  8. In the DNS machineBuilding workflow you will see entries similar to
    2020-02-20 20:30:05.252] [I] Hostname from SovLabs_Network_VIP1.Hostname is prodDocoap01-VIP1.my.domain
    [2020-02-20 20:30:05.254] [I] Updating vmProperties property SovLabs_Network_VIP1.Hostname
    [2020-02-20 20:30:05.256] [I] Hostname is prodDocoap01-VIP1.my.domain
    [2020-02-20 20:30:05.258] [I] Updating VM entity property SovLabs_Network_VIP1.Hostname
    [2020-02-20 20:30:05.260] [I] ipAddress: 10.30.58.106
    2020-02-20 20:30:20.412] [I] Verifying DNS entries for Hostname: prodDocoap01-VIP2.my.domain, IP Address: 10.30.58.105, Domain: my.domain
    [2020-02-20 20:30:20.415] [I] validateDNSForEntry : nic VIP2 added forward=true; nic VIP2 added reverse=true
    [2020-02-20 20:30:20.416] [I] Verifying DNS entries for Hostname: prodDocoap01-VIP2.my.domain, IP Address: 10.30.58.105, Domain: my.domain
    [2020-02-20 20:30:20.418] [I] Valdiating DNS Entries...
    [2020-02-20 20:30:20.420] [I] validateDNSForEntry : Checking if SovLabs_Network_VIP1.Hostname is empty.
    [2020-02-20 20:30:20.422] [I] Hostname is nic/interface specific.
    [2020-02-20 20:30:20.423] [I] Verifying DNS entries for Hostname: prodDocoap01-VIP1.my.domain, IP Address: 10.30.58.106, Domain: my.domain
    [2020-02-20 20:30:20.426] [I] validateDNSForEntry : nic VIP1 added forward=true; nic VIP1 added reverse=true
    [2020-02-20 20:30:20.427] [I] Verifying DNS entries for Hostname: prodDocoap01-VIP1.my.domain, IP Address: 10.30.58.106, Domain: my.domain
    [2020-02-20 20:30:20.429] [I] Valdiating DNS Entries...
  9. In your IPAM/DNS (In this example it is infoblox) you will see your reserved IPs

Additional information

SovLabs IPAM and DNS Module Documentation : http://docs.sovlabs.com/latest/vRA/7.6/modules/#endpoint-integrations
SovLabs Template Engine Documentation : http://docs.sovlabs.com/latest/vRA/7.6/framework/sovlabs-template-engine/basics/intro/
SovLabs Property Toolkit Documentation : http://docs.sovlabs.com/latest/vRA/7.6/modules/vra-toolkits/property-toolkit/

Did you find it helpful? Yes No

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