Smarts IP Manager : Why does sm_adapter -S flag subscription functionality request credentials twice?
search cancel

Smarts IP Manager : Why does sm_adapter -S flag subscription functionality request credentials twice?

book

Article ID: 332142

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms:




The -S flag used in conjunction with sm_adapter command (instead of -s) should re-establish connection to a server, providing a smooth transition from DISCONNECTED to CONNECTED state. 

You are forced to enter admin + password twice:


[root@linvm246 bin]# ./sm_adapter -s WIMBO-AM-PM --subscribeProp=*::*::*
Server WIMBO-AM-PM User: admin
admin's Password: XXXXXXXXXX
Server WIMBO-AM-PM User: admin
admin's Password: XXXXXXXXXX
1421819976|CONNECT|WIMBO-AM-PM|
[1]+  Stopped                 ./sm_adapter -s WIMBO-AM-PM --subscribeProp=*::*::*
[root@linvm246 bin]#

Environment

VMware Smart Assurance - SMARTS

Cause

Below are the list of Back-End (Server) Options:
   [--server=self]               Connect driver to local repository; the default.
    --server=null                 Do not connect to any server.  Useful for debugging offline in combination with --traceServer.
    --server=<name>          Connect driver to remote server. Also -s <name>.
    --rserver=<name>         Auto-reconnect driver to remote server. Also -S <name>.
    --description=<desc>    Description of this adapter; sent to remote server.
    --mcast=<name>          Connect driver to a local subscription server.
    --locale=<locale>          Specify the locale. Over-rides the value of the SM_LOCALE environment variable.

These are 3 options to be noted :
        
[--server=self]              Connect driver to local repository; the default.
 --server=null                Do not connect to any server.  Useful for debugging offline in combination with  --traceServer.
 --server=<name>         Connect driver to remote server. Also -s <name>.
 --rserver=<name>        Auto-reconnect driver to remote server. Also -S <name>.
     

         --server=self means to the default INCHARGE-AM-PM running on 426 broker and --server=<server_name> or -s means connect to a different server running on a different broker by specifying the server name along with the broker port. 
            
            --rserver=<name>  Auto-reconnect driver to remote server. Also -S <name>. is something like, when there is a disconnect the previous ones will stop the adapter. But specifying the server with -S i.e capital S will reconnect the server if there is a disconnect.
            

Say for example, if you use sm_adapter -s <server_name> for some processing and somehow there was a disconnect in such case, the sm_adapter will terminate as the connection with the server is lost. sm_adapter is a just a client to the running sm_server so if the connection is lost, the client also stops working. If -S is specified and if there is an disconnect in the connectivity then the adapter will not terminate rather it will wait for re-connect like how SAM does with IP domain.

Resolution

This is expected behavior with subscribing events see the below resolution:

In GA_DriverBase::createParser(), we generate the front and back end.

Generate the front end:-

During generation of front-end we call feObj.getFrontEnd() which in turns calls the following sequence of routines: GA_Server::attachServer() => GA_RemoteServer::getServerInterface() => SM_Broker::attachServer() => SM_Broker::attachServer() => _sm_attach_dm_host_port() => attach_dm_host_port() => CI_Authority::Get_Credentials() => CI_Authority::do_prompt().

Generate the backend:-

We call beObj.attachServer() which in turn calls same sequence of routines, ends up with do_prompt().
do_prompt() is the actual routine being called to provide the user credentials.
This portion of code GA_DriverBase::createParser() is same in latest version even and caused the same behavior.

As a workaround, We can bypass this entry by adding tee as shown below :

[root@linvm246 bin]# ./sm_adapter -s WIMBO-AM-PM --subscribeProp=*::*::* | tee
1421820015|CONNECT|WIMBO-AM-PM|
SIGINT received at 1421820021, shutting down...
[root@linvm246 bin]#