Red Hat Training

A Red Hat training course is available for Red Hat CloudForms

Configuring the Nuage Networks Provider for Red Hat CloudForms

Red Hat CloudForms 4.7

Configuring the Nuage Networks Provider for Red Hat CloudForms

Red Hat CloudForms Documentation

Abstract

This guide outlines how to configure the Nuage Networks Provider.

Chapter 1. Overview

The Nuage Networks Provider for Red Hat CloudForms provides IT and Network administrators the capabilities to integrate a Nuage Networks VSP environment into Red Hat CloudForms. Nuage Networks VSP provides a software-defined networking (SDN) solution which delivers policy-based automation across the network. Its components can be used to optimize datacenter, cloud and software-defined WAN operations, and to automate security policies and remediation. For more information on Nuage Networks VSP, please visit the Nuage Networks website.

Key features include:

  • Monitoring of all events and alarms from the Nuage VSP environment.
  • Leveraging events and alarms for automation and reporting.
  • Visibility in the Nuage VSP tenants.
  • Visibility in the Nuage VSP overlay networks.
  • Visibility in the Nuage VSP security groups.
  • Visibility in the Nuage VSP ports.
  • Visibility in the relationships between the different Nuage entities.
  • Display the above relationships.
  • Display the relationship between Nuage VSP ports and Virtual Machines in the other providers.
  • Automatic targeted refresh of entities on events.

Chapter 2. Configuring Nuage Networks VSP for Red Hat CloudForms integration

The Nuage Networks Provider for Red Hat CloudForms is a Network provider which can be used to monitor one or more Nuage Networks VSP deployments. For more details on how to deploy and install a Nuage Networks VSP deployment, please contact your Nokia or Nuage Networks representative.

2.1. Connectivity Requirements

For the successful integration of the Nuage Networks Provider, you will need to make sure that there is proper network connectivity between the Red Hat CloudForms nodes and the Nuage VSD nodes.

For the basic functionality of monitoring the networks and security groups that are present in the Nuage Networks VSP environment, connectivity can either be provided to a single VSD node to port 8443, or using the load-balancer which is deployed in front of a VSD cluster environment, in which case the port advertised by the load-balancer should be used when configuring the Nuage Networks Provider.

For the events and alarms monitoring functionality, the Red Hat CloudForms nodes will need connectivity to port 5672 on each VSD node of the Nuage Networks VSP environment.

2.2. Configuring the Nuage Networks VSP environment

Please follow the Nuage Networks VSP Installation and User guides to install the Nuage Networks components and configure them with the networks, policies and features you want to use.

It is advised to create at least one user on the global level in the Nuage Networks VSP environment. This user can be used to configure the Nuage Networks Red Hat CloudForms provider and facilitate the connection between Red Hat CloudForms and the Nuage Networks VSP environment.

Chapter 3. Managing the Nuage Networks provider

3.1. Enabling support for the Nuage Networks provider

In the current release of Red Hat CloudForms, the Nuage Networks provider requires extra permissions to be enabled on the Red Hat CloudForms application to be available. The following steps can be followed to enable the Nuage Networks provider.

  1. Open a console on the Red Hat CloudForms Appliance VM or SSH to the Red Hat CloudForms Appliance.
  2. Log in using the root user. The default password is smartvm.
  3. Edit the /var/www/miq/vmdb/config/permissions.yml file, this can be done using vim or nano.
  4. Add the bottom of the file, add a line stating - ems-type:nuage_network.
  5. Save the file.
  6. Run appliance_console.
  7. Press Enter to continue.
  8. Select option 16) Stop EVM Server Processes
  9. Confirm you want to stop the services. Wait for the services to stop. Once they are stopped, press Enter twice to return to the menu.
  10. Select option 17) Start EVM Server Processes
  11. Confirm you want to start the services. Wait for the services to start. Once they are started, press Enter twice to return to the menu.
  12. Select option 21) Quit and log out of the Red Hat CloudForms Appliance.

This will enable the use of the Nuage Networks provider. After starting the service, you might need to wait a few minutes before you can log in to the Red Hat CloudForms application.

3.2. Adding a Nuage Networks provider

You can add a Nuage Networks provider using the following steps.

Note: You must be logged in to Red Hat CloudForms as a user with permission to add providers.

3.2.1. Configuring the basic Nuage Networks provider settings

  1. Navigate to Networks > Providers.
  2. Click Configuration.
  3. Select Add a New Network Provider.
  4. Enter a Name for the Network Provider, for instance "Nuage Networks VSP".
  5. From the Type list, select "Nuage Network Manager".
  6. From the API Version list, select the appropriate version for your Nuage Networks VSP environment.

Note If you want to use the Events feature, you will need to have a Nuage Networks VSP environment of version 5.1.1 or newer.

3.2.2. Configuring endpoints

It is a requirement to configure the Nuage Networks VSD endpoint with which the provider can communicate. This is done through the Endpoints tab in the form when configuring the Nuage Networks provider. The following steps go in more detail.

  1. From the Security Protocol list, select the "SSL without validation" option.
  2. In the Hostname (or IPv4 or IPv6 address) field, enter the IP or hostname of your Standalone Nuage Networks VSD, or the load-balancer IP or hostname that sits in front of the Nuage Networks VSD nodes in a clustered deployment.
  3. In the API Port field, enter the API port to use. The default port on the Nuage Networks VSD for API is 8443.
  4. In the Username field, enter the API username you want to use, this should be a user in the Nuage Networks VSD global environment, not an Enterprise specific user.
  5. In the Password field, enter the API password for the user that you want to use.
  6. Click Validate to validate your input.

A message stating "Credential validation was successful" should appear on the top of the page. If an error is presented, please check the inputs of the different fields and validate again.

3.2.3. Configuring events

By default the Events and Alarms feature is disabled when adding a new Nuage Networks provider. To enable it, follow these steps, using the Events tab in the form when configuring the Nuage Networks provider.

  1. Select AMQP on the Events tab.
  2. From the Security Protocol select Non-SSL.
  3. In the Hostname (or IPv4 or IPv6 address) field, enter the IP or hostname of your Standalone Nuage Networks VSD, or if a Nuage Networks VSD Cluster is deployed, enter the IP or hostname of the first node of the Nuage Networks VSD Cluster.
  4. (Optional) In the Fallback Hostname 1 field, enter the IP or hostname of the second node of the Nuage Networks VSD Cluster.
  5. (Optional) In the Fallback Hostname 2 field, enter the IP or hostname of the third node of the Nuage Networks VSD Cluster.
  6. In the API Port field, enter the port that the AMQP service uses on the Nuage Networks VSD node(s). The default value is 5672.
  7. In the Username field, enter the AMQP username you want to use, this should be a user in the Nuage Networks VSD global environment, not an Enterprise specific user. It is important that the username is in the format of <username>@csp, for example: jmsclient@csp.
  8. In the Password field, enter the AMQP password for the user that you want to use.
  9. Click Validate to validate your input.

A message stating "Credential validation was successful" should appear on the top of the page. If an error is presented, please check the inputs of the different fields and validate again.

3.2.4. Adding the provider

After following the appropriate steps above, you can click the Add button to add the Nuage Networks provider.

3.3. Refreshing a Nuage Networks provider

The Nuage Networks provider supports targeted refresh of the supported entities when the Events and Alarms feature is enabled. This will update the information for Subnets and Security Groups whenever the entity in the Nuage Networks VSD is changed.

Manual refresh is also supported, to achieve this, follow these steps:

  1. Navigate to Networks > Providers.
  2. Select the appropriate Nuage Networks provider.
  3. Click Configuration, then click Refresh Relationships and Power States.
  4. In the popup, click OK.

3.4. Changing a Nuage Networks provider

To change the configuration of a Nuage Networks provider, you can follow these steps.

  1. Navigate to Networks > Providers.
  2. Select the appropriate Nuage Networks provider.
  3. Click Configuration, then click Edit selected Network Provider.
  4. Change the fields according to the required changes.
  5. Click Validate in case of new credentials.
  6. Click Save to save the changes.

3.5. Removing a Nuage Networks provider

If you want to delete the Nuage Networks provider, follow these steps:

  1. Navigate to Networks > Providers.
  2. Select the appropriate Nuage Networks provider.
  3. Click Configuration, then click Remove Network Providers from Inventory.
  4. Confirm that the Nuage Network provider needs to be removed by clicking OK.

Chapter 4. Relationships within the Nuage Networks Provider

4.1. Relationships between entities in the Nuage Networks provider

The different entities in Nuage Networks VSP have relationships between each other. For instance an Enterprise will have multiple Domains, and a Domain will have several Subnets. These relationships are also present in Red Hat CloudForms. Below is a view on the relationships between different entities in Nuage Networks VSP and their counterparts in Red Hat CloudForms.

Figure 4.1. Nuage Networks VSP relationships and their Red Hat CloudForms counterparts.

nuage relationships

When viewing any of the entities in the Nuage Networks Provider, each of these relationships will be visible.

4.2. Nuage Networks Provider relationships with other Providers

The Nuage Networks Provider will automatically try to identify other Cloud Providers to build relationships between entities within the Nuage Networks Provider and the other Cloud Providers.

4.2.1. Current supported relationships

  • VMware vCenter Provider: The Nuage Networks Provider will build a relationship between the Network Ports inside the Provider with the Virtual Machines in the VMware vCenter Provider.
  • OpenStack Provider: The Nuage Networks Provider will build a relationship between the Cloud Subnets inside the Provider with the Networks in the OpenStack Provider.

4.2.2. Future relationships

  • OpenStack Provider: Virtual Machine in OpenStack to Network Ports inside the Nuage Networks Provider.
  • OpenShift Container Platform Provider: Pods in OpenShift to Network Ports inside the Nuage Networks Provider.

4.3. Viewing the relationship between Nuage Networks VSP subnets and OpenStack subnets

The Nuage Networks provider can also show the relationship between Nuage Networks VSP subnets and OpenStack subnets if the OpenStack environment is using the Nuage Networks VSP plugin.

To view this relationship, open the Networks > Topology view. It will show a connection between the Nuage Networks VSP subnet and an OpenStack subnet as seen below.

nuage osp

Chapter 5. Using the Nuage Networks provider to inspect elements

5.1. Inspecting Nuage Networks VSP enterprises

The Nuage Networks provider allows you to inspect the Nuage Networks VSP enterprises that are present in your Nuage Networks VSD. There are two ways of achieving this and each is described below.

5.1.1. Inspecting Nuage Networks VSP enterprises through the Nuage Networks provider

  1. Navigate to Networks > Providers.
  2. Click on the Nuage Networks provider for which you want to inspect the enterprises. This will bring you to the detailed information of the Nuage Networks provider.
  3. In the Relationships panel, click on Cloud Tenants. This will open the list of enterprises related to the selected Nuage Networks provider.
  4. To go in more detail, click the Cloud Tenant you want to inspect. This will take you to the detailed information of the Cloud Tenant.

5.1.2. Inspecting Nuage Networks VSP enterprises through the Cloud tenant view

  1. Navigate to Compute > Clouds > Tenants. You will be presented with a list of all the Cloud Tenants across all Network and Cloud Providers.
  2. To go in more detail, click the Cloud Tenant you want to inspect. This will take you to the detailed information of the Cloud Tenant.

5.2. Inspecting Nuage Networks VSP domains

The Nuage Networks provider allows you to inspect the Nuage Networks VSP domains that are present in your Nuage Networks VSD. There are two ways of achieving this and each is described below.

5.2.1. Inspecting Nuage Networks VSP domains through the Nuage Networks provider

  1. Navigate to Networks > Providers.
  2. Click on the Nuage Networks provider for which you want to inspect the domains. This will bring you to the detailed information of the Nuage Networks provider.
  3. In the Relationships panel, click on Network Routers. This will open the list of domains related to the selected Nuage Networks provider.
  4. To go in more detail, click the Network Router you want to inspect. This will take you to the detailed information of the Network Router.

5.2.2. Inspecting Nuage Networks VSP domains through the Network Router view

  1. Navigate to Networks > Network Routers. You will be presented with a list of all the Network Routers across all Network Providers.
  2. To go in more detail, click the Network Router you want to inspect. This will take you to the detailed information of the Network Router.

5.3. Inspecting Nuage Networks VSP subnets

The Nuage Networks provider allows you to inspect the Nuage Networks VSP subnets that are present in your Nuage Networks VSD. There are two ways of achieving this and each is described below.

5.3.1. Inspecting Nuage Networks VSP subnets through the Nuage Networks provider

  1. Navigate to Networks > Providers.
  2. Click on the Nuage Networks provider for which you want to inspect the subnets. This will bring you to the detailed information of the Nuage Networks provider.
  3. In the Relationships panel, click on Cloud Subnets. This will open the list of subnets related to the selected Nuage Networks provider.
  4. To go in more detail, click the Cloud Subnet you want to inspect. This will take you to the detailed information of the Cloud Subnet.

5.3.2. Inspecting Nuage Networks VSP subnets through the Cloud subnet view

  1. Navigate to Networks > Subnets. You will be presented with a list of all the Cloud Subnets across all Network Providers.
  2. To go in more detail, click the Cloud Subnet you want to inspect. This will take you to the detailed information of the Cloud Subnet.

5.4. Inspecting Nuage Networks VSP vports

The Nuage Networks provider allows you to inspect the Nuage Networks VSP vports that are present in your Nuage Networks VSD. There are two ways of achieving this and each is described below.

5.4.1. Inspecting Nuage Networks VSP vports through the Nuage Networks provider

  1. Navigate to Networks > Providers.
  2. Click on the Nuage Networks provider for which you want to inspect the vports. This will bring you to the detailed information of the Nuage Networks provider.
  3. In the Relationships panel, click on Network Ports. This will open the list of vports related to the selected Nuage Networks provider.
  4. To go in more detail, click the Network Port you want to inspect. This will take you to the detailed information of the Network Port.

5.4.2. Inspecting Nuage Networks VSP vports through the Network Port view

  1. Navigate to Networks > Network Ports. You will be presented with a list of all the Network Ports across all Network Providers.
  2. To go in more detail, click the Network Port you want to inspect. This will take you to the detailed information of the Network Port.

5.5. Inspecting Nuage Networks VSP floating ips

The Nuage Networks provider allows you to inspect the Nuage Networks VSP floating ips that are present in your Nuage Networks VSD. There are two ways of achieving this and each is described below.

5.5.1. Inspecting Nuage Networks VSP floating ips through the Nuage Networks provider

  1. Navigate to Networks > Providers.
  2. Click on the Nuage Networks provider for which you want to inspect the floating ips. This will bring you to the detailed information of the Nuage Networks provider.
  3. In the Relationships panel, click on Floating IPs. This will open the list of floating ips related to the selected Nuage Networks provider.
  4. To go in more detail, click the Floating IP you want to inspect. This will take you to the detailed information of the Floating IP.

5.5.2. Inspecting Nuage Networks VSP floating ips through the Floating IP view

  1. Navigate to Networks > Floating IPs. You will be presented with a list of all the Floating IPs across all Network Providers.
  2. To go in more detail, click the Floating IP you want to inspect. This will take you to the detailed information of the Floating IP.

5.6. Inspecting Nuage Networks VSP Security Groups

The Nuage Networks provider allows you to inspect the Nuage Networks VSP Security Groups that are present in your Nuage Networks VSD. There are two ways of achieving this and each is described below.

5.6.1. Inspecting Nuage Networks VSP Security Groups through the Nuage Networks provider

  1. Navigate to Networks > Providers.
  2. Click on the Nuage Networks provider for which you want to inspect the Security Groups. This will bring you to the detailed information of the Nuage Networks provider.
  3. In the Relationships panel, click on Security Groups. This will open the list of Security Groups related to the selected Nuage Networks provider.
  4. To go in more detail, click the Security Group you want to inspect. This will take you to the detailed information of the Security Group.

5.6.2. Inspecting Nuage Networks VSP Security Groups through the Security Group view

  1. Navigate to Networks > Security Groups. You will be presented with a list of all the Security Groups across all Network Providers.
  2. To go in more detail, click the Security Group you want to inspect. This will take you to the detailed information of the Security Group.

5.7. Inspecting Nuage Networks VSP events and alarms

The Nuage Networks VSP Events and Alarms will be created as an EmsEvent in Red Hat CloudForms. To view these events, you can go to Automation > Automate > Log

This will show you the log of all the events that Red Hat CloudForms is receiving and potentially which automated workflow it is executing. This provides some basic information about the events and alarms, in the next chapter, we will demonstrate how to create a generic automation workflow to log all events.

Chapter 6. Managing Nuage Networks entities

6.1. Creating a Cloud Subnet on a Nuage VSP domain

It is possible to create a new subnet on a Nuage VSP domain using the Nuage Networks Provider. This can be done following these steps:

  1. Select the Network Router (Nuage VSP domain) to which you want to add a new Cloud Subnet (Nuage VSP subnet).
  2. Click the Edit button.
  3. Select Create L3 Cloud Subnet.
  4. Fill in a Name, Address, Netmask and Gateway.
  5. Click Add.

This will start a task in Red Hat CloudForms that will create a new Cloud Subnet inside the Nuage VSP domain. In the Nuage VSD Architect, you can see that a zone will be created called Red Hat CloudForms Subnets and a new subnet is added in this zone.

Chapter 7. Using the Nuage Networks events and alarms for automation

7.1. Creating an example automation workflow

In the following section we will setup an automation task that will log the events for all the Nuage Networks VSP events that do not have a specific workflow available.

7.1.1. Creating the Automate Class

We will start by setting up a new Automate Class with its own Method and Instance.

  1. Go to Automation > Automate > Explorer.
  2. Select Datastore.
  3. (Optional) If you do not have an Automate Domain yet, click on Configuration and select Add a New Domain.

    1. Enter a Name and Enable the Automate Domain.
    2. Click Add.
  4. Select your Automate Domain.
  5. (Optional) If you do not have a Namespace yet, click on Configuration and select Add a New Namespace.

    1. Enter a Name.
    2. Click Add.
  6. Select your Namespace.
  7. Click Configuration and select Add a New Class.
  8. Fill in the Name field.
  9. Click Add.
  10. Select your Class.
  11. Click the Schema tab.
  12. Click Configuration and select Edit selected Schema.
  13. Click the plus sign next to New Field.
  14. Enter "execute" as the Name.
  15. From the Type list, select "Method".
  16. From the Data Type list, select "String".
  17. Click the V sign to save the new field.
  18. Click Save to save the Schema changes.
  19. Select the Methods tab.
  20. Click Configuration and select Add a New Method.
  21. From the Type list, select "inline".
  22. Enter a Name.
  23. In the Data field add the following code:

    $evm.log(:info, "******** HANDLING NUAGE EVENT ********")
    $evm.log(:info, "EVENT DATA: #{$evm.root['event_stream']['full_data']}")
    $evm.log(:info, "**************************************")
  24. Click Add.
  25. Select the Instances tab.
  26. Click Configuration and select Add a New Instance.
  27. Enter a Name.
  28. In the (execute) field, enter the Name of your Method in the Value field.
  29. Click Add.

7.1.2. Attaching the Automate Class to Nuage Networks VSP Events

This part will make sure that the Automate Class created in the previous section is executed when an event comes in that does not have a specific assignment already.

  1. Open the Domain, Namespace, Automate Class and Instance ManageIQ (Locked) > System > Event > EmsEvent > Nuage > .missing.
  2. Click Configuration and select Copy this Instance.
  3. From the To Domain list, select your Domain.
  4. Check Copy to same path.
  5. Click Copy. This will create a .missing instance in your Domain, in the System > Event > EmsEvent > Nuage Class.
  6. Select your private .missing Instance in your Domain.
  7. Click Configuration and select Edit this Instance.
  8. In the (rel1) Value field, enter the path to the Automate Instance you created in the previous section. For instance, if the Namespace you created is Automation, the Class you created is LogInfo and the Instance is logging, you would enter /Automation/LogInfo/logging in this field.
  9. Click Save.

7.1.3. Seeing the Automation in action

To see the automation in action, follow these steps:

  1. Go to Automation > Automate > Log.
  2. In your Nuage Networks VSP environment, take an action, for instance: create or delete a redirection target.
  3. Click the refresh button.
  4. In the log, you will see something similar as the following appear:

    [----] I, [2018-03-07T03:40:45.609931 #24569:559eebc]  INFO -- : <AEMethod logmissing> ******** HANDLING NUAGE EVENT ********
    [----] I, [2018-03-07T03:40:45.618829 #24569:559eebc]  INFO -- : <AEMethod logmissing> EVENT DATA: {"userName"=>"csproot", "enterpriseName"=>"csp", "type"=>"DELETE", "entityType"=>"redirectiontarget", "entityVersion"=>nil, "assoicatedEvent"=>false, "eventReceivedTime"=>1520390432802, "entities"=>[{"children"=>nil, "parentType"=>"domain", "entityScope"=>"ENTERPRISE", "lastUpdatedBy"=>"8a6f0e20-a4db-4878-ad84-9cc61756cd5e", "lastUpdatedDate"=>1520390262000, "creationDate"=>1520390262000, "virtualNetworkID"=>"8988894", "name"=>"Demo Redirection Target", "description"=>nil, "endPointType"=>"L3", "redundancyEnabled"=>false, "triggerType"=>"NONE", "destinationType"=>"REDIRECTION_TARGET", "owner"=>"8a6f0e20-a4db-4878-ad84-9cc61756cd5e", "ID"=>"29a4905d-5a5d-480d-b5f7-8db549814b1a", "parentID"=>"d6a213c7-6595-4dab-b7df-669c86ee53a5", "externalID"=>nil, "ESI"=>"0xFFFFFF00000000002710", "templateID"=>nil}], "diffMap"=>nil, "ignoreDiffInMediationEvents"=>false, "updateMechanism"=>"DEFAULT", "requestID"=>"f6440c04-ebf5-423f-a95c-b385ac1eb1d8", "sourceEnterpriseID"=>"4e68985d-54e8-46e7-b541-16b98193ea00"}
    [----] I, [2018-03-07T03:40:45.620338 #24569:559eebc]  INFO -- : <AEMethod logmissing> **************************************

Note You might need to wait a few seconds before doing the refresh.

7.2. Using Embedded Ansible to run Automation tasks

Red Hat CloudForms comes with the Nuage Ansible module which can be used to manage any Nuage Networks VSP environment and supports all features and Nuage Networks VSP API capabilities.

This Nuage Ansible module can be used from within the Red Hat CloudForms Automation framework. This chapter will go in more detail of how to set this up and demonstrate this automation.

7.2.1. Enabling Embedded Ansible

Before you can use the Nuage Ansible module and the Ansible Automation inside Red Hat CloudForms, you need to enable the Embedded Ansible functionality. To do this, follow these steps:

  1. Log in as an Administrator in Red Hat CloudForms.
  2. Open the Red Hat CloudForms configuration.
  3. Select a Red Hat CloudForms server.
  4. In the Server Control > Server Roles make sure the Embedded Ansible switch is toggled to On.
  5. Click the Save button.

More details can be found in the Red Hat CloudForms documentation in the Introduction to Embedded Ansible chapter.

7.2.2. Create a Git Ansible playbook repository

Once you have enabled Embedded Ansible, the next step is to setup a Git Ansible playbook repository that will contain the playbooks you want to use in your automation tasks.

Use your preferred Git environment to setup a repository and make sure that repository is reachable by the Red Hat CloudForms appliance so it can clone the repository locally.

7.2.3. Create an Ansible playbook

Inside the Git repository, you will need to have one or more Ansible playbooks. These playbooks contain tasks that need to be executed in order when they are called.

A very simple playbook that is designed to automatically be executed by the Red Hat CloudForms Automation framework when a certain Nuage event comes in, could be:

printout.yaml

---
- name: Nuage event callback
  hosts: localhost
  connection: local
  gather_facts: False
  vars:
    manageiq_validate_certs: False
  pre_tasks:
  - debug: msg="Running printout"
  roles:
  - role: xlab_si.nuage_miq_automate
    validate_certs: False
  tasks:
  - debug: msg="I am a playbook running as event callback and I am able to access nuage credentials"
  - debug: var=nuage_auth
  - debug: msg="As well as details of the event that triggered me"
  - debug: var=event
  - debug: msg="So I'm now ready to do some work!"

This playbook will capture the event and print out some information about the event in the automation log file.

The important part to note in this playbook is that it includes a role called xlab_si.nuage_miq_automate. This role is provided by Nuage Networks to support the Ansible integration. It’s purpose is to get the necessary information from Red Hat CloudForms and provide it as Ansible facts to the other tasks in the playbook.

A more advanced playbook, using the Nuage Ansible module, looks like:

printout-and-fetch.yaml

---
- name: Nuage event callback
  hosts: localhost
  connection: local
  gather_facts: False
  vars:
    manageiq_validate_certs: False
  pre_tasks:
  - debug: msg="Running printout with fetch entity"
  roles:
  - xlab_si.nuage_miq_automate
  tasks:
  - debug: msg="I am a playbook running as event callback and I am able to access nuage credentials"
  - debug: var=nuage_auth
  - debug: msg="As well as details of the event that triggered me"
  - debug: var=event
  - debug: msg="So I'm now ready to do some work!"

  - name: Fetch entity from Nuage
    nuage_vspk:
      auth: "{{ nuage_auth }}"
      type: "{{ event.entity_type | capitalize }}"
      command: find
      id: "{{ event.entity.ID }}"
    register: entity
    when: event.type == 'CREATE' or event.type == 'UPDATE'
  - debug: var=entity

In this playbook, the Nuage VSPK Ansible module is used to fetch the data from the Nuage environment on the entity on which the event happened.

More examples, and details on the xlab_si.nuage_miq_automate role, can be found in our Example GitHub repository.

7.2.4. Adding a Ansible playbook repository to Red Hat CloudForms

After enabling the Embedded Ansible functionality and creating your playbooks, the next step is to add the Ansible playbook repository to Red Hat CloudForms. This can be done following these steps:

  1. In Red Hat CloudForms, open Automation > Ansible > Repositories.
  2. Click Configuration > Add New Repository.
  3. Provide a Name, select the SCM type to GIT and fill in the URL to your Git repository. If you have specific credentials that are needed for the repository, or a specific branch, please provide that information too.
  4. Click Add.

This will make the Red Hat CloudForms appliance clone the repository locally. Once that has been completed, you can check the Automation > Ansible > Playbooks page to see your playbooks showing up.

7.2.5. Setting up the automation

Now that we have the playbooks available in Red Hat CloudForms, you can use them in your Automation.

First, you will need to create an Automate domain:

  1. Go to Automation > Automate > Explorer.
  2. Select Datastore.
  3. Click on Configuration and select Add a New Domain.
  4. Enter a Name and Enable the Automate Domain.
  5. Click Add.

Using this Automate Domain, you can either configure your own set of Namespaces, Classes and instances; or you can copy the existing examples and modify them to your needs. The following section describes the copy method:

  1. Select an example Automate Instance in the ManageIQ (Locked) > System > Event > EmsEvent > Nuage Automate Class.
  2. Click Configuration > Copy this instance.
  3. Select your new Automate Domain and where you want to copy it to.

Now that you have a copied Automate Instance, you can update that class with your own Nuage Authentication information by following these steps:

  1. Select the Automate Class to which your new Automate Instance belongs.
  2. Select the Schema tab.
  3. Click Configuration > Edit this Class.
  4. Fill in the nuage_username, nuage_password, nuage_enterprise and nuage_url with the appropriate information of your environment.
  5. Click Save to save the information.

Setup the playbook that needs to be executed:

  1. Select the Method tab on the Automate Class.
  2. Click Configuration > Add New Method.
  3. Select the Type to be playbook.
  4. Provide a Name.
  5. Select your Ansible repository.
  6. Select the Ansible playbook.
  7. Select the Machine Credentials as CFME Default Credential.
  8. If your Red Hat CloudForms server and/or the Nuage VSD is using self-signed certificates or untrusted certificates, add an Input Parameter called manageiq_validate_certs with a default value False.
  9. Click Add.

The last step is to add the method to the Automate Instance:

  1. Select the previously created Automate Instance.
  2. Click Configuration > Edit this Instance.
  3. In one of the (methX) fields, put the name of the Method you just created.
  4. Click Save.

This will setup an automated event handler that will execute the playbook when an event comes in with the name of the Automate Instance that you copied.

In case you want to execute a playbook based on an event which has not been previously defined, you can create a new Automate Instance with the name of the event on which you want to execute the playbook.

For instance, if you want to make sure a playbook runs every time a Nuage Job is updated, you can create an Automate Instance with the name nuage_job_update.

Chapter 8. Using OpenStack to manage Nuage Networks VSP networks from Red Hat CloudForms

While the Nuage Networks provider currently does not allow the management of Nuage Network VSP resources, the Nuage Networks VSP integration with OpenStack can be leveraged through the OpenStack provider for Red Hat CloudForms. Using the OpenStack provider for Red Hat CloudForms, it is possible to manage the networks, security groups, policies, and much more in OpenStack. The Nuage Networks VSP plugin for OpenStack will then manage these resources in the Nuage Networks VSP environment.

Figure 8.1. Nuage Networks VSP and OpenStack interaction with Red Hat CloudForms

nuage openstack manageiq integration

Any changes made using the OpenStack provider to the networks or the security groups will automatically be reflected in the Nuage Networks provider.

Chapter 9. Troubleshooting the Nuage Networks provider

To troubleshoot the Nuage Networks provider, the following items should be verified:

  • Is the configuration of the Nuage Networks provider valid.
  • Are all credentials valid.
  • Make sure that the user that is being used, is part of the CSP Root group in the Nuage Networks VSD.
  • Check the /var/www/miq/vmdb/log/evm.log log file for mentions of Nuage and see if errors are shown.
  • Check the /var/www/miq/vmdb/log/nuage.log log file for more details on the activities of the Nuage Networks Provider.