1 2 Previous Next 24 Replies Latest reply on Oct 9, 2017 1:56 AM by Devendra Dehadaraya

    Hostname customization in CLM 4.1

    Atul Matkar

      Hello All,

      I want to customize host name in CLM 4.1 please advice best approach or let me know if anybody did in past. requirement as below.

       

      1

      2

      3

      4-6

      7-12

      W/L

      A

      P/Q

      App/SQL/ORA/MTS/WEB

      00001

      OS- Win or Linux

      A- is constant

      Location of server

      Role either app or sql etc

      Sequance No

       

      example lapapp1 or waqsql2 etc.

      When user comes to hostname page the default value should populate like "lapapp1" or "waqsql2" depending on service offering. Same time host name field should be editable.

      As per my understanding remedy filter needs to be design, anything to change in BAO or PM?


      Thanks

      Atul.

        • 1. Re: Hostname customization in CLM 4.1
          Nitin Patil

          Atul,

           

          Yes, it is possible to customize the hostname generation by writing a Custom Hostname Advisor (CHA). Please go through the following link for details

          https://docs.bmc.com/docs/display/NP/Custom+Hostname+Advisor

           

          At a high level

          - Setup: Register CHA in CLM eco-system.

          - You'll do the UI customization to generate the hostname at the UI layer itself (or as you say have the user enter the "exact" hostname).

            - If you are not expecting any UI customization for this requirement, you may be able to completely eliminate or at least minimize need for any AR filters or other UI side changes. For e.g., if user will enter the hostname in the hostname prefix field, no additional effort is required to pass this data to CHA.

          - The CHA (which will be written using BAO) will look at the hostname supplied and return that back.

           

          CAUTION

          - From your explanation it seems like the user will be entering the "exact" hostname in the CLM UI. As you can imagine, this could get error prone and what if multiple users happen to enter the same name around the same time? So, unless this is a hard requirement, it'll be best to let the CHA append some sort of a counter to the user supplied prefix. You could also build some level of error checking to handle duplicates, race conditions, etc. Again, this should all be determined based on your requirement and the end-to-end usecase flow.

          - What if user requests quantity > 1 or the ResourceSet has multiple ComputeContainers? Since the user is entering only 1 hostname, situations like this could be problematic. Please note that the CHA is expected to return hostname(s) for all ComputeContainers in a ResourceSet.

           

          HTH,

          - Nitin

          • 2. Re: Hostname customization in CLM 4.1
            Atul Matkar

            1. cannot open link.

             

            2. Register CHA in CLM eco-system? Last i worked on clm was 2-3 years ago on 2.1. You mean in the workspace->configuration pannel?

             

            3. Yes will keep it as a free text so that users from china, japan, Indonesian will enter host name as per there need. Same time customer also want to auto populate host name field depending on condition like W if it is windows, A as in fix, Q for location of Data Center, sql/app (can we have it in option editor? same like we have for CPU/RAM/Network?) and then the counter. example "waqsql2".


            4. If the above customization is too complicated considering future upgrade etc? then i will keep it as free text and have only validation duplicate host name. Which form/cmdb/vc should i looks for existing  host name?


            5. will keep in-front of customer on "what if multiple users happen to enter the same name around the same time"


            6. I think it is good idea that CHA append 1,2,3...counter to the user supplied prefix.


            7. Customer is going to disable the quantity spin field. So one request for one server. I already told them we are leveraging this oob function of 1 request and multiple server provisioning.


            • 3. Re: Hostname customization in CLM 4.1
              Nitin Patil

              Atul,

               

              Please try the following link.

              https://docs.bmc.com/docs/display/public/clm30/Custom+Hostname+Advisor

               

              It covers #1 and #2. If you run into any issues, please contact BMC Support.

               

              Custom Hostname Advisor is written in BAO and can be used across CLM releases typically with minimal to no effort.

               

              Thanks

              • 4. Re: Hostname customization in CLM 4.1
                Lu Wang

                I don't seem to have access to the doc.

                 

                Get an error message whenever I try to go to the link:

                "You can not view this page due to inherited permissions"

                 

                Any idea how I can get the info?

                 

                Thanks.

                • 5. Re: Hostname customization in CLM 4.1
                  Abhishek Rai

                  Hi Lu,

                   

                  How are you doing?

                   

                  I checked the page and it looks like the page is being modified for additional information and its locked.

                   

                  Please try to access it again by Friday. I am sure by that time they should finish updating it.

                   

                  Regards,

                  Abhishek

                  • 6. Re: Hostname customization in CLM 4.1
                    Vinnie Lima

                    Hi Abhishek/Nitin,

                     

                    Looking at CHA for CLM 4.5, the links above reference a bao workflow which uses a file adapter. I am curious to know if there are any available bao workflows better developed for CHA implementations?  Also some of the XML sample input/output files in the links above seem to be corrupt and partially populated.

                     

                    Thanks,

                    Vinnie

                    • 7. Re: Hostname customization in CLM 4.1
                      Nitin Patil

                      Dear Vinnie,

                       

                      Please find the sample CHA response XML based on a working CLM 3.x CHA below. I do not have a recent example. But, this should work with minor tweaks, if needed.

                       

                      <CloudObjects>

                        <CloudObject class="HostnameAdvice">

                          <entry>

                            <string>hostname</string>

                            <list>

                              <string>SJCWMYWEB001</string>

                            </list>

                          </entry>

                        </CloudObject>

                        <CloudObject class="HostnameAdvice">

                          <entry>

                            <string>hostname</string>

                            <list>

                              <string>SJCWMYWEB002</string>

                            </list>

                          </entry>

                        </CloudObject>

                      </CloudObjects>

                       

                      Most CHAs we've seen are based on customer specific needs. There's perhaps some element of re-usability, but the logic is generally custom.

                       

                      HTH

                      • 8. Re: Hostname customization in CLM 4.1
                        Vinnie Lima

                        Thank you Nitin.  Yes I am working on the custom logic for this customer, just wanted to ensure the response to the output parameter was correct.

                        • 9. Re: Hostname customization in CLM 4.1
                          Vinnie Lima

                          Nitil,

                           

                          One more thing, it seems the CHA Provider registration references a GUID which is no longer present in CLM 4.5:

                           

                                            {

                                                  "cloudClass": "com.bmc.cloud.model.beans.AccessAttributeValue",

                                                  "accessAttribute": {

                                                      "cloudClass": "com.bmc.cloud.model.beans.AccessAttribute",

                                                      "datatype": "STRING",

                                                      "guid": "63f93467-af36-42b6-8481-f6d6d3b24e93",

                                                      "isOptional": false,

                                                      "isPassword": false,

                                                      "modifiableWithoutRestart": false,

                                                      "name": "AO_SERVER_ADAPTER_NAME"

                                                  },

                                                  "attributeValue": "Host_Adapter",

                                                  "name": "AO_SERVER_ADAPTER_NAME"

                                              }

                           

                          Can you confirm it is safe to remove this entry from the POST request when registering this provider? The following are the only attributes containing anything relevant to this entry:

                           

                          # grep AO_SERVER *.json

                          providers.json:      "name" : "AO_SERVER_URL"

                          providers.json:    "name" : "AO_SERVER_URL"

                          providers.json:      "name" : "AO_SERVER_GRID_NAME"

                          providers.json:    "name" : "AO_SERVER_GRID_NAME"

                          providers.json:      "name" : "AO_SERVER_USERNAME"

                          providers.json:    "name" : "AO_SERVER_USERNAME"

                          providers.json:      "name" : "AO_SERVER_PASSWORD"

                          providers.json:    "name" : "AO_SERVER_PASSWORD"

                          providers.json:      "name" : "AO_SERVER_URL"

                          providers.json:      "name" : "AO_SERVER_GRID_NAME"

                          providers.json:      "name" : "AO_SERVER_USERNAME"

                          providers.json:      "name" : "AO_SERVER_PASSWORD"

                          • 10. Re: Hostname customization in CLM 4.1
                            Nitin Patil

                            This is the json for your CHA Provider Definition, right? If yes, it's ok to remove the "guid" attribute from the json. In general, you can remove guids for any attributes as CLM will assign one. The only guids you should keep are the ones where you are drawing a reference to an OOB CLM artifact, such as, a parent provider guid.

                             

                            HTH

                            • 11. Re: Hostname customization in CLM 4.1
                              Vinnie Lima

                              Got it.  One last question, can you provide a clean copy of the input XML passed to AO?  The one in the link below is corrupted as well.

                               

                              https://docs.bmc.com/docs/download/attachments/349603650/RegisterProvider-Output.txt?version=1&modificationDate=14041418…

                              • 12. Re: Hostname customization in CLM 4.1
                                Nitin Patil

                                The attached CSM request XML is from a CLM 3.x deployment as well. So, you may find some differences in a CLM 4.x environment. So, use it as a reference only.

                                 

                                Thanks

                                • 13. Re: Hostname customization in CLM 4.1
                                  Vinnie Lima

                                  Hi Nitin,

                                   

                                  I have completed the CHA for our use case.  Ran into issue with the response format you provided above. I am passing the following response to CLM 4.5 for a Service Offering with Option Choices to increase ResourceSet count (Virtual Machine) set to 2:

                                   

                                  <CloudObjects>

                                    <CloudObject class="HostnameAdvice">

                                    <entry>

                                    <string>hostname</string>

                                    <list>

                                    <string>rt16vmabcxyz1</string>

                                    </list>

                                    </entry>

                                    </CloudObject>

                                    <CloudObject class="HostnameAdvice">

                                    <entry>

                                    <string>hostname</string>

                                    <list>

                                    <string>rt16vmabcxyz2</string>

                                    </list>

                                    </entry>

                                    </CloudObject>

                                  </CloudObjects>

                                   

                                  The following is received by Platform Manager:

                                   

                                  01 Dec 2015 20:29:05,242 [INFO] GENERIC_PROVIDER - [Thread=pool-100-thread-5(1534)] [Class=com.bmc.cloud.genericprovider.adapter.polling.AOAdapterPollingTask:AOAdapterPollingTask.doProcess()] - InvocationID:WorkflowID= 643c0341-da03-4792-9aac-09f11f8c8cf6:11d1def534ea1be0:7dcdad0c:150aa2dd923:-7ea01-1449030693269 Workflow Response as CloudObjects [{

                                    "cloudClass" : "com.bmc.cloud.model.beans.HostnameAdvice",

                                    "guid" : "5b7cb384-ea58-40a7-92e7-9ccafe54ffe4",

                                    "hostname" : [ "rt16vmabcxyz1" ]

                                  },{

                                    "cloudClass" : "com.bmc.cloud.model.beans.HostnameAdvice",

                                    "guid" : "6c482029-4fa3-4f42-9845-f4860759ba63",

                                    "hostname" : [ "rt16vmabcxyz2" ]

                                  }]

                                   

                                  Yet CLM is complaining about receiving only one hostname:

                                   

                                         "errorCause" : "The hostname number generated by HostnameAdvisor [1] is not the expected value [2] .",

                                   

                                  Could it possibly be an incorrect format? I suspect the following should be the response for multi-hostname (multiple resourceset) requests:

                                   

                                  <CloudObjects>

                                    <CloudObject class="HostnameAdvice">

                                    <entry>

                                    <string>hostname</string>

                                    <list>

                                    <string>rt16vmabcxyz1</string>

                                    <string>rt16vmabcxyz2</string>

                                    </list>

                                    </entry>

                                    </CloudObject>

                                  </CloudObjects>

                                   

                                  Can you confirm? I will try this in any case tomorrow and will update you if I don't hear back.

                                  • 14. Re: Hostname customization in CLM 4.1
                                    Amit Subhedar

                                    Yes. CLM expects list of hostnames in the HostnameAdvice object (and not multiple HostnameAdvice objects)  and it should match to the number of instances.

                                     

                                    So the correct format is  -

                                    {

                                      "cloudClass" : "com.bmc.cloud.model.beans.HostnameAdvice",

                                      "guid" : "5b7cb384-ea58-40a7-92e7-9ccafe54ffe4",

                                      "hostname" : [ "rt16vmabcxyz1","rt16vmabcxyz2" ]

                                    }

                                    1 2 Previous Next