Routing Requests—Available Capacity Query

Routing Requests—Available Capacity Query

#340120

Description

A Routing Request can be posted with an available capacity query before actually creating the Routing Request. This query can be used to determine the best placement based on cost, capacity and Fit-for-Purpose. Workloads can then be manually routed to your preferred hosting venues.

The Routing Request Available Capacity Query accepts UNROUTED or REJECTED Workloads, or REJECTED Routing Requests.

Available capacity is determined using a conservative approach, reserving capacity for Workloads specified in Routing Requests that are not yet placed for all future timeframes and continuing to reserve capacity for outbound Bookings that are still online. Also, the available capacity query returns capacity for new planned hosts and sensors, including those sensors that are shared among open and closed hosting venues. Infinite capacity is calculated for non-control and guest-level environments and hosting venues.

For Fit-for-Purpose, the query returns the Fit-for-Purpose results for the hosting venues and datastores. This includes fit according to software requirements, fit for business rules, fit for storage tiers, etc. A Routing Request cannot be routed to a hosting venue that is not fit, i.e. does not pass the Fit-for-Purpose rules, does not have enough capacity, and does not Allow New VM Bookings.

Note:  The results of this query INCLUDE sensors that do not Allow New VM Bookings.

The query can be posted by defining a scope of environments and/or hosting venues to consider. In this way, you can narrow your query as needed.

Hosting Venues

This API supports a mix of full control hosting venues (i.e. infrastructure groups), non-control hosting venues and guest-level hosting venues.

With respect to this API, the difference between these venues is as follows:

  • Supported Operations—all operations are supported for all three hosting venues except:
    • for non-control and guest-level hosting venues, options ?detailed_sensor_calc=true and ?detailed_host_calc=true do not apply
  • Resource Elements—only elements that are applicable to the hosting venue is returned in the response. Also, some elements may have special values as non-control and guest-level hosting venues have infinite capacity. Specifically:
    • for non-control and guest-level hosting venues and their environments, element cei, constraint and constraint_name are not returned
    • for non-control and guest-level hosting venues and environments, empty array elements "subslots": [], "sensor_capacity": [], "host_capacity": [] are returned
    • for non-control and guest-level hosting venues of infinite capacity, slots is set to MAXINT (with a "hosting_score": 100) if the hosting venue passes the Fit-for-Purpose requirements and is 0 otherwise (with a "hosting_score": 0)
    • for environments of non-control and guest-level hosting venues, total_slots is set to MAXINT if at least one of its hosting venues has slots set to MAXINT and is 0 otherwise
    • for non-control and guest-level hosting venues, the capacity/cost mode does not apply. The mode is always assumed capacity_sensitive and element "hosting_cost": 0 is returned.

Options for Returned Details

You can extend the query with one or all of the following:

  • ?subslots=true (default is false)—to return the slot workload metrics which can be used to determine the primary constraint for the available capacity. When set to true, the query returns the elements of the subslots array for each hosting venue (even if the Infrastructure Group is closed/blocked), subslots and tiers array for each sensor type (where applicable), and subslots array for each host.
  • ?detailed_sensor_calc=true (default is false)—to return sensor metrics using a highly detailed computation of sensor capacity that also consolidates duplicate sensors across Control Environments. The recommendation is to use this flag when trying to determine available capacity at the environment level. If you are only considering available capacity at a hosting venue level, then the recommendation is not to use this flag. When ?detailed_sensor_calc=true is not used, the query aggregates all sensor metrics before determining slot counts, instead of aggregating slot counts based on individual sensor metrics.
  • ?ffp_enabled=false (default is true)—to return available capacity without Fit-for-Purpose calculations. With this option, all Fit-for-Purpose tests pass. The "categories": [] is returned empty and the resulting pass status "status": "PASS" is returned. The hosting_score (described below) is calculated assuming the Fit-for-Purpose tests all pass. This option is used when the Route and Reserve Demand page is first displayed and can be used when generating slot reports.
  • ?negative_slots=true (default is false)—to perform capacity calculations and then either return actual slot counts even if negative (when true) or show negative slot counts as 0. This affects element slots for the number of Workloads and Sensors that can fit in this hosting venue, element subslots value for specific slot and sensor metrics, and element total_slots for the total sum of slots elements for the hosting venues within the environment. All constraints and sums are calculated first before any values are updated when ?negative_slots=false. For example, if IG1=10 and IG2=-5, then IG1=10, IG2=-5 and Env=5 are returned with ?negative_slots=true, and IG1=10, IG2=0 and Env=5 are returned with ?negative_slots=false. The constraint is the same, independent of this ?negative_slots option.
  • ?detailed_host_calc=true (default is false)—to return the slot count, primary constraint and subslot metrics on a per host basis for today. When set to true and if the expected_date is today, the query returns the element host_capacity.

Capacity Based on Expected Date

This POST returns the following capacity information based on the expected_date (or today if no expected_date is specified). For each hosting venue that matches the request, the number of available slots (i.e. the number of Workloads that can fit including sensor capacity), CEI, subslot metrics, Fit-for-Purpose tests and hosting_score are returned. The hosting_score is a standard metric with a range 0..100 to determine the best routing choice. For each Control Environment that matches the request, total_slots, CEI and subslot metrics are returned. The total_slots and subslot metrics of each environment is equal to the total of all slots and subslot metrics from the returned list of matching hosting venues, only if sensors are not shared across hosting venues or other environments.

Capacity/Cost Mode Option and Hosting Score

The available capacity query calculates the hosting_score as an integer from 0..100 where 0 means no placement and 100 provides the best placement out of the specified scope. There are three modes that are supported, which affect this score. You can either take the default mode as defined by the configuration setting API Default Routing Strategy (see Configuration Settings) or you can specify the mode as part of the query:

  • ?mode=capacity_sensitive—Calculates the hosting_score according to the available capacity of the hosting venues. The more capacity available, the higher the score.
  • ?mode=cost_sensitive—Calculates the hosting_score according to the cost while ensuring there is enough capacity. The higher the cost, the lower the score. If the hosting_cost is 0, then the hosting_score=0.
  • ?mode=cost_and_capacity—Calculates the hosting_score as the average of the capacity_sensitive and cost_sensitive. This is the default.

Note:  If an Infrastructure Group has an availability_status=UNAVAILABLE or BLOCKED_BY_USER, has no available slots (i.e. slots<=0 or sensor_capacity slots<=0), or fails the Fit-for-Purpose tests, then the returned hosting_score is 0 for that Infrastructure Group. Workloads cannot be routed to such Infrastructure Groups, unless the placement is forced.

Available Slots

The number of available slots is the number of Workloads (taking into account sensor capacity requirements) that can fit within a hosting venue. The size of each slot is defined by the aggregate of the Workloads specified in the Routing Request. For example, if there are 2 available slots, then that means two Routing Requests with the same Workload requirements can fit.

The available slots is defined in element slots and can take on any of the following values (rounded down to the nearest integer):

  • MAXINT—applies only to a non-control or guest-level hosting venue, if it passes the Fit-for-Purpose requirements
  • positive integer—number of such Workloads that can still fit in the hosting venue. Capacity is still available and is limited by the policy high limits.
  • 0—no available capacity, or the Infrastructure Group has an availability_status of "UNAVAILABLE". 0 is also returned if the hosting venue does not pass the Fit-for-Purpose validation or if the expected_date is past the timeline for that hosting venue. If there is no capacity, option ?negative_slots=false always updates the slot count to 0.
  • negative integer—number of such Workloads that have been over-provisioned to the hosting venue. This number of Workloads should be moved to another hosting venue. There is no capacity left, as defined by the policy high limits.

Notes

If there is no data for the timeframe as specified by the requested_date of the Routing Request, the CEI for today and the slot capacity of 0 are returned.

See Querying Available Capacity for Specified Workloads for more information on slots.

This query supports inline Workloads having only single disk requirements with no storage tier specified and with no attributes specified.

Resource

/routing-requests/available-capacity-query

Supported Operations

Table: Routing Requests–Available Capacity Query Supported Operations

Operation

HTTP Method

Input

Output

Description

Query

POST /routing-requests/available-capacity-query

Routing Requests: Form Definition

[Routing Requests–Available Capacity Query: Resource Elements]

This request is exactly the same as the POST to a Routing Request, except no objects are created with this query (i.e. Routing Request and specified Workloads). Note that when specifying an inline Workload object, the name element is not required.

This post returns the cost, capacity and Fit-for-Purpose results for the Control Environments and Infrastructure Groups.

The expected_date should be within the supported Timeline Definition of the Control Console. Otherwise, metrics are not returned (e.g. "constraint": null, "subslots": [] and "sensor_capacity": []).

Note: The specification of only 1 inline workload and 1 inline disk is supported, with no attributes and no tier specified.

Example: Selecting Placement From Multiple Environments, Example: With Host Available Capacity

Example: Obtaining Subslot Available Capacity, Example: Obtaining Available Capacity for a Catalog Spec, Example: Obtaining Available Capacity for the Default Catalog Spec with Overrides

Resource Elements

Table: Routing Requests–Available Capacity Query Resource Elements

Element

Type

Description

control_environment

Complex, as specified in the Description

The Control Environment that is associated with the array of Infrastructure Groups above. The Control Environment’s available capacity is as follows:

  • id, name, hrefID, Name and Self Reference (id, name, href) of the Control Environment
  • platformplatform of the Control Environment
  • platform_categoryplatform_category of the Control Environment
  • control_type−Type of environment ("FULL", "NONE" or "GUEST_LEVEL").
  • total_slots−the total sum of the slots elements from the returned list of matching Infrastructure Groups for this Control Environment. Set to 0 if there is no data for the timeframe as specified by the requested_date of the Routing Request. The total may differ when ?detailed_sensor_calc=true is used in the query and sensor capacity is consolidated.
  • cei−the CEI for the requested_date of the Routing Request. Set to Today’s CEI if there is no data for the timeframe as specified by the requested_date of the Routing Request.
  • subslots−the slot calculations returned only if ?subslots=true is used with the query. This is the total sum of the subslots elements from the returned list of matching Infrastructure Groups for this Control Environment. See the subslots element of the Infrastructure Group for element details.
  • sensor_capacity−if detailed_sensor_calc=true is not specified in the query, sensor_capacity is the sum of all sensor_capacity elements from the returned list of matching Infrastructure Groups for this Control Environment. If detailed_sensor_calc=true is specified, the slots and metric sums consolidate duplicate sensors across Control Environments.
  • icon−icon of the Control Environment.

infrastructure_groups

[Complex, as specified in the Description]

An array of Infrastructure Groups, matching the scopes definition in the query and belonging to the Control Environment specified by control_environment below.

Each Infrastructure Group is defined by the following array of elements (see Infrastructure Groups):

  • id, name, hrefID, Name and Self Reference (id, name, href) of the Infrastructure Group
  • slots−the number of Workloads (the aggregate specified in the request), that can fit in this Infrastructure Group. This number takes into account the subslot metrics, sensor capacity (i.e. sensor_capacity: slots if returned) and the host capacity (i.e. host_capacity: slots if returned), taking the smallest number of the three. Set to 0 if there is no data for the timeframe as specified by the requested_date of the Routing Request. If there is no capacity, this number is updated to 0 when ?negative_slots=false is specified.
  • cei−the CEI for the requested_date of the Routing Request. Set to Today’s CEI if there is no data for the timeframe as specified by the requested_date of the Routing Request.
  • subslots−the slot metrics returned only if ?subslots=true is used with the query. The value for a metric indicates the number of Routing Requests (i.e. defined by the total Workload requirement in your Routing Request), that can fit considering that metric alone. The metrics returned depend on platform. If there is no capacity, these numbers are updated to 0 when ?negative_slots=false is specified. For details of the workloads with descriptions, see Workload Types. Here is an example of what is returned:

  "subslots": [
     {"name": "Total_Cores", "value": 104},
     {"name": "Disk_Utilization_As_Percent", "value": 2606},
     {"name": "Disk_Operations", "value": 10500},
     {"name": "CPU_Utilization", "value": 59},
     {"name": "Mem_Reservation", "value": 2147483647},
     {"name": "Net_Utilization_As_Percent", "value": 5480},
     {"name": "CPU_Reservation_MHz", "value": 2147483647},
     {"name": "Mem_Utilization_As_Pct", "value": 24},
     {"name": "Mem_VE_Active_Pct", "value": 114},
     {"name": "Network_Packets", "value": 840},
     {"name": "Total_Memory", "value": 61},
  ]

This is an example when the capacity cannot be computed (e.g. data is too stale):
  "subslots": []

 

 

  • constraint−Workload type with the minimum number of slots (which is the constraint of the "subslots" above); null is returned if a constraint cannot be calculated (e.g. expected date is too far into the future, or "subslots": [] is empty when ?subslots=true is used). Note that the constraint is the same independent of option ?negative_slots.
  • constraint_name−Display name of the constraint element. Only returned when constraint is not null.
  • control_type−Type of hosting venue ("FULL", "NONE" or "GUEST_LEVEL").
  • hosting_cost−Monetary cost for maintaining a host in this Infrastructure Group.
  • fit_for_purpose−Fit-for-Purpose tests, which includes a categories array of tests and status. status is "FAIL" if the status of at least one category is "FAIL"; "INCOMPLETE" if the status of at least one category is "INCOMPLETE"; otherwise, "PASS" (when all categories have passed). This status must be "PASS" before the Infrastructure Group is considered for routing. Each category within the categories array is defined as:
    • name−name or description of the category
    • test−an array of tests for the category in the form name, status, status_reason. status is either "PASS" (test passed), "INCOMPLETE" (e.g. a Workload did not have enough information defined) or "FAIL" (test failed). status_reasons is defined only when status is either "INCOMPLETE" or "FAIL", and includes all messages.
    • status−category summary status. This is "FAIL" if the status of at least one test in the category is "FAIL"; "INCOMPLETE" if the status of at least one test in the category is "INCOMPLETE"; otherwise, "PASS" (when all tests in the category have passed).
   
  • sensor_capacity−the number of sensor slots available for the sensor requirements (i.e. defined by the total Workload requirement in your Routing Request), along with the slot metrics subslots[] if ?subslots=true is used with the query. The slots calculation is the number of such requests that can fit, given the multi-disk requirements. The value calculation in the subslots[] array is the number of such requests that can fit, considering that metric alone (thus providing the metric in contention). If there is no capacity, these numbers are set to 0 when ?negative_slots=false is specified.
  • The sensor_capacity includes sensors that are configured as Do Not Allow New VM Bookings (see Managing Storage Settings (Help Topic ID 172390)), as well as sensors of closed hosting venues.

    For datastores, subslots[] is returned with the totals of all datastore metrics, independent of tier requirements. If no tier capabilities are specified for the Workloads, then only this array with totals is returned. Also for datastores, a tiers[] array is returned (if ?subslots=true) for each tier specified in the Routing Request, with the metrics specific for that tier and slots calculated as the number of such requests that can fit for that tier. For example, if the Routing Request only includes "Gold" tier disks, then only the slot count and metrics for Gold datastores are returned, along with the subslots totals.

    If there are no sensors audited, the sensor_capacity is returned with "slots": 2147483647. This means that the space is unlimited.

    Here is an example of what is returned (note that the 107 slot limitation is due to the Total Provisioned Space which has the same 107 value):

   

"sensor_capacity": [

  {

    "type": "phystor",

    "slots": 1456,

    "constraint": "509E681F-0C7A-4193-95B0-9523C14E0FED",

    "constraint_name": "Total Used Space (MB)",

    "subslots": [

      // ... *SNIP* of subslot metrics ...

    ]

  },

  {

    "type": "datastore",

    "slots": 113,

    "constraint": "B4E008AD-8ECC-43DB-BFA7-6A590873453E",

    "constraint_name": "Total Used Space (MB)",

    "subslots": [

      {

        "name": "Total Provisioned Space (MB)",

        "value": 159,

        "spec_code": "B89E1E20-F71D-4B70-9179-EEA3C6F81D6C"

      },

      {

        "name": "Number of VMs",

        "value": 180,

        "spec_code": "525F567D-61FC-4A6E-A617-D203FB8E9CDC"

      },

      {

        "name": "Total Used Space (MB)",

        "value": 113,

        "spec_code": "B4E008AD-8ECC-43DB-BFA7-6A590873453E"

      },

      {

        "name": "Health Status",

        "value": 2147483647,

        "spec_code": "C17D631D-C584-48AE-B4F1-77D9EAAAAB59"

      },

      {

        "name": "Total Required Space (MB)",

        "value": 170,

        "spec_code": "98EA05B5-E0E1-4828-A3DD-919C5738D29A"

      }

    ],

 

 

    "tiers": [

      {

        "name": "Gold",

        "slots": 113,

        "subslots": [

          {

            "name": "Total Provisioned Space (MB)",

            "value": 159,

            "spec_code": "B89E1E20-F71D-4B70-9179-EEA3C6F81D6C"

          },

          {

            "name": "Number of VMs",

            "value": 180,

            "spec_code": "525F567D-61FC-4A6E-A617-D203FB8E9CDC"

          },

          {

            "name": "Total Used Space (MB)",

            "value": 113,

            "spec_code": "B4E008AD-8ECC-43DB-BFA7-6A590873453E"

          },

          {

            "name": "Health Status",

            "value": 0,

            "spec_code": "C17D631D-C584-48AE-B4F1-77D9EAAAAB59"

          },

          {

            "name": "Total Required Space (MB)",

            "value": 170,

            "spec_code": "98EA05B5-E0E1-4828-A3DD-919C5738D29A"

          }

      }

    ]

  }

]

This is an example where the environment or the hosting venue does not have any sensors, when the capacity cannot be computed (e.g. data is too stale):

"sensor_capacity": []

   
  • host_capacity−provides the total slot count across the hosts within the infrastructure group. Also, provides the slot count, primary constraint and subslot metrics on a per host basis.
  • The slots calculation is the sum of the host slots of the request (i.e. defined by the total Workload requirement in the Routing Request). Negative slot counts are not included in the sum (e.g. if host1 has 5 and host2 has -10, then slots will be set to 5).

    The hosts array lists all the hosts within the infrastructure group, along with the primary constraint and subslots array of each host.

    • name−Name of the host.
    • constraint−Primary workload constraint (i.e. the name of the workload having the lowest value in the "subslots" array). Note that the constraint is the same independent of option ?negative_slots.
    • constraint_name−Display name of the constraint element. Only returned when constraint is not null.
    • id−ID of the host name element. Can be used with the Existing Systems object to obtain host specifics. See Existing Systems.
    • slots−Number of Workloads (the aggregate specified in the request), that can fit in this host. This is the value of the constraint in the "subslots" array.
    • subslots—Slot workload metrics returned only if ?subslots=true is used with the query. The value for a metric indicates the number of Routing Requests (i.e. defined by the total Workload requirement in your Routing Request), that can fit considering that metric alone. If there is no capacity, these numbers are updated to 0 when ?negative_slots=false is specified. For details of the workloads with descriptions, see Workload Types.

See Example: With Host Available Capacity for an example.

 

 

Form Definition

You need to define the workloads and optionally specify Control Environments and Infrastructure Groups for your query. Use the same form definition as that used for the Routing Request (see Routing Requests: Form Definition).

Examples

Example: Selecting Placement From Multiple Environments

The following example shows you how to select a placement from multiple environments:

Example: With Host Available Capacity

The following example shows you how to obtain host-level capacity information for the hosts in scope. Using the same example as above, the response highlights the delta in the response:

Example: Obtaining Subslot Available Capacity

The following example shows you how to obtain slot metrics. The referenced Workload is defined with one disk with a tier definition of "Gold". A few datastores are defined with "Gold", which are located in the Boston environment. As well, in the Boston environment, two hosting venues are configured with "Do Not Allow" new VM bookings.

As the Singapore environment has no datastores, each Infrastructure Group will return sensor_capacity: []. The slots and hosting_score are calculated ignoring any of the disk requirements.

For the two Infrastructure Groups that are not accepting new bookings, slots: 0 is returned.

The following example output shows you the Fit-for-Purpose test when it fails. This failure is due to the Infrastructure Group not having any datastores with the proper tier definition. In this case, the datastores are all defined as "Default", not "Gold".

Example: Obtaining Available Capacity for a Catalog Spec

The following example shows you how to obtain available capacity for a specific catalog specification:

Example: Obtaining Available Capacity for the Default Catalog Spec with Overrides

The following example shows you how to obtain available capacity for the default catalog specification with overrides: