The Contrail observer is installed as part of the core installation procedure. Using the
Contrail Observer, you can retrieve topology data from Juniper Network Contrail Release 4.1 via REST
APIs exposed by the Contrail API server. This observer is developed against Juniper Network Contrail
that integrates with OpenStack orchestration platform (Ubuntu 18.04 + Contrail Cloud - Ocata).
Before you begin
Important: The Contrail Observer supports the on-premise Contrail version 4.1.0.
Ensure you have the Contrail service details to hand, such as the username, password, and
URL.
Remember: Swagger documentation for the observer is available at the following default
location: https://<your
host>/1.0/contrail-observer/swagger
About this task
Contrail Observer jobs retrieve topology data from Juniper Network Contrail Release 4.1 via REST
APIs exposed by the Contrail API server. The observer loads and updates the resources and their
relationships within the Netcool Agile Service Manager core topology service.
contrail_observer_common.sh
- The configuration file you use to customize Contrail Observer settings.
- The parameters defined here are then used by the
contrail_observer_load_start.sh
and
contrail_observer_listen_start.sh
scripts to trigger the Contrail Observer
jobs.
-
Tip: Alternatively, you can set the appropriate environment variables. If an environment
variable is set, it takes precedence over the configuration file settings.
You define and start the following jobs. You must edit the parameters in the configuration file
before running these jobs.
- Load job
- A transient (one-off) job that loads all requested topology data.
- This job is started by the contrail_observer_load_start.sh script and loads
all supported resources.
- Run this job whenever you need the Contrail topology data refreshed.
- Listener
- A long-running job that monitors its source for updates and runs until it is explicitly stopped,
or until the Observer is stopped.
- This job is started by the
contrail_observer_listen_start.sh
script and loads
all supported resources during startup, and listens to RabbitMQ messages from
'vnc_config.object-update' fanout exchange.
- There is no need to run the Load job before running the Listen job, because the Listen job
performs a Load job during initialization.
Table 1. Mapping of Contrail object types to Agile Service Manager entity types:
Contrail object types |
Agile Service Manager entity types |
domain |
domain |
project |
project |
bgp-as-a-service |
service |
bgpvpn |
vpn |
loadbalancer |
loadbalancer |
logical-router |
router |
network-ipam |
ipam |
service-instance |
service |
virtual-ip |
ipaddress |
virtual-machine-interface |
networkinterface |
virtual-network |
network |
virtual-router |
router |
physical-router |
router |
global-system-config |
group |
instance-ip |
ipaddress |
routing-instance |
vrf |
bgp-router |
router |
route-target |
routetarget |
Procedure
To edit the parameters in the configuration file
-
Open the contrail_observer_common.sh configuration file and edit (at
least) the following parameters:
- api_server_url
- The Contrail API URL on which the Contrail API server is running
- os_auth_url
- The authentication URL for the identity service
- os_user
- OpenStack username
- os_password
- OpenStack password
- auth
- Optional
- The supported authentication type types are 'keystone' and 'none'.
- Use 'keystone' as default.
- os_project_domain_name
- Optional
- Openstack project domain name
- os_user_domain_name
- Optional
- Openstack user domain name
- os_project_name
- The OpenStack project name is required for version 3 authentication.
- os_tenant_name
- The OpenStack tenant name is required for version 2 authentication.
- os_identity_api_version
- OpenStack Identity API version
- Default to 3 = ['1', '2', '3'],
- connect_read_timeout_ms
- Optional
- Choose the time at which the connection and read action times out.
Encryption requirement:
The Load job requires the
os_password
in encrypted form. To encrypt the
password, run the
encrypt_password.sh
script in the
ASM_HOME/bin directory:
./bin/encrypt_password.sh
Enter
and then confirm the password. The encryption utility will return an encrypted password.
-
Still in the contrail_observer_common.sh configuration file, edit (at
least) the following Listen parameters:
- api_server_url
- The Contrail API URL on which the Contrail API server is running
- os_auth_url
- The authentication URL for the identity service
- os_user
- OpenStack username
- os_password
- OpenStack password
- rabbit_server
- Hostname or IP address of RabbitMQ server
- rabbit_port
- The port number to use for connection
- rabbit_user
- The username to authenticate with RabbitMQ
- rabbit_password
- The encrypted password to authenticate with RabbitMQ
- auth
- Optional
- The supported authentication type types are 'keystone' and 'none'.
- Use 'keystone' as default.
- os_project_domain_name
- Optional
- Openstack project domain name
- os_user_domain_name
- Optional
- Openstack user domain name
- os_project_name
- The OpenStack project name is required for version 3 authentication.
- os_tenant_name
- The OpenStack tenant name is required for version 2 authentication.
- os_identity_api_version
- OpenStack Identity API version
- Default to 3 = ['1', '2', '3'],
- connect_read_timeout_ms
- Optional
- Choose the time at which the connection and read action times out.
Encryption requirement:
The Listener job requires the
os_password
and
rabbit_password
in encrypted form. To encrypt a password, run the
encrypt_password.sh
script in the
ASM_HOME/bin directory:
./bin/encrypt_password.sh
Enter
and then confirm the password. The encryption utility will return an encrypted password.
To start the Load and Listener jobs
-
To start the Contrail Observer Load job, use the following command:
$ASM_HOME/bin/contrail_observer_load_start.sh
This job loads all requested topology data. This job runs only once.
-
To start the Contrail Observer Listener job, use the following command:
$ASM_HOME/bin/contrail_observer_listen_start.sh
This job monitors its source for updates and runs until it is explicitly stopped, or
until the observer is stopped.
What to do next
You can also use the following scripts:
- contrail_observer_load_stop.sh
- Stops the Load job
- contrail_observer_listen_stop.sh
- Stops the Listener job
- contrail_observer_job_list.sh
- Lists the status of current jobs
- contrail_observer_log_level.sh
- Sets the log level
Remember: As an alternative to being configured using the Observer Configuration
UI, observer jobs have scripts to start and stop all available jobs, to list the status of a current
job, and to set its logging levels. These scripts can be run with -h or
--help to display help information, and with -v or
--verbose to print out the details of the actions performed by the script,
including the full cURL command. For the on-prem version of Agile Service Manager, observer scripts
are configured for specific jobs by editing the script configuration files.