Reader small image

You're reading from  VMware vRealize Orchestrator Cookbook. - Second Edition

Product typeBook
Published inNov 2016
PublisherPackt
ISBN-139781786462787
Edition2nd Edition
Right arrow
Author (1)
Daniel Langenhan
Daniel Langenhan
author image
Daniel Langenhan

Daniel Langenhan is a Virtualisation expert with formidable skills in Architecture, Design and Implementation for large multi-tier systems. His experience and knowledge of process management, enterprise-level storage, Linux and Windows operation systems has made him and his business a highly sought after international consultancy in the Asia-Pacific and European regions for multinational clientele in the areas of Finance, Communication, Education and Government. Daniel has been working with VMware products since 2002 and is directly associated with VMWare since 2008. His proven track record of successful integrations of Virtualisation into different business areas while minimizing cost and maximizing reliability and effectiveness of the solution for his clients. Currently, Daniel is operating in the Europe and Asia-Pacific region with his company vLeet GmbH and Melbourne Business Boosters Pty Ltd. Daniel's expertise and practical approach to VMWare has resulted in the publication of the following books: Instant VMware vCloud Starter, Packt Publishing VMware View Security Essentials, Packt Publishing VMware vCloud Director Cookbook, Packt Publishing VMware vRealize Orchestrator Cookbook, Packt Publishing VMware vRealize Orchestrator Essentials, Packt Publishing He has also lent his expertise to many other publishing projects as a Technical Editor.
Read more about Daniel Langenhan

Right arrow

Chapter 9. Essential Plugins

In this recipe, we are looking at essential plugins that are often used. We will be looking at the following plugins:

  • Working with e-mail

  • File operations

  • Working with SSH

  • Working with REST

Introduction


These plugins are just normal plugins that are used regularly (well...at least by me). All the plugins shown in this recipe will add a lot of possibilities in your programming kit bag.

Let's have a look at an example: You have a workflow that deploys a VM and after it is finished you would like to send an acknowledgment e-mail to a user and a CSV file to a CMDB (Content Management Database).

Another example would be current or legacy systems that have an SSH interface but no API or plug-in available. The SSH plug-in could be used to SCP files/scripts to and from the target system, automatically backup configurations, or apply approved configurations.

Working with e-mail


In this recipe, we will learn how to interact with e-mails and discuss configuring, sending, and receiving e-mails with Orchestrator. We will discuss both e-mail objects that the API currently has.

Getting ready

Unsurprisingly, we need an e-mail server. If you don't have one handy, you can use hMailServer for Windows; refer to the There's more... section of this recipe to learn how to install and configure this free, open source e-mail server.

For this recipe, we will use IMAP and SMTP to connect to the e-mail server. In the How it works... section, we also take a quick look at POP3 and SSL. We will also need two e-mail addresses. In our example, we will use vcotest@mylab.local and vcotest2@mylab.local.

There are two API objects that can be used when working with e-mail: the MailClient object and the EmailMessage object. We will use EmailMessage to send messages and MailClient to receive e-mail.

How to do it...

We will break this recipe down into configuration and sending/receiving...

File operations


Here we will explore how Orchestrator can interact with the filesystem of its operating system. We will also take a look at how to access a network share and execute local files.

Getting ready

Orchestrator needs to be able to access a directory on the local filesystem. To configure this access and set the access rights, take a look at the Configuring access to the local filesystem recipe in Chapter 2, Optimizing Orchestrator Configuration.

In my example, I will simply use the default Orchestrator file location that is set to rwx the directory /var/run/vco/.

In addition to this, you should have administrative (root) access to Orchestrator's operating system.

How to do it...

We have a bit of ground to cover, so let's start!

Writing a file

This part showcases how to write into a file with, and without, a line feed as well as how to append to an existing file:

  1. Create a new workflow and create the following variables:

    Working with SSH


    This recipe centers on using the SSH plugin. With this plugin, you are able to connect to appliances (think managed routers, switches, and so on...) or a Linux- or Solaris-based system, run programs, or transfer files.

    Getting ready

    We need to be able to create a new workflow. We also need a Linux or Solaris system that we can access via SSH (for example, as root). If you don't have a Linux system handy, you can use the Orchestrator appliance itself.

    For the SCP example, you need to allow Orchestrator access to its local filesystem, or use the default /var/run/vco directory. Refer to the Configuring access to the local filesystem recipe in Chapter 2, Optimizing Orchestrator Configuration.

    If you want to connect to the appliance itself (127.0.0.1) you need to enable SSH access as shown in the Tuning the appliance recipe in Chapter 2, Optimizing Orchestrator Configuration.

    How to do it...

    We split this recipe into three parts: SSH access, SSL key access, and SCP usage.

    Using SSH

    You...

    Working with REST


    In this recipe, we will use the REST plugin. We will use it to connect to the Orchestrator Control Center REST API.

    Getting ready

    We need a REST-capable host you can contact. As every REST host handles things a little differently, we will use the REST interface Orchestrator and the Orchestrator Control Center, to showcase the functionality.

    I have also collected some other Orchestrator-REST integration examples in the See also section of this recipe.

    If you are new to REST, I would like to point you to the Accessing Orchestrator REST API recipe in Chapter 7, Interacting with Orchestrator.

    How to do it...

    This recipe is divided into connecting, gathering information, sending information, as well as creating workflows.

    Connecting to a REST host

    There are two methods (as of vRO7.1) to connect to a host. We will use the normal method here to connect to a REST host, as this showcases a lot of things you should know. The other one (using Swagger) is discussed in the There's more... section...

    lock icon
    The rest of the chapter is locked
    You have been reading a chapter from
    VMware vRealize Orchestrator Cookbook. - Second Edition
    Published in: Nov 2016Publisher: PacktISBN-13: 9781786462787
    Register for a free Packt account to unlock a world of extra content!
    A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
    undefined
    Unlock this book and the full library FREE for 7 days
    Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
    Renews at $15.99/month. Cancel anytime

    Author (1)

    author image
    Daniel Langenhan

    Daniel Langenhan is a Virtualisation expert with formidable skills in Architecture, Design and Implementation for large multi-tier systems. His experience and knowledge of process management, enterprise-level storage, Linux and Windows operation systems has made him and his business a highly sought after international consultancy in the Asia-Pacific and European regions for multinational clientele in the areas of Finance, Communication, Education and Government. Daniel has been working with VMware products since 2002 and is directly associated with VMWare since 2008. His proven track record of successful integrations of Virtualisation into different business areas while minimizing cost and maximizing reliability and effectiveness of the solution for his clients. Currently, Daniel is operating in the Europe and Asia-Pacific region with his company vLeet GmbH and Melbourne Business Boosters Pty Ltd. Daniel's expertise and practical approach to VMWare has resulted in the publication of the following books: Instant VMware vCloud Starter, Packt Publishing VMware View Security Essentials, Packt Publishing VMware vCloud Director Cookbook, Packt Publishing VMware vRealize Orchestrator Cookbook, Packt Publishing VMware vRealize Orchestrator Essentials, Packt Publishing He has also lent his expertise to many other publishing projects as a Technical Editor.
    Read more about Daniel Langenhan

    Name

    Type

    Section

    Use

    fileName

    String

    IN

    The name...