9 Replies Latest reply: Dec 7, 2011 10:21 AM by Jonathan Bishop RSS

ADDM -> CMDB Sync question (file systems)

Jonathan Bishop

Hello. I found this piece of TPL code on the communities here, and modified it slightly to suit my needs. The question I have is related to the CMDB and syncing discovered CIs. It appears that it's setting relationships on a 1:1 basis. The issue we're encountering is that we have the same filesystems mounted on dozens of systems, but it appears that when it does the syncing, it only creates a relationship for the last system (alphabetically, I presume it's creating and destroying relationships). Is there some way to discover a filesystem, and related it to the multiple computer systems it is mounted on?

 

tpl 1.5 module CMDB.Extension.ComputerSystem_Augment;

from CMDB.Host_ComputerSystem import Host_ComputerSystem 1.0;

syncmapping Host_FileSystem 1.0

"""

FileSystem mapped to BMC_LocalFileSystem or BMC_RemoteFileSystem

"""

overview

tags CMDB, Extension;

end overview;

mapping from Host_ComputerSystem.host as host

traverse Mounter:FileSystemMount:MountedFileSystem:FileSystem as fsmount

fsystem -> BMC_FileSystem;

end traverse;

end mapping;

body

computersystem := Host_ComputerSystem.computersystem;

for each fsmount do

// Check whether the kind is LOCAL or REMOTE

if fsmount.fs_kind = "LOCAL" then

fsystem := sync.BMC_LocalFileSystem(

key := fsmount.key,

Name := "%host.name%,%fsmount.fs_name%",

NameFormat := "HostName:FileSystem",

ShortDescription := fsmount.mount,

Description := "%host.name%: %fsmount.fs_name%: %fsmount.mount%"

);

else

fsystem := sync.BMC_RemoteFileSystem(

key := fsmount.key,

Name := "%fsmount.fs_name%",

NameFormat := "FileSystem",

ShortDescription := fsmount.mount,

Description := "%fsmount.fs_name%: %fsmount.mount%"

);

end if;

 

sync.rel.BMC_HostedSystemComponents(

Source := computersystem,

Destination := fsystem,

Name := "HOSTEDFILESYSTEM"

);

end for;

end body;

end syncmapping;

  • 1. Re: ADDM -> CMDB Sync question (file systems)
    Charles Oldham

    Jonathan one challenge is that the ADDM model of filesystems is not 1:1 with the CDM model.

     

    This is the ADDM model:

    ADDMfilesystemModel.png

    As you can see both the "local" and "remote" types of FileSystem nodes are actually per host i.e. "remote" is the local view of the remote filesystem. The actual shared filesystem is the one that is of type "exported". It's done this was as you can find the serving host and the client host in any order and also in practise many exported filesystems are actually subsections of other underlying filesystems.

     

    I would advise simply syncing "local" and "remote" as BMC_FileSystem

  • 2. Re: ADDM -> CMDB Sync question (file systems)
    Jonathan Bishop

    So, if I use BMC_FileSystem, discovery will relate it to all servers that it sees it on?

  • 3. Re: ADDM -> CMDB Sync question (file systems)
    Petrus Johansson

    The biggest (only) reason I can see to sync filesystems to CMDB is to support impact management.

    Many server parks include dediacted file servers, so if administrators need to upgrade or for whatever reason take any of them offline, what other servers are impacted? Using BMC_FileSystem, BMC_LocalFileSystem or BMC_RemoteFileSystem, the relationships between local and remote is the important piece.

     

    Something like:

     

    sync.rel.BMC_Dependency

                                                                          (Source := filesystem

                                                                          Destination := remotefilesystem

                                                                          Name := "MOUNTEDON"

                                                                          );

  • 4. Re: ADDM -> CMDB Sync question (file systems)
    Jonathan Bishop

    That's exactly why we are trying to do this. We have EMC storage mounted to multiple servers throughout our network and want to be able to determine what systems will be effected by taking a filesystem offline, etc.

     

    I'm still having tpl issues though. Now it doesn't seem to create any relationships.

     

     

    tpl 1.5 module CMDB.Extension.ComputerSystem_Augment;

    from CMDB.Host_ComputerSystem import Host_ComputerSystem 1.0;

    syncmapping Host_FileSystem 1.0

    """

    FileSystem mapped to BMC_LocalFileSystem or BMC_RemoteFileSystem

    """

    overview

    tags CMDB, Extension;

    end overview;

    mapping from Host_ComputerSystem.host as host

    traverse Mounter:FileSystemMount:MountedFileSystem:FileSystem as fsmount

    fsystem -> BMC_FileSystem;

    end traverse;

    end mapping;

    body

    computersystem := Host_ComputerSystem.computersystem;

    for each fsmount do

    // Check whether the kind is LOCAL or REMOTE

    if fsmount.fs_kind = "LOCAL" then

    fsystem := sync.BMC_LocalFileSystem(

    key := fsmount.key,

    Name := "%host.name%,%fsmount.fs_name%",

    NameFormat := "HostName:FileSystem",

    ShortDescription := fsmount.mount,

    Description := "%host.name%: %fsmount.fs_name%: %fsmount.mount%",

    FileSystemType := fsmount.fs_type,

    FileSystemSize := fsmount.size

    );

    else

    fsystem := sync.BMC_RemoteFileSystem(

    key := fsmount.key,

    Name := "%fsmount.fs_name%",

    NameFormat := "FileSystem",

    ShortDescription := fsmount.mount,

    Description := "%fsmount.fs_name%: %fsmount.mount%",

    FileSystemType := fsmount.fs_type,

    FileSystemSize := fsmount.size

    );

    end if;

     

    sync.rel.BMC_Dependency(

    Source := computersystem,

    Destination := fsystem,

    Name := "MOUNTEDON"

    );

    end for;

    end body;

    end syncmapping;

  • 5. ADDM -> CMDB Sync question (file systems)
    Rob Fernie

    One thing that I ran in to with relating anything to multiple hosts is the principal of a shared CI. If you relate nodes in ADDM to multiple hosts, but don't define the CI as shared in your syncmapping, it can have odd results-- in my experience it tends to relate the CI to the host which was last synched, deleting relationships previously made to other hosts. 

     

    Check out the "Shared CI" note here

    http://discovery.bmc.com/confluence/display/82/Syncmapping+block

  • 6. ADDM -> CMDB Sync question (file systems)
    Charles Oldham

    Rob unless you define the CI as shared then the syncmapping will regard it is solely maintained by the root node you are syncing and therefore any relationships that do not match those that have been found by that invocation of the syncmapping will be removed.

  • 7. Re: ADDM -> CMDB Sync question (file systems)
    Charles Oldham

    As a general point please consider the diagram of the ADDM model that I posted in light of the CDM model.

     

    Syncing the "Remote" FileSystem ADDM node as a shared CDM BMC_RemoteFilesystem node would be the wrong thing to do and will not do what you expect as there will be one per Host node that mounts the filesystem. The shared filesystem is represented by the "Exported" FileSystem ADDM node.

     

    Note Jonathon ADDM does not (currently) discover SAN storage so there is no "Exported" FileSystem node within ADDM and in fact no node that represents the shared filesystem just a per host view of what is mounted. The best you can do is to sync what ADDM does have, i.e the per host "local" and "remote" but I would recommend that those are synced as BMC_FilesSystem

     

    "local" and "remote" FileSystem nodes in the ADDM model are not the same semantics as BMC_LocalFileSystem and BMC_RemoteFileSystem CIs in the CDM model

  • 8. ADDM -> CMDB Sync question (file systems)
    Rob Fernie

    Charles, 

     

    How would you recommend defining relationships of this sort for the case in which the "host" that exports the filesystem is not on the roadmap to be discoverable as a host node? Indeed the impact knowledge for remote filesystems is valuable CMDB data.

  • 9. ADDM -> CMDB Sync question (file systems)
    Jonathan Bishop

    Charles - can you explain to me then how we should differentiate between local filesystems, and remote mounts?

     

     

    As far as shared syncmapping goes, I'm having some difficulties with that as well. I tried the following tpl, but got an error when I uploaded/activated it.

     

    Change to package template_FileSystem_MountedOn Failed because module CMDB.Extension.ComputerSystem_Augment 'Inconsistent containment for 'BMC_FileSystem' at line 34'.

     

    Line 34 is: fsystem := sync.shared.BMC_FileSystem(

    And here is the TPL I was trying to use.

     

     

    tpl 1.5 module CMDB.Extension.ComputerSystem_Augment;

    from CMDB.Host_ComputerSystem import Host_ComputerSystem 1.0;

    syncmapping Host_FileSystem 1.0

    """

    FileSystem mapped to BMC_LocalFileSystem or BMC_RemoteFileSystem

    """

    overview

    tags CMDB, Extension;

    end overview;

    mapping from Host_ComputerSystem.host as host

    traverse Mounter:FileSystemMount:MountedFileSystem:FileSystem as fsmount

    fsystem -> BMC_FileSystem;

    end traverse;

    end mapping;

    body

    computersystem := Host_ComputerSystem.computersystem;

    for each fsmount do

    // Check whether the kind is LOCAL or REMOTE

    if fsmount.fs_kind = "LOCAL" then

    fsystem := sync.BMC_FileSystem(

    key := fsmount.key,

    Name := "%host.name%,%fsmount.fs_name%",

    NameFormat := "HostName:FileSystem",

    ShortDescription := fsmount.mount,

    Description := "%host.name%: %fsmount.fs_name%: %fsmount.mount%",

    FileSystemType := fsmount.fs_type,

    FileSystemSize := fsmount.size

    );

    else

    fsystem := sync.shared.BMC_FileSystem(

    key := fsmount.key,

    Name := "%fsmount.fs_name%",

    NameFormat := "FileSystem",

    ShortDescription := fsmount.mount,

    Description := "%fsmount.fs_name%: %fsmount.mount%",

    FileSystemType := fsmount.fs_type,

    FileSystemSize := fsmount.size

    );

    end if;

     

    sync.rel.BMC_Dependency(

    Source := computersystem,

    Destination := fsystem,

    Name := "MOUNTEDON"

    );

    end for;

    end body;

    end syncmapping;