FitBit HR Data Raw

Excited by the Fitbit Charge 2’s second by second heart rate data, but frustrated by the lack of an easy export function for accessing this data in raw form, I rolled a very quick Node.js app to give me CSV-formatted raw data from Fitbit.  Note that to access the APIs I am using, you either need special approval, or a Personal application registered on the Fitbit developer portal.

It looks like this, after the app is initially authorized:

Clicking the “Get HR for Today” link gives me this raw CSV:

And so on.

Here’s the bare bones code, posted as a gist on GitHub:

vRealize Automation 7.0 to 7.1 Upgrade the SQL Database Manually DBUpgrade.zip

 

Summary

Following the installation instructions for manual SQL database upgrade using vRealize Automation 7.0 to 7.1, the vRA VAMI installation download page didn’t have a link for DBUpdate.zip, only DBInstall.zip.  I manually created the path https://<vra>:5480/installers/DBUpgrade.zip and continued with the upgrade.

Problem Details

Doing a manual update of the vRealize Automation IaaS MS SQL database, the vRealize 7.0 to 7.1 upgrade guide has this instruction:

I thought I followed the directions, but had errors and was missing the key utility DBUpgrade.exe in the ZIP file.  I eventually logged on the vRA server, found the DBUpgrade.zip file in /opt/vmware/share/htdocs/service/iaas/ to confirm it was there.  Only then did I realize I had been downloading the wrong file.  Apparently I do not have a link to download the database upgrade scripts on the installation interface.

Solution

Clearly, the file exists:

So I used the URL https://<vRA-appliance>:5480/installer/DBUpgrade.zip and followed the install instructions from there.

vRealize Orchestrator additionalPropertyFilters Explanation

Summary

The Orchestrator VcPlugin getAll…() methods (such as VcPlugin.getAllDatastores(), VcPlugin.getAllVirtualMachines(), etc.) accept two parameters, additionalPropertyFilters and xpath.  Use of xpath has been well documented, but I had trouble finding information on additionalPropertyFilters.  Then, I found this explanation in the vRO Coding Design Guide, page 26:

For performance reasons, the returned objects are not fully populated with all of the properties but a pre-defined set of properties. The initial set can be determined by looking at the plugin inventory – all properties displayed in the inventory are in the initial properties set. If additional properties are needed, specify them during the getAll…(…) call so that the request from the vCenters can get a combined set of properties upfront. If this is not done and extra properties are referenced by the workflow or action then a remote call is made each time to vCenter to create a vCenter filter for the tuple <vm, property=”” name=””>, which wastes resources both for remote execution and for filter management on vCenter side.

Ah hah!

 

How To Use additionalPropertyFilters

A quick look at vroapi.com tells me the syntax is getAll…(string[], string).  As a test, I created a string array containing the name of all properties for the VcVirtualMachine class and ran this code successfully:

Simple!

 

Performance Gains?

After performance testing, I found an average gain of 190ms per VM when reading all the VcVirtualMachine’s base level attributes.  However, I’m using Date.now() for performance testing and it is less granular than I would like, also this wasn’t exactly the most controlled test – other environmental factors may have impacted performance, so your results may not be the same.

For the performance test, I ran 30 iterations of VcPlugin.getAllVirtualMachines() and averaged execution time with and without the additionalPropertyFilters parameter, 195ms and 165ms respectively.

Then I read all base-level properties from the first 200 virtual machines, using the object returned by each of the two types of calls, and averaged that time per VM.  I felt that this should trigger the “remote call… to vCenter” referenced above.


…Results!

  • Per-VM property read time without additionalPropertyFilters: About 240ms
  • Per-VM property read time with additionalPropertyFilters: About 50ms

 

Hope this helps.

 

 

Cross-vCenter VM Clone using vRealize Orchestrator

vRealize Orchestrator includes a built-in workflow to clone VMs, but does not handle cross-vCenter VM cloning automatically.  This code is an early example of the necessary parameters to perform cross-vCenter VM clone using Orchestrator.  I hope it can serve as a starting point for others.

There are some parts of this code that need work, namely:

  • Workflow relies on input values for username and password to authenticate the destination vCenter.  I would prefer to use token based authentication from the VcPlugin’s connection to vCenter.
  • vCenter SSL Thumbprint is provided manually via input value.  I would prefer to find the SSL thumbprint from the VcPlugin’s existing trusted relationship with the destination vCenter.
  • VcPlugin.allSdkConnections[1] is not the right way to get the destination vCenter sdk connection.  This is the easiest one to fix.

Parameters

Code

vRA 7 vSphere Data Collection, Error processing [inventory]…

Problem

After vRealize Automation Center 7 initial data collection on a new vSphere compute resource, when trying to create a reservation, no compute, storage, and network paths are available for the resource.  This is because all hosts in the vSphere cluster were in maintenance mode.

I see the following error in Infrastructure -> Monitoring -> Log:

Error processing [inventory], error details: Value cannot be null. Parameter name: collection

And this related error (I’ve replaced identifiers):

DC: {guid}: inventory: {endpoint: compute}: Received failed data collection response, StatusID = {guid} : Value cannot be null. Parameter name: collection

Resolution

All hosts in the vSphere cluster were in maintenance mode.  As a result, data collection failed with an error.  After exiting maintenance mode, I was able to run data collection again (Infrastructure -> Compute Resource -> Compute Resources -> Hover on resource -> Data Collection -> Inventory -> Request Now).  This fixed the issue.

Blog entry created as searching for the error verbatim did not yield any results.