How to Migrate OCI Qtree Application from OCI to CI (and BU)

Carrying on from How to Migrate OCI Qtree Annotation from OCI to CI.

  • OCI = NetApp OnCommand Insight
  • CI = NetApp Cloud Insights
Collecting the Data from the OCI Operational Server

Again, using the MySQL connection to the OCI Operational Server, we can get our CSV of data to upload into the CI Annotation Import Utility (API Swagger UI: /assets/import). Edit (in a text editor) the top line of the CSV output so it is either of:
  • ,,Application
  • ,,Application,Business_Unit
Below are some slightly different options for acquiring the data. Why you might use these is explained at the end of the article.

Option 1) With application is not 'No-Service' and Business Unit IS NOT NULL

SELECT
  'Qtree' AS 'ObjectType',
  CONCAT(s.name,'->',i.name,'->',q.name) AS 'S>I>Q',
  a.name AS 'Application',
  a.businessUnit AS 'Business_Unit'
FROM inventory.qtree AS q
JOIN inventory.storage AS s ON s.ID = q.storageID
JOIN inventory.internal_volume AS i ON i.ID = q.internalVolumeID
JOIN inventory.qtree_to_application AS qa ON qa.qtreeID = q.ID
JOIN inventory.application AS a ON a.id = qa.applicationId
WHERE a.name != 'No-Service'
AND a.businessUnit IS NOT NULL;

Option 1B) With application is not 'No-Service' and Business Unit IS NOT NULL, and Application name is not the same as Business Unit

SELECT
  'Qtree' AS 'ObjectType',
  CONCAT(s.name,'->',i.name,'->',q.name) AS 'S>I>Q',
  a.name AS 'Application',
  a.businessUnit AS 'Business_Unit'
FROM inventory.qtree AS q
JOIN inventory.storage AS s ON s.ID = q.storageID
JOIN inventory.internal_volume AS i ON i.ID = q.internalVolumeID
JOIN inventory.qtree_to_application AS qa ON qa.qtreeID = q.ID
JOIN inventory.application AS a ON a.id = qa.applicationId
WHERE a.name != 'No-Service'
AND a.businessUnit IS NOT NULL
AND a.name != a.businessUnit;

Option 1C) With application is not 'No-Service' and Business Unit IS NOT NULL, and Application name = Business Unit

SELECT
  'Qtree' AS 'ObjectType',
  CONCAT(s.name,'->',i.name,'->',q.name) AS 'S>I>Q',
  a.name AS 'Application',
  a.businessUnit AS 'Business_Unit'
FROM inventory.qtree AS q
JOIN inventory.storage AS s ON s.ID = q.storageID
JOIN inventory.internal_volume AS i ON i.ID = q.internalVolumeID
JOIN inventory.qtree_to_application AS qa ON qa.qtreeID = q.ID
JOIN inventory.application AS a ON a.id = qa.applicationId
WHERE a.name != 'No-Service'
AND a.businessUnit IS NOT NULL
AND a.name != a.businessUnit;

Option 2) With application and ignoring Business Unit because it is null

SELECT
  'Qtree' AS 'ObjectType',
  CONCAT(s.name,'->',i.name,'->',q.name) AS 'S>I>Q',
  a.name AS 'Application'
FROM inventory.qtree AS q
JOIN inventory.storage AS s ON s.ID = q.storageID
JOIN inventory.internal_volume AS i ON i.ID = q.internalVolumeID
JOIN inventory.qtree_to_application AS qa ON qa.qtreeID = q.ID
JOIN inventory.application AS a ON a.id = qa.applicationId
WHERE a.name != 'No-Service'
AND a.businessUnit IS NULL;

Option 3) With application and completely ignoring Business Unit

SELECT
  'Qtree' AS 'ObjectType',
  CONCAT(s.name,'->',i.name,'->',q.name) AS 'S>I>Q',
  a.name AS 'Application'
FROM inventory.qtree AS q
JOIN inventory.storage AS s ON s.ID = q.storageID
JOIN inventory.internal_volume AS i ON i.ID = q.internalVolumeID
JOIN inventory.qtree_to_application AS qa ON qa.qtreeID = q.ID
JOIN inventory.application AS a ON a.id = qa.applicationId
WHERE a.name != 'No-Service';

Explained

If you notice in Option 1, that a lot of the Business Units are exactly the same name as the Application (can get the break down with 1B and 1C), then it suggests the Business Units have been incorrectly input (i.e. you would expect to have a different Application Name to Business Unit.) In which case you might skip Business Unit entirely and just go with Option 3.

If not (Business Units are mostly correct and not simply the Application input twice), then you would go with Option 1 and Option 2.

Comments