- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
of NAPALM/driver-standard; .github/ is gone.
- setuptools>=77 with the SPDX license string, no License classifier,
Python 3.13 classifier, napalm-device-types>=4.21.1, a dev extra with
floors, Issues and Changelog links; README installs from PyPI and links
pyVmomi on PyPI.
- mypy strict for the package (the blanket ignore_missing_imports is now
limited to napalm and yaml); exempt for now (35 errors): _inventory,
_session, _tasks, base, esxi, parse.environment, parse.snapshots,
parse.vm_devices, provision.seed, provision.transfer, provisioning.
Recorded in the quality baseline with the long and complex functions.
- Coverage floor 97 % (measured 97.11 %).
- zip() in provisioning is strict (B905): the OVF asks for one adapter
per requested NIC, so the two lists match. A VM that came back with
fewer adapters used to get a seed that left a NIC unconfigured; it now
fails, and create_vm_from_cloud_init discards it as on any other error
after the import. A test covers it.
- A failed abort of the import lease is logged at debug level instead of
passed over (B110); the original error is still the one raised.
- nosec for false positives, each with its reason: the 0.0.0.0 entries in
the parsers are addresses vSphere reports, not binds (B104); qemu-img
runs with a fixed argv and no shell (B404, B603); xml.sax.saxutils only
escapes the OVF descriptor the driver writes, nothing is parsed (B406),
so defusedxml would not apply.
get_device_warnings is gone; netOrk names the warnings from facts
(netOrk #1111). get_hypervisor_hosts() reports each host's connection
state, maintenance mode, configuration issues and managing vCenter;
get_licenses() the assigned licenses with the edition key as edition,
never the key itself.
The reach stays: the ESXi driver reports connected as None (a
disconnected host could not have answered), and managed_by only for a
host it reached directly. parse/warnings.py is replaced by
parse/hosts.py and parse/licenses.py.
Follows napalm-device-types 3.0, which replaces GUEST_AGENT_PACKAGES /
GUEST_AGENT_RUNCMD with GUEST_AGENTS = {guest_os: (packages, runcmd)}.
VMware lists Linux with open-vm-tools, as before, and refuses any other
guest_os before anything is created: BSD guests on VMware are optional
for now (NetOrk/netork#801).
The NoCloud network-config moved to napalm-device-types
(`provisioning.network_config`), which Proxmox now uses as well; the seed
module's copy is gone, and the tests check that the generic one is used.
napalm_device_types' create_vm_from_cloud_init gained cpu_type, the CPU model
a new VM gets (netork#494). VMware sets CPU compatibility per cluster (EVC),
not per VM, and this driver has no get_vm_cpu_types() to offer a model, so
None is the only value it can honour. Anything else raises ValueError before
the image is fetched rather than being dropped silently.
create_vm_from_cloud_init takes the same qcow2/raw cloud images netOrk
offers for Proxmox. ESXi can neither boot nor download them, so the
driver does both: download with checksum check and one retry, convert
with qemu-img to a streamOptimized VMDK (cached by URL), import through
a minimal OVF descriptor over NFC, pin requested MACs, grow the disk,
and attach a NoCloud seed ISO placed next to the VM's files. NoCloud
rather than guestinfo because it needs nothing in the guest; the
user-data installs open-vm-tools, which the driver declares as its
guest agent. A failure after the import removes the VM again.
Placement is a pure decision over inventory rows: a connected host
outside maintenance mode that sees the datastore and every port group,
with the resource pool and VM folder found by walking up to the
datacenter -- one path for a standalone host and for a vCenter.
Two faults vcsim surfaced and the tests now pin: a chunked upload body
next to a Content-Length is refused with 500, so the disk goes up as a
sized file object that also reports lease progress; and a device edit
replaces the device as sent, so disk and NIC edits start from the live
objects, backing included (vcsim panicked on a disk without one).
destroy_vm, get_vm_status, get_network_targets (port groups with their
fixed VLAN) and get_image_storages complete the contract.
reboot_host on ESXi uses RebootHost_Task and refuses outside
maintenance mode: force=True would cut power to running VMs.
Tested against vcsim in ESXi and vCenter mode, end to end.
Two drivers from one package, both in the hypervisor role:
- vmware_esxi talks to one host directly: facts, vmnics and vmkernel
NICs, CDP/LLDP neighbours, sensors, VMs, datastores and port groups.
- vmware_vcenter talks to a vCenter: every VM of every host it manages,
with the host as the VM's node, plus distributed port groups. It
reports no interfaces of its own; the hosts' NICs belong to the hosts.
Both implement the HypervisorDriver VM contract: get_vms, get_vm_config,
start/stop/reboot/suspend_vm and the four snapshot methods, and emit raw
device warnings (maintenance mode, disconnected host, config issues,
host managed by a vCenter, free license making the API read-only).
Every read is a PropertyCollector query for the explicit paths in
paths.py, converted by to_plain() into dicts and lists; the parsers
only ever see that. tools/harvest.py dumps exactly those paths to JSON
and tools/sanitize.py scrubs the dump, so a real host can become a test
fixture without code changes. A VM's vmid is its instance UUID, which
survives vMotion and re-registration; a MoRef does not.
Tested against govmomi's vcsim in ESXi and vCenter mode, including real
power and snapshot tasks. Not yet tested against real hardware.