Skip to main content

az-scout plugin for On-Demand Capacity Reservation (ODCR) coverage analysis

Project description

az-scout-plugin-odcr-coverage

An az-scout plugin that analyses On-Demand Capacity Reservation (ODCR) coverage for Azure VMs.

Identifies VMs at risk of allocation failure by combining VM inventory, Activity Log allocation events, and existing ODCR utilization — then classifies each VM by risk level.

Features

  • Risk classification — critical (past allocation failures), high (always-on without ODCR), medium, low, covered
  • Allocation event timeline — start/deallocate/failed events from Activity Log with configurable lookback (3–30 days)
  • ODCR utilization — reserved capacity, used/unused counts per reservation group
  • Multi-subscription — analyse across multiple subscriptions with incremental rendering and progress bar
  • SSE streaming — two-phase analysis: VMs load instantly, Activity Log events stream page-by-page with day-based progress
  • VM detail modal — click any VM row to see risk profile, allocation summary, and event timeline
  • Cross-highlighting — hover an ODCR card to highlight associated VMs, and vice versa
  • Azure Portal links — direct links to each VM in the Azure Portal
  • MCP tools — three tools with tiered performance for AI agents:
    • get_odcr_coverage_summary — fast overview (no Activity Log)
    • get_odcr_vm_allocation_history — drill-down for specific VMs
    • get_odcr_coverage — full analysis with allocation events
  • Chat mode — "ODCR Advisor" with tool selection guidance
  • Caching — VM list (5 min), capacity reservations (5 min), activity log (10 min)

Installation

pip install az-scout-plugin-odcr-coverage
# or
uv pip install az-scout-plugin-odcr-coverage

Restart az-scout — the plugin is discovered automatically.

MCP Tools

Tool Parameters Description
get_odcr_coverage_summary region, subscription_id, tenant_id? Fast ODCR overview — VMs + utilization, no Activity Log
get_odcr_vm_allocation_history region, subscription_id, vm_names, lookback_days? (7), uptime_threshold? (90), tenant_id? Allocation events + accurate risk for specific VMs
get_odcr_coverage region, subscription_id, lookback_days? (7), uptime_threshold? (90), tenant_id? Full analysis with per-VM allocation history

RBAC Requirements

Role Why
Reader List VMs (via ARG), Capacity Reservation Groups
Reader or Monitoring Reader Activity Log queries

Setup

uv pip install az-scout-plugin-odcr-coverage
az-scout  # plugin is auto-discovered

For development:

git clone https://github.com/az-scout/az-scout-plugin-odcr-coverage
cd az-scout-plugin-odcr-coverage
uv sync --group dev
uv pip install -e .
az-scout  # plugin is auto-discovered

Structure

az-scout-plugin-odcr-coverage/
├── .github/
│   ├── copilot-instructions.md  # Copilot context for this plugin
│   └── workflows/
│       └── ci.yml               # CI pipeline (lint + test, Python 3.11–3.13)
├── pyproject.toml
├── README.md
└── src/
    └── az_scout_odcr_coverage/
        ├── __init__.py          # Plugin class + module-level `plugin` instance
        ├── routes.py            # FastAPI APIRouter (optional)
        ├── tools.py             # MCP tool functions (optional)
        └── static/
            ├── css/
            │   └── odcr-coverage.css      # Plugin styles (auto-loaded via css_entry)
            ├── html/
            │   └── odcr-coverage-tab.html # HTML fragment (fetched by JS at runtime)
            └── js/
                └── odcr-coverage-tab.js   # Tab UI logic (auto-loaded via js_entry)

How it works

  1. The plugin JS loads the HTML fragment into #plugin-tab-odcr-coverage.
  2. It listens to azscout:* context events from the core app.
  3. When tenant and region are set, it fetches subscriptions from /api/subscriptions.
  4. The user picks subscriptions and clicks Analyse.
  5. For each subscription, an SSE stream (GET /plugins/odcr-coverage/coverage/stream) delivers results in two phases:
    • Phase 1 — VMs and ODCR utilization load instantly via Azure Resource Graph.
    • Phase 2 — Activity Log events stream page-by-page, progressively enriching VM risk levels and allocation stats. Progress is displayed as days covered (e.g. "events 12/30d").
  6. The table, summary cards, and risk bar update incrementally as data arrives.

Quality checks

uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run mypy src/
uv run pytest

Copilot support

The .github/copilot-instructions.md file provides context to GitHub Copilot about the plugin structure, conventions, and az-scout plugin API.

License

MIT

Disclaimer

This tool is not affiliated with Microsoft. All capacity, pricing, and availability information is indicative and not a guarantee of deployment success. Values are dynamic and may change between planning and actual deployment. Always validate in official Microsoft sources and in your target tenant/subscription.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

az_scout_plugin_odcr_coverage-2026.3.3.tar.gz (136.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file az_scout_plugin_odcr_coverage-2026.3.3.tar.gz.

File metadata

File hashes

Hashes for az_scout_plugin_odcr_coverage-2026.3.3.tar.gz
Algorithm Hash digest
SHA256 d36af12e23db9808027ba46c76de0b1987412b8cb5e1ab52aea98f43ed82266b
MD5 4d6f41f811d405d7487fc10d64837e78
BLAKE2b-256 8707bd5c5ecd01ed43440c4640e16d95b6fd6f71aeaef77dafe7f8b537697bac

See more details on using hashes here.

Provenance

The following attestation bundles were made for az_scout_plugin_odcr_coverage-2026.3.3.tar.gz:

Publisher: publish.yml on az-scout/az-scout-plugin-odcr-coverage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file az_scout_plugin_odcr_coverage-2026.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for az_scout_plugin_odcr_coverage-2026.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fb30b92f77adf5c3187e4c9e75b3e6e5bf68746f83c36b09300e353e982bf42d
MD5 ade3f58c72863a786c5bd8409c9e652f
BLAKE2b-256 69b0d2c56ca01f54c52870408c443936bfff45b7812e34e441e8c68aadf439a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for az_scout_plugin_odcr_coverage-2026.3.3-py3-none-any.whl:

Publisher: publish.yml on az-scout/az-scout-plugin-odcr-coverage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page