From 005575d18edaa18c1a00bac4fc157bc96a318b0a Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Thu, 26 Nov 2026 17:26:57 +0100 Subject: [PATCH 1/2] feat: get_vms reports the instance UUID as the guest uid (NetOrk/netork#2728) --- CHANGELOG.md | 5 +++++ napalm_vmware/parse/vms.py | 2 ++ tests/test_parse_vms.py | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52a4336..cea8609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- `get_vms()` reports each VM's `uid` (napalm-device-types 4.44.0's `VMDict.uid`, + NetOrk/netork#2728): its instance UUID, which already survives a migration and a + restore. netOrk knows a guest by `uid` on every hypervisor that has one. + ## [0.4.0] - 2026-11-25 ### Added diff --git a/napalm_vmware/parse/vms.py b/napalm_vmware/parse/vms.py index 3126a6f..a195b4c 100644 --- a/napalm_vmware/parse/vms.py +++ b/napalm_vmware/parse/vms.py @@ -87,6 +87,8 @@ def _vm( return { "name": vm.get("name", ""), "vmid": vm["config.instanceUuid"], + # VMDict.uid: the instance UUID already survives a migration and a restore. + "uid": vm["config.instanceUuid"], "moref": vm["_moref"], "type": "vm", "status": _STATUS.get(vm.get("runtime.powerState", ""), "unknown"), diff --git a/tests/test_parse_vms.py b/tests/test_parse_vms.py index 1c2b394..923514a 100644 --- a/tests/test_parse_vms.py +++ b/tests/test_parse_vms.py @@ -33,6 +33,11 @@ class TestVmListFromVcsim: assert vm["node"] == "localhost.localdomain" assert vm["type"] == "vm" + def test_the_uid_is_the_instance_uuid(self, esxi_data, vm0): + # VMDict.uid: an identity that survives a migration and a restore; vSphere's + # instance UUID is one (NetOrk/netork#2728). + assert _vms(esxi_data)[0]["uid"] == vm0["config.instanceUuid"] + def test_vcenter_node_is_the_esxi_host(self, vcenter_data): nodes = {vm["name"]: vm["node"] for vm in _vms(vcenter_data)} assert nodes["DC0_H0_VM0"] == "DC0_H0" From ebf437dac630400167d28570115d0d4b41ff1339 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Thu, 26 Nov 2026 18:05:27 +0100 Subject: [PATCH 2/2] chore(release): 0.5.0 --- CHANGELOG.md | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cea8609..3e15e52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.0] - 2026-11-26 + ### Added - `get_vms()` reports each VM's `uid` (napalm-device-types 4.44.0's `VMDict.uid`, NetOrk/netork#2728): its instance UUID, which already survives a migration and a diff --git a/pyproject.toml b/pyproject.toml index 7cdfceb..326dab1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "napalm-vmware" -version = "0.4.0" +version = "0.5.0" description = "NAPALM drivers for VMware ESXi hosts and vCenter Server (vSphere API via pyVmomi)" readme = "README.md" requires-python = ">=3.12"