Skip to content

Add VixDiskLib_GetInfo (capacity, geometry, DDB_GET fields) - #2

Merged
artm-hx merged 4 commits into
replication_agentfrom
pr2-getinfo-ddbget
Oct 1, 2026
Merged

artm-hx merged 4 commits into
replication_agentfrom
pr2-getinfo-ddbget

Conversation

@artm-hx

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

Copy link
Copy Markdown
Collaborator

Collected from cloudbase#4

Original author: doccaz
Original branch: pr2-getinfo-ddbget

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

Adds VixDiskLib_GetInfo: capacity and physical geometry from the OPEN_FILE reply, plus biosGeo, adapterType, and uuid via DDB_GET.

doccaz and others added 4 commits September 19, 2026 10:37
Capacity and physical geometry come free from the OPEN_FILE reply:
found via an SSL-hook capture of VixDiskLib_GetInfo that dumped every
byte of the reply rather than just the fields an earlier Open-only
capture had labeled. Offset 28 (uint64, bytes) matches
VixDiskLibInfo.capacity; offsets 40/44/48 match physGeo exactly. No
extra NFC round trip needed for these two fields.

biosGeo, adapterType, and uuid come from DDB_GET (a generic VMDK
descriptor key/value NFC message, implemented here too): request is a
16-byte fixed payload plus the key name as a raw ASCII extra; reply is
16 bytes plus a value extra that is ASCII text on the wire (not
binary) -- geometry.cylinders comes back as the literal bytes b"2088",
matching how a VMDK descriptor's DDB section stores key/value pairs
as plain text.

VixDiskLibHandle.get_info() now issues the same 5 DDB_GET round trips
real VDDK's VixDiskLib_GetInfo pays on every call, matching its
behavior and cost exactly (previously it only returned the two free
OPEN_FILE-derived fields).

Adds unit tests for the OPEN_FILE reply parsing, the DDB_GET wire
format, and query_full_info's field combination/fallback logic -- no
lab needed. Validated against a live standalone ESXi 8.0.3 host:
output matches native VDDK's own GetInfo on the same disk exactly
(adapterType=3 <-> "lsilogic", same uuid string, same zeroed biosGeo).
Full protocol details in docs/nfc_open.md.
We're currently hitting the following mypy error:

```
tests/unit/test_nfc_open.py:107: error: Argument "sock" to "NfcDisk"
has incompatible type "_FakeSocket"; expected "socket"  [arg-type]
```

`typing.Protocol` is a convenient way of addressing this.

https://typing.python.org/en/latest/spec/protocol.html
Keep direct-ESXi from replication_agent and GetInfo from this branch.
@artm-hx
artm-hx merged commit fceadf8 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