Implements get_clusters() from napalm-device-types for vCenter and ESXi, and create_vm_from_cloud_init(node=) (NetOrk/netork#1820).
Changes
parse/clusters.py (pure): vCenter reports each ClusterComputeResource and each standalone compute resource as a cluster of one, id = "<about.instanceUuid>/<moref>"; ESXi reports itself (id = its system UUID). Hosts: state (connected → online, disconnected/notResponding → offline), maintenance, threads, cores, model, memory, CPU usage from quick stats (capped at 1.0, None when not computable); cpu_flags and quorate are None (vSphere gives neither). Datastores with the hosts that mount them (accessible only), port groups with fixed VLAN where readable (uplink port groups left out).
paths.CLUSTER and the merged ComputeResource paths in paths.ALL (harvest stays in sync).
choose_placement(..., host_name=) raises NodeRefused(ValueError) for an unknown or ineligible host; placement now runs before the image download, so a refused node fails at once (CHANGELOG: Changed). choose_placement split below complexity 10 and dropped from the baseline.
Related Issue
NetOrk/netork#484, NetOrk/netork#1822. Needs NAPALM/napalm-device-types feat/cluster-inventory merged first; raise the device-types floor with its release.
Testing
Parser and placement unit tests; vcsim: 10 passed (get_clusters on vCenter and ESXi, provisioning on a named node and refusing an unknown one). pytest 339 passed, 10 skipped, coverage 97 %; ruff and mypy clean.
## Summary
Implements `get_clusters()` from napalm-device-types for vCenter and ESXi, and `create_vm_from_cloud_init(node=)` (NetOrk/netork#1820).
## Changes
- `parse/clusters.py` (pure): vCenter reports each ClusterComputeResource and each standalone compute resource as a cluster of one, `id` = `"<about.instanceUuid>/<moref>"`; ESXi reports itself (`id` = its system UUID). Hosts: state (connected → online, disconnected/notResponding → offline), maintenance, threads, cores, model, memory, CPU usage from quick stats (capped at 1.0, None when not computable); `cpu_flags` and `quorate` are None (vSphere gives neither). Datastores with the hosts that mount them (accessible only), port groups with fixed VLAN where readable (uplink port groups left out).
- `paths.CLUSTER` and the merged ComputeResource paths in `paths.ALL` (harvest stays in sync).
- `choose_placement(..., host_name=)` raises `NodeRefused(ValueError)` for an unknown or ineligible host; placement now runs before the image download, so a refused node fails at once (CHANGELOG: Changed). `choose_placement` split below complexity 10 and dropped from the baseline.
## Related Issue
NetOrk/netork#484, NetOrk/netork#1822. Needs NAPALM/napalm-device-types `feat/cluster-inventory` merged first; raise the device-types floor with its release.
## Testing
Parser and placement unit tests; vcsim: 10 passed (get_clusters on vCenter and ESXi, provisioning on a named node and refusing an unknown one). pytest 339 passed, 10 skipped, coverage 97 %; ruff and mypy clean.
vCenter reports each cluster compute resource, and each standalone host
it runs as a cluster of one, identified by "<instanceUuid>/<moref>"; an
ESXi host reports itself. Nodes carry state, maintenance, CPU and memory;
datastores and port groups carry the hosts that see them.
create_vm_from_cloud_init(node=) places the VM on that host and refuses
one that does not exist or cannot take it, before anything is created.
Placement now runs before the image download, so a refused host fails at
once instead of after the download.
Refs NetOrk/netork#484, NetOrk/netork#1822
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Implements
get_clusters()from napalm-device-types for vCenter and ESXi, andcreate_vm_from_cloud_init(node=)(NetOrk/netork#1820).Changes
parse/clusters.py(pure): vCenter reports each ClusterComputeResource and each standalone compute resource as a cluster of one,id="<about.instanceUuid>/<moref>"; ESXi reports itself (id= its system UUID). Hosts: state (connected → online, disconnected/notResponding → offline), maintenance, threads, cores, model, memory, CPU usage from quick stats (capped at 1.0, None when not computable);cpu_flagsandquorateare None (vSphere gives neither). Datastores with the hosts that mount them (accessible only), port groups with fixed VLAN where readable (uplink port groups left out).paths.CLUSTERand the merged ComputeResource paths inpaths.ALL(harvest stays in sync).choose_placement(..., host_name=)raisesNodeRefused(ValueError)for an unknown or ineligible host; placement now runs before the image download, so a refused node fails at once (CHANGELOG: Changed).choose_placementsplit below complexity 10 and dropped from the baseline.Related Issue
NetOrk/netork#484, NetOrk/netork#1822. Needs NAPALM/napalm-device-types
feat/cluster-inventorymerged first; raise the device-types floor with its release.Testing
Parser and placement unit tests; vcsim: 10 passed (get_clusters on vCenter and ESXi, provisioning on a named node and refusing an unknown one). pytest 339 passed, 10 skipped, coverage 97 %; ruff and mypy clean.