Preview only show first 10 pages with watermark. For full document please download

Using The Vcenter Orchestrator Sql Plug-in 1.0

   EMBED


Share

Transcript

Using the vCenter Orchestrator SQL Plug-In 1.0 vCenter Orchestrator 4.1 vCenter Orchestrator 4.2 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs. EN-000770-00 Using the vCenter Orchestrator SQL Plug-In 1.0 You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: [email protected] Copyright © 2011 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents. VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies. VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com 2 VMware, Inc. Contents Using the vCenter Orchestrator SQL Plug-In 1.0 5 1 Introduction to the VMware vCenter Orchestrator SQL Plug-In 7 Role of vCenter Orchestrator with the SQL Plug-In Installing the SQL Plug-In 7 SQL Plug-In Functional Prerequisites 7 Install the SQL Plug-In 8 7 2 Using the SQL Plug-In 11 Using the SQL Plug-In Inventory 11 Configuring the SQL Plug-In 11 Configuration Workflows 11 Add a Database 12 Add Tables to a Database 13 Update a Database 13 Generate CRUD Workflows for a Table 14 Exporting and Importing Database Configuration 14 Export Database Configuration as a Package 14 Import Database Configuration from a Package 15 Access the SQL Plug-In API 16 Index 17 VMware, Inc. 3 Using the vCenter Orchestrator SQL Plug-In 1.0 4 VMware, Inc. Using the vCenter Orchestrator SQL Plug-In 1.0 Using the vCenter Orchestrator SQL Plug-In 1.0 provides information and instructions about configuring and ® using the VMware vCenter Orchestrator SQL Plug-In 1.0. Intended Audience This book is intended for anyone who is installing and configuring the plug-in, using the API of the plug-in, and using the workflow library. The information in Using the vCenter Orchestrator SQL Plug-In 1.0 is written for experienced users who are familiar with Orchestrator workflow development and with databases. For more information about Orchestrator, see http://www.vmware.com/support/pubs/orchestrator_pubs.html. VMware, Inc. 5 Using the vCenter Orchestrator SQL Plug-In 1.0 6 VMware, Inc. Introduction to the VMware vCenter Orchestrator SQL Plug-In 1 The SQL plug-in allows interaction between vCenter Orchestrator and databases. You use the plug-in to access and manage data stored in a database. The plug-in contains a set of standard workflows that allow you to manage databases and generate CRUD workflows. You can also create custom workflows that implement the plug-in API. This chapter includes the following topics: n “Role of vCenter Orchestrator with the SQL Plug-In,” on page 7 n “Installing the SQL Plug-In,” on page 7 Role of vCenter Orchestrator with the SQL Plug-In You must use the Orchestrator configuration interface to install the SQL plug-in. You use the Orchestrator client to run and create workflows and access the plug-in API. The SQL plug-in is powered by vCenter Orchestrator. Orchestrator is a development and process-automation platform that provides a library of extensible workflows to manage the VMware vCenter infrastructure and other technologies. Orchestrator allows integration with management and administration solutions through its open plug-in architecture. SQL is one example of a database management system that you can integrate with Orchestrator by using plug-ins. Installing the SQL Plug-In You must use the Orchestrator configuration interface to install the SQL plug-in. SQL Plug-In Functional Prerequisites To be able to install and use the SQL plug-in, your system must meet the functional prerequisites. vCenter Orchestrator Verify that you have a running instance of Orchestrator. You can log in to the Orchestrator configuration interface at http://orchestrator_server:8282. Version 1.0 of the plug-in works with vCenter Orchestrator 4.1.x and 4.2. For information about setting up Orchestrator, see the documentation about installing and configuring the respective Orchestrator version. VMware, Inc. 7 Using the vCenter Orchestrator SQL Plug-In 1.0 Database Verify that you can establish a connection to a database. The plug-in supports Oracle, Microsoft SQL Server, and PostgreSQL databases. Optionally, you can enable support for MySQL databases. The plug-in does not support inserting data into database columns of type BLOB and CLOB. The plug-in can only read data from database columns of type BLOB and CLOB. Enable Support for MySQL Databases on Windows To use a MySQL database, you must download the driver and copy it to the appropriate location. The Orchestrator installer does not install drivers for MySQL databases. Prerequisites Verify that you have downloaded the latest MySQL driver from http://dev.mysql.com/downloads/connector/j/. Procedure 1 Extract the MySQL driver archive. 2 In the extracted folder, locate the mysql-connector-java-x.x.x.jar file, where x.x.x is the current version. 3 Copy mysql-connector-java-x.x.x.jar to the following location: install_directory\VMware\Orchestrator\app-server\server\vmo\lib\ext\ 4 Restart the Orchestrator server. a Right-click My Computer on your desktop and select Manage. b In the Computer Management dialog box, expand Services and Applications and select Services. c In the right pane, right-click and select VMware vCenter Orchestrator Server > Restart. You installed the MySQL database driver. Install the SQL Plug-In To be able to use the SQL plug-in, you must download the .vmoapp file containing the plug-in and install it by using the Orchestrator configuration interface. Prerequisites n Verify that you are logged in to the Orchestrator configuration interface at http://orchestrator_server:8282. n Verify that you have downloaded the .vmoapp file from http://www.vmware.com/products/datacenter-virtualization/vcenter-orchestrator/plugins.html. Procedure 8 1 On the General tab, click Install Application. 2 Upload the SQL plug-in. a Click the magnifying glass icon. b Select the .vmoapp file to install. c Click Open. d Click Install. VMware, Inc. Chapter 1 Introduction to the VMware vCenter Orchestrator SQL Plug-In A message appears after successful installation. The SQL plug-in is installed without a tab in the Orchestrator configuration interface. 3 VMware, Inc. On the Startup Options tab, click Restart service to complete the plug-in installation. 9 Using the vCenter Orchestrator SQL Plug-In 1.0 10 VMware, Inc. Using the SQL Plug-In 2 The SQL plug-in workflow library contains workflows that allow you to manage databases and generate CRUD workflows for database tables. You can use the Inventory view in the Orchestrator client to manage the available database resources. You can use the scripting API of the plug-in to develop custom workflows. This chapter includes the following topics: n “Using the SQL Plug-In Inventory,” on page 11 n “Configuring the SQL Plug-In,” on page 11 n “Generate CRUD Workflows for a Table,” on page 14 n “Exporting and Importing Database Configuration,” on page 14 n “Access the SQL Plug-In API,” on page 16 Using the SQL Plug-In Inventory The SQL plug-in exposes all objects in the connected databases in the Inventory view. You can use the Inventory view to add authorization elements or to run workflows on database objects. The Inventory view of the plug-in contains three levels of database inventory objects. The first level contains the database configuration objects. The second level contains the database table objects. The third level contains the database column objects. All inventory objects are exposed as scriptable objects and can be accessed from the JavaScript API. You can enable the Use contextual menu in inventory option to display the workflows that are available for an inventory object. After the option is enabled, when you right-click an object in the Orchestrator inventory, all available workflows for the object are displayed. Configuring the SQL Plug-In You must use the Orchestrator client to configure the SQL plug-in. Configuration Workflows The Configuration workflow category contains workflows that allow you to manage databases and database tables. You can access these workflows from Library > SQL > Configuration on the Workflows view in the Orchestrator client. VMware, Inc. 11 Using the vCenter Orchestrator SQL Plug-In 1.0 Workflow Name Description Add a database Adds a database object to the plug-in's inventory. Add tables to a database Adds database tables to a database in the plug-in's inventory. Remove a database Removes a database object from the plug-in's inventory. Remove a table from a database Removes a database table from a database in the plug-in's inventory. Update a database Updates the configuration of a database object in the plug-in's inventory. Validate a database Validates a database in the plug-in's inventory. Add a Database You can run a workflow to add a database and configure the host connection parameters. When you add a database that requires a secure connection, you must import the SSL certificate for the database, from the Network view in the Orchestrator configuration interface. Procedure 1 Log in to the Orchestrator client as an administrator. 2 Click the Workflows view in the Orchestrator client. 3 In the workflows hierarchical list, select Library > SQL > Configuration and navigate to the Add a database workflow. 4 Right-click the Add a database workflow and select Start workflow. 5 In the Name text box, type the name of the database. The database appears in the Inventory view with the name that you specify. 6 Select the type of the database. 7 In the Connection URL text box, type the address of the database. 8 9 Database Type Syntax Oracle jdbc:oracle:thin:@host_url:port_number:SID MS SQL jdbc:jtds:sqlserver://host_url:port_number/database_name PostgreSQL jdbc:postgresql://host_url:port_number/database_name MySQL jdbc:mysql://host_url:port_number/database_name Select the session mode that the plug-in uses to connect to the database. Option Description Shared Session The plug-in uses shared credentials to connect to the database. You must provide the database credentials for the shared session. Per User Session The Orchestrator client retrieves credentials from the user who is logged in. Click Submit to run the workflow. After the workflow runs successfully, the database and all tables that belong to it appear in the Inventory view. 12 VMware, Inc. Chapter 2 Using the SQL Plug-In Add Tables to a Database You can run a workflow to add tables to a database that is in the plug-in's inventory. Prerequisites n Verify that you are logged in to the Orchestrator client as an administrator. n Verify that you have a connection to a database from the Inventory view. Procedure 1 Click the Workflows view in the Orchestrator client. 2 In the workflows hierarchical list, select Library > SQL > Configuration and navigate to the Add tables to a database workflow. 3 Right-click the Add tables to a database workflow and select Start workflow. 4 Select a database to which to add tables. 5 Select the tables that you want to add. 6 Click Submit to run the workflow. After the workflow runs successfully, the added database tables appear in the Inventory view. Update a Database You can run a workflow to update the configuration of a database that is in the plug-in's inventory. Procedure 1 Log in to the Orchestrator client as an administrator. 2 Click the Workflows view in the Orchestrator client. 3 In the workflows hierarchical list, select Library > SQL > Configuration and navigate to the Update a database workflow. 4 Right-click the Update a database workflow and select Start workflow. 5 Select a database that you want to update. 6 In the Name text box, type the new name of the database. The database appears in the Inventory view with the name that you specify. 7 Select the type of the database. 8 In the Connection URL text box, type the new address of the database. 9 Select the session mode that the plug-in uses to connect to the database. 10 VMware, Inc. Option Description Shared Session The plug-in uses shared credentials to connect to the database. You must provide the database credentials for the shared session. Per User Session The Orchestrator client retrieves credentials from the user who is logged in. Click Submit to run the workflow. 13 Using the vCenter Orchestrator SQL Plug-In 1.0 Generate CRUD Workflows for a Table You can run a workflow to generate Create, Read, Update, and Delete workflows for a particular table. Prerequisites n Verify that you are logged in to the Orchestrator client as an administrator. n Verify that you have a connection to a database from the Inventory view. Procedure 1 Click the Workflows view in the Orchestrator client. 2 In the workflows hierarchical list, select Library > SQL and navigate to the Generate CRUD workflows for a table workflow. 3 Right-click the Generate CRUD workflows for a table workflow and select Start workflow. 4 Select a table for which to generate the workflows. 5 Select the workflow folder in which to generate the workflows. 6 Select whether to overwrite any existing workflows. 7 Option Description Yes The generated workflows overwrite existing workflows of the same type. No New workflows are not generated if workflows of the same type exist in the folder. (Optional) Select columns that should not be populated. You cannot edit the selected columns with the generated CRUD workflows. 8 Click Submit to run the workflow. After the workflow runs successfully, the CRUD workflows appear in the selected workflow folder. What to do next You can run the generated workflows on the selected database table. Exporting and Importing Database Configuration You can transfer the configuration of the SQL plug-in from one Orchestrator instance to another by creating a configuration package. You can export all plug-in elements, such as database objects and custom workflows, or export a selection of elements. You cannot update existing databases by importing a configuration package. If you want to import a new version of a database, you must remove the existing database and all elements related to it. You can back up the existing database by exporting it as a package. If a configuration package contains a database that has the same name as an existing database, but has different content, you should rename the existing database before importing the package. Export Database Configuration as a Package You can export elements of the SQL plug-in configuration as an Orchestrator package. Prerequisites Verify that you are logged in to the Orchestrator client as an administrator. 14 VMware, Inc. Chapter 2 Using the SQL Plug-In Procedure 1 Click the Packages view in the Orchestrator client. 2 From the Packages drop-down menu, select Add package. 3 Type the name of the package and click Ok. 4 Right-click the package that you added and select Edit. 5 From the Resources tab, select Insert Resource Element (tree browsing). Option Action Add all available databases In the hierarchical list, select Library > SQL and click Select. Add a specific database Expand the hierarchical list to Library > SQL, select a database, and click Select. 6 (Optional) From the Workflows tab, add custom SQL plug-in workflows. 7 (Optional) From the General tab, provide a description of the package. 8 Click Save and close. 9 Right-click the edited package and select Export package. 10 Type the filename, select a location, and click Save. Import Database Configuration from a Package You can import elements of the SQL plug-in configuration from an Orchestrator package. Prerequisites n Verify that you are logged in to the Orchestrator client as an administrator. n Verify that the SQL plug-in is installed on the Orchestrator instance. Procedure 1 Click the Packages view in the Orchestrator client. 2 From the Packages drop-down menu, select Import package. 3 Browse to select the package to import and click Open. Certificate information about the exporter appears. 4 Review the package import details and select Import or Import and trust provider. The Import package view appears. If the version of the imported package element is later than the server version, the system selects the element for import. 5 Click Import checked elements. The imported package appears in the list of packages. 6 VMware, Inc. (Optional) Verify that the databases are imported successfully. a In the workflows hierarchical list, select Library > SQL > Configuration to navigate to the Validate a database workflow. b Right-click the Validate a database workflow and select Start workflow. c Select a database to validate. d Click Submit to run the workflow. 15 Using the vCenter Orchestrator SQL Plug-In 1.0 What to do next You can edit the configuration of an imported database by running the Update a database workflow. See “Update a Database,” on page 13. Access the SQL Plug-In API Orchestrator provides an API Explorer to allow you to search the SQL plug-in API and see the documentation for JavaScript objects that you can use in scripted elements. Procedure 1 Log in to the Orchestrator client as an administrator. 2 Access the API Explorer from either the Orchestrator client or from the Scripting tabs of the workflow, policy, and action editors. 3 n To access the API Explorer from the Orchestrator client, click Tools > API Explorer in the Orchestrator client toolbar. n To access the API Explorer from the Scripting tabs of the workflow, policy, and action editors, click Search API on the left. To expand the hierarchical list of SQL plug-in API objects, double-click the SQL module in the left pane. What to do next You can copy code from API elements and paste it into scripting boxes. For more information about API scripting, see the vCenter Orchestrator Developer's Guide. 16 VMware, Inc. Index A adding a database 12 adding tables to a database 13 API access 16 audience 5 C configuration exporting 14 importing 15 configuration transfer 14 F functional prerequisites 7 G generating CRUD workflows 14 I installation 7 installation process 8 introduction 7 Inventory 11 M MySQL, installing MySQL driver 8 O Orchestrator 7 P prerequisites 7 U updating a database 13 usage 11 W workflows, configuration 11 VMware, Inc. 17 Using the vCenter Orchestrator SQL Plug-In 1.0 18 VMware, Inc.