How to Migrate OCI Qtree Annotation from OCI to CI

Carrying on from the last post where we looked at storage annotation.

  • OCI = NetApp OnCommand Insight
  • CI = NetApp Cloud Insights

The Easy Way to Migrate Qtree Annotations from OCI to CI

Note: I know some people will debate this, but the setup time for this method is like zero. If you have access to the OCI operational servers MySQL (which you should do with a certain default user that runs the ETL process from the OCI DWH) and a MySQL client, you're up and running super fast.

Connect to the MySQL interface on the operational OCI Server (not the DWH) and query data there, to create an output that you can apply in CI's Annotation Import Utility.

What Object Types are in inventory.object_to_annotation?

SELECT DISTINCT objectType FROM inventory.object_to_annotation;

What Annotation Types (Annotation Names) Do We Have For Qtree?

This is going to be dependent on customer, but to get the list run:

SELECT DISTINCT annotationType FROM inventory.object_to_annotation WHERE objectType = 'Qtree';

Getting Qtree Annotation from OCI to CI

Say we have an annotation called "Cost Code" on qtrees. To get all the "Cost Code" annotations for all our qtrees, we would simply collect the CSV output of:

SELECT
  'Qtree' AS 'ObjectType',
  CONCAT(s.name,'->',i.name,'->',q.name) AS 'S>I>Q',
  a.valueIdentifier AS 'Cost Code' # <--- YOUR ANNOTATION
FROM inventory.object_to_annotation AS o
JOIN inventory.annotation_value AS a ON a.id = o.annotationValueId
JOIN inventory.qtree AS q ON q.id = o.objectId
JOIN inventory.storage AS s ON s.id = q.storageID
JOIN inventory.internal_volume AS i ON i.id = q.internalVolumeID
WHERE o.objectType = 'Qtree'
AND o.annotationType = 'cost_code'; # <--- YOUR ANNOTATION

Edit CSV output with a text editor (Excel has a habit of messing things up), and edit the top line to:

,,"Cost Code"

And then simply upload to CI via the Swagger UI and API:

/assets/import

Note: If you have a lot of qtree annotations to update, you may need to batch this up into batches of like 2000 (test to find a number that works for you.)

Comments