scheduler

A scheduling component for VM migration plans. A virtual machine, or VM, is a software-based computer; the scheduler chooses which VM migration can start next for each infrastructure provider.

In plain words
What is it for?
Use it when implementing or reviewing migration plans that need provider-specific scheduling and a limit on the number of migrations in progress.
Why use it?
It prevents too many migrations from running at once and overloading the source system. It also skips VMs that are already busy or finished.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/kubev2v/forklift-console-plugin/scheduler
Clone the repo
git clone --depth 1 https://github.com/kubev2v/forklift-console-plugin

Made for: Cursor.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,095 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.02095
Opus 5 $0.00006 $0.01047
Sonnet 5 $0.00003 $0.00419
Haiku 4.5 $0.00001 $0.00210

Measured 3d ago against content hash dd2b3392b075, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

scheduler scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/backend/plans/scheduler.mdc · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Plan Scheduler

Analyzed from commit: 412c71822 on 2026-05-04

Overview

The scheduler determines which VM to migrate next from a Plan's VM list. It enforces concurrency limits to prevent overloading source infrastructure. Each provider type has its own scheduler implementation, but all share the same interface and factory.

Source: pkg/controller/plan/scheduler/


Scheduler Interface

// pkg/controller/plan/scheduler/doc.go
type Scheduler interface {
    Next() (vm *plan.VMStatus, hasNext bool, err error)
}

Next() returns:

  • vm — the next VMStatus eligible to start migration
  • hasNexttrue if a VM was found, false if all are busy/done or concurrency limit reached
  • err — any error during scheduling

Factory

scheduler.New(ctx *plancontext.Context) creates the correct scheduler based on ctx.Source.Provider.Type(). All schedulers receive settings.Settings.MaxInFlight as their concurrency limit.


MaxInFlight Setting

Setting Env Var Default Scope
MaxInFlight MAX_VM_INFLIGHT 20 Per source provider (all plans sharing the same provider)

Defined in pkg/settings/migration.go. Must be a positive integer.


Two Scheduling Models

1. Simple Model (oVirt, OpenStack, OCP, OVA, Hyper-V, EC2)

These providers use a flat VM-count concurrency model:

inFlight (running VMs across all plans for same provider) < MaxInFlight → schedule next VM

Algorithm (Next()):

  1. Acquire package-level mutex
  2. List all Plans in the cluster
  3. Count running VMs across all Plans sharing the same source provider (skip archived, non-executing plans)
  4. If inFlight >= MaxInFlight → return no VM
  5. Iterate this Plan's VMs in order; return the first VM that is not canceled, not started, and not completed

Concurrency unit: 1 VM = 1 slot. Simple counter across the provider.

2. Host-Aware Model (vSphere only)

vSphere uses a per-ESXi-host disk-count concurrency model. The limit is per host, not globally flat:

Read the full file on GitHub · 217 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 217 lines · 13 tokens per session scan A dd2b3392b075

Subscribe to this mod's changes

scheduler is a cursor rule published in the GitHub repository kubev2v/forklift-console-plugin (11 stars, last pushed 3d ago), licensed Apache-2.0. It adds 13 tokens to every session and 2,095 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.