(aka Using Nutanix Calm to Provide Integrated Self Service for Nutanix Era)
Nutanix Era is a software suite that automates and simplifies database administration – bringing one-click simplicity and invisible operations to database provisioning and lifecycle management (LCM). With one-click database provisioning and Copy Data Management (CDM) as its first services, Nutanix Era enables DBAs to provision, clone, refresh, and backup their databases to any point in time.
The API-first Nutanix Era architecture can easily integrate with your preferred self-service tools like Nutanix Calm. DBAs and infrastructure admins can build Era focused Calm blueprints, which developers can use to provision or clone Era managed databases via self service. This allows for DBAs and infra admins to retain sole access to the administrator accounts of Era, while still enabling developers to provision or clone databases on demand.
This blog post will focus on importing and launching a Calm blueprint which clones existing Era managed databases. For blueprints focused on database provisioning, please see the Nutanix GitHub blueprints repository for both PostgreSQL and MariaDB provisioning blueprints. In an upcoming blog we’ll cover those blueprints, and how they can be utilized to provide production grade databases for your applications.
Blueprint ImportTo get started, we’ll need to download the raw JSON blueprint file stored on GitHub. Either navigate to that link, and save the page, or run the following command from your terminal:
$ wget https://raw.githubusercontent.com/MichaelHaigh/calm-blueprints/master/EraDatabaseClone/EraDatabaseClone.json
Next, log in to Nutanix Calm with an Admin, Project Admin, or Developer account. Select the Blueprints button, and then select the Upload Blueprint button
In the pop-up, first select the recently downloaded blueprint, then give the blueprint a descriptive name, and select the project you wish to associate with this blueprint. Please note that blueprints are restricted to a single project. If you have multiple projects you wish to associate, you can later publish the blueprint to the Marketplace, which allows for an unlimited number of projects.
After clicking the Upload button, you’ll be presented with the blueprint canvas. There are two areas we’ll need to fill out prior to launching the blueprint. First, select Credentials along the top, and provide the following two credentials:
- era_creds: The admin account credentials for your Era Server. The DBA or Infra Admin should provide these credentials, which will be encrypted and securely stored, and will not be available for developers.
- db_server_creds: A private key that will allow SSH access to the Era provisioned Database. It is recommended to provide a default private key, but left as runtime so a developer can specify their own key if desired.
If you do not have an SSH key handy, one can be generated and printed with the following commands:
$ ssh-keygen -t rsa -f ~/erakey -C firstname.lastname@example.org
$ cat ~/erakey # enter this value in the credentials section
$ cat ~/erakey.pub # enter this value later in the variables section
Once complete, select the Back button in the upper right. Next, we’ll need to configure a couple of variables:
- source_db_name: This should be left blank, but left as runtime, so a developer can specify the name of the source database at application launch. If left blank, or an incorrect name is given, the application will intentionally fail early, and provide a list of valid database names for the developer.
- source_snapshot_id: This should be left blank, but left as runtime, so a developer can specify the UUID of the snapshot they wish to use for the database clone. If left blank, the most recent snapshot will be automatically chosen. If an incorrect UUID is provided, the application will intentionally fail early, and provide a list of valid snapshot UUIDs for the developer.
- cloned_db_name: This should be left blank, but left as runtime, so a developer can name the database clone. If left blank, the cloned database will default to _Clone_.
- cloned_db_public_key: In conjunction with the "db_server_creds", this allows SSH access to the Cloned DB Server. It is recommended to add a default matching public key, but leave the field as runtime, so a developer can specify their own key if desired.
- era_ip: The IP address of your Era Server. This should be configured at the time of blueprint import, and then left alone.
After you’ve filled out the bottom two variables, click Save in the upper right corner, and verify that no warnings or errors appear. At this point, we’re ready to launch our blueprint.
Blueprint LaunchIn the upper right corner, click the Launch button, where you’ll be presented with the Application Launch page. At minimum, you’ll need to provide an Application Name, and fill in the source_db_name and cloned_db_password variables.
If you’re not aware of the names of the databases registered with Era, either ask your DBA, or simply launch the app with the source_db_name field blank. The application launch will fail, however the 1GetDbHostInfo Package Install task will contain a list of valid database names.
While it’s not expected nor required to have access to Nutanix Era, if you do, you can monitor the clone operation from the Operations page of Era:
Application ManagementOn the Calm Application changes to a Running state, the Era source database has been successfully cloned, and access information can be gathered from the Services tab. To validate that we have a functional database, we can copy the IP from the Services tab, and provide the database name and password provided at launch to a tool like PSequel:
Additionally, in addition to the default profile actions (Start, Stop, Delete, etc.), custom day two operations are available under the Manage tab:
- Get Parent Snapshot List: When this action is run, a list of Snapshot times and UUIDs of the clone's parent will be provided. This is useful when running the Refresh Clone action.
- Refresh Clone: When this action is run, the cloned database will be refreshed to a different snapshot. Optionally provide a snapshot UUID (which can be gathered from the Get Parent Snapshot List action), if left blank, the clone will be refreshed to the most recent snapshot.
Snapshot ID (copy this): 1192b09d-3259-4f3e-91de-a7af9aea5179
Snapshot Time Stamp: 2019-05-12 22:35:57
Snapshot ID (copy this): 8a27dd58-64ef-4972-add4-edad4558fdc8
Snapshot Time Stamp: 2019-05-12 23:23:58
Snapshot ID (copy this): 5a4168e3-93ac-48e6-bdb5-1d1794a4ac42
Snapshot Time Stamp: 2019-05-13 00:11:57
To ensure we capture the reported error, we’ll refresh our database to the snapshot beginning with 8a27dd58:
SummaryThanks to the open and flexible nature of Nutanix Era and its APIs, it's very simple to use an existing self service tool, like Service Now or Nutanix Calm, to extend Era functionality. This allows for self service provisioning and cloning of Era managed databases, without Administrators having to provide Era admin credentials to developers.
© 2019 Nutanix, Inc. All rights reserved. Nutanix, the Nutanix logo and the other Nutanix products and features mentioned herein are registered trademarks or trademarks of Nutanix, Inc. in the United States and other countries. All other brand names mentioned herein are for identification purposes only and may be the trademarks of their respective holder(s), and Nutanix may not be associated with, or sponsored or endorsed by such holder(s). This document is provided for informational purposes only and is presented ‘as is’ with no warranties of any kind, whether implied, statutory or otherwise