Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Managing SLOs using the REST API

You can use the Hitachi Ops Center Analyzer REST API to monitor and manage the Service Level Objectives (SLO) defined for the user resources such as volumes and VMs. Using the REST API, you can define, evaluate, and customize the SLOs defined for the monitored resources.

Allocating volumes to a host

The example in this article describes how to allocate a batch of volumes to a platinum grade consumer and manage the SLOs defined for the volumes using the REST API.

Procedure:

  1. Create a consumer.
  2. Assign volumes to a consumer.
  3. Create a user resource threshold profile when a new Service Level Agreement (SLA) is introduced.
  4. Assign volumes to the user resource threshold profile.

Each task in the workflow is explained using the curl commands.

NoteThe sample curl commands described in this article work on the Linux environment. If you plan on using these examples in the Windows environment, you must address the single-quote issue because the curl statements with single-quotes do not work on Windows. Please refer appropriate documentation for using curl on Windows.

Creating a consumer

Consumers are business management units used to group user resources such as virtual machines, hosts, or volumes by either company name or business domain. You can assign grades such as Platinum, Gold, Silver, and Bronze to the consumers based on the objectives negotiated in the SLA.

The following values are assumed for creating a platinum grade consumer classA:

  • Server IP address: 10.76.245.95
  • Port number: 22015

Before you begin

You must have Admin or Modify permissions to create a consumer.

Procedure

  1. (Optional) Obtain the gradekey value for the platinum grade consumer.

    Request:

    curl -v -u system:manager -X GET http://10.76.245.95:22015/Analytics/v1/objects/Grades
    

    Response:

    {
      "data" : [ {
        "instanceID" : "grade#Platinum",
        "gradeKey" : "10",
        "name" : "Platinum",
        "displayOrder" : 10
      }
      ….
    
    The gradekey value of the consumer is 10.
  2. Create a consumer.

    Request:

    curl -v -u system:manager -H "Content-Type: application/json" 
    -X POST http://hiaasrv:22015/Analytics/v1/objects/Groups 
    -d '{"name":"ClassA","gradeKey":"10","description":"Company: ABC company\nSystem: Main System\nTel: 0000-1234\nAddress: ClassA@mail.com\nContact Person: Taro\n"}'

    Response:

    {
      "instanceID" : "group#d0bf91d3-a5ba-423d-961f-1c025f959712",
      "name" : "ClassA",
      "status" : "Unknown",
      "gradeKey" : "10",
      "gradeName" : "Platinum",
      "gradeDisplayOrder" : 10,
      "description" : "Company: ABC company¥nSystem: Main System¥nTel: 0000-1234¥nAddress: ClassA@mail.com¥nContact Person: Taro¥n",
      "templateCreatorType" : "User",
      "numOfVolumes" : 0,
      "numOfVMs" : 0,
      "numOfHosts" : 0,
      "volumeAutoAssignFilters" : [ ],
      "vmAutoAssignFilters" : [ ],
      "hostAutoAssignFilters" : [ ]
    }
    
    The consumer classA is created.

Assigning volumes to the consumer

You can simplify the management of your infrastructure resources by assigning monitored resources to a consumer group which associates a consumer with the resources they are using.

Before you begin

You must have Admin or Modify permissions to assign volumes to a consumer.

Procedure

  1. (Optional) Obtain a list of volumes.

    Specify the page option to display a list that exceeds 100 items. You can display up to 100 items on a page.

    Request:

    curl -v -u system:manager - X GET http:/ /hiaasrv: 22015/Analytics/v1/objects/ Volumes ?page =1&pageSize=100

    Response:

    {
      "data" : [ {
        "instanceID" : "raidLdev#10119-00^00^00",
        "status" : "Normal",
        "ldev" : "00:00:00",
        "storageSubsystemID" : "raidStorage#10119",
        "storageSubsystem" : "VSP G1000 (10119)",
        "storageSubsystemMonitorStatus" : "Manage",
        "parityGroup" : "01-01",
        "storageSubsystemModel" : "VSP G1000",
        "hostGroupIDs" : [ "raidHG#10119-CL4-D-2" ],
        "hostGroupNames" : [ "scsil721350000" ],
        "thresholdProfileID" : "thProfile#RAID_VOLUME",
        "thresholdProfileName" : "Default Profile for Volume",
        "groupIDs" : [ "group#0" ],
        "groupNames" : [ "#Unassigned Resources" ],
        "profileResourceType" : "RAID_VOLUME",
        "virtualMachineIDs" : [ ],
        "virtualMachineNames" : [ ],
        "hostIDs" : [ ],
        "hostNames" : [ ],
        "groupIDsOfRelatedResources" : [ ],
        "groupNamesOfRelatedResources" : [ ],
        "lunOwnerIDs" : [ "raidOwner#10119-scsil721350000" ],
        "lunOwnerNames" : [ "10119-scsil721350000" ],
        "volumeLocation" : "INTERNAL”
      }, 
      ….
    
  2. Assign volumes to the consumer.

    Request:

    Specify the IDs of the volumes that you want to assign to the consumer.

    curl -v -u system:manager -H "Content-Type: application/json" 
    -X POST http://hiaasrv:22015/Analytics/v1/objects/Groups/group%23d0bf91d3%2da5ba%2d423d%2d961f%2d1c025f959712/actions/updateTargetResource/invoke -d '{"parameters":[{"volumeIDs":["raidLdev#10119-00^00^00"],"vmIDs":[],"resourceIDs":[]}]}'
    

    Response:

    {
      "instanceID": "3453b160-d3ab-4ced-b3d4-cf5627cf0fca",
      "created": "2016-06-10T11:52:50.138+09:00",
      "updated": "2016-06-10T11:52:50.138+09:00",
      "completed": "2016-06-10T11:52:50.138+09:00",
      "state": "success",
      "affectedResource": [],
      "result": []
    }
    
    The specified volumes are assigned to the consumer.

Creating a user resource threshold profile

You can define the threshold settings and monitoring parameters for the target volumes in the user resource threshold profile. The volumes can be monitored using dynamic or static thresholds. You can also schedule the monitoring plans for volumes whose workloads vary at different times of the day or week.

Before you begin

You must have Admin or Modify permissions to create a user resource threshold profile.

Procedure

  1. (Optional) Obtain a list of user resource threshold profiles.

    Request:

    curl -v -u system:manager -H "Content-Type: application/json" -X GET http://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles
    

    Response:

    Use the default profile for the volume listed at the beginning of the response code as template to create user resource threshold profiles.

    {
      "pagination" : {
        "page" : 1,
        "pageSize" : 7,
        "numPages" : 1,
        "totalCount" : 7
      },
      "data" : [ {
     ................          
    
        "instanceID" : "thProfile#RAID_VOLUME",
        "profileName" : "Default Profile for Volume",
        "description" : "Default Profile for Volume",
        "resourceType" : "User",
        "profileType" : "Default",
        "profileResourceType" : "RAID_VOLUME",
        "margin" : "Normal",
        "marginName" : "Normal",
        "plans" : [ {
          "instanceID" : "thPlan#RAID_VOLUME",
          "planType" : "Base",
          "planName" : "Base",
          "schedule" : [ 1, 2, 3, 4, 5, 6, 7 ],
    .............
    "thresholdValues" : [ {
            "instanceID" : "th#RAID_VOLUME_RAIDLDEV_TOTALIOPS",
            "monitoringMode" : "Dynamic",
            "metricType" : "RAID_VOLUME_RAIDLDEV_TOTALIOPS",
            "metricTypeName" : "Total IOPS (LDEV)",
            "unit" : "Ops",
            "proportion" : false,
            "thresholdValueOfWarning" : 0.0,
            "thresholdValueOfCritical" : 0.0,
            "stepSize" : 1.0,
            "max" : 3.4028235E38,
            "min" : 0.0
          }, {
            "instanceID" : "th#RAID_VOLUME_RAIDLDEV_READHIT",
            "monitoringMode" : "OFF",
            "metricType" : "RAID_VOLUME_RAIDLDEV_READHIT",
            "metricTypeName" : "Read Hit (LDEV)",
            "unit" : "%",
            "proportion" : true,
            "thresholdValueOfWarning" : 0.0,
    
    .............
    
  2. Create a user resource threshold profile.

    Specify monitoring mode, key performance metrics, threshold values, and other parameters.

    Request:

    curl -v -u system:manager -H "Content-Type: application/ json " -X POST http ://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles -d @ createRequest.json
    
    
    {
      "profileName":"new SLA profile",
      "description":"RAID volume profile for new SLA.",
      "profileType":"User",
      "profileResourceType":"RAID_VOLUME",
      "margin":"Normal",
      "plans":[{
        "planName":"Base",
        "description":"Base Plan",
        "thresholdValues":[{
          "instanceID":"th#RAID_VOLUME_RAIDLDEV_TOTALIOPS_PRESET",
          "monitoringMode":"Dynamic",
          "metricType":"RAID_VOLUME_RAIDLDEV_TOTALIOPS",
          "metricTypeName":"Total IOPS (LDEV)",
          "unit":"Ops",
          "proportion":false,
    ..........................
     },{
          "instanceID":"th#RAID_VOLUME_RAIDLDEV_READIOPS_PRESET",
         "monitoringMode":"Static", 
          "metricType":"RAID_VOLUME_RAIDLDEV_READIOPS",
          "metricTypeName":"Read IOPS (LDEV)",
          "unit":"Ops",
          "proportion":false,
          "thresholdValueOfWarning":50,
          "thresholdValueOfCritical":100,
          "stepSize":1,
          "max":3.4028235e+38,
          "min":0
        },{
    
    .............

    Response:

    The details of the newly created user resource threshold profile are listed.

    {
      "instanceID" : "thProfile#9449d700-360b-45b9-9b65-4ec5ed6627b4",
      "profileName" : "new SLA profile",
      "description" : "RAID volume profile for new SLA.",
      "resourceType" : "User",
      "profileType" : "User",
      "profileResourceType" : "RAID_VOLUME",
      "margin" : "Normal",
      "marginName" : "Normal",
      "plans" : [ {
        "instanceID" : "thPlan#7b358266-ddd7-4acf-a2dd-2a458c502df0",
        "planType" : "Base",
        "planName" : "Base",
    
    .............
    .............
     }, {
          "instanceID" : "th#7511393f-38f4-4180-9555-b7e8810dcf99",
          "monitoringMode" : "Static",
          "metricType" : "RAID_VOLUME_RAIDLDEV_READIOPS",
          "metricTypeName" : "Read IOPS (LDEV)",
          "unit" : "Ops",
          "proportion" : false,
          "thresholdValueOfWarning" : 50.0,
          "thresholdValueOfCritical" : 100.0,
          "stepSize" : 1.0,
          "max" : 3.4028235E38,
          "min" : 0.0
        }, {
    
    .............
    

Assigning volumes to the user resource threshold profile

The volumes associated with a user resource threshold profile are monitored based on the parameters defined in the profile. This example assumes you manually assign resources to the user resource threshold profile.

Before you begin

You must have Admin or Modify permissions to assign volumes to the user resource threshold profile.

Procedure

  1. (Optional) Obtain a list of volumes and identify the ones that you need to assign to the user resource threshold profile.

    Specify the page option to display a resource list that exceeds 100 items. You can display up to 100 items on a page.

    Request:

    curl -v -u system:manager -X GET http://hiaasrv:22015/Analytics/v1/objects/Volumes?page=1&pageSize=100

    Response:

    {
        "instanceID" : "raidLdev#10182-00^00^27",
        "status" : "Unknown",
        "ldev" : "00:00:27",
        "storageSubsystemID" : "raidStorage#10182",
        "storageSubsystem" : "VSP G1000 (10182)",
        "storageSubsystemMonitorStatus" : "Manage",
        "parityGroup" : "01-01",
        "storageSubsystemModel" : "VSP G1000",
        "hostGroupIDs" : [ "raidHG#10182-CL3-C-3" ],
        "hostGroupNames" : [ "ha85st1" ],
        "thresholdProfileID" : "thProfile#RAID_VOLUME",
        "thresholdProfileName" : "Default Profile for Volume",
        "groupIDs" : [ "group#0" ],
        "groupNames" : [ "#Unassigned Resources" ],
        "gradeNames" : [ "-" ],
        "gradeOrders" : [ 2147483647 ],
        "profileResourceType" : "RAID_VOLUME",
        "virtualMachineIDs" : [ ],
        "virtualMachineNames" : [ ],
        "hostIDs" : [ ],
        "hostNames" : [ ],
        "groupIDsOfRelatedResources" : [ ],
        "groupNamesOfRelatedResources" : [ ],
        "lunOwnerIDs" : [ "raidOwner#10182-ha85st1" ],
        "lunOwnerNames" : [ "10182-ha85st1" ],
    
    ...................
    
    
  2. Assign volumes to the user resource threshold profile.

    Request:

    Specify the IDs of the volumes you want to assign.

    curl -v -u system:manager -H "Content-Type: application/json" -H "Accept: application/json, */*" -X POST "http://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles/thProfile%239449d700-360b-45b9-9b65-4ec5ed6627b4/actions/updateTargetResource/invoke" -d {"name":"updateTargetResource","href":"http://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles/thProfile%239449d700%2d360b%2d45b9%2d9b65%2d4ec5ed6627b4/actions/updateTargetResource/invoke","method":"POST","type":"application/json","parameters":[{"instanceID":"raidLdev#10182-00^00^27"}]}
    

    Response:

    Check the status of the API request for confirmation.

    {
      "instanceID" : "5f54b9c6-086c-49c1-ad42-738972f34571",
      "created" : "2016-10-03T12:32:58.972+09:00",
      "updated" : "2016-10-03T12:34:51.174+09:00",
      "completed" : "2016-10-03T12:34:51.174+09:00",
      "state" : "success",
      "affectedResource" : [ ],
      "result" : [ ]
    }
    

Modifying SLO information

The SLOs defined for monitoring your infrastructure resources can change based on the business requirements and you are routinely required to monitor and update the SLOs for compliance. For example, when you decommission or repurpose the hosts, or when you want to upgrade a consumer from one performance grade to another you must modify the previously defined SLO information.

The example in this article describes how to modify the SLO information defined for your infrastructure resources.

Procedure

  1. Rename a consumer.
  2. Reassign the volumes to a user resource threshold profile.

Each task in the workflow is explained using the curl commands.

NoteThe sample curl commands described in this article work on the Linux environment. If you plan on using these examples in the Windows environment, you must address the single-quote issue because the curl statements with single-quotes do not work on Windows. Please refer appropriate documentation for using curl on Windows.

Renaming a consumer

You can rename a consumer to assign the associated resources to a new consumer.

Before you begin

You must have Admin or Modify permissions to rename a consumer.

Procedure

  1. Obtain a list of consumers and identify the one you want to rename.

    Request:

    curl -v -u system:manager -H "Content-Type: application/json" -H "Accept: application/json, */*" -X GET "http://localhost:22015/Analytics/v1/objects/Groups"
    

    Response:

    ......................
    
     }, {
        "instanceID" : "group#a6b3e676-4983-4de0-bdf0-48429ee06cd7",
        "name" : “XX System v1",
        "status" : "Unknown",
        "gradeKey" : "20",
        "gradeName" : "Gold",
        "gradeDisplayOrder" : 20,
        "description" : "Company:\nSystem: \nTel:\nAddress:\nContact Person:\n",
        "templateCreatorType" : "User",
        "numOfVolumes" : 0,
        "numOfVMs" : 0,
        "numOfHosts" : 0,
        "volumeAutoAssignFilters" : [ ],
        "vmAutoAssignFilters" : [ ],
        "hostAutoAssignFilters" : [ ]
      }, {
    
    ......................
  2. Rename the consumer.

    Request:

    curl -v -u system:manager -H "Content-Type: application/json" -H "Accept: application/json, */*" -X PUT "http://localhost:22015/Analytics/v1/objects/Groups/group%23a6b3e676-4983-4de0-bdf0-48429ee06cd7" -d @rename.json
    
    {
      "name":"XX System support team",
      "gradeKey":"20",
      "description":"Company:HDS\nSystem: HIAA\nTel:012-345-678\nAddress:XX\nContact Person:Smith\n"
    }
    

    Response:

    {
      "instanceID" : "group#a6b3e676-4983-4de0-bdf0-48429ee06cd7",
      "name" : "XX System support team",
      "status" : "Unknown",
      "gradeKey" : "20",
      "gradeName" : "Gold",
      "gradeDisplayOrder" : 20,
      "description" : "Company:HDS\nSystem: HIAA\nTel:012-345-678\nAddress:XX\nContact Person:Smith\n",
      "templateCreatorType" : "User",
      "numOfVolumes" : 0,
      "numOfVMs" : 0,
      "numOfHosts" : 0,
      "volumeAutoAssignFilters" : [ ],
      "vmAutoAssignFilters" : [ ],
      "hostAutoAssignFilters" : [ ]
    }
    
    The consumer XX System v1 is renamed as XX System support team.

Re-assigning volumes to a new user resource threshold profile

When the SLOs defined for resources in your monitoring environment are revised, you might have to modify the monitoring parameters and re-assign resources to a new threshold profile.

Before you begin

You must have Admin or Modify permissions to reassign volumes to a user resource threshold profile.

Procedure

  1. Obtain a list of volumes and identify the volumes you want to re-assign to the new user resource threshold profile.

    Specify the page option to display a resource list that exceeds 100 items. You can display up to 100 items on a page.

    Request:

    curl -v -u system:manager -X GET http://hiaasrv:22015/Analytics/v1/objects/Volumes?page=1&pageSize=100
    

    Response:

    {
        "instanceID" : "raidLdev#10182-00^00^27",
        "status" : "Unknown",
        "ldev" : "00:00:27",
        "storageSubsystemID" : "raidStorage#10182",
        "storageSubsystem" : "VSP G1000 (10182)",
        "storageSubsystemMonitorStatus" : "Manage",
        "parityGroup" : "01-01",
        "storageSubsystemModel" : "VSP G1000",
        "hostGroupIDs" : [ "raidHG#10182-CL3-C-3" ],
        "hostGroupNames" : [ "ha85st1" ],
        "thresholdProfileID" : " thProfile#9449d700-360b-45b9-9b65-4ec5ed6627b4 ",
        "thresholdProfileName" : " new SLA profile ",
        "groupIDs" : [ "group#0" ],
        "groupNames" : [ "#Unassigned Resources" ],
        "gradeNames" : [ "-" ],
        "gradeOrders" : [ 2147483647 ],
        "profileResourceType" : "RAID_VOLUME",
        "virtualMachineIDs" : [ ],
        "virtualMachineNames" : [ ],
        "hostIDs" : [ ],
        "hostNames" : [ ],
        "groupIDsOfRelatedResources" : [ ],
        "groupNamesOfRelatedResources" : [ ],
        "lunOwnerIDs" : [ "raidOwner#10182-ha85st1" ],
        "lunOwnerNames" : [ "10182-ha85st1" ],
    ...................
    
    
  2. Obtain a list of user resource threshold profiles and identify the user resource threshold profile to which you want to assign volumes.

    Request:

    curl -v -u system:manager -H "Content-Type: application/json" -X GET http://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles

    Response:

    ...............................
     
    "data" : [ {
        "instanceID" : "thProfile#1c8758bb-6890-487f-ae37-41c583e8a7d6",
        "profileName" : "XX System SLA profile",
        "description" : "RAID volume profile for XX system.",
        "resourceType" : "User",
        "profileType" : "User",
        "profileResourceType" : "RAID_VOLUME",
        "margin" : "Severe",
        "marginName" : "Severe",
        "plans" : [ {
          "instanceID" : "thPlan#40ff4afa-c86d-4c25-ba7b-454040a24230",
          "planType" : "Base",
          "planName" : "Base",
          "schedule" : [ 1, 2, 3, 4, 5, 6, 7 ],
          "from" : "00:00",
          "to" : "24:00",
          "priority" : 1,
          "description" : "Base Plan",
          "thresholdValues" : [ {
            "instanceID" : "th#65140547-850d-48c9-bc74-a1211ee7f4bb",
            "monitoringMode" : "Dynamic",
            "metricType" : "RAID_VOLUME_RAIDLDEV_TOTALIOPS",
    
    ..............................
    
  3. Obtain the list of volumes already assigned to the new user resource threshold profile.

    Request:

    curl -v -u system:manager -H "Content-Type: application/json" -H "Accept: application/json, */*" -X GET "http://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles/ thProfile%231c8758bb-6890-487f-ae37-41c583e8a7d6/actions/updateTargetResource"
    

    Response:

    The details of the volumes are listed.

    {
      "name": "updateTargetResource",
      "href": "http://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles/thProfile%231c8758bb%2d6890%2d487f%2dae37%2d41c583e8a7d6/actions/updateTargetResource/invoke",
      "method": "POST",
      "type": "application/json",
      "parameters": [
        {
          "instanceID": "raidLdev#10182-00^02^5A"
        },
        {
          "instanceID": "raidLdev#10182-00^02^D1"
        },
        {
          "instanceID": "raidLdev#10182-00^07^92"
        }
      ]
    }
    
  4. Re-assign the volumes to the new user resource threshold profile .

    Specify the IDs of the volumes you want to re-assign. Make sure you specify the IDs of the volumes that were previously assigned to the user resource threshold profile along with the new volume IDs.

    Request:

    curl -v -u system:manager -H "Content-Type: application/json" -H "Accept: application/json, */*" -X POST "http://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles/thProfile%231c8758bb-6890-487f-ae37-41c583e8a7d6/actions/updateTargetResource/invoke" -d {"name":"updateTargetResource","href":"http://hiaasrv:22015/Analytics/v1/objects/ThresholdProfiles/thProfile%231c8758bb%2d6890%2d487f%2dae37%2d41c583e8a7d6/actions/updateTargetResource/invoke","method":"POST","type":"application/json","parameters":[{"instanceID":"raidLdev#10182-00^02^5A"},{"instanceID":"raidLdev#10182-00^02^D1"},{"instanceID":"raidLdev#10182-00^07^92"},{"instanceID":"raidLdev#10182-00^00^27"}]}
    

    Response:

    Check the status of the API request for confirmation. The volume raidLdev#10182-00^00^27 is assigned to the threshold profile ID thProfile#1c8758bb-6890-487f-ae37-41c583e8a7d6.

    {
      "instanceID" : "5f54b9c6-086c-49c1-ad42-738972f34571",
      "created" : "2016-10-03T12:32:58.972+09:00",
      "updated" : "2016-10-03T12:34:51.174+09:00",
      "completed" : "2016-10-03T12:34:51.174+09:00",
      "state" : "success",
      "affectedResource" : [ ],
      "result" : [ ]
    }