Converged Data Center Infrastructure
Showing results for 
Search instead for 
Do you mean 

Infrastructure changes. Stay in the loop with the HP OneView state change message

Bryan Jacquot_3 ‎03-19-2014 01:19 PM - edited ‎09-30-2015 07:02 AM

IT is under pressure to respond more rapidly to changing business conditions due to factors like mobility, cloud computing and big data.  I’ve stated in my previous blogs that one of the key reasons customers are using HP OneView is because of its automation capabilities through its RESTful APIs.  Another critical element for infrastructure automation is the state change message bus (SCMB), a key feature in HP OneView.  I’ve alluded to the SCMB in some of my previous blogs, but this important topic deserves a deeper dive.  To experience these automation capabilities for yourself, and how HP OneView can benefit your data center, download HP OneView software free for 60 days.


The SCMB allows enterprises to closely integrate with HP OneView in ways that would have previously been cost prohibitive.  Competing management solutions depend on inefficient polling mechanisms that are difficult to implement and do not scale.


The HP OneView SCMB is based on an industry standard protocol, Advanced Message Queuing Protocol.  The implementation we are using is the open source, RabbitMQ, technology.  Using the SCMB, you can automate any task in HP OneView based on a wide variety of activities in the system, including:

  • Arrival of critical alerts
  • Deployment of enclosures
  • Maintenance of server profiles


Tune-in to alerts

In order to connect to the HP OneView SCMB, you must first establish a secure connection using certificates.  As you may have guessed, there is a REST API that is used to create and download certificates for use by the SCMB.  This one-time operation is detailed in the HP OneView online help.  Once you have certificates in place, it’s time to connect to message bus.  This can be accomplished using nearly any language ranging from Python to C# to Java.  For these examples I will use Python.  A complete example of this is in the online help, so I will only touch on the highlights here to give you an idea for how the SCMB works.


First, setup the SSL options.  This step creates the data structure pointing to the certificates which have been created and downloaded from the appliance.


ssl_options = ({"ca_certs": caFile,

                "certfile": certFile,

                "keyfile": sslFile,

                "cert_reqs": ssl.CERT_REQUIRED,

                "server_side": False})


Next you define the message exchange and the routing key.  This is a really important step as it defines which messages are sent to you on the exchange.  In the example below, you can see how it’s easy to fine-tune the types of messages you receive.  It’s recommended that you define your key as narrow as possible to limit traffic on the message bus to only those messages need.  For example, ROUTING_KEY1 will result in all messages on the SCMB getting published on the message bus.  ROUTING_KEY2 will result in only alert messages getting published on the message bus.  Likewise the ROUTING_KEY3 will result in only messages pertaining to enclosure resources getting published on the message bus.



ROUTING_KEY1   = "scmb.#"

#ROUTING_KEY2  = "scmb.alerts.#"

#ROUTING_KEY3  = “scmb.enclosures.#”


Finally, it’s time to start listening on the message bus.  This method starts the listener and instructs it to invoke the process_messages() function when each new message is received. 


channel.basic_consume(   process_messages,




Within the process_messages() method, you can take any action necessary, including operations such as:

  • Automated profile movement – In the unlikely event that a hardware resource experience a fault, you can detect that alert on the SCMB and use the RESTful API to move the server profile to a spare hardware resource to reduce downtime.
  • Update asset trackers - When you add a new enclosure, you can read the hardware information, such as the serial number, UUID, and asset tag from the SCMB messages, and store details for enclosures and server in your asset tracking system.
  • Enable application monitoring – When you deploy server profiles, you can update your application monitoring tool to begin managing the application.


The ability to automate processes in your data center can save you time and money and reduce the chance for human errors. Using the state change message bus in HP OneView can help you respond with more agilely to the needs of your business.



0 Kudos
About the Author

Bryan Jacquot_3

27 Feb - 2 March 2017
Barcelona | Fira Gran Via
Mobile World Congress 2017
Hewlett Packard Enterprise at Mobile World Congress 2017, Barcelona | Fira Gran Via Location: Hall 3, Booth 3E11
Read more
Each Month in 2017
Software Expert Days - 2017
Join us online to talk directly with our Software experts during online Expert Days. Find information here about past, current, and upcoming Expert Da...
Read more
View all