1 2 Previous Next 26 Replies Latest reply on Oct 14, 2019 5:20 PM by Lisa Keeler

    How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)

    Marco Del Papa
      Share This:

      Hello everyone,

       

      we would like to understand how can we bring the "AWS Tags" dicovered with the Cloud API on the relative CMDB classes (we have already created the new fields for those tags on the classes)

       

      On the ADDM vm nodes page for example, we can see a Tags [tag_set] atrribute that contatins all the AWS Tags of our interest.

       

                                                                                                
      Now if we look to the code of our CMDB.SoftwareInstance_VirtualSystemEnabler pattern, we can see that the cmdb sync.shared function, is missing the sync for AWS Tags.

       

      We would like to enanche the sync.share function to the CMDB with the discovered tags, we made some tries, but none of the is working:

       

      $cmdbfieldname$ := tag_set[$TAGNAME$]

      $cmdbfieldname$ := vm_node.$TAGNAME$

      $cmdbfieldname$ := vm_node.tag_set[$TAGNAME$]

       

      We need help to modify this pattern, or at least create an augment sync pattern for it.

       

      We have customized some ootb patterns and also created augument for other cmdb classes, and we never had issue so far. (but I'm not expert at all, to be honest)

       

      This time we are facing some difficulties to create/modify this pattern.

       

      We cannot even try to create a different ADDM modelling for those tags (since the tags are discovered with the aws.addtags function in the AmazonWebServices.EC2 pattern), that we don't know how to handle.

       

      I saw somewhere here in the community that someone created a CMDB.Extension.VirtualSystemEnabler_Augment.VirtualSytemEnabler_Augment pattern, that was for the cloud tag handling, but no tpl code was shared

       

      Let me know when you can.

       

      Regards

       

      Fabio De Biase

      Phone: +39 3428014190

       

        • 1. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
          Duncan Grisby

          You should not edit the base mappings. You should use extension mappings, otherwise your edits are overwritten whenever you do a TKU update.

           

          This works (with appropriate names inserted, of course):

           

          tpl 1.12 module Extension.CMDB.VM_Tags;

           

          from CMDB.SoftwareInstance_VirtualSystemEnabler import VirtualMachine_VirtualSystemEnabler 1.1;

           

          syncmapping VM_Tags 1.0

              """

              Access VM tags.

              """

              overview

                  tags Extension, CMDB;

              end overview;

           

              mapping from VirtualMachine_VirtualSystemEnabler.vm_node as vm_node

              end mapping;

           

              body

                  vse := VirtualMachine_VirtualSystemEnabler.vse;

           

                  if vse = void then

                      // vse CI is not always created

                      stop;

                  end if;

           

                  tag_set := vm_node.tag_set;

           

                  if tag_set and "My.Tag.Name" in tag_set then

                      // Make sure the node has a tag_set attribute and

                      // that it has the tag we want in it.

           

                      vse.MyTagField := tag_set["My.Tag.Name"];

           

                  end if;

           

              end body;

          end syncmapping;

          3 of 3 people found this helpful
          • 2. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
            Lisa Keeler

            Note for everyone:

             

            If you add attributes to the CMDB (for the purpose of adding tags information), such as adding new attributes to the BMC.CORE:BMC_VirtualSystemEnabler, then after adding the attributes, you must restart the Discovery services.

             

            After those 2 steps, then you can test a syncmapping extension pattern such as Duncan provided.

            2 of 2 people found this helpful
            • 3. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
              Lisa Keeler

              UPDATE:

              The August TKU for Discovery has a new syncmapping for cloud TAGS:  Tags.tpl is the new syncmapping.  module=CMDB.Tags

               

              DETAILS:

              The new syncmapping syncs data to (the existing class):  BMC.CORE:BMC_Tag

              New attributes for BMC_Tag have been added to the CDM:  TagName, TagValue

              There is a new relationship in the CDM:    BMC.CORE:BMC_RelatedTo

               

              Excerpt from the new syncmapping:

              "

                      for tag_name in tag_set do

                          tag_value := tag_set[tag_name];

                          tag_ci := sync.shared.BMC_Tag(

                              key              := "%node.key%/%tag_name%",

                              Name             := "%tag_name% : %ci.Name%",

                              ShortDescription := tag_name,

                              Description      := "%tag_name% : %ci.Description%",

                              TagName          := tag_name,

                              TagValue         := tag_value,

                              Company          := ci.Company,

                              Category         := "Miscellaneous",

                              Type             := "Metadata",

                              Item             := "Tag");

               

                          sync.rel.BMC_RelatedTo(

                              Source      := ci,

                              Destination := tag_ci,

                              Name        := "ITEMWITHTAG");

              "

               

              REQUIREMENTS:

              1) Customer must upgrade to an Atrium CMDB or Remedyforce version which supports the new attributes (TagName, TagValue) on BMC_Tag, and supports the new relationship, BMC_RelatedTo.

              2) Customer must have the August 2019 TKU for Discovery.

               

              To my knowledge, the Atrium CMDB release is not yet available to support the new requirements.

               

              RemedyForce (summer 2019) already has added the new requirements.

               

               


              SUGGESTIONS FOR TESTING with Remedyforce:

              After you set up the necessary software, then I would advise to create a new CMDB Sync connection from Discovery and point it to the RF sandbox.  Then, perform a Resync from Discovery, and check that the Remedyforce data looks correct (in the sandbox).

               

              If all is well, then you can continue by Sync'ing your CloudService data to RF on your normal connection.  You don't need to perform a Resync of your regular connection.

              Basically, you can just Select All CloudService nodes (from Explore->Data) in Discovery and then Actions->CMDB Sync.

              1 of 1 people found this helpful
              • 4. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                Vishnu Parihar

                Hi Lisa,

                 

                could you please tell me exact path to this new TPL.

                I have already deployed August and September month TKU but not able to find this Tag TPL in my Discovery 11.3 environment.

                 

                May I looked on a wrong path !

                 

                Thanks

                Parihar

                • 5. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                  Andrew Waters

                  The syncmapping module is CMDB.Tags

                  2 of 2 people found this helpful
                  • 6. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                    Duncan Grisby

                    The new BMC_Tag attributes and the BMC_RelatedTo class were added in CMDB 19.08: Summary of changes to the Common Data Model - Documentation for BMC CMDB 19.08 - BMC Documentation

                    2 of 2 people found this helpful
                    • 7. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                      Hitesh Jha

                      Lisa,

                      In our environment CMDB version is 9.1.03

                      Correct me if I am wrong using the above sync mapping extension pattern we can extract the AWS tags details to the CMDB inside the class ( BMC.CORE:BMC_VirtualSystemEnabler)

                      • 8. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                        Lisa Keeler

                        You could use Duncan's TPL with CMDB 9.1.03 to get the tags data into the BMC.CORE:BMC_VirtualSystemEnable class.

                         

                         

                        It would be better upgrade to CMDB 19.08 so you can use the OOTB syncmappings with August 2019 TKU (or later) to sync the information to BMC_Tags class.

                        2 of 2 people found this helpful
                        • 9. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                          Hitesh Jha

                          Lisa,

                          I am looking to add below attributes from AWS tags into the BMC.CORE:BMC_VirtualSystemEnable class.

                          I guess we need to edit the above extension mapping as below in order to achieve the same.

                          tag_set := vm_node.tag_set;

                           

                                  if tag_set and "My.Tag.Name" in tag_set then

                          vse.Funtion := tag_set["Function"];

                          vse.Product := tag_set["Product"];

                          vse.Segment := tag_set["Segment"];

                          vse.ChargeCode := tag_set["ChargeCode"];

                          • 10. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                            Lisa Keeler

                            Hi Hitesh,

                             

                            Yes, I think you are on the right track with the mapping. 

                             

                            BUT:

                            You need to add those attributes to the CMDB of course.

                            After adding the attributes to the CMDB, then you need to restart Discovery services so it reads the new CMDB data model.

                             

                            After that, you can test your syncmapping pattern.

                             

                            Lisa

                            2 of 2 people found this helpful
                            • 11. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                              Hitesh Jha

                              Thanks a lot for your help.I will do the testing and update the same.

                              • 12. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                                Hitesh Jha

                                Hey Lisa,

                                I have uploaded the sync mapping extension pattern and also created the custom attributes to the CMDB.

                                Do we need to upload the template_cmdb_cs_augment as well for syncing those attributes or Discovery services restart will work ?

                                • 13. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                                  Brice-Emmanuel Loiseaux

                                  Didn't you wrote that you uploaded the syncmapping extension for synching the custom attributes? So you are fine. Why do you mention a template (an example to be completed) here?

                                  • 14. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                                    Lisa Keeler

                                    The "template(s)" are used for creating a new syncmapping extension pattern.  And, you already have a syncmapping extension pattern.

                                    So, you only need to restart the discovery services.

                                     

                                    After that, test the Sync ... either by discovering the Cloud again, or by navigating in the UI to a CloudService, and then Actions->Sync to CMDB

                                    1 of 1 people found this helpful
                                    1 2 Previous Next