rastern

Template Bulk Import and Physical to Virtual (P2V) UI Extension

Blog Post created by rastern Expert on May 23, 2018

Overview

This post details the installation and operation of the P2V import utility recently created to aid clients with both bulk template importing, and physical to virtual migration simulations. A previous script called plan.html has been distributed with Turbonomic, and used by some clients. This utility was commissioned to fully replace the previous CGI script while keeping close parity with the new UI design. In addition to providing the p2v planning functionality, it adds support for bulk importing templates into Turbonomic from a CSV file.

 

Installation

Installation of the utility requires copying a single file to each instance upon which a client wishes to run P2V plans, or bulk import templates. The utility is JavaScript based, and operates fully client-side using API 2 calls.

 

To install, the attached import.html file must be copied to the Turbonomic instance, and placed in the /srv/www/htdocs/ folder. This operation must be performed on each Turbonomic instance that will be used. 

 

For example if the target instance resides at 10.10.0.1, from a Linux or OS X machine, you might copy the file like follows:

scp ./import.html root@10.10.0.1:/srv/www/htdocs

 

Usage

Accessing the UI extension is simple. Using our same host 10.10.0.1 from before, you navigate to the new import.html page on the host as follows:

https://10.10.0.1/import.html

 

If not already logged in, the user will be prompted for their Turbonomic credentials as usual. Once logged in, the user will be redirected to the import utility.

 

The import utility contains two modes: Template Import & P2V Plan

 

Bulk Import Mode

  1. File selection dialog - The file must be a simple CSV file. See the attached Template Values Documentation file for details on the format
  2. Mode selection - Switches between bulk import and P2V planning modes
  3. Submit button - Imports templates from the provided CSV file
  4. Close button - Exits back to the main UI

 

P2V Plan Mode

  1. File selection dialog - The file must be a simple CSV file. See the attached Template Values Documentation file for details on the format
  2. Mode selection - Switches between bulk import and P2V planning modes
  3. Market - On 6.0.x this will show only the Realtime Market, while on 6.1 instances, you may apply the P2V to a previously run plan to perform a plan-on-plan simulation
  4. Submit button - Imports templates, and runs the simulation; the plan itself will open in a new tab, and after the plan copies the temporary templates will be removed
  5. Close button - Exits back to the main UI

 

Documentation

File format: Both modes of the utility make use of a comma separated values (CSV) formatted input file. Excel XLS or XLST files and CSV files saved as XLS are not supported and will generate errors if used. The file must be a basic CSV file.

 

Supported Fields: The attached Template Values Documentation.xlsx is the template field documentation, providing details on which fields are valid for which templates, required fields, and default field values. The sample.csv is an example file you can refer to.

 

Creating the CSV file:

When creating the CSV file, the first line is the field headers and must contain all the field names you will be using, comma separated. The field names are not case-sensitive, and the order in which they appear in the header does not matter either. Each following line after the first represents a single template entry, and the order of the columns must match what you specified in the first line. As shown in the sample.csv, fields that are not valid for a template (i.e. CPU for a storage template) will be ignored. This allows you to mix and match all different template types within one file.  

 

Control Fields:

In addition to the template fields, there are two special control fields:

  • class - this field indicates which template type the row is for. Template names are listed in the Template Values Documentation file, and the following short-hand template codes may also be used:
    • vm for virtual machine
    • pm for physical machine
    • st for storage
    • ct for container
  • qty - this field is required in P2V plan mode, and is ignored by the bulk template import mode. The field indicates how many copies of the template are to be used in the plan, and should be 1 or greater. 

 

Known Issues

There is a single known issue with the removal of P2V plan templates which may impact very large instances that take longer than 1 minute to copy the plan. This may result in some templates not being copied into the plan prior to being removed from the system by the utility. This will be addressed in a future release.

Outcomes