Skip to content

Add Changed Block Tracking (CBT) support - #4

Merged
artm-hx merged 3 commits into
replication_agentfrom
pr4-cbt
Oct 1, 2026
Merged

artm-hx merged 3 commits into
replication_agentfrom
pr4-cbt

Conversation

@artm-hx

@artm-hx artm-hx commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Collected from cloudbase#6

Original author: doccaz
Original branch: pr4-cbt

This pull request is the open upstream change, retargeted at replication_agent.

Changed Block Tracking uses the public VIM API (enable_change_tracking, disk_change_id, query_changed_disk_areas), not an NFC message.

doccaz and others added 3 commits September 19, 2026 10:42
CBT turned out to need no NFC reverse engineering at all:
VirtualMachine.QueryChangedDiskAreas -- the actual changed-byte-range
query real backup tools use, distinct from VDDK's own
VixDiskLib_QueryAllocatedBlocks (a different, disk-internal
allocated-block bitmap) -- is public VIM API with no VDDK/NFC
involvement whatsoever.

Adds thin wrappers: enable_change_tracking (sets
changeTrackingEnabled via ReconfigVM_Task), disk_change_id (reads a
disk's current changeId off its backing, once CBT is active and a
snapshot exists), and query_changed_disk_areas (the actual changed-
range query, converted to plain dataclasses).

Also documents real-world characteristics found through live testing,
not obvious from the API docs:
- A wildcard changeId="*" query (the initial-full-backup path) reports
  only *allocated* regions on a thin-provisioned disk, not the full
  sparse virtual capacity.
- A single large contiguous write comes back as one extent regardless
  of size; only the number of *discontiguous* changed regions drives
  how large the extent list gets -- the real scaling risk for CBT on
  a busy disk is fragmented random I/O, not big sequential writes.

Adds unit tests (ValueError paths, VIM call argument/result
conversion, mocked -- no lab needed) and an integration test exercising
the full cycle: enable CBT, snapshot, write a known sector, snapshot,
query, verify the write falls inside the reported extent. Validated
against a live standalone ESXi 8.0.3 host. Full workflow and lab
evidence: docs/cbt.md.
Keep the merged NFC features and add Changed Block Tracking.
@artm-hx
artm-hx merged commit 8b3523b into replication_agent Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants