1 2 Previous Next 26 Replies Latest reply on Oct 14, 2019 5:20 PM by Lisa Keeler Go to original post
      • 15. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
        Hitesh Jha

        Sorry for the misunderstanding.

        I got confused with custom pattern with sync mapping pattern.

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

          Thanks Lisa for your help and it's totally clear for me.But while uploading we are getting an error as below.

          1 tpl 1.12 module Extension.CMDB.VM_Tags;

          2

          3 from CMDB.SoftwareInstance_VirtualSystemEnabler import VirtualMachine_VirtualSystemEnabler 1.1;

          4

          5 syncmapping VM_Tags 1.0

          6 """

          7 Access VM tags.

          8 """

          9 overview

          10 tags Extension, CMDB;

          11 end overview;

          12

          13 mapping from VirtualMachine_VirtualSystemEnabler.vm_node as vm_node

          14

          15 body

          16 vse := VirtualMachine_VirtualSystemEnabler.vse;

          17 if vse = void then

          18 // vse CI is not always created

          19 stop;

          20 end if;

          21 tag_set := vm_node.tag_set;

          22

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

          24

          25 // Make sure the node has a tag_set attribute and

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

          27

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

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

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

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

          32 end if;

          33 end body;

          34

          35 end syncmapping;

          36

          37

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

            You must add

             

            end mapping;

             

            13 mapping from VirtualMachine_VirtualSystemEnabler.vm_node as vm_node

            14 end mapping;

            15 body

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

              Lisa,

              When checked further I have noticed we have different tags_set for different EC2 Instances as below.

               

              In the above scenario how we will sync the AWS tags on CMDB Class.

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

                Hi Hitesh,

                 

                Of course, 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.

                But, I realize a Remedy/CMDB upgrade is not undertaken lightly.

                 

                That's the problem with tags.  It is hard (or maybe impossible) to get a complete set of tag names.

                 

                One option is for you to continue hard-coding the tag names in the CMDB.... i.e. keep adding what you find.

                 

                Or, you could try to re-design the customization so you do something similar to what our new OOTB support does.

                 

                The new OOTB support for tags actually puts the tag-name and tag-value into the (newly-added) TagName / TagValue attributes on BMC_Tag, and it uses the newly-added BMC_RelatedTo relationship to related the BMC_Tags CI's to the parent CI.

                 

                You can see the full logic in the Tags.tpl (module=CMDB.Tags) in your August or later TKU.

                Here is an excerpt:

                 

                        ci := CloudCluster.cluster_ci                              or

                              CloudLoadBalancing.service_ci                        or

                              CloudDatabase.database_ci                            or

                              Database.database_ci                                 or

                              SoftwareCluster_Cluster.cluster_ci                   or

                              SoftwareInstance_ApplicationSystem.applicationsystem or

                              SoftwareInstance_SoftwareServer.softwareserver       or

                              Deployment_ConcreteCollection.deployment_ci          or

                              AdminCollection_AdminDomain.admin_ci                 or

                              VirtualMachine_VirtualSystemEnabler.vse;

                 

                        tag_set := node.tag_set;

                 

                        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");

                        end for;

                 

                 

                 

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

                  Hey Lisa,

                  I have extracted tags details for few AWS Instances so as per the above comment ..I need to hard coded all the below.Correct?

                  But I am confused with one thing how the  values will reflect in CMDB.

                  TagName := tag_name,

                  TagValue:= tag_value,

                   

                  I have raised the support case but for the same but they are stuck to one point only .i.e. CMDB upgradation.

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

                    Lisa,

                    I have uploaded the sync mapping pattern as below in order to retrieve AWS tags.

                     

                    but when I validate the same in CMDB no luck.

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

                      Hitesh,

                       

                      The custom syncmapping pattern is adding these attributes to the BMC_VirtualSystemEnabler:

                         Function

                         Product

                         Segment

                         ChargeCode

                       

                      Nothing is added to BMC_Tags.

                       

                      First, make sure those attributes have been added to BMC_VirtualSystemEnabler (you should see them in the core form).

                      Second, you must restart the Discovery services after adding the attributes.

                      Third, you can try the Sync again to see if those attributes get populate on BMC_VirtualSystemEnabler

                       

                      If they don't get populated, it would likely be because you had done a sync before steps 1&2 above.

                      In that case, you need to Resync so that you get those attributes populated.

                       

                      Also, depending on your Discovery and TKU version, you should change the version on your import statement, line 3.

                      Duncan's sample had used 1.1, but I see that in Discovery 11.3 August 2019 TKU the version for the CMDB.SoftwareInstance_VirtualSystemEnabler syncmapping is now 1.3.  Here is a cut&paste from that pattern:

                      syncmapping VirtualMachine_VirtualSystemEnabler 1.3

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

                        Thanks a lot lisa.

                        I will work with the CMDB Team and update you once it's done.

                        • 24. Re: How to sync cloud AWS Tags on CMDB vm class (VirtualSystemEnabler)
                          Vishnu Parihar

                          Hi, I was just wondering if we have separate custom class for Tags and other information.

                          What we need to do in that case ? Just change the class name like:

                           

                           

                          // custom class name is MS_PublicCloudTags

                          // i.e we have MS_PublicCloudTags instead of BMC_VirtualSystemEnabler

                          mapping

                               from VirtualMachine_PublicCloudTags.vm_node as vm_node

                          end mapping;

                           

                          body

                           

                               vse := VirtualMachine_PublicCloudTags.vse;

                                    if vse = void then

                                         // vse CI is not always created

                                         stop;

                                    end if;

                           

                          will it work ?

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

                            No. Don't blindly replace strings. You really need to read Syncmapping block - Documentation for BMC Discovery 11.3 - BMC Documentation to understand what the syncmapping syntax means.

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

                              Also, see my entry from Sep 3 on this thread.  You can use the BMC_Tags class OOTB if you meet the requirements.

                              1 of 1 people found this helpful
                              1 2 Previous Next