VMware Vrealize Orchestrator Cookbook - Sample Chapter
VMware Vrealize Orchestrator Cookbook - Sample Chapter
VMware Vrealize Orchestrator Cookbook - Sample Chapter
ee
$ 49.99 US
30.99 UK
P U B L I S H I N G
Daniel Langenhan
VMware vRealize
Orchestrator Cookbook
Sa
pl
e
Q u i c k
a n s w e r s
t o
c o m m o n
p r o b l e m s
VMware vRealize
Orchestrator Cookbook
Master the configuration, programming, and interaction
of plugins with Orchestrator to efficiently automate your
VMware infrastructure
Foreword by Christophe Decanini and Burke Azbill, Consulting Architects,
VMware Global Center of Excellence
Daniel Langenhan
P U B L I S H I N G
He has also lent his expertise to many other publishing projects as a technical editor.
I would like to thank my wife, Renata, for her endless efforts and patience.
I also like to express my gratitude to my reviewers for improving this book.
A special thank you goes out to Christophe Decanini and Burke Azbill who
have been committed to make Orchestrator a successful product since they
started working on Orchestrator.
VMware vRealize
Orchestrator Cookbook
Orchestrator started its life as Dunes at a small company in Lucerne, Switzerland. In 2009,
VMware bought Dunes and then introduced Orchestrator into vSphere 4.0 as vCenter
Orchestrator. Orchestrator's first stage debut was with VMware Lifecycle Manager, which used
Orchestrator to automate the virtual infrastructure life cycle. Orchestrator itself never really
received the spotlight until the recent launch of VMware vCloud Automation Center (vCAC). In
the beginning, vCAC used Orchestrator only as an extension, but with version 6.1, it became
the central tool for automation.
In October 2014, VMware renamed vCenter Orchestrator (vCO)
to vRealize Orchestrator (vRO) to align with their new strategies.
vRO is not a new product; it is just the new name of vCO.
With version 6.2 of vCAC, the product has been renamed to
vRealize Automation.
Due to the massive renaming bonanza that VMware undertook during the writing of this
book, we will simply refer to vRO/vCO as Orchestrator. Even after the renaming, you will still
find reminisces of Dunes and vCO in vRealize Orchestrator; have a look in some of the error
messages or in the API.
The nice thing about Orchestrator that still astounds people is that Orchestrator is licensed
with vCenter, which means that it comes free with vCenter (as well as vRealize Automation).
Also, there are no extra licensing fees for any VMware distributed plugins.
A lot of third parties such as F5, Cisco, and so on have developed plugins for Orchestrator,
making it possible to push the automation further.
Orchestrator comes in four versions that differ only in the way they are installed but not in
their content or their abilities. The version most people don't know about is the one that
is automatically installed (but not activated) with vCenter. The second is the one that is
integrated with vRealize Automation. Then, there is a Windows-based installation, and last
but not least, the shrink-wrapped Linux appliance. This book covers all of these and also
dives into their little specialties.
Installing and
Configuring
Orchestrator
In this chapter, we explore how to install and configure Orchestrator. We will be looking at the
following recipes:
Introduction
vRealize Orchestrator (vRO) is the new name (since October 2014) of vCenter Orchestrator
(vCO). In this book, we will refer to vRO/vCO simply as Orchestrator.
10
Chapter 1
Getting ready
You either need administrative access to the Windows OS of your existing vCenter Server
(5.1 or higher) installation, or you need a functional vRealize Automation installation (see the
introduction to Chapter 7, Working with VMware Infrastructure, for more information).
How to do it...
This recipe is not the same for vCenter-integrated and vRA-integrated Orchestrator
implementations. There is a slight difference.
On your marks, get set, GO!
11
vCenter-integrated Orchestrator
Follow these steps if you are using the vCenter-integrated Orchestrator.
1. Log in to the Windows OS of your existing vCenter installation.
2. Open the Servicesfor example, for Win 2008 R2, navigate to Start | Administrative
Tools | Services.
3. Find the VMware vCenter Orchestrator Server service.
4. Right-click and select Start. If the service fails to start, have a look at the There's
more... section of this recipe. The first start might take a while and Windows might
complain about it, but just have patience.
5. When the service has started, use vCenter Orchestrator Client to connect to
Orchestrator. You'll find the client by navigating to Start | VMware | vCenter
Orchestrator Client.
6. Enter localhost:8281 as Host name, [email protected]
as User name with the corresponding password, and click on Login.
12
Chapter 1
Finished! Orchestrator is up and running.
How it works...
When you install vCenter, you also automatically install Orchestrator; however, what you
probably don't know is that the installer also configures Orchestrator to use the vCenter
database, registers itself with SSO, and configures the vCenter plugin. Orchestrator is now
easily accessible and fully configured to work with vCenter/vRA.
That said, one needs to understand that we have just started another hungry service on
vCenter/vRA VM. As already discussed in the introduction, you might want to rethink this.
Looking at how the vCenter-integrated Orchestrator is configured, we find that the whole
configuration process is triggered by the vco.properties file in the C:\Program Files\
VMware\Infrastructure\Orchestrator directory. It contains all relevant information,
but no passwords.
If you look into Orchestrator's configuration using the Orchestrator Configuration tool (see
the Two ways to configure Orchestrator recipe in this chapter), you will find the following
configurations:
In the Network section, the vCenter and the SSO SSL certificates have been added.
In the Database section, there is a new and unique database type: vDB. This is a
connection to the ODBC drivers you set up for vCenter.
In the Licensing section, Orchestrator has been licensed with the vCenter license key.
Last but not least, the vCenter plugin is configured with vCenter details.
13
There's more...
If you get an error while starting the Orchestrator service, have a quick look at C:\Program
Files\VMware\Infrastructure\Orchestrator\app-server\logs. There is a
file called server.log. This is the logfile for the Orchestrator service. The most common
problem at this point is that the database cannot be accessed. If this is the case, I would
recommend switching the database type to embedded.
See also
To fully integrate Orchestrator into your vCenter, continue with the Integrating Orchestrator
into SSO and vSphere Web Client recipe in this chapter as well as the recipe Orchestrator
and vSphere Web Client in Chapter 5, Basic Orchestrator Operations.
Getting ready
We can deploy the Orchestrator appliance on either a vSphere environment or on VMware
Workstation (or Fusion if you are a MAC user).
The Orchestrator appliance needs the following (defaults):
3 GB memory
12 GB disk space
How to do it...
In this recipe, we will learn how to download and deploy Orchestrator.
14
Chapter 1
Download
1. Navigate to http://vmware.com and select Downloads.
2. Enter Orchestrator appliance in the search text box and press Enter.
3. Select the latest version from the menu.
4. Download the file that ends in .ova.
Deploy
1. Log in to vCenter using WebClient.
2. Right-click on the cluster or ESXi Server and select Deploy OVF Template....
3. The Deploy OVF Template wizard starts. Select the OVA file you have downloaded and
click on Next.
4. Accept the EULA and click on Next.
5. Select a name (or accept the default) as well as the vCenter folder for the
Orchestrator appliance and click on Next.
6. Select the cluster or ESXi Server or a resource pool for the Orchestrator appliance
and click on Next.
7.
Select the datastore you would like to deploy the Orchestrator appliance on and click
on Next.
15
16
Chapter 1
12. Opt to power on the VM after deployment and click on Finish.
13. Wait until the VM has finished deploying and is powered on.
14. Open the console of the Orchestrator appliance and wait until the install process
has completed and the VM console shows the following screen:
Let's go
1. Open a browser and browse to the IP of the Orchestrator appliance (for example,
http://192.168.220.132).
17
18
Chapter 1
How it works...
vCO 5.5.2.1 appliance is a preconfigured Orchestrator installation that uses the following:
PostgreSQL 9.1.9
OpenLDAP 2.4.26
Everything is ready to run; however, no integration with vCenter or any external service is
configured. The Orchestrator appliance comes with a 90-day evaluation license installed.
The LDAP has the following preconfigured entries:
Username
vcoadmin
vcouser
Password
vcoadmin
vcouser
Group membership
vcoadmins
vcousers
Both LDAP and DB are protected to allow only local access to them.
There's more...
If you want to deploy the Orchestrator appliance on VMware Workstation, the process of
deploying the Orchestrator appliance differs from the one described in this recipe. Follow
these steps instead:
1. Use Windows Explorer to navigate to the downloaded .ova file.
2. Double-click on the OVA file. VMware Workstation opens up.
3. Select a name and a path for the new VM and click on Import.
4. Accept the EULA and wait until the VM is deployed.
5. You might need to select a different network (for example, Host-Only) depending
on your lab environment.
19
7.
8. Then, enter and confirm a new password for the Orchestrator Configuration tool.
The installation will now continue. Wait until it has finished.
The appliance will start with a DHCP address from Workstation. To set a static IP,
you will have to access the admin interface of the appliance.
See also
See the Tuning the appliance recipe in Chapter 2, Optimizing Orchestrator Configuration.
Getting ready
To get the Windows install working, we need the following:
20
Chapter 1
4 GB memory
2 GB disk space
How to do it...
We assume that you are installing Orchestrator on a freshly installed Windows VM.
Install
1. Insert the ISO image into the VM (for example, mount it via vCenter).
2. Use Explorer to browse to the [CDROM]:\vCenter-Server\vCO directory.
3. Execute the install file. The install wizard starts.
4. Skip the introduction by clicking on Next.
5. Accept the EULA and click on Next.
6. Select the path where you want to install Orchestrator and click on Next.
7.
21
How it works...
The Windows Orchestrator version now also comes with embedded LDAP and database,
making the first steps much easier.
The embedded database and LDAP can't be as easily accessed as with the appliance because
there isn't really a need to do so. If you want to be serious about Orchestrator, you should use
an external database and you will want to use at least your Active Directory (AD),
if not SSO, as an authentication source.
The Windows installation also comes with a 90-day evaluation license.
22
Chapter 1
Getting ready
We need an Orchestrator instance up and running, as described in the recipes about installing.
To use the Configuration tool, we just need a web browser; and for the workflow method, we
need either a local Java install to start the Java Web Client or an installed Orchestrator Client.
How to do it...
There are two ways to configure Orchestrator; I would encourage you to explore both.
23
Here are all the sections that can be used to configure Orchestrator.
24
Chapter 1
3. You might need to accept the SSL certificate. Click on Install this Certificate to not
have this come up again and then click on Ignore.
4. Once the Orchestrator Client opens, click on workflows (the blue icon with white in it)
and then expand the tree, as seen in the next screenshot.
5. Here, you'll find all the Orchestrator-specific configuration workflow. Start one by
right-clicking on it and choosing Start workflow.
6. After entering the required information and clicking on Submit, the workflow will start.
7.
A green tick next to the workflow execution will show you that the workflow was
executed without an error. A red cross shows that the workflow encountered an error
and has stopped. See the How it works... section of this recipe.
25
Base-configuring Orchestrator
Independent of the way you choose to configure Orchestrator, please continue with the recipe
Important Orchestrator base configurations as the recipes in the rest of this chapter require
the use of either method.
How it works...
The Orchestrator Configuration tool is an independent service in Windows as in Linux. The
service doesn't require to be switched on all the time; it is more or less a one-off tool to get
the initial deployment working.
The Orchestrator Configuration tool was commonly used to configure Orchestrator, and you
will find countless websites still quoting it. It is a generally straightforward tool that helps you
configure Orchestrator. The trick is to work your way down, starting with the General section.
Every time you configure an item correctly, the little light next to the section title will switch
to green. The light turns red if the item is not configured or is misconfigured. When you log in
to Orchestrator for the first time, you will notice that all the lights are green; this is because it
uses the preconfigured settings. You can still reconfigure all items to your own specifications.
26
Chapter 1
This will start the workflow again; however, it preserves all the information you have entered
already into the workflow. No retyping is needed as everything from the last run is still
displayed in the forms. The only exceptions are passwords, which is a good thing.
There's more...
There is actually a third way of configuring Orchestrator. Using the REST API of Orchestrator,
you can connect to Orchestrator Server and run the configuration workflows. Showcasing this
is beyond the scope of this book; however, you can find some instruction in the Orchestrator
documentation and also in the Accessing the Orchestrator API via REST recipe in Chapter 6,
Advanced Operations.
Getting ready
You need an installed and running Orchestrator. You should also be comfortable with using
one of the methods described in the Two ways to configure Orchestrator recipe.
27
How to do it...
These are some basic configurations that have to be done to Orchestrator to make it
production-ready. I will describe the use of the Orchestrator Configuration tool as well
as the workflow method.
28
Chapter 1
3. Right-click on the workflow Configure the network settings and select
Start Workflow.
4. Select the correct IP address and click on Submit.
5. Wait until the workflow has successfully finished.
29
30
Chapter 1
Licensing
Both the Orchestrator Windows version and the appliance come with a 90-day evaluation
license. Orchestrator is licensed with vCenter. The vCenter license key is the Orchestrator
license key, and no extra purchase is required. However, if you are using the vCenter Essential
license, you can only run workflows; you cannot create or edit them.
You can either enter a license key manually or connect to the vCenter Server to acquire
the license.
Before you begin, add the vCenter SSL Certificate to Orchestrator.
Using the Orchestrator Configuration tool
1. Open the Orchestrator Configuration tool.
2. Click on the Licenses section.
3. Select Use vCenter Server license.
4. Enter the FQDN to vCenter.
5. Enter an administrative vCenter username and the corresponding password.
6. Click on Apply changes.
31
32
Chapter 1
Using the Orchestrator Configuration tool
1. Open the Orchestrator Configuration tool.
2. Click on the Server Certificate section.
3. Click on Create a certificate database and self-signed server certificate.
4. Enter the required information, and select a country from the drop-down menu,
and click on Create. Your new certificate will now be shown.
33
How it works...
You can see that, for the most part, the workflow method requires the same inputs as the
Orchestrator Configuration tool; however, you have probably also noticed that there are not
as many options in workflows as with the Configuration tool.
The settings we just applied are important and need to be done in order to make Orchestrator
production-ready. The network configuration, the package signing, as well as the licensing
need to be done only once. Importing an SSL certificate is an action that we will encounter
more often. Every time we want to establish a secure connection (SSL) between Orchestrator
and another server, we first have to import this server's SSL certificate.
Please note that, in earlier versions of Orchestrator, you had to restart the Orchestrator
Configuration tool or the Orchestrator service after importing the SSL certificate; this is
no longer the case.
The SSL certificate we configured here is used to sign exports or packages to be used with
other Orchestrator installations. We will work with exports and imports in the Importing and
exporting Orchestrator elements recipe in Chapter 5, Basic Orchestrator Operations. In the
Working with packages recipe of that chapter, you will find some more detailed information
about how to manage and use this SSL certificate.
34
Chapter 1
At the time of writing of this book, there is a small bug that appears from time to time with
the network configuration. When using the appliance and changing the network setting to
anything else but 0.0.0.0, some things, such as the Orchestrator home page, won't work
anymore. To fix the problem, check out this VMware community article available at https://
communities.vmware.com/thread/477955.
See also
Have a look at the Backup and recovery recipe in Chapter 2, Optimizing Orchestrator
Configuration, to learn how to export and import the configuration.
Getting ready
You need a supported LDAP service configured and running. The following LDAP services are
supported in vCO 5.5:
OpenLDAP
We also need to create a group and a user in these services, so you should have access to
these services.
You should be comfortable with using one of the methods described in the Two ways to
configure Orchestrator recipe.
If your LDAP (AD) requires SSL (Kerberos), you will need to import the SSL certificate first (see
the Important Orchestrator base configurations recipe in this chapter.
35
How to do it...
We will focus on linking Orchestrator to AD. Connecting Orchestrator to LDAP is pretty much
the same procedure; for anyone who understands LDAP, this will be a breeze.
AD is basically the same as LDAP but most Windows administrators have problems with the
LDAP representation of AD, which is why we focus on AD in this recipe.
We will configure SSO in the Integrating Orchestrator into SSO and vSphere Web Client recipe.
36
Chapter 1
6. The standard port for Microsoft Active Directory LDAP is 389.
7.
8. If you have secured your AD with Kerberos, you need to activate SSL (don't forget to
import the SSL certificate first).
9. The username can be entered in both formats: user@Domain or domain\user. The user
can be any active user within the AD; however, its best to use Orchestrator Admin.
10. The user and group lookup base is easiest set to the root of your domain,
for example, dc=mylab,dc=local. However, if your AD or LDAP is large,
performance-wise it might be better to choose a different root.
11. The Orchestrator Admin group path can be easily found. Enter the name of the group
(case-sensitive) and click on Search to the right.
37
13. The rest of the settings can be left alone for most AD settings.
14. Click on Apply changes.
15. At this stage, you should try the test login described in the There's more... section of
this recipe.
16. Click on Startup Options and then restart the Orchestrator Server.
17. Now, try to log in to the Orchestrator Client using the AD user.
Using the workflow
1. Open the Orchestrator Client.
2. Navigate to Library | Configuration | Authentication | LDAP.
3. Right-click on the workflow Configure Active Directory and select Start Workflow.
4. In the primary host, enter mylab.local as the Active Domain DNS name.
5. The standard port for AD LDAP is 389.
6. If you secured your AD with Kerberos, you need to activate SSL.
7.
Click on Next.
38
Chapter 1
Sadly, there isn't a test to check whether your settings are correct as there is with the
Configuration tool. Have a look at the test login described in the There's more... section
of this recipe.
There is no workflow to restart Orchestrator Server, so you have to restart the Orchestrator
Server another way:
In Linux, use the services command from the OS or use the Orchestrator
Configurator (see the Tuning the appliance recipe in Chapter 2, Optimizing
Orchestrator Configuration)
How it works...
Configuring Orchestrator to work with an external authentication enables AD users to log in to
the Orchestrator Client. The alternative would be either having only one user using it or adding
users to the embedded LDAP. However, for a production Orchestrator, the embedded LDAP
solution is not viable. As SSO is now a highly integrated part of vSphere, using Orchestrator
with AD (or LDAP) isn't really such a good solution any longer. SSO can proxy multiple AD and/
or LDAP domains and lets you integrate Orchestrator directly into vCenter as well as other
corner pieces of VMware software offerings, making SSO integration the better choice for
the future.
39
There's more...
There are some things you should be aware of when working with LDAP.
Test login
In order to find out whether everything is working as it should, we need to test it. However,
there is no workflow for this, so you have to trust your entries or use the Configuration tool.
1. Using the Orchestrator Configuration tool, click on Authentication.
2. Click on the Test Login tab.
3. Enter the Orchestrator Admin username and its password and click on Test Login.
4. Read the message carefully. It should be green and confirm that you can log in and
that the user is part of the Orchestrator Admin group.
A red message mostly indicates that the user provided isn't in the LDAP or that the password
is wrong.
If the message doesn't confirm an Orchestrator Admin group membership, review the
membership of the user account.
40
Chapter 1
Meaning
What to do
525
52e
Password is incorrect
530
531
532
Password expired
533
Account disabled
701
Account expired
773
775
User locked
See also
See the Integrating Orchestrator into SSO and vSphere Web Client recipe in this chapter to
learn how to configure Orchestrator with VMware SSO.
Getting ready
vCO 5.5 (and higher) requires an SSO server 5.5, as it won't work with an SSO 5.1 server.
We need an up-and-running Orchestrator as well as access to vCenter Web Client.
Make sure that you set the Orchestrator Network configuration (see the Configuring the
network section in the Important Orchestrator base configurations recipe)
41
How to do it...
Again both configuration methods are shown. Choose the one you're most comfortable with.
42
Chapter 1
11. This registration registers a new application user in SSO.
12. Select from the drop-down menu the group you would like to use for
Orchestrator administrators.
13. Click on Accept Orchestrator Configuration.
43
44
Chapter 1
6. Enter a vCenter Server administrative user and click on Apply changes.
45
46
Chapter 1
How it works...
Since vCenter Server 5.1, vSphere Web Client is (or better, should be) the main method for
accessing vCenter. Orchestrator completely integrates with vSphere Web Client, making it
possible for Orchestrator workflows to be executed directly from vSphere Web Client.
47
See also
To learn more about Orchestrator user management, see the User management recipe in
Chapter 5, Basic Orchestrator Operations.
To configure Orchestrator workflows in vSphere Web Client, see the Orchestrator and vSphere
Web Client recipe in Chapter 5, Basic Orchestrator Operations.
48
Chapter 1
Getting ready
We will need a database; the following databases are supported with vCO 5.5.2.1:
Oracle 11g
PostgreSQL
You will need to create an empty database for Orchestrator, and you should also create a
dedicated user account for Orchestrator to access the database.
You should be comfortable with using one of the methods described in the Two ways to
configure Orchestrator recipe.
If your Database requires SSL, you will need to import the SSL certificate first; for this, see
the Important Orchestrator base configurations recipe in this chapter.
When you replace the database, you will have to reconfigure the following
items: Licensing and Server Certificate.
How to do it...
Both configuration methods will be shown; choose the one you prefer. In this example, we
have added a SQL database to Orchestrator. The other databases are not that much different.
49
Database information
The following information is needed for each type of database:
Database type
Oracle
SQL Server
PostgreSQL
Login
required
required
required
SSL
optional
optional
optional
Hostname
required
required
required
Port
1521 or custom
1433 or custom
5432 or custom
Database name
required
required
Instance
required
optional
Domain
optional
Use NTLMv2
optional
50
Chapter 1
51
How it works...
The Orchestrator database contains the entire configuration, workflows, workflow runs, events,
runtime information, actions, and a lot more. Therefore, it is quite important to consider using
an external database. Without an external database, certain Orchestrator features, such as
resuming a workflow after an Orchestrator Server crash, will not work or will be impaired.
All Orchestrator versions come with the embedded PostgreSQL database or use the vCenter
Server database. A production environment dictates the use of an external database that
integrates with the business continuity processes of your company.
In addition to this, the embedded database isn't really sized or optimized for large
deployments and doesn't allow the use of Orchestrator Clustering.
Using the vCenter Server database for Orchestrator is not really a very pretty solution either.
IT best practices dictate using dedicated resources for production environments. Putting
the database on the same VM as Orchestrator is something to think about as it results in a
competition for resources between the database and the Java process.
52
Chapter 1
Sizing
Sizing is hard to predict. Each workflow run consumes around 4 KB, and most objects (for
example, vCenter Server Object) require around 50 KB each. VMware recommends 1 GB for
a production database. The good thing is that Orchestrator regularly runs clean-up jobs to
reduce the database content. Also have a look at the User preferences recipe in Chapter 5,
Basic Orchestrator Operations, where we discuss certain properties that influence how much
information is kept in the database.
Database roles
For the initial setup (and for updates), you should give the dedicated Orchestrator user the
db_owner rights on the Orchestrator database.
For a normal usage scenario the Orchestrator user only requires the db_dataread and
db_datawrite rights.
There's more...
Here are some things you might find useful.
Microsoft SQL
Giving the database the settings ALLOW_SNAPSHOT_ISOLATION and READ_COMMITTED_
SNAPSHOT will reduce the chance of a deadlock occurring and is also a prerequisite for
Orchestrator clusters.
Oracle
The database should have NLS_CHARACTER_SET = AL32UTF8 set before you start allowing
Orchestrator to build its tables.
To avoid an ORA-01450 error, it is important that you have the database block size configured
in accordance with your database index.
53
www.PacktPub.com
Stay Connected: