Compare commits
2
Commits
8396b7c64a
...
8624ddb62f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8624ddb62f | ||
|
|
c8b581089c |
No files matched your search
@@ -47,6 +47,7 @@ Plugin settings:
|
||||
- The B-side device selection of a cable can be pre-filtered by tenant group, tenant and site.
|
||||
- A **Prefix** column (first word of the site name) for device and rack lists, including sorting and filtering.
|
||||
- A **Disks** tab for servers, NAS, SAN and MSA devices: slot layout, disks, RAID groups, warranty and age warnings, replacement history, CSV import, HPE MSA disk export import, REST API and GraphQL.
|
||||
- **CPU & RAM** per server from a built-in catalogue of 700+ Intel and AMD server CPUs since 2012, with cluster capacity and overcommit for NetBox virtualization.
|
||||
|
||||
Navigation settings are stored per user. The active tenant or tenant-group
|
||||
selection is stored in the browser session.
|
||||
@@ -218,6 +219,9 @@ sudo systemctl restart netbox netbox-rq
|
||||
| `disk_device_roles` | `["Server", "NAS", "SAN", "MSA"]` | Device role names (case-insensitive) that get the **Disks** tab |
|
||||
| `disk_age_warning_years` | `5` | Warn about disks older than this (manufacture date, otherwise install date) |
|
||||
| `disk_warranty_warning_days` | `90` | Warn this many days before the warranty ends |
|
||||
| `hardware_enabled` | `True` | **CPU & RAM** panels, catalogue, columns and cluster capacity |
|
||||
| `hardware_device_roles` | `["Server"]` | Device roles (case-insensitive) that show the **CPU & RAM** panel; cluster hosts always show it |
|
||||
| `hardware_vcpu_ratio_warning` | `4` | Warn when a host or cluster has more vCPUs per physical core |
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -269,7 +273,7 @@ can start at slot 0 again.
|
||||
for the device type. The next device of the same type offers **Apply
|
||||
template**, which creates all stored areas with one click; on a device that
|
||||
already has areas, the button adds the missing ones. Templates are managed under
|
||||
**Disks > Disk templates** in the main menu.
|
||||
**Hardware > Disk templates** in the main menu.
|
||||
|
||||
**Slot grid.** Each area is drawn as its own grid and coloured by
|
||||
status (active, hot spare, failed, planned). A warning icon marks disks with
|
||||
@@ -312,10 +316,11 @@ capacity, the usable RAID capacity, spares and failed disks. The warnings panel
|
||||
lists failed disks, expired warranties, warranties ending within
|
||||
`disk_warranty_warning_days` and disks older than `disk_age_warning_years`.
|
||||
|
||||
**Main menu.** The plugin adds its own **Disks** menu with the entries
|
||||
**Disks**, **RAID groups** and **Disk templates**.
|
||||
**Main menu.** The plugin adds its own **Hardware** menu with the entries
|
||||
**Disks**, **RAID groups** and **Disk templates**, plus **CPU & RAM** and
|
||||
**CPU models** (see below).
|
||||
|
||||
**Disks grouped by device.** **Disks > Disks** shows all disks grouped by device.
|
||||
**Disks grouped by device.** **Hardware > Disks** shows all disks grouped by device.
|
||||
Each device is a collapsible section whose header shows the device, role, site,
|
||||
tenant, number of disks, raw capacity, failed disks and warnings, plus a link to
|
||||
the device's **Disks** tab. The page offers a search (serial number, model,
|
||||
@@ -333,7 +338,7 @@ device and slot. The device list offers an optional **Disks** column
|
||||
(used/total, linked to the tab) under **Configure Table**; it runs two queries
|
||||
per row, so enable it only where needed.
|
||||
|
||||
**CSV import.** **Disks > Disks > Import** accepts CSV, JSON or YAML
|
||||
**CSV import.** **Hardware > Disks > Import** accepts CSV, JSON or YAML
|
||||
with these columns: `device` (device name), `bay` (area name, may be empty when
|
||||
the device has only one area), `slot`, `status`, `disk_type`,
|
||||
`interface`, `form_factor`, `manufacturer`, `model`, `capacity` (e.g. `4 TB`),
|
||||
@@ -351,7 +356,7 @@ srv-01,Front,1,spare,ssd,sas,Samsung,PM1643a,1.92 TB,S4XXNA0R123457,2029-05-31
|
||||
srv-01,PCIe,0,active,nvme,nvme,Samsung,PM9A3,3.84 TB,S64XNA0T654321,2030-01-31
|
||||
```
|
||||
|
||||
**HPE MSA import.** The *HPE MSA export* button next to **Disks > Disks** (also
|
||||
**HPE MSA import.** The *HPE MSA export* button next to **Hardware > Disks** (also
|
||||
*MSA import* in a device's **Disks** tab) reads the CSV disk export of an HPE MSA
|
||||
(*Pools → Disks*, export to CSV). The `Location` column (`1.4` = enclosure 1,
|
||||
slot 4) defines the enclosures; in the next step each enclosure (shelf) is
|
||||
@@ -403,6 +408,90 @@ The HPE MSA import requires `netbox_utilities.add_disk`; updating or replacing
|
||||
existing disks additionally requires `netbox_utilities.change_disk`, and creating
|
||||
RAID groups `netbox_utilities.add_raidgroup` (otherwise they are skipped).
|
||||
|
||||
### CPU & RAM
|
||||
|
||||
Servers and virtualization hosts get a **CPU & RAM** panel on the device page.
|
||||
It is shown for devices whose role is listed in `hardware_device_roles`, for
|
||||
every device assigned to a cluster, and for every device that already has CPU &
|
||||
RAM recorded. **Add** opens a form with:
|
||||
|
||||
- **CPU model**: a searchable select over the catalogue. Typing `6338`,
|
||||
`Gold 6338` or `epyc 7543` is enough; each entry shows cores, threads and
|
||||
base/turbo clock.
|
||||
- **Number of CPUs** (populated sockets). It is checked against the maximum
|
||||
socket count of the model, e.g. EPYC "P" models are single-socket only.
|
||||
- **RAM**: number and size of the modules, total RAM (calculated from modules ×
|
||||
size when left empty), type (DDR3/DDR4/DDR5) and speed in MT/s.
|
||||
|
||||
The panel then shows e.g. *2 × Intel Xeon Gold 6338 · 64 cores / 128 threads ·
|
||||
1 TB (16 × 64 GB DDR4-3200)*. The device list offers the optional columns
|
||||
**CPU**, **Cores / Threads** and **RAM** under **Configure Table**.
|
||||
|
||||
**CPU catalogue.** **Hardware > CPU models** lists about 700 server CPUs:
|
||||
|
||||
| Vendor | Families |
|
||||
|---|---|
|
||||
| Intel | Xeon E5-2600/2400/4600/1600 v1–v4, E7 v2–v4, E3-1200 v2–v6, Xeon E-2100 to E-2400, Xeon 6300P, Xeon Scalable 1st–5th Gen (Skylake to Emerald Rapids), Xeon 6 (Sierra Forest, Granite Rapids), Xeon 6+ (Clearwater Forest) |
|
||||
| AMD | Opteron 4300/6300, EPYC 7001/7002/7003 (incl. F and X models), 9004 (Genoa, Genoa-X, Bergamo), 8004, 4004, 4005, 9005 (Turin) |
|
||||
|
||||
Each entry has cores, threads, base and turbo clock, TDP, socket, launch year
|
||||
and maximum socket count. The values were checked against Intel ARK, AMD and
|
||||
server vendor specifications. Missing models can be added in the UI or by CSV
|
||||
import; catalogue entries can be edited, too. The catalogue is loaded by the
|
||||
migration and refreshed after a plugin update with:
|
||||
|
||||
```bash
|
||||
cd /opt/netbox/netbox
|
||||
../venv/bin/python manage.py netbox_utilities_cpu_catalog # add new models, keep edited ones
|
||||
../venv/bin/python manage.py netbox_utilities_cpu_catalog --force # also reset edited catalogue entries
|
||||
```
|
||||
|
||||
Models you created yourself are never changed by the command.
|
||||
|
||||
**Virtualization.** CPU & RAM work together with NetBox clusters and virtual
|
||||
machines (vCPUs and memory of the VM):
|
||||
|
||||
- **Cluster page:** a **Capacity (CPU & RAM)** panel sums the hosts (devices
|
||||
of the cluster) and compares them with the VMs: physical cores/threads and
|
||||
RAM, allocated vCPUs and RAM, the vCPU-to-core ratio, RAM allocation in
|
||||
percent and the RAM that remains if the largest host fails (N+1). A table
|
||||
lists every host with its CPU, VMs, ratio and RAM usage; hosts without CPU &
|
||||
RAM are flagged with a link to record them.
|
||||
- **Host (device) page:** the CPU & RAM panel adds the VMs running on that
|
||||
host (VMs whose *Device* is set) with the same figures.
|
||||
- **VM page:** a **Host hardware** panel shows the CPU of the host, or of the
|
||||
cluster hosts if the VM has no fixed host, and warns if the VM has more
|
||||
vCPUs than the host has threads.
|
||||
- **Cluster list:** the optional column **vCPU : core · RAM** shows the ratio
|
||||
and RAM allocation per cluster.
|
||||
|
||||
Warnings appear when VMs are allocated more RAM than the hosts have, when the
|
||||
RAM no longer fits after the failure of the largest host, and when the vCPU
|
||||
ratio exceeds `hardware_vcpu_ratio_warning`. VMs with the status *Offline* or
|
||||
*Decommissioning* are not counted. VM memory is read in MB as NetBox stores it.
|
||||
|
||||
**CSV import.** **Hardware > CPU & RAM > Import** accepts `device` (name),
|
||||
`cpu` (catalogue model name, e.g. `Xeon Gold 6338`), `cpu_count`, `memory_gb`,
|
||||
`memory_type` (`ddr3`, `ddr4`, `ddr5`), `memory_modules`, `memory_module_gb`,
|
||||
`memory_speed_mts`, `description`, `comments` and `tags`.
|
||||
|
||||
```csv
|
||||
device,cpu,cpu_count,memory_modules,memory_module_gb,memory_type,memory_speed_mts
|
||||
esx01,Xeon Gold 6338,2,16,64,ddr4,3200
|
||||
esx02,EPYC 9354,2,24,32,ddr5,4800
|
||||
```
|
||||
|
||||
**REST API and GraphQL.** `/api/plugins/utilities/cpu-models/` and
|
||||
`/api/plugins/utilities/device-hardware/` (with read-only `total_cores` and
|
||||
`total_threads`); filters include `?q=6338`, `?manufacturer=amd`,
|
||||
`?cores__gte=32`, `?cluster_id=4` and `?cpu_id=17`. GraphQL offers
|
||||
`netbox_utilities_cpu_model(_list)` and `netbox_utilities_device_hardware(_list)`.
|
||||
|
||||
**Permissions.** The panels require `netbox_utilities.view_devicehardware`;
|
||||
recording and editing use `netbox_utilities.add_devicehardware` and
|
||||
`netbox_utilities.change_devicehardware`. The catalogue uses the
|
||||
`netbox_utilities.*_cpumodel` permissions.
|
||||
|
||||
### Pre-filter for the B-side of a cable
|
||||
|
||||
When creating or editing a cable, the **B-side** section shows optional
|
||||
|
||||
@@ -6,7 +6,9 @@ __version__ = "0.16.0"
|
||||
class NetBoxUtilitiesConfig(PluginConfig):
|
||||
name = "netbox_utilities"
|
||||
verbose_name = "NetBox Utilities"
|
||||
description = "Navigation, tenant utilities, connection VLANs, partial-width racks, disks and bulk operations"
|
||||
description = (
|
||||
"Navigation, tenant utilities, connection VLANs, partial-width racks, disks, CPU & RAM and bulk operations"
|
||||
)
|
||||
version = __version__
|
||||
author = "LKE"
|
||||
base_url = "utilities"
|
||||
@@ -26,6 +28,9 @@ class NetBoxUtilitiesConfig(PluginConfig):
|
||||
"disk_device_roles": ["Server", "NAS", "SAN", "MSA"],
|
||||
"disk_age_warning_years": 5,
|
||||
"disk_warranty_warning_days": 90,
|
||||
"hardware_enabled": True,
|
||||
"hardware_device_roles": ["Server"],
|
||||
"hardware_vcpu_ratio_warning": 4,
|
||||
}
|
||||
middleware = [
|
||||
"netbox_utilities.middleware.GlobalTenantFilterMiddleware",
|
||||
@@ -46,6 +51,10 @@ class NetBoxUtilitiesConfig(PluginConfig):
|
||||
from .disk_integration import install_disk_support
|
||||
|
||||
install_disk_support()
|
||||
if get_plugin_config("netbox_utilities", "hardware_enabled"):
|
||||
from .hardware_integration import install_hardware_support
|
||||
|
||||
install_hardware_support()
|
||||
if get_plugin_config("netbox_utilities", "site_prefix_column_enabled"):
|
||||
from .site_prefix import install_site_prefix_column
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from netbox.api.serializers import NetBoxModelSerializer
|
||||
from rest_framework import serializers
|
||||
from tenancy.api.serializers import TenantSerializer
|
||||
|
||||
from ..models import Disk, DiskBayLayout, DiskBayTemplate, RAIDGroup
|
||||
from ..models import CPUModel, DeviceHardware, Disk, DiskBayLayout, DiskBayTemplate, RAIDGroup
|
||||
|
||||
LAYOUT_FIELDS = ("name", "weight", "slot_count", "rows", "first_slot", "numbering", "form_factor")
|
||||
|
||||
@@ -125,3 +125,74 @@ class DiskBayTemplateSerializer(NetBoxModelSerializer):
|
||||
"last_updated",
|
||||
)
|
||||
brief_fields = ("id", "url", "display", "device_type", "name", "slot_count")
|
||||
|
||||
|
||||
class CPUModelSerializer(NetBoxModelSerializer):
|
||||
url = serializers.HyperlinkedIdentityField(view_name="plugins-api:netbox_utilities-api:cpumodel-detail")
|
||||
display = serializers.SerializerMethodField(read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = CPUModel
|
||||
fields = (
|
||||
"id",
|
||||
"url",
|
||||
"display_url",
|
||||
"display",
|
||||
"manufacturer",
|
||||
"family",
|
||||
"name",
|
||||
"cores",
|
||||
"threads",
|
||||
"base_clock_ghz",
|
||||
"boost_clock_ghz",
|
||||
"tdp_watts",
|
||||
"socket",
|
||||
"launch_year",
|
||||
"max_sockets",
|
||||
"builtin",
|
||||
"customized",
|
||||
"description",
|
||||
"tags",
|
||||
"custom_fields",
|
||||
"created",
|
||||
"last_updated",
|
||||
)
|
||||
brief_fields = ("id", "url", "display", "manufacturer", "name", "cores", "threads")
|
||||
|
||||
def get_display(self, obj):
|
||||
# Shown in the CPU select: "Intel Xeon Gold 6338 – 32 Kerne / 64 Threads, 2 / 3,2 GHz".
|
||||
return f"{obj} – {obj.summary}"
|
||||
|
||||
|
||||
class DeviceHardwareSerializer(NetBoxModelSerializer):
|
||||
url = serializers.HyperlinkedIdentityField(view_name="plugins-api:netbox_utilities-api:devicehardware-detail")
|
||||
device = DeviceSerializer(nested=True)
|
||||
cpu = CPUModelSerializer(nested=True, required=False, allow_null=True)
|
||||
total_cores = serializers.IntegerField(read_only=True, allow_null=True)
|
||||
total_threads = serializers.IntegerField(read_only=True, allow_null=True)
|
||||
|
||||
class Meta:
|
||||
model = DeviceHardware
|
||||
fields = (
|
||||
"id",
|
||||
"url",
|
||||
"display_url",
|
||||
"display",
|
||||
"device",
|
||||
"cpu",
|
||||
"cpu_count",
|
||||
"total_cores",
|
||||
"total_threads",
|
||||
"memory_gb",
|
||||
"memory_type",
|
||||
"memory_modules",
|
||||
"memory_module_gb",
|
||||
"memory_speed_mts",
|
||||
"description",
|
||||
"comments",
|
||||
"tags",
|
||||
"custom_fields",
|
||||
"created",
|
||||
"last_updated",
|
||||
)
|
||||
brief_fields = ("id", "url", "display", "device", "cpu", "cpu_count", "memory_gb")
|
||||
@@ -9,5 +9,7 @@ router.register("disks", views.DiskViewSet)
|
||||
router.register("raid-groups", views.RAIDGroupViewSet)
|
||||
router.register("disk-bay-layouts", views.DiskBayLayoutViewSet)
|
||||
router.register("disk-bay-templates", views.DiskBayTemplateViewSet)
|
||||
router.register("cpu-models", views.CPUModelViewSet)
|
||||
router.register("device-hardware", views.DeviceHardwareViewSet)
|
||||
|
||||
urlpatterns = router.urls
|
||||
@@ -1,7 +1,7 @@
|
||||
from netbox.api.viewsets import NetBoxModelViewSet
|
||||
|
||||
from .. import disk_filtersets
|
||||
from ..models import Disk, DiskBayLayout, DiskBayTemplate, RAIDGroup
|
||||
from .. import disk_filtersets, hardware_filtersets
|
||||
from ..models import CPUModel, DeviceHardware, Disk, DiskBayLayout, DiskBayTemplate, RAIDGroup
|
||||
from . import serializers
|
||||
|
||||
|
||||
@@ -27,3 +27,15 @@ class DiskBayTemplateViewSet(NetBoxModelViewSet):
|
||||
queryset = DiskBayTemplate.objects.select_related("device_type")
|
||||
serializer_class = serializers.DiskBayTemplateSerializer
|
||||
filterset_class = disk_filtersets.DiskBayTemplateFilterSet
|
||||
|
||||
|
||||
class CPUModelViewSet(NetBoxModelViewSet):
|
||||
queryset = CPUModel.objects.all()
|
||||
serializer_class = serializers.CPUModelSerializer
|
||||
filterset_class = hardware_filtersets.CPUModelFilterSet
|
||||
|
||||
|
||||
class DeviceHardwareViewSet(NetBoxModelViewSet):
|
||||
queryset = DeviceHardware.objects.select_related("device", "cpu")
|
||||
serializer_class = serializers.DeviceHardwareSerializer
|
||||
filterset_class = hardware_filtersets.DeviceHardwareFilterSet
|
||||
@@ -0,0 +1,900 @@
|
||||
"""Built-in catalogue of Intel and AMD server CPUs since 2012.
|
||||
|
||||
Values follow the vendor specifications (cores, threads, base/boost clock in GHz,
|
||||
TDP in watts). The catalogue is loaded by a migration and can be refreshed with
|
||||
``manage.py netbox_utilities_cpu_catalog``; entries can also be edited or added in
|
||||
the UI. Edited entries are not overwritten unless the command runs with --force.
|
||||
|
||||
Each family: (manufacturer, family, socket, launch year, max sockets, models)
|
||||
Each model: (name, cores, threads, base GHz, boost GHz or None, TDP W)
|
||||
A trailing "P" on EPYC models means single-socket only.
|
||||
"""
|
||||
|
||||
INTEL = "intel"
|
||||
AMD = "amd"
|
||||
|
||||
FAMILIES = (
|
||||
#
|
||||
# Intel Xeon E5 / E7
|
||||
#
|
||||
(INTEL, "Xeon E5-2600 (Sandy Bridge-EP)", "LGA2011", 2012, 2, (
|
||||
("Xeon E5-2603", 4, 4, 1.8, None, 80),
|
||||
("Xeon E5-2609", 4, 4, 2.4, None, 80),
|
||||
("Xeon E5-2620", 6, 12, 2.0, 2.5, 95),
|
||||
("Xeon E5-2630", 6, 12, 2.3, 2.8, 95),
|
||||
("Xeon E5-2630L", 6, 12, 2.0, 2.5, 60),
|
||||
("Xeon E5-2637", 2, 4, 3.0, 3.5, 80),
|
||||
("Xeon E5-2640", 6, 12, 2.5, 3.0, 95),
|
||||
("Xeon E5-2643", 4, 8, 3.3, 3.5, 130),
|
||||
("Xeon E5-2650", 8, 16, 2.0, 2.8, 95),
|
||||
("Xeon E5-2650L", 8, 16, 1.8, 2.3, 70),
|
||||
("Xeon E5-2660", 8, 16, 2.2, 3.0, 95),
|
||||
("Xeon E5-2665", 8, 16, 2.4, 3.1, 115),
|
||||
("Xeon E5-2667", 6, 12, 2.9, 3.5, 130),
|
||||
("Xeon E5-2670", 8, 16, 2.6, 3.3, 115),
|
||||
("Xeon E5-2680", 8, 16, 2.7, 3.5, 130),
|
||||
("Xeon E5-2690", 8, 16, 2.9, 3.8, 135),
|
||||
("Xeon E5-2687W", 8, 16, 3.1, 3.8, 150),
|
||||
)),
|
||||
(INTEL, "Xeon E5-2400 (Sandy Bridge-EN)", "LGA1356", 2012, 2, (
|
||||
("Xeon E5-2407", 4, 4, 2.2, None, 80),
|
||||
("Xeon E5-2420", 6, 12, 1.9, 2.4, 95),
|
||||
("Xeon E5-2430", 6, 12, 2.2, 2.7, 95),
|
||||
("Xeon E5-2440", 6, 12, 2.4, 2.9, 95),
|
||||
("Xeon E5-2450", 8, 16, 2.1, 2.9, 95),
|
||||
("Xeon E5-2470", 8, 16, 2.3, 3.1, 95),
|
||||
)),
|
||||
(INTEL, "Xeon E5-4600 (Sandy Bridge-EP)", "LGA2011", 2012, 4, (
|
||||
("Xeon E5-4610", 6, 12, 2.4, 2.9, 95),
|
||||
("Xeon E5-4620", 8, 16, 2.2, 2.6, 95),
|
||||
("Xeon E5-4640", 8, 16, 2.4, 2.8, 95),
|
||||
("Xeon E5-4650", 8, 16, 2.7, 3.3, 130),
|
||||
)),
|
||||
(INTEL, "Xeon E5-2600 v2 (Ivy Bridge-EP)", "LGA2011", 2013, 2, (
|
||||
("Xeon E5-2603 v2", 4, 4, 1.8, None, 80),
|
||||
("Xeon E5-2609 v2", 4, 4, 2.5, None, 80),
|
||||
("Xeon E5-2620 v2", 6, 12, 2.1, 2.6, 80),
|
||||
("Xeon E5-2630 v2", 6, 12, 2.6, 3.1, 80),
|
||||
("Xeon E5-2630L v2", 6, 12, 2.4, 2.8, 60),
|
||||
("Xeon E5-2637 v2", 4, 8, 3.5, 3.8, 130),
|
||||
("Xeon E5-2640 v2", 8, 16, 2.0, 2.5, 95),
|
||||
("Xeon E5-2643 v2", 6, 12, 3.5, 3.8, 130),
|
||||
("Xeon E5-2650 v2", 8, 16, 2.6, 3.4, 95),
|
||||
("Xeon E5-2650L v2", 10, 20, 1.7, 2.1, 70),
|
||||
("Xeon E5-2660 v2", 10, 20, 2.2, 3.0, 95),
|
||||
("Xeon E5-2667 v2", 8, 16, 3.3, 4.0, 130),
|
||||
("Xeon E5-2670 v2", 10, 20, 2.5, 3.3, 115),
|
||||
("Xeon E5-2680 v2", 10, 20, 2.8, 3.6, 115),
|
||||
("Xeon E5-2690 v2", 10, 20, 3.0, 3.6, 130),
|
||||
("Xeon E5-2695 v2", 12, 24, 2.4, 3.2, 115),
|
||||
("Xeon E5-2697 v2", 12, 24, 2.7, 3.5, 130),
|
||||
("Xeon E5-2687W v2", 8, 16, 3.4, 4.0, 150),
|
||||
)),
|
||||
(INTEL, "Xeon E5-2400 v2 (Ivy Bridge-EN)", "LGA1356", 2014, 2, (
|
||||
("Xeon E5-2407 v2", 4, 4, 2.4, None, 80),
|
||||
("Xeon E5-2420 v2", 6, 12, 2.2, 2.7, 80),
|
||||
("Xeon E5-2430 v2", 6, 12, 2.5, 3.0, 80),
|
||||
("Xeon E5-2440 v2", 8, 16, 1.9, 2.4, 95),
|
||||
("Xeon E5-2450 v2", 8, 16, 2.5, 3.3, 95),
|
||||
("Xeon E5-2470 v2", 10, 20, 2.4, 3.2, 95),
|
||||
)),
|
||||
(INTEL, "Xeon E5-4600 v2 (Ivy Bridge-EP)", "LGA2011", 2014, 4, (
|
||||
("Xeon E5-4610 v2", 8, 16, 2.3, 2.7, 95),
|
||||
("Xeon E5-4620 v2", 8, 16, 2.6, 3.0, 95),
|
||||
("Xeon E5-4640 v2", 10, 20, 2.2, 2.7, 95),
|
||||
("Xeon E5-4650 v2", 10, 20, 2.4, 2.9, 95),
|
||||
("Xeon E5-4657L v2", 12, 24, 2.4, 2.9, 115),
|
||||
("Xeon E5-4603 v2", 4, 8, 2.2, None, 95),
|
||||
("Xeon E5-4607 v2", 6, 12, 2.6, None, 95),
|
||||
)),
|
||||
(INTEL, "Xeon E7 v2 (Ivy Bridge-EX)", "LGA2011-1", 2014, 8, (
|
||||
("Xeon E7-4850 v2", 12, 24, 2.3, 2.8, 105),
|
||||
("Xeon E7-4870 v2", 15, 30, 2.3, 2.9, 130),
|
||||
("Xeon E7-8870 v2", 15, 30, 2.3, 2.9, 130),
|
||||
("Xeon E7-8890 v2", 15, 30, 2.8, 3.4, 155),
|
||||
("Xeon E7-4809 v2", 6, 12, 1.9, None, 105),
|
||||
("Xeon E7-4820 v2", 8, 16, 2.0, 2.5, 105),
|
||||
("Xeon E7-4830 v2", 10, 20, 2.2, 2.7, 105),
|
||||
("Xeon E7-4860 v2", 12, 24, 2.6, 3.2, 130),
|
||||
("Xeon E7-4880 v2", 15, 30, 2.5, 3.1, 130),
|
||||
("Xeon E7-4890 v2", 15, 30, 2.8, 3.4, 155),
|
||||
("Xeon E7-8850 v2", 12, 24, 2.3, 2.8, 105),
|
||||
("Xeon E7-8880 v2", 15, 30, 2.5, 3.1, 130),
|
||||
("Xeon E7-8891 v2", 10, 20, 3.2, 3.7, 155),
|
||||
("Xeon E7-8893 v2", 6, 12, 3.4, 3.7, 155),
|
||||
)),
|
||||
(INTEL, "Xeon E5-2600 v3 (Haswell-EP)", "LGA2011-3", 2014, 2, (
|
||||
("Xeon E5-2603 v3", 6, 6, 1.6, None, 85),
|
||||
("Xeon E5-2609 v3", 6, 6, 1.9, None, 85),
|
||||
("Xeon E5-2620 v3", 6, 12, 2.4, 3.2, 85),
|
||||
("Xeon E5-2623 v3", 4, 8, 3.0, 3.5, 105),
|
||||
("Xeon E5-2630 v3", 8, 16, 2.4, 3.2, 85),
|
||||
("Xeon E5-2630L v3", 8, 16, 1.8, 2.9, 55),
|
||||
("Xeon E5-2637 v3", 4, 8, 3.5, 3.7, 135),
|
||||
("Xeon E5-2640 v3", 8, 16, 2.6, 3.4, 90),
|
||||
("Xeon E5-2643 v3", 6, 12, 3.4, 3.7, 135),
|
||||
("Xeon E5-2650 v3", 10, 20, 2.3, 3.0, 105),
|
||||
("Xeon E5-2650L v3", 12, 24, 1.8, 2.5, 65),
|
||||
("Xeon E5-2660 v3", 10, 20, 2.6, 3.3, 105),
|
||||
("Xeon E5-2667 v3", 8, 16, 3.2, 3.6, 135),
|
||||
("Xeon E5-2670 v3", 12, 24, 2.3, 3.1, 120),
|
||||
("Xeon E5-2680 v3", 12, 24, 2.5, 3.3, 120),
|
||||
("Xeon E5-2683 v3", 14, 28, 2.0, 3.0, 120),
|
||||
("Xeon E5-2687W v3", 10, 20, 3.1, 3.5, 160),
|
||||
("Xeon E5-2690 v3", 12, 24, 2.6, 3.5, 135),
|
||||
("Xeon E5-2695 v3", 14, 28, 2.3, 3.3, 120),
|
||||
("Xeon E5-2697 v3", 14, 28, 2.6, 3.6, 145),
|
||||
("Xeon E5-2698 v3", 16, 32, 2.3, 3.6, 135),
|
||||
("Xeon E5-2699 v3", 18, 36, 2.3, 3.6, 145),
|
||||
)),
|
||||
(INTEL, "Xeon E5-1600 v3 (Haswell-EP)", "LGA2011-3", 2014, 1, (
|
||||
("Xeon E5-1620 v3", 4, 8, 3.5, 3.6, 140),
|
||||
("Xeon E5-1650 v3", 6, 12, 3.5, 3.8, 140),
|
||||
("Xeon E5-1630 v3", 4, 8, 3.7, 3.8, 140),
|
||||
("Xeon E5-1660 v3", 8, 16, 3.0, 3.5, 140),
|
||||
("Xeon E5-1680 v3", 8, 16, 3.2, 3.8, 140),
|
||||
)),
|
||||
(INTEL, "Xeon E5-4600 v3 (Haswell-EP)", "LGA2011-3", 2015, 4, (
|
||||
("Xeon E5-4620 v3", 10, 20, 2.0, 2.6, 105),
|
||||
("Xeon E5-4640 v3", 12, 24, 1.9, 2.6, 105),
|
||||
("Xeon E5-4650 v3", 12, 24, 2.1, 2.8, 105),
|
||||
("Xeon E5-4669 v3", 18, 36, 2.1, 2.9, 135),
|
||||
("Xeon E5-4610 v3", 10, 20, 1.7, None, 105),
|
||||
("Xeon E5-4627 v3", 10, 10, 2.6, 3.2, 135),
|
||||
("Xeon E5-4660 v3", 14, 28, 2.1, 2.9, 120),
|
||||
("Xeon E5-4667 v3", 16, 32, 2.0, 2.9, 135),
|
||||
)),
|
||||
(INTEL, "Xeon E7 v3 (Haswell-EX)", "LGA2011-1", 2015, 8, (
|
||||
("Xeon E7-4850 v3", 14, 28, 2.2, 2.8, 115),
|
||||
("Xeon E7-8870 v3", 18, 36, 2.1, 2.9, 140),
|
||||
("Xeon E7-8890 v3", 18, 36, 2.5, 3.3, 165),
|
||||
("Xeon E7-4809 v3", 8, 16, 2.0, None, 115),
|
||||
("Xeon E7-4820 v3", 10, 20, 1.9, None, 115),
|
||||
("Xeon E7-4830 v3", 12, 24, 2.1, 2.7, 115),
|
||||
("Xeon E7-8860 v3", 16, 32, 2.2, 3.2, 140),
|
||||
("Xeon E7-8867 v3", 16, 32, 2.5, 3.3, 165),
|
||||
("Xeon E7-8880 v3", 18, 36, 2.3, 3.1, 140),
|
||||
("Xeon E7-8891 v3", 10, 20, 2.8, 3.5, 165),
|
||||
("Xeon E7-8893 v3", 4, 8, 3.2, 3.5, 140),
|
||||
)),
|
||||
(INTEL, "Xeon E5-2600 v4 (Broadwell-EP)", "LGA2011-3", 2016, 2, (
|
||||
("Xeon E5-2603 v4", 6, 6, 1.7, None, 85),
|
||||
("Xeon E5-2609 v4", 8, 8, 1.7, None, 85),
|
||||
("Xeon E5-2620 v4", 8, 16, 2.1, 3.0, 85),
|
||||
("Xeon E5-2623 v4", 4, 8, 2.6, 3.2, 85),
|
||||
("Xeon E5-2630 v4", 10, 20, 2.2, 3.1, 85),
|
||||
("Xeon E5-2630L v4", 10, 20, 1.8, 2.9, 55),
|
||||
("Xeon E5-2637 v4", 4, 8, 3.5, 3.7, 135),
|
||||
("Xeon E5-2640 v4", 10, 20, 2.4, 3.4, 90),
|
||||
("Xeon E5-2643 v4", 6, 12, 3.4, 3.7, 135),
|
||||
("Xeon E5-2650 v4", 12, 24, 2.2, 2.9, 105),
|
||||
("Xeon E5-2650L v4", 14, 28, 1.7, 2.5, 65),
|
||||
("Xeon E5-2660 v4", 14, 28, 2.0, 3.2, 105),
|
||||
("Xeon E5-2667 v4", 8, 16, 3.2, 3.6, 135),
|
||||
("Xeon E5-2680 v4", 14, 28, 2.4, 3.3, 120),
|
||||
("Xeon E5-2683 v4", 16, 32, 2.1, 3.0, 120),
|
||||
("Xeon E5-2690 v4", 14, 28, 2.6, 3.5, 135),
|
||||
("Xeon E5-2695 v4", 18, 36, 2.1, 3.3, 120),
|
||||
("Xeon E5-2697 v4", 18, 36, 2.3, 3.6, 145),
|
||||
("Xeon E5-2697A v4", 16, 32, 2.6, 3.6, 145),
|
||||
("Xeon E5-2698 v4", 20, 40, 2.2, 3.6, 135),
|
||||
("Xeon E5-2699 v4", 22, 44, 2.2, 3.6, 145),
|
||||
("Xeon E5-2687W v4", 12, 24, 3.0, 3.5, 160),
|
||||
("Xeon E5-2699A v4", 22, 44, 2.4, 3.6, 145),
|
||||
)),
|
||||
(INTEL, "Xeon E5-1600 v4 (Broadwell-EP)", "LGA2011-3", 2016, 1, (
|
||||
("Xeon E5-1620 v4", 4, 8, 3.5, 3.8, 140),
|
||||
("Xeon E5-1650 v4", 6, 12, 3.6, 4.0, 140),
|
||||
("Xeon E5-1660 v4", 8, 16, 3.2, 3.8, 140),
|
||||
("Xeon E5-1630 v4", 4, 8, 3.7, 4.0, 140),
|
||||
("Xeon E5-1680 v4", 8, 16, 3.4, 4.0, 140),
|
||||
)),
|
||||
(INTEL, "Xeon E5-4600 v4 (Broadwell-EP)", "LGA2011-3", 2016, 4, (
|
||||
("Xeon E5-4620 v4", 10, 20, 2.1, 2.6, 105),
|
||||
("Xeon E5-4640 v4", 12, 24, 2.1, 2.6, 105),
|
||||
("Xeon E5-4650 v4", 14, 28, 2.2, 2.8, 105),
|
||||
("Xeon E5-4669 v4", 22, 44, 2.2, 3.0, 135),
|
||||
("Xeon E5-4610 v4", 10, 20, 1.8, None, 105),
|
||||
("Xeon E5-4627 v4", 10, 10, 2.6, 3.2, 135),
|
||||
("Xeon E5-4660 v4", 16, 32, 2.2, 3.0, 120),
|
||||
("Xeon E5-4667 v4", 18, 36, 2.2, 3.0, 135),
|
||||
)),
|
||||
(INTEL, "Xeon E7 v4 (Broadwell-EX)", "LGA2011-1", 2016, 8, (
|
||||
("Xeon E7-4850 v4", 16, 32, 2.1, 2.8, 115),
|
||||
("Xeon E7-8880 v4", 22, 44, 2.2, 3.3, 150),
|
||||
("Xeon E7-8890 v4", 24, 48, 2.2, 3.4, 165),
|
||||
("Xeon E7-4809 v4", 8, 16, 2.1, None, 115),
|
||||
("Xeon E7-4820 v4", 10, 20, 2.0, None, 115),
|
||||
("Xeon E7-4830 v4", 14, 28, 2.0, 2.8, 115),
|
||||
("Xeon E7-8860 v4", 18, 36, 2.2, 3.2, 140),
|
||||
("Xeon E7-8867 v4", 18, 36, 2.4, 3.3, 165),
|
||||
("Xeon E7-8870 v4", 20, 40, 2.1, 3.0, 140),
|
||||
("Xeon E7-8891 v4", 10, 20, 2.8, 3.5, 165),
|
||||
("Xeon E7-8893 v4", 4, 8, 3.2, 3.5, 140),
|
||||
("Xeon E7-8894 v4", 24, 48, 2.4, 3.4, 165),
|
||||
)),
|
||||
#
|
||||
# Intel Xeon E3 / E (single socket)
|
||||
#
|
||||
(INTEL, "Xeon E3-1200 v2 (Ivy Bridge)", "LGA1155", 2012, 1, (
|
||||
("Xeon E3-1220 v2", 4, 4, 3.1, 3.5, 69),
|
||||
("Xeon E3-1230 v2", 4, 8, 3.3, 3.7, 69),
|
||||
("Xeon E3-1240 v2", 4, 8, 3.4, 3.8, 69),
|
||||
("Xeon E3-1270 v2", 4, 8, 3.5, 3.9, 69),
|
||||
("Xeon E3-1225 v2", 4, 4, 3.2, 3.6, 77),
|
||||
("Xeon E3-1245 v2", 4, 8, 3.4, 3.8, 77),
|
||||
("Xeon E3-1275 v2", 4, 8, 3.5, 3.9, 77),
|
||||
("Xeon E3-1280 v2", 4, 8, 3.6, 4.0, 69),
|
||||
("Xeon E3-1290 v2", 4, 8, 3.7, 4.1, 87),
|
||||
)),
|
||||
(INTEL, "Xeon E3-1200 v3 (Haswell)", "LGA1150", 2013, 1, (
|
||||
("Xeon E3-1220 v3", 4, 4, 3.1, 3.5, 80),
|
||||
("Xeon E3-1230 v3", 4, 8, 3.3, 3.7, 80),
|
||||
("Xeon E3-1231 v3", 4, 8, 3.4, 3.8, 80),
|
||||
("Xeon E3-1240 v3", 4, 8, 3.4, 3.8, 80),
|
||||
("Xeon E3-1270 v3", 4, 8, 3.5, 3.9, 80),
|
||||
("Xeon E3-1225 v3", 4, 4, 3.2, 3.6, 84),
|
||||
("Xeon E3-1241 v3", 4, 8, 3.5, 3.9, 80),
|
||||
("Xeon E3-1245 v3", 4, 8, 3.4, 3.8, 84),
|
||||
("Xeon E3-1246 v3", 4, 8, 3.5, 3.9, 84),
|
||||
("Xeon E3-1271 v3", 4, 8, 3.6, 4.0, 80),
|
||||
("Xeon E3-1275 v3", 4, 8, 3.5, 3.9, 84),
|
||||
("Xeon E3-1280 v3", 4, 8, 3.6, 4.0, 82),
|
||||
("Xeon E3-1281 v3", 4, 8, 3.7, 4.1, 82),
|
||||
)),
|
||||
(INTEL, "Xeon E3-1200 v5 (Skylake)", "LGA1151", 2015, 1, (
|
||||
("Xeon E3-1220 v5", 4, 4, 3.0, 3.5, 80),
|
||||
("Xeon E3-1230 v5", 4, 8, 3.4, 3.8, 80),
|
||||
("Xeon E3-1240 v5", 4, 8, 3.5, 3.9, 80),
|
||||
("Xeon E3-1270 v5", 4, 8, 3.6, 4.0, 80),
|
||||
("Xeon E3-1245 v5", 4, 8, 3.5, 3.9, 80),
|
||||
("Xeon E3-1280 v5", 4, 8, 3.7, 4.0, 80),
|
||||
)),
|
||||
(INTEL, "Xeon E3-1200 v6 (Kaby Lake)", "LGA1151", 2017, 1, (
|
||||
("Xeon E3-1220 v6", 4, 4, 3.0, 3.5, 72),
|
||||
("Xeon E3-1230 v6", 4, 8, 3.5, 3.9, 72),
|
||||
("Xeon E3-1240 v6", 4, 8, 3.7, 4.1, 72),
|
||||
("Xeon E3-1270 v6", 4, 8, 3.8, 4.2, 72),
|
||||
("Xeon E3-1280 v6", 4, 8, 3.9, 4.2, 72),
|
||||
("Xeon E3-1225 v6", 4, 4, 3.3, 3.7, 73),
|
||||
("Xeon E3-1245 v6", 4, 8, 3.7, 4.1, 73),
|
||||
("Xeon E3-1275 v6", 4, 8, 3.8, 4.2, 73),
|
||||
("Xeon E3-1285 v6", 4, 8, 4.1, 4.5, 79),
|
||||
)),
|
||||
(INTEL, "Xeon E-2100 (Coffee Lake)", "LGA1151", 2018, 1, (
|
||||
("Xeon E-2124", 4, 4, 3.3, 4.3, 71),
|
||||
("Xeon E-2134", 4, 8, 3.5, 4.5, 71),
|
||||
("Xeon E-2136", 6, 12, 3.3, 4.5, 80),
|
||||
("Xeon E-2144G", 4, 8, 3.6, 4.5, 71),
|
||||
("Xeon E-2146G", 6, 12, 3.5, 4.5, 80),
|
||||
("Xeon E-2176G", 6, 12, 3.7, 4.7, 80),
|
||||
("Xeon E-2186G", 6, 12, 3.8, 4.7, 95),
|
||||
("Xeon E-2124G", 4, 4, 3.4, 4.5, 71),
|
||||
("Xeon E-2126G", 6, 6, 3.3, 4.5, 80),
|
||||
("Xeon E-2174G", 4, 8, 3.8, 4.7, 71),
|
||||
)),
|
||||
(INTEL, "Xeon E-2200 (Coffee Lake Refresh)", "LGA1151", 2019, 1, (
|
||||
("Xeon E-2224", 4, 4, 3.4, 4.6, 71),
|
||||
("Xeon E-2234", 4, 8, 3.6, 4.8, 71),
|
||||
("Xeon E-2236", 6, 12, 3.4, 4.8, 80),
|
||||
("Xeon E-2244G", 4, 8, 3.8, 4.8, 71),
|
||||
("Xeon E-2246G", 6, 12, 3.6, 4.8, 80),
|
||||
("Xeon E-2274G", 4, 8, 4.0, 4.9, 83),
|
||||
("Xeon E-2276G", 6, 12, 3.8, 4.9, 80),
|
||||
("Xeon E-2278G", 8, 16, 3.4, 5.0, 80),
|
||||
("Xeon E-2288G", 8, 16, 3.7, 5.0, 95),
|
||||
("Xeon E-2224G", 4, 4, 3.5, 4.7, 71),
|
||||
("Xeon E-2226G", 6, 6, 3.4, 4.7, 80),
|
||||
("Xeon E-2286G", 6, 12, 4.0, 4.9, 95),
|
||||
)),
|
||||
(INTEL, "Xeon E-2300 (Rocket Lake)", "LGA1200", 2021, 1, (
|
||||
("Xeon E-2314", 4, 4, 2.8, 4.5, 65),
|
||||
("Xeon E-2324G", 4, 4, 3.1, 4.6, 65),
|
||||
("Xeon E-2334", 4, 8, 3.4, 4.8, 65),
|
||||
("Xeon E-2336", 6, 12, 2.9, 4.8, 65),
|
||||
("Xeon E-2356G", 6, 12, 3.2, 5.0, 80),
|
||||
("Xeon E-2378", 8, 16, 2.6, 4.8, 65),
|
||||
("Xeon E-2378G", 8, 16, 2.8, 5.1, 80),
|
||||
("Xeon E-2386G", 6, 12, 3.5, 5.1, 95),
|
||||
("Xeon E-2388G", 8, 16, 3.2, 5.1, 95),
|
||||
("Xeon E-2374G", 4, 8, 3.7, 5.0, 80),
|
||||
)),
|
||||
(INTEL, "Xeon E-2400 (Raptor Lake)", "LGA1700", 2023, 1, (
|
||||
("Xeon E-2414", 4, 4, 2.6, 4.5, 55),
|
||||
("Xeon E-2434", 4, 8, 3.4, 5.0, 55),
|
||||
("Xeon E-2436", 6, 12, 2.9, 4.8, 65),
|
||||
("Xeon E-2456", 6, 12, 3.3, 5.1, 80),
|
||||
("Xeon E-2468", 8, 16, 2.6, 5.2, 65),
|
||||
("Xeon E-2478", 8, 16, 2.8, 5.2, 80),
|
||||
("Xeon E-2488", 8, 16, 3.2, 5.6, 95),
|
||||
("Xeon E-2486", 6, 12, 3.5, 5.6, 95),
|
||||
)),
|
||||
#
|
||||
# Intel Xeon Scalable
|
||||
#
|
||||
(INTEL, "Xeon Scalable 1. Gen (Skylake-SP)", "LGA3647", 2017, 8, (
|
||||
("Xeon Bronze 3104", 6, 6, 1.7, None, 85),
|
||||
("Xeon Bronze 3106", 8, 8, 1.7, None, 85),
|
||||
("Xeon Silver 4108", 8, 16, 1.8, 3.0, 85),
|
||||
("Xeon Silver 4109T", 8, 16, 2.0, 3.0, 70),
|
||||
("Xeon Silver 4110", 8, 16, 2.1, 3.0, 85),
|
||||
("Xeon Silver 4112", 4, 8, 2.6, 3.0, 85),
|
||||
("Xeon Silver 4114", 10, 20, 2.2, 3.0, 85),
|
||||
("Xeon Silver 4116", 12, 24, 2.1, 3.0, 85),
|
||||
("Xeon Gold 5115", 10, 20, 2.4, 3.2, 85),
|
||||
("Xeon Gold 5118", 12, 24, 2.3, 3.2, 105),
|
||||
("Xeon Gold 5120", 14, 28, 2.2, 3.2, 105),
|
||||
("Xeon Gold 5122", 4, 8, 3.6, 3.7, 105),
|
||||
("Xeon Gold 6126", 12, 24, 2.6, 3.7, 125),
|
||||
("Xeon Gold 6128", 6, 12, 3.4, 3.7, 115),
|
||||
("Xeon Gold 6130", 16, 32, 2.1, 3.7, 125),
|
||||
("Xeon Gold 6132", 14, 28, 2.6, 3.7, 140),
|
||||
("Xeon Gold 6134", 8, 16, 3.2, 3.7, 130),
|
||||
("Xeon Gold 6136", 12, 24, 3.0, 3.7, 150),
|
||||
("Xeon Gold 6138", 20, 40, 2.0, 3.7, 125),
|
||||
("Xeon Gold 6140", 18, 36, 2.3, 3.7, 140),
|
||||
("Xeon Gold 6142", 16, 32, 2.6, 3.7, 150),
|
||||
("Xeon Gold 6144", 8, 16, 3.5, 4.2, 150),
|
||||
("Xeon Gold 6146", 12, 24, 3.2, 4.2, 165),
|
||||
("Xeon Gold 6148", 20, 40, 2.4, 3.7, 150),
|
||||
("Xeon Gold 6150", 18, 36, 2.7, 3.7, 165),
|
||||
("Xeon Gold 6152", 22, 44, 2.1, 3.7, 140),
|
||||
("Xeon Gold 6154", 18, 36, 3.0, 3.7, 200),
|
||||
("Xeon Platinum 8153", 16, 32, 2.0, 2.8, 125),
|
||||
("Xeon Platinum 8160", 24, 48, 2.1, 3.7, 150),
|
||||
("Xeon Platinum 8164", 26, 52, 2.0, 3.7, 150),
|
||||
("Xeon Platinum 8168", 24, 48, 2.7, 3.7, 205),
|
||||
("Xeon Platinum 8170", 26, 52, 2.1, 3.7, 165),
|
||||
("Xeon Platinum 8176", 28, 56, 2.1, 3.8, 165),
|
||||
("Xeon Platinum 8180", 28, 56, 2.5, 3.8, 205),
|
||||
("Xeon Silver 4114T", 10, 20, 2.2, 3.0, 85),
|
||||
("Xeon Silver 4116T", 12, 24, 2.1, 3.0, 85),
|
||||
("Xeon Gold 5117", 14, 28, 2.0, 2.8, 105),
|
||||
("Xeon Gold 5119T", 14, 28, 1.9, 3.2, 85),
|
||||
("Xeon Gold 5120T", 14, 28, 2.2, 3.2, 105),
|
||||
("Xeon Gold 6126T", 12, 24, 2.6, 3.7, 125),
|
||||
("Xeon Gold 6130T", 16, 32, 2.1, 3.7, 125),
|
||||
("Xeon Gold 6134M", 8, 16, 3.2, 3.7, 130),
|
||||
("Xeon Gold 6138T", 20, 40, 2.0, 3.7, 125),
|
||||
("Xeon Gold 6140M", 18, 36, 2.3, 3.7, 140),
|
||||
("Xeon Gold 6142M", 16, 32, 2.6, 3.7, 150),
|
||||
("Xeon Platinum 8156", 4, 8, 3.6, 3.7, 105),
|
||||
("Xeon Platinum 8158", 12, 24, 3.0, 3.7, 150),
|
||||
("Xeon Platinum 8160M", 24, 48, 2.1, 3.7, 150),
|
||||
("Xeon Platinum 8160T", 24, 48, 2.1, 3.7, 150),
|
||||
("Xeon Platinum 8170M", 26, 52, 2.1, 3.7, 165),
|
||||
("Xeon Platinum 8176M", 28, 56, 2.1, 3.8, 165),
|
||||
("Xeon Platinum 8180M", 28, 56, 2.5, 3.8, 205),
|
||||
)),
|
||||
(INTEL, "Xeon Scalable 2. Gen (Cascade Lake)", "LGA3647", 2019, 8, (
|
||||
("Xeon Bronze 3204", 6, 6, 1.9, None, 85),
|
||||
("Xeon Silver 4208", 8, 16, 2.1, 3.2, 85),
|
||||
("Xeon Silver 4210", 10, 20, 2.2, 3.2, 85),
|
||||
("Xeon Silver 4214", 12, 24, 2.2, 3.2, 85),
|
||||
("Xeon Silver 4215", 8, 16, 2.5, 3.5, 85),
|
||||
("Xeon Silver 4216", 16, 32, 2.1, 3.2, 100),
|
||||
("Xeon Gold 5215", 10, 20, 2.5, 3.4, 85),
|
||||
("Xeon Gold 5217", 8, 16, 3.0, 3.7, 115),
|
||||
("Xeon Gold 5218", 16, 32, 2.3, 3.9, 125),
|
||||
("Xeon Gold 5220", 18, 36, 2.2, 3.9, 125),
|
||||
("Xeon Gold 5222", 4, 8, 3.8, 3.9, 105),
|
||||
("Xeon Gold 6226", 12, 24, 2.7, 3.7, 125),
|
||||
("Xeon Gold 6230", 20, 40, 2.1, 3.9, 125),
|
||||
("Xeon Gold 6234", 8, 16, 3.3, 4.0, 130),
|
||||
("Xeon Gold 6238", 22, 44, 2.1, 3.7, 140),
|
||||
("Xeon Gold 6240", 18, 36, 2.6, 3.9, 150),
|
||||
("Xeon Gold 6242", 16, 32, 2.8, 3.9, 150),
|
||||
("Xeon Gold 6244", 8, 16, 3.6, 4.4, 150),
|
||||
("Xeon Gold 6246", 12, 24, 3.3, 4.2, 165),
|
||||
("Xeon Gold 6248", 20, 40, 2.5, 3.9, 150),
|
||||
("Xeon Gold 6252", 24, 48, 2.1, 3.7, 150),
|
||||
("Xeon Gold 6254", 18, 36, 3.1, 4.0, 200),
|
||||
("Xeon Platinum 8253", 16, 32, 2.2, 3.0, 125),
|
||||
("Xeon Platinum 8260", 24, 48, 2.4, 3.9, 165),
|
||||
("Xeon Platinum 8268", 24, 48, 2.9, 3.9, 205),
|
||||
("Xeon Platinum 8270", 26, 52, 2.7, 4.0, 205),
|
||||
("Xeon Platinum 8276", 28, 56, 2.2, 4.0, 165),
|
||||
("Xeon Platinum 8280", 28, 56, 2.7, 4.0, 205),
|
||||
("Xeon Gold 6208U", 16, 32, 2.9, 3.9, 150),
|
||||
("Xeon Gold 6209U", 20, 40, 2.1, 3.9, 125),
|
||||
("Xeon Gold 6210U", 20, 40, 2.5, 3.9, 150),
|
||||
("Xeon Gold 6212U", 24, 48, 2.4, 3.9, 165),
|
||||
("Xeon Silver 4209T", 8, 16, 2.2, 3.2, 70),
|
||||
("Xeon Silver 4210T", 10, 20, 2.3, 3.2, 95),
|
||||
("Xeon Silver 4214Y", 12, 24, 2.2, 3.2, 85),
|
||||
("Xeon Gold 5215L", 10, 20, 2.5, 3.4, 85),
|
||||
("Xeon Gold 5215M", 10, 20, 2.5, 3.4, 85),
|
||||
("Xeon Gold 5218B", 16, 32, 2.3, 3.9, 125),
|
||||
("Xeon Gold 5218N", 16, 32, 2.3, 3.7, 125),
|
||||
("Xeon Gold 5218T", 16, 32, 2.1, 3.8, 105),
|
||||
("Xeon Gold 5220S", 18, 36, 2.7, 3.9, 125),
|
||||
("Xeon Gold 5220T", 18, 36, 1.9, 3.9, 105),
|
||||
("Xeon Gold 6222V", 20, 40, 1.8, 3.6, 115),
|
||||
("Xeon Gold 6230N", 20, 40, 2.3, 3.5, 125),
|
||||
("Xeon Gold 6230T", 20, 40, 2.1, 3.9, 125),
|
||||
("Xeon Gold 6238L", 22, 44, 2.1, 3.7, 140),
|
||||
("Xeon Gold 6238M", 22, 44, 2.1, 3.7, 140),
|
||||
("Xeon Gold 6238T", 22, 44, 1.9, 3.7, 125),
|
||||
("Xeon Gold 6240L", 18, 36, 2.6, 3.9, 150),
|
||||
("Xeon Gold 6240M", 18, 36, 2.6, 3.9, 150),
|
||||
("Xeon Gold 6240Y", 18, 36, 2.6, 3.9, 150),
|
||||
("Xeon Gold 6250", 8, 16, 3.9, 4.5, 185),
|
||||
("Xeon Gold 6250L", 8, 16, 3.9, 4.5, 185),
|
||||
("Xeon Gold 6252N", 24, 48, 2.3, 3.6, 150),
|
||||
("Xeon Gold 6256", 12, 24, 3.6, 4.5, 205),
|
||||
("Xeon Gold 6262V", 24, 48, 1.9, 3.6, 135),
|
||||
("Xeon Platinum 8256", 4, 8, 3.8, 3.9, 105),
|
||||
("Xeon Platinum 8260L", 24, 48, 2.4, 3.9, 165),
|
||||
("Xeon Platinum 8260M", 24, 48, 2.4, 3.9, 165),
|
||||
("Xeon Platinum 8260Y", 24, 48, 2.4, 3.9, 165),
|
||||
("Xeon Platinum 8276L", 28, 56, 2.2, 4.0, 165),
|
||||
("Xeon Platinum 8276M", 28, 56, 2.2, 4.0, 165),
|
||||
("Xeon Platinum 8280L", 28, 56, 2.7, 4.0, 205),
|
||||
("Xeon Platinum 8280M", 28, 56, 2.7, 4.0, 205),
|
||||
)),
|
||||
(INTEL, "Xeon Scalable 2. Gen Refresh (Cascade Lake R)", "LGA3647", 2020, 2, (
|
||||
("Xeon Bronze 3206R", 8, 8, 1.9, None, 85),
|
||||
("Xeon Silver 4210R", 10, 20, 2.4, 3.2, 100),
|
||||
("Xeon Silver 4214R", 12, 24, 2.4, 3.5, 100),
|
||||
("Xeon Silver 4215R", 8, 16, 3.2, 4.0, 130),
|
||||
("Xeon Gold 5218R", 20, 40, 2.1, 4.0, 125),
|
||||
("Xeon Gold 5220R", 24, 48, 2.2, 4.0, 150),
|
||||
("Xeon Gold 6226R", 16, 32, 2.9, 3.9, 150),
|
||||
("Xeon Gold 6230R", 26, 52, 2.1, 4.0, 150),
|
||||
("Xeon Gold 6238R", 28, 56, 2.2, 4.0, 165),
|
||||
("Xeon Gold 6240R", 24, 48, 2.4, 4.0, 165),
|
||||
("Xeon Gold 6242R", 20, 40, 3.1, 4.1, 205),
|
||||
("Xeon Gold 6246R", 16, 32, 3.4, 4.1, 205),
|
||||
("Xeon Gold 6248R", 24, 48, 3.0, 4.0, 205),
|
||||
("Xeon Gold 6258R", 28, 56, 2.7, 4.0, 205),
|
||||
("Xeon Silver 4216R", 16, 32, 2.2, 3.7, 125),
|
||||
)),
|
||||
(INTEL, "Xeon Scalable 3. Gen (Ice Lake-SP)", "LGA4189", 2021, 2, (
|
||||
("Xeon Silver 4309Y", 8, 16, 2.8, 3.6, 105),
|
||||
("Xeon Silver 4310", 12, 24, 2.1, 3.3, 120),
|
||||
("Xeon Silver 4314", 16, 32, 2.4, 3.4, 135),
|
||||
("Xeon Silver 4316", 20, 40, 2.3, 3.4, 150),
|
||||
("Xeon Gold 5315Y", 8, 16, 3.2, 3.6, 140),
|
||||
("Xeon Gold 5317", 12, 24, 3.0, 3.6, 150),
|
||||
("Xeon Gold 5318Y", 24, 48, 2.1, 3.4, 165),
|
||||
("Xeon Gold 5320", 26, 52, 2.2, 3.4, 185),
|
||||
("Xeon Gold 6326", 16, 32, 2.9, 3.5, 185),
|
||||
("Xeon Gold 6330", 28, 56, 2.0, 3.1, 205),
|
||||
("Xeon Gold 6334", 8, 16, 3.6, 3.7, 165),
|
||||
("Xeon Gold 6336Y", 24, 48, 2.4, 3.6, 185),
|
||||
("Xeon Gold 6338", 32, 64, 2.0, 3.2, 205),
|
||||
("Xeon Gold 6342", 24, 48, 2.8, 3.5, 230),
|
||||
("Xeon Gold 6346", 16, 32, 3.1, 3.6, 205),
|
||||
("Xeon Gold 6348", 28, 56, 2.6, 3.5, 235),
|
||||
("Xeon Gold 6354", 18, 36, 3.0, 3.6, 205),
|
||||
("Xeon Platinum 8352Y", 32, 64, 2.2, 3.4, 205),
|
||||
("Xeon Platinum 8358", 32, 64, 2.6, 3.4, 250),
|
||||
("Xeon Platinum 8360Y", 36, 72, 2.4, 3.5, 250),
|
||||
("Xeon Platinum 8362", 32, 64, 2.8, 3.6, 265),
|
||||
("Xeon Platinum 8368", 38, 76, 2.4, 3.4, 270),
|
||||
("Xeon Platinum 8380", 40, 80, 2.3, 3.4, 270),
|
||||
("Xeon Gold 6312U", 24, 48, 2.4, 3.6, 185),
|
||||
("Xeon Gold 6314U", 32, 64, 2.3, 3.4, 205),
|
||||
("Xeon Silver 4310T", 10, 20, 2.3, 3.4, 105),
|
||||
("Xeon Gold 5318N", 24, 48, 2.1, 3.4, 150),
|
||||
("Xeon Gold 5318S", 24, 48, 2.1, 3.4, 165),
|
||||
("Xeon Gold 5320T", 20, 40, 2.3, 3.5, 150),
|
||||
("Xeon Gold 6330N", 28, 56, 2.2, 3.4, 165),
|
||||
("Xeon Gold 6338N", 32, 64, 2.2, 3.5, 185),
|
||||
("Xeon Gold 6338T", 24, 48, 2.1, 3.4, 165),
|
||||
("Xeon Platinum 8351N", 36, 72, 2.4, 3.5, 225),
|
||||
("Xeon Platinum 8352M", 32, 64, 2.3, 3.5, 185),
|
||||
("Xeon Platinum 8352S", 32, 64, 2.2, 3.4, 205),
|
||||
("Xeon Platinum 8352V", 36, 72, 2.1, 3.5, 195),
|
||||
("Xeon Platinum 8358P", 32, 64, 2.6, 3.4, 240),
|
||||
("Xeon Platinum 8368Q", 38, 76, 2.6, 3.7, 270),
|
||||
)),
|
||||
(INTEL, "Xeon Scalable 4. Gen (Sapphire Rapids)", "LGA4677", 2023, 8, (
|
||||
("Xeon Bronze 3408U", 8, 8, 1.8, 1.9, 125),
|
||||
("Xeon Silver 4410Y", 12, 24, 2.0, 3.9, 150),
|
||||
("Xeon Silver 4416+", 20, 40, 2.0, 3.9, 165),
|
||||
("Xeon Gold 5415+", 8, 16, 2.9, 4.1, 150),
|
||||
("Xeon Gold 5416S", 16, 32, 2.0, 4.0, 150),
|
||||
("Xeon Gold 5418Y", 24, 48, 2.0, 3.8, 185),
|
||||
("Xeon Gold 5420+", 28, 56, 2.0, 4.1, 205),
|
||||
("Xeon Gold 6416H", 18, 36, 2.2, 4.2, 165),
|
||||
("Xeon Gold 6426Y", 16, 32, 2.5, 4.1, 185),
|
||||
("Xeon Gold 6430", 32, 64, 2.1, 3.4, 270),
|
||||
("Xeon Gold 6434", 8, 16, 3.7, 4.1, 195),
|
||||
("Xeon Gold 6438Y+", 32, 64, 2.0, 4.0, 205),
|
||||
("Xeon Gold 6442Y", 24, 48, 2.6, 4.0, 225),
|
||||
("Xeon Gold 6444Y", 16, 32, 3.6, 4.0, 270),
|
||||
("Xeon Gold 6448Y", 32, 64, 2.1, 4.1, 225),
|
||||
("Xeon Gold 6454S", 32, 64, 2.2, 3.4, 270),
|
||||
("Xeon Gold 6458Q", 32, 64, 3.1, 4.0, 350),
|
||||
("Xeon Platinum 8452Y", 36, 72, 2.0, 3.2, 300),
|
||||
("Xeon Platinum 8460Y+", 40, 80, 2.0, 3.7, 300),
|
||||
("Xeon Platinum 8462Y+", 32, 64, 2.8, 4.1, 300),
|
||||
("Xeon Platinum 8468", 48, 96, 2.1, 3.8, 350),
|
||||
("Xeon Platinum 8470", 52, 104, 2.0, 3.8, 350),
|
||||
("Xeon Platinum 8480+", 56, 112, 2.0, 3.8, 350),
|
||||
("Xeon Platinum 8490H", 60, 120, 1.9, 3.5, 350),
|
||||
("Xeon Silver 4410T", 10, 20, 2.7, 4.0, 150),
|
||||
("Xeon Gold 5411N", 24, 48, 1.9, 3.9, 165),
|
||||
("Xeon Gold 5412U", 24, 48, 2.1, 3.9, 185),
|
||||
("Xeon Gold 5418N", 24, 48, 1.8, 3.8, 165),
|
||||
("Xeon Gold 6414U", 32, 64, 2.0, 3.4, 250),
|
||||
("Xeon Gold 6418H", 24, 48, 2.1, 4.0, 185),
|
||||
("Xeon Gold 6421N", 32, 64, 1.8, 3.6, 185),
|
||||
("Xeon Gold 6428N", 32, 64, 1.8, 3.8, 185),
|
||||
("Xeon Gold 6434H", 8, 16, 3.7, 4.1, 195),
|
||||
("Xeon Gold 6438M", 32, 64, 2.2, 3.9, 205),
|
||||
("Xeon Gold 6438N", 32, 64, 2.0, 3.6, 205),
|
||||
("Xeon Gold 6448H", 32, 64, 2.4, 4.1, 250),
|
||||
("Xeon Platinum 8444H", 16, 32, 2.9, 4.0, 270),
|
||||
("Xeon Platinum 8450H", 28, 56, 2.0, 3.5, 250),
|
||||
("Xeon Platinum 8454H", 32, 64, 2.1, 3.4, 270),
|
||||
("Xeon Platinum 8458P", 44, 88, 2.7, 3.8, 350),
|
||||
("Xeon Platinum 8460H", 40, 80, 2.2, 3.8, 330),
|
||||
("Xeon Platinum 8461V", 48, 96, 2.2, 3.7, 300),
|
||||
("Xeon Platinum 8468H", 48, 96, 2.1, 3.8, 330),
|
||||
("Xeon Platinum 8468V", 48, 96, 2.4, 3.8, 330),
|
||||
("Xeon Platinum 8470N", 52, 104, 1.7, 3.6, 300),
|
||||
("Xeon Platinum 8470Q", 52, 104, 2.1, 3.8, 350),
|
||||
("Xeon Platinum 8471N", 52, 104, 1.8, 3.6, 300),
|
||||
)),
|
||||
(INTEL, "Xeon Scalable 5. Gen (Emerald Rapids)", "LGA4677", 2023, 2, (
|
||||
("Xeon Bronze 3508U", 8, 8, 2.1, 2.2, 125),
|
||||
("Xeon Silver 4509Y", 8, 16, 2.6, 4.1, 125),
|
||||
("Xeon Silver 4510", 12, 24, 2.4, 4.1, 150),
|
||||
("Xeon Silver 4514Y", 16, 32, 2.0, 3.4, 150),
|
||||
("Xeon Silver 4516Y+", 24, 48, 2.2, 3.7, 185),
|
||||
("Xeon Gold 5512U", 28, 56, 2.1, 3.7, 185),
|
||||
("Xeon Gold 5515+", 8, 16, 3.2, 4.1, 165),
|
||||
("Xeon Gold 5520+", 28, 56, 2.2, 4.0, 205),
|
||||
("Xeon Gold 6526Y", 16, 32, 2.8, 3.9, 195),
|
||||
("Xeon Gold 6534", 8, 16, 3.9, 4.2, 195),
|
||||
("Xeon Gold 6538Y+", 32, 64, 2.2, 4.0, 225),
|
||||
("Xeon Gold 6542Y", 24, 48, 2.9, 4.1, 250),
|
||||
("Xeon Gold 6544Y", 16, 32, 3.6, 4.1, 270),
|
||||
("Xeon Gold 6548Y+", 32, 64, 2.5, 4.1, 250),
|
||||
("Xeon Gold 6554S", 36, 72, 2.2, 4.0, 270),
|
||||
("Xeon Gold 6558Q", 32, 64, 3.2, 4.1, 350),
|
||||
("Xeon Platinum 8558", 48, 96, 2.1, 4.0, 330),
|
||||
("Xeon Platinum 8562Y+", 32, 64, 2.8, 4.1, 300),
|
||||
("Xeon Platinum 8568Y+", 48, 96, 2.3, 4.0, 350),
|
||||
("Xeon Platinum 8580", 60, 120, 2.0, 4.0, 350),
|
||||
("Xeon Platinum 8592+", 64, 128, 1.9, 3.9, 350),
|
||||
("Xeon Silver 4510T", 12, 24, 2.0, 3.7, 115),
|
||||
("Xeon Gold 6530", 32, 64, 2.1, 4.0, 270),
|
||||
("Xeon Gold 6538N", 32, 64, 2.1, 4.1, 205),
|
||||
("Xeon Gold 6548N", 32, 64, 2.8, 4.1, 250),
|
||||
("Xeon Platinum 8558P", 48, 96, 2.7, 4.0, 350),
|
||||
("Xeon Platinum 8558U", 48, 96, 2.0, 4.0, 300),
|
||||
("Xeon Platinum 8570", 56, 112, 2.1, 4.0, 350),
|
||||
("Xeon Platinum 8571N", 52, 104, 2.4, 4.0, 300),
|
||||
("Xeon Platinum 8581V", 60, 120, 2.0, 3.9, 270),
|
||||
("Xeon Platinum 8592V", 64, 128, 2.0, 3.9, 330),
|
||||
("Xeon Platinum 8593Q", 64, 128, 2.2, 3.9, 385),
|
||||
)),
|
||||
(INTEL, "Xeon 6 E-Core (Sierra Forest)", "LGA4710", 2024, 2, (
|
||||
("Xeon 6710E", 64, 64, 2.4, 3.2, 205),
|
||||
("Xeon 6731E", 96, 96, 2.2, 3.1, 250),
|
||||
("Xeon 6740E", 96, 96, 2.4, 3.2, 250),
|
||||
("Xeon 6746E", 112, 112, 2.0, 2.7, 250),
|
||||
("Xeon 6756E", 128, 128, 1.8, 2.6, 225),
|
||||
("Xeon 6766E", 144, 144, 1.9, 2.7, 250),
|
||||
("Xeon 6780E", 144, 144, 2.2, 3.0, 330),
|
||||
)),
|
||||
(INTEL, "Xeon 6900P (Granite Rapids-AP)", "LGA7529", 2024, 2, (
|
||||
("Xeon 6960P", 72, 144, 2.7, 3.9, 500),
|
||||
("Xeon 6972P", 96, 192, 2.4, 3.9, 500),
|
||||
("Xeon 6979P", 120, 240, 2.1, 3.9, 500),
|
||||
("Xeon 6980P", 128, 256, 2.0, 3.9, 500),
|
||||
("Xeon 6944P", 72, 144, 1.8, 3.9, 350),
|
||||
("Xeon 6952P", 96, 192, 2.1, 3.9, 400),
|
||||
("Xeon 6962P", 72, 144, 2.7, 3.9, 500),
|
||||
)),
|
||||
(INTEL, "Xeon 6700P/6500P (Granite Rapids-SP)", "LGA4710", 2025, 8, (
|
||||
("Xeon 6505P", 12, 24, 2.2, 4.1, 150),
|
||||
("Xeon 6507P", 8, 16, 3.5, 4.3, 150),
|
||||
("Xeon 6511P", 16, 32, 2.5, 4.3, 150),
|
||||
("Xeon 6515P", 16, 32, 2.4, 3.8, 150),
|
||||
("Xeon 6517P", 16, 32, 3.2, 4.2, 190),
|
||||
("Xeon 6520P", 24, 48, 2.4, 4.0, 210),
|
||||
("Xeon 6521P", 24, 48, 2.6, 4.1, 225),
|
||||
("Xeon 6527P", 24, 48, 3.0, 4.2, 255),
|
||||
("Xeon 6530P", 32, 64, 2.3, 4.1, 225),
|
||||
("Xeon 6714P", 8, 16, 4.0, 4.3, 165),
|
||||
("Xeon 6724P", 16, 32, 3.6, 4.3, 210),
|
||||
("Xeon 6730P", 32, 64, 2.5, 3.8, 250),
|
||||
("Xeon 6736P", 36, 72, 2.0, 4.1, 205),
|
||||
("Xeon 6737P", 32, 64, 2.9, 4.0, 270),
|
||||
("Xeon 6740P", 48, 96, 2.1, 3.8, 270),
|
||||
("Xeon 6745P", 32, 64, 3.1, 4.3, 300),
|
||||
("Xeon 6747P", 48, 96, 2.7, 3.9, 330),
|
||||
("Xeon 6748P", 48, 96, 2.5, 4.1, 300),
|
||||
("Xeon 6760P", 64, 128, 2.2, 3.8, 330),
|
||||
("Xeon 6761P", 64, 128, 2.5, 3.9, 350),
|
||||
("Xeon 6767P", 64, 128, 2.4, 3.9, 350),
|
||||
("Xeon 6768P", 64, 128, 2.4, 3.9, 330),
|
||||
("Xeon 6776P", 64, 128, 2.3, 3.6, 350),
|
||||
("Xeon 6787P", 86, 172, 2.0, 3.8, 350),
|
||||
("Xeon 6728P", 24, 48, 2.7, 4.1, 210),
|
||||
("Xeon 6731P", 32, 64, 2.5, 4.1, 245),
|
||||
("Xeon 6732P", 32, 64, 3.8, 4.3, 350),
|
||||
("Xeon 6738P", 32, 64, 2.9, 4.2, 270),
|
||||
("Xeon 6741P", 48, 96, 2.5, 3.8, 300),
|
||||
("Xeon 6774P", 64, 128, 2.5, 3.9, 350),
|
||||
("Xeon 6781P", 80, 160, 2.0, 3.8, 350),
|
||||
("Xeon 6788P", 86, 172, 2.0, 3.8, 350),
|
||||
)),
|
||||
(INTEL, "Xeon 6300P (Raptor Lake-E)", "LGA1700", 2025, 1, (
|
||||
("Xeon 6315P", 4, 4, 2.8, 4.7, 55),
|
||||
("Xeon 6325P", 4, 8, 3.5, 5.2, 55),
|
||||
("Xeon 6333P", 6, 12, 3.1, 5.2, 65),
|
||||
("Xeon 6337P", 6, 12, 3.5, 5.3, 80),
|
||||
("Xeon 6349P", 6, 12, 3.6, 5.7, 95),
|
||||
("Xeon 6353P", 8, 16, 2.7, 5.4, 65),
|
||||
("Xeon 6357P", 8, 16, 3.0, 5.4, 80),
|
||||
("Xeon 6369P", 8, 16, 3.3, 5.7, 95),
|
||||
)),
|
||||
(INTEL, "Xeon 6+ (Clearwater Forest)", "LGA7529", 2026, 2, (
|
||||
("Xeon 6960E+", 144, 144, 2.4, 3.2, 330),
|
||||
("Xeon 6970E+", 192, 192, 2.3, 3.2, 400),
|
||||
("Xeon 6980E+", 264, 264, 2.1, 3.2, 400),
|
||||
("Xeon 6990E+", 288, 288, 2.2, 3.2, 450),
|
||||
)),
|
||||
#
|
||||
# AMD Opteron
|
||||
#
|
||||
(AMD, "Opteron 6300 (Abu Dhabi)", "G34", 2012, 4, (
|
||||
("Opteron 6308", 4, 4, 3.5, None, 115),
|
||||
("Opteron 6320", 8, 8, 2.8, 3.3, 115),
|
||||
("Opteron 6328", 8, 8, 3.2, 3.8, 115),
|
||||
("Opteron 6344", 12, 12, 2.6, 3.2, 115),
|
||||
("Opteron 6348", 12, 12, 2.8, 3.4, 115),
|
||||
("Opteron 6366 HE", 16, 16, 1.8, 3.1, 85),
|
||||
("Opteron 6376", 16, 16, 2.3, 3.2, 115),
|
||||
("Opteron 6378", 16, 16, 2.4, 3.3, 115),
|
||||
("Opteron 6380", 16, 16, 2.5, 3.4, 115),
|
||||
("Opteron 6386 SE", 16, 16, 2.8, 3.5, 140),
|
||||
("Opteron 6338P", 12, 12, 2.3, 2.8, 99),
|
||||
("Opteron 6370P", 16, 16, 2.0, 2.5, 99),
|
||||
)),
|
||||
(AMD, "Opteron 4300 (Seoul)", "C32", 2012, 2, (
|
||||
("Opteron 4310 EE", 4, 4, 2.2, 3.0, 35),
|
||||
("Opteron 4332 HE", 6, 6, 3.0, 3.7, 65),
|
||||
("Opteron 4334", 6, 6, 3.1, 3.5, 95),
|
||||
("Opteron 4340", 6, 6, 3.5, 3.8, 95),
|
||||
("Opteron 4376 HE", 8, 8, 2.6, 3.6, 65),
|
||||
("Opteron 4386", 8, 8, 3.1, 3.8, 95),
|
||||
("Opteron 4365 EE", 8, 8, 2.0, 2.8, 40),
|
||||
)),
|
||||
#
|
||||
# AMD EPYC
|
||||
#
|
||||
(AMD, "EPYC 7001 (Naples)", "SP3", 2017, 2, (
|
||||
("EPYC 7251", 8, 16, 2.1, 2.9, 120),
|
||||
("EPYC 7261", 8, 16, 2.5, 2.9, 170),
|
||||
("EPYC 7281", 16, 32, 2.1, 2.7, 170),
|
||||
("EPYC 7301", 16, 32, 2.2, 2.7, 170),
|
||||
("EPYC 7351", 16, 32, 2.4, 2.9, 170),
|
||||
("EPYC 7351P", 16, 32, 2.4, 2.9, 170),
|
||||
("EPYC 7371", 16, 32, 3.1, 3.8, 200),
|
||||
("EPYC 7401", 24, 48, 2.0, 3.0, 170),
|
||||
("EPYC 7401P", 24, 48, 2.0, 3.0, 170),
|
||||
("EPYC 7451", 24, 48, 2.3, 3.2, 180),
|
||||
("EPYC 7501", 32, 64, 2.0, 3.0, 170),
|
||||
("EPYC 7551", 32, 64, 2.0, 3.0, 180),
|
||||
("EPYC 7551P", 32, 64, 2.0, 3.0, 180),
|
||||
("EPYC 7601", 32, 64, 2.2, 3.2, 180),
|
||||
)),
|
||||
(AMD, "EPYC 7002 (Rome)", "SP3", 2019, 2, (
|
||||
("EPYC 7232P", 8, 16, 3.1, 3.2, 120),
|
||||
("EPYC 7252", 8, 16, 3.1, 3.2, 120),
|
||||
("EPYC 7262", 8, 16, 3.2, 3.4, 155),
|
||||
("EPYC 7272", 12, 24, 2.9, 3.2, 120),
|
||||
("EPYC 7282", 16, 32, 2.8, 3.2, 120),
|
||||
("EPYC 7302", 16, 32, 3.0, 3.3, 155),
|
||||
("EPYC 7302P", 16, 32, 3.0, 3.3, 155),
|
||||
("EPYC 7352", 24, 48, 2.3, 3.2, 155),
|
||||
("EPYC 7402", 24, 48, 2.8, 3.35, 180),
|
||||
("EPYC 7402P", 24, 48, 2.8, 3.35, 180),
|
||||
("EPYC 7452", 32, 64, 2.35, 3.35, 155),
|
||||
("EPYC 7502", 32, 64, 2.5, 3.35, 180),
|
||||
("EPYC 7502P", 32, 64, 2.5, 3.35, 180),
|
||||
("EPYC 7542", 32, 64, 2.9, 3.4, 225),
|
||||
("EPYC 7552", 48, 96, 2.2, 3.3, 200),
|
||||
("EPYC 7642", 48, 96, 2.3, 3.3, 225),
|
||||
("EPYC 7662", 64, 128, 2.0, 3.3, 225),
|
||||
("EPYC 7702", 64, 128, 2.0, 3.35, 200),
|
||||
("EPYC 7702P", 64, 128, 2.0, 3.35, 200),
|
||||
("EPYC 7742", 64, 128, 2.25, 3.4, 225),
|
||||
("EPYC 7H12", 64, 128, 2.6, 3.3, 280),
|
||||
("EPYC 7532", 32, 64, 2.4, 3.3, 200),
|
||||
)),
|
||||
(AMD, "EPYC 7002 F (Rome, High Frequency)", "SP3", 2020, 2, (
|
||||
("EPYC 7F32", 8, 16, 3.7, 3.9, 180),
|
||||
("EPYC 7F52", 16, 32, 3.5, 3.9, 240),
|
||||
("EPYC 7F72", 24, 48, 3.2, 3.7, 240),
|
||||
)),
|
||||
(AMD, "EPYC 7003 (Milan)", "SP3", 2021, 2, (
|
||||
("EPYC 72F3", 8, 16, 3.7, 4.1, 180),
|
||||
("EPYC 7313", 16, 32, 3.0, 3.7, 155),
|
||||
("EPYC 7313P", 16, 32, 3.0, 3.7, 155),
|
||||
("EPYC 7343", 16, 32, 3.2, 3.9, 190),
|
||||
("EPYC 73F3", 16, 32, 3.5, 4.0, 240),
|
||||
("EPYC 7413", 24, 48, 2.65, 3.6, 180),
|
||||
("EPYC 7443", 24, 48, 2.85, 4.0, 200),
|
||||
("EPYC 7443P", 24, 48, 2.85, 4.0, 200),
|
||||
("EPYC 74F3", 24, 48, 3.2, 4.0, 240),
|
||||
("EPYC 7453", 28, 56, 2.75, 3.45, 225),
|
||||
("EPYC 7513", 32, 64, 2.6, 3.65, 200),
|
||||
("EPYC 7543", 32, 64, 2.8, 3.7, 225),
|
||||
("EPYC 7543P", 32, 64, 2.8, 3.7, 225),
|
||||
("EPYC 75F3", 32, 64, 2.95, 4.0, 280),
|
||||
("EPYC 7643", 48, 96, 2.3, 3.6, 225),
|
||||
("EPYC 7663", 56, 112, 2.0, 3.5, 240),
|
||||
("EPYC 7713", 64, 128, 2.0, 3.675, 225),
|
||||
("EPYC 7713P", 64, 128, 2.0, 3.675, 225),
|
||||
("EPYC 7763", 64, 128, 2.45, 3.5, 280),
|
||||
("EPYC 7643P", 48, 96, 2.3, 3.6, 225),
|
||||
("EPYC 7663P", 56, 112, 2.0, 3.5, 240),
|
||||
)),
|
||||
(AMD, "EPYC 7003X (Milan-X)", "SP3", 2022, 2, (
|
||||
("EPYC 7373X", 16, 32, 3.05, 3.8, 240),
|
||||
("EPYC 7473X", 24, 48, 2.8, 3.7, 240),
|
||||
("EPYC 7573X", 32, 64, 2.8, 3.6, 280),
|
||||
("EPYC 7773X", 64, 128, 2.2, 3.5, 280),
|
||||
)),
|
||||
(AMD, "EPYC 7003 (Milan, 2023)", "SP3", 2023, 2, (
|
||||
("EPYC 7203", 8, 16, 2.8, 3.4, 120),
|
||||
("EPYC 7303", 16, 32, 2.4, 3.4, 130),
|
||||
("EPYC 7203P", 8, 16, 2.8, 3.4, 120),
|
||||
("EPYC 7303P", 16, 32, 2.4, 3.4, 130),
|
||||
)),
|
||||
(AMD, "EPYC 9004 (Genoa)", "SP5", 2022, 2, (
|
||||
("EPYC 9124", 16, 32, 3.0, 3.7, 200),
|
||||
("EPYC 9174F", 16, 32, 4.1, 4.4, 320),
|
||||
("EPYC 9224", 24, 48, 2.5, 3.7, 200),
|
||||
("EPYC 9254", 24, 48, 2.9, 4.15, 200),
|
||||
("EPYC 9274F", 24, 48, 4.05, 4.3, 320),
|
||||
("EPYC 9334", 32, 64, 2.7, 3.9, 210),
|
||||
("EPYC 9354", 32, 64, 3.25, 3.75, 280),
|
||||
("EPYC 9354P", 32, 64, 3.25, 3.75, 280),
|
||||
("EPYC 9374F", 32, 64, 3.85, 4.3, 320),
|
||||
("EPYC 9454", 48, 96, 2.75, 3.8, 290),
|
||||
("EPYC 9454P", 48, 96, 2.75, 3.8, 290),
|
||||
("EPYC 9474F", 48, 96, 3.6, 4.1, 360),
|
||||
("EPYC 9534", 64, 128, 2.45, 3.7, 280),
|
||||
("EPYC 9554", 64, 128, 3.1, 3.75, 360),
|
||||
("EPYC 9554P", 64, 128, 3.1, 3.75, 360),
|
||||
("EPYC 9634", 84, 168, 2.25, 3.7, 290),
|
||||
("EPYC 9654", 96, 192, 2.4, 3.7, 360),
|
||||
("EPYC 9654P", 96, 192, 2.4, 3.7, 360),
|
||||
)),
|
||||
(AMD, "EPYC 9004X (Genoa-X)", "SP5", 2023, 2, (
|
||||
("EPYC 9184X", 16, 32, 3.55, 4.2, 320),
|
||||
("EPYC 9384X", 32, 64, 3.1, 3.9, 320),
|
||||
("EPYC 9684X", 96, 192, 2.55, 3.7, 400),
|
||||
)),
|
||||
(AMD, "EPYC 97x4 (Bergamo)", "SP5", 2023, 2, (
|
||||
("EPYC 9734", 112, 224, 2.2, 3.0, 340),
|
||||
("EPYC 9754", 128, 256, 2.25, 3.1, 360),
|
||||
("EPYC 9754S", 128, 128, 2.25, 3.1, 360),
|
||||
)),
|
||||
(AMD, "EPYC 8004 (Siena)", "SP6", 2023, 1, (
|
||||
("EPYC 8024P", 8, 16, 2.4, 3.0, 90),
|
||||
("EPYC 8124P", 16, 32, 2.45, 3.0, 125),
|
||||
("EPYC 8224P", 24, 48, 2.55, 3.0, 160),
|
||||
("EPYC 8324P", 32, 64, 2.65, 3.0, 180),
|
||||
("EPYC 8434P", 48, 96, 2.5, 3.1, 200),
|
||||
("EPYC 8534P", 64, 128, 2.3, 3.1, 200),
|
||||
("EPYC 8024PN", 8, 16, 2.05, None, 80),
|
||||
("EPYC 8124PN", 16, 32, 2.0, None, 100),
|
||||
("EPYC 8224PN", 24, 48, 2.0, None, 120),
|
||||
("EPYC 8324PN", 32, 64, 2.05, None, 130),
|
||||
("EPYC 8434PN", 48, 96, 2.0, 3.0, 155),
|
||||
("EPYC 8534PN", 64, 128, 2.0, None, 175),
|
||||
)),
|
||||
(AMD, "EPYC 4004 (Raphael)", "AM5", 2024, 1, (
|
||||
("EPYC 4124P", 4, 8, 3.8, 5.1, 65),
|
||||
("EPYC 4244P", 6, 12, 3.8, 5.1, 65),
|
||||
("EPYC 4344P", 8, 16, 3.8, 5.3, 65),
|
||||
("EPYC 4364P", 8, 16, 4.5, 5.4, 105),
|
||||
("EPYC 4464P", 12, 24, 3.7, 5.4, 65),
|
||||
("EPYC 4484PX", 12, 24, 4.4, 5.6, 120),
|
||||
("EPYC 4564P", 16, 32, 4.5, 5.7, 170),
|
||||
("EPYC 4584PX", 16, 32, 4.2, 5.7, 120),
|
||||
)),
|
||||
(AMD, "EPYC 4005 (Grado)", "AM5", 2025, 1, (
|
||||
("EPYC 4245P", 6, 12, 3.9, 5.4, 65),
|
||||
("EPYC 4345P", 8, 16, 3.8, 5.5, 65),
|
||||
("EPYC 4465P", 12, 24, 3.4, 5.4, 65),
|
||||
("EPYC 4545P", 16, 32, 3.0, 5.4, 65),
|
||||
("EPYC 4565P", 16, 32, 4.3, 5.7, 170),
|
||||
("EPYC 4585PX", 16, 32, 4.3, 5.7, 170),
|
||||
)),
|
||||
(AMD, "EPYC 9005 (Turin)", "SP5", 2024, 2, (
|
||||
("EPYC 9015", 8, 16, 3.6, 4.1, 125),
|
||||
("EPYC 9115", 16, 32, 2.6, 4.1, 125),
|
||||
("EPYC 9135", 16, 32, 3.65, 4.3, 200),
|
||||
("EPYC 9175F", 16, 32, 4.2, 5.0, 320),
|
||||
("EPYC 9255", 24, 48, 3.25, 4.3, 200),
|
||||
("EPYC 9275F", 24, 48, 4.1, 4.8, 320),
|
||||
("EPYC 9335", 32, 64, 3.0, 4.4, 210),
|
||||
("EPYC 9355", 32, 64, 3.55, 4.4, 280),
|
||||
("EPYC 9355P", 32, 64, 3.55, 4.4, 280),
|
||||
("EPYC 9365", 36, 72, 3.4, 4.3, 300),
|
||||
("EPYC 9375F", 32, 64, 3.8, 4.8, 320),
|
||||
("EPYC 9455", 48, 96, 3.15, 4.4, 300),
|
||||
("EPYC 9455P", 48, 96, 3.15, 4.4, 300),
|
||||
("EPYC 9475F", 48, 96, 3.65, 4.8, 400),
|
||||
("EPYC 9535", 64, 128, 2.4, 4.3, 300),
|
||||
("EPYC 9555", 64, 128, 3.2, 4.4, 360),
|
||||
("EPYC 9555P", 64, 128, 3.2, 4.4, 360),
|
||||
("EPYC 9565", 72, 144, 3.15, 4.3, 400),
|
||||
("EPYC 9575F", 64, 128, 3.3, 5.0, 400),
|
||||
("EPYC 9645", 96, 192, 2.3, 3.7, 320),
|
||||
("EPYC 9655", 96, 192, 2.5, 4.5, 400),
|
||||
("EPYC 9655P", 96, 192, 2.5, 4.5, 400),
|
||||
("EPYC 9745", 128, 256, 2.4, 3.7, 400),
|
||||
("EPYC 9755", 128, 256, 2.7, 4.1, 500),
|
||||
("EPYC 9825", 144, 288, 2.2, 3.7, 390),
|
||||
("EPYC 9845", 160, 320, 2.1, 3.7, 390),
|
||||
("EPYC 9965", 192, 384, 2.25, 3.7, 500),
|
||||
)),
|
||||
) # fmt: skip
|
||||
|
||||
|
||||
def max_sockets(name, family_max):
|
||||
"""EPYC "P" models (e.g. 7402P, 9354P, 4484PX) are single-socket only."""
|
||||
if name.startswith("EPYC") and name.endswith(("P", "PX")):
|
||||
return 1
|
||||
return family_max
|
||||
|
||||
|
||||
def entries():
|
||||
"""Yield one dict per CPU, ready for CPUModel(**entry)."""
|
||||
for manufacturer, family, socket, year, family_max, models in FAMILIES:
|
||||
for name, cores, threads, base, boost, tdp in models:
|
||||
yield {
|
||||
"manufacturer": manufacturer,
|
||||
"family": family,
|
||||
"name": name,
|
||||
"cores": cores,
|
||||
"threads": threads,
|
||||
"base_clock_ghz": base,
|
||||
"boost_clock_ghz": boost,
|
||||
"tdp_watts": tdp,
|
||||
"socket": socket,
|
||||
"launch_year": year,
|
||||
"max_sockets": max_sockets(name, family_max),
|
||||
}
|
||||
|
||||
|
||||
def sync(model, force=False):
|
||||
"""Create missing catalogue CPUs; update untouched built-in ones. Returns (created, updated).
|
||||
|
||||
``model`` is the CPUModel class (also the historical one inside migrations).
|
||||
Entries with ``builtin=False`` were added by users and are never touched; built-in
|
||||
entries edited in the UI keep their values unless ``force`` is set.
|
||||
"""
|
||||
from decimal import Decimal
|
||||
|
||||
created = updated = 0
|
||||
existing = {(cpu.manufacturer, cpu.name.casefold()): cpu for cpu in model.objects.all()}
|
||||
for entry in entries():
|
||||
values = {
|
||||
**entry,
|
||||
"base_clock_ghz": Decimal(str(entry["base_clock_ghz"])),
|
||||
"boost_clock_ghz": Decimal(str(entry["boost_clock_ghz"])) if entry["boost_clock_ghz"] else None,
|
||||
}
|
||||
cpu = existing.get((entry["manufacturer"], entry["name"].casefold()))
|
||||
if cpu is None:
|
||||
model.objects.create(builtin=True, **values)
|
||||
created += 1
|
||||
elif cpu.builtin and (force or not cpu.customized):
|
||||
changed = [name for name, value in values.items() if getattr(cpu, name) != value]
|
||||
if changed:
|
||||
for name in changed:
|
||||
setattr(cpu, name, values[name])
|
||||
cpu.save(update_fields=changed)
|
||||
updated += 1
|
||||
return created, updated
|
||||
@@ -4,7 +4,7 @@ import strawberry
|
||||
import strawberry_django
|
||||
from netbox.graphql.types import NetBoxObjectType
|
||||
|
||||
from .models import Disk, DiskBayLayout, DiskBayTemplate, RAIDGroup
|
||||
from .models import CPUModel, DeviceHardware, Disk, DiskBayLayout, DiskBayTemplate, RAIDGroup
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dcim.graphql.types import DeviceType, DeviceTypeType
|
||||
@@ -70,6 +70,55 @@ class NetBoxUtilitiesDiskBayTemplateType(NetBoxObjectType):
|
||||
device_type: Annotated["DeviceTypeType", strawberry.lazy("dcim.graphql.types")]
|
||||
|
||||
|
||||
@strawberry_django.type(
|
||||
CPUModel,
|
||||
fields=[
|
||||
"id",
|
||||
"manufacturer",
|
||||
"family",
|
||||
"name",
|
||||
"cores",
|
||||
"threads",
|
||||
"base_clock_ghz",
|
||||
"boost_clock_ghz",
|
||||
"tdp_watts",
|
||||
"socket",
|
||||
"launch_year",
|
||||
"max_sockets",
|
||||
"builtin",
|
||||
"description",
|
||||
],
|
||||
)
|
||||
class NetBoxUtilitiesCPUModelType(NetBoxObjectType):
|
||||
pass
|
||||
|
||||
|
||||
@strawberry_django.type(
|
||||
DeviceHardware,
|
||||
fields=[
|
||||
"id",
|
||||
"cpu_count",
|
||||
"memory_gb",
|
||||
"memory_type",
|
||||
"memory_modules",
|
||||
"memory_module_gb",
|
||||
"memory_speed_mts",
|
||||
"description",
|
||||
],
|
||||
)
|
||||
class NetBoxUtilitiesDeviceHardwareType(NetBoxObjectType):
|
||||
device: Annotated["DeviceType", strawberry.lazy("dcim.graphql.types")]
|
||||
cpu: Annotated["NetBoxUtilitiesCPUModelType", strawberry.lazy("netbox_utilities.graphql")] | None
|
||||
|
||||
@strawberry_django.field
|
||||
def total_cores(self) -> int | None:
|
||||
return self.total_cores
|
||||
|
||||
@strawberry_django.field
|
||||
def total_threads(self) -> int | None:
|
||||
return self.total_threads
|
||||
|
||||
|
||||
@strawberry.type(name="Query")
|
||||
class NetBoxUtilitiesDiskQuery:
|
||||
netbox_utilities_disk: NetBoxUtilitiesDiskType = strawberry_django.field()
|
||||
@@ -80,6 +129,10 @@ class NetBoxUtilitiesDiskQuery:
|
||||
netbox_utilities_disk_bay_layout_list: list[NetBoxUtilitiesDiskBayLayoutType] = strawberry_django.field()
|
||||
netbox_utilities_disk_bay_template: NetBoxUtilitiesDiskBayTemplateType = strawberry_django.field()
|
||||
netbox_utilities_disk_bay_template_list: list[NetBoxUtilitiesDiskBayTemplateType] = strawberry_django.field()
|
||||
netbox_utilities_cpu_model: NetBoxUtilitiesCPUModelType = strawberry_django.field()
|
||||
netbox_utilities_cpu_model_list: list[NetBoxUtilitiesCPUModelType] = strawberry_django.field()
|
||||
netbox_utilities_device_hardware: NetBoxUtilitiesDeviceHardwareType = strawberry_django.field()
|
||||
netbox_utilities_device_hardware_list: list[NetBoxUtilitiesDeviceHardwareType] = strawberry_django.field()
|
||||
|
||||
|
||||
schema = [NetBoxUtilitiesDiskQuery]
|
||||
@@ -0,0 +1,189 @@
|
||||
"""Pure helpers for "CPU & RAM": capacity of hosts and clusters versus the virtual machines on them."""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from decimal import Decimal
|
||||
|
||||
DEFAULT_HARDWARE_DEVICE_ROLES = ("Server",)
|
||||
# vCPUs per physical core above which the cluster is shown as overcommitted.
|
||||
DEFAULT_VCPU_RATIO_WARNING = 4
|
||||
|
||||
# VM states that do not use host resources.
|
||||
INACTIVE_VM_STATUSES = ("offline", "decommissioning")
|
||||
|
||||
MEMORY_TYPES = {
|
||||
"ddr3": "DDR3",
|
||||
"ddr4": "DDR4",
|
||||
"ddr5": "DDR5",
|
||||
"other": "Sonstiges",
|
||||
}
|
||||
|
||||
|
||||
def configured_roles(roles=None):
|
||||
if roles is None:
|
||||
try:
|
||||
from netbox.plugins import get_plugin_config
|
||||
|
||||
roles = get_plugin_config("netbox_utilities", "hardware_device_roles")
|
||||
except Exception: # noqa: BLE001 - outside NetBox (tests) fall back to defaults
|
||||
roles = None
|
||||
return {str(role).casefold() for role in (roles if roles is not None else DEFAULT_HARDWARE_DEVICE_ROLES)}
|
||||
|
||||
|
||||
def supports_hardware(device, roles=None):
|
||||
"""Servers by role, and every device that is a host of a virtualization cluster."""
|
||||
if getattr(device, "cluster_id", None):
|
||||
return True
|
||||
role = getattr(device, "role", None)
|
||||
return bool(role and str(getattr(role, "name", "")).casefold() in configured_roles(roles))
|
||||
|
||||
|
||||
def vcpu_ratio_warning():
|
||||
try:
|
||||
from netbox.plugins import get_plugin_config
|
||||
|
||||
return get_plugin_config("netbox_utilities", "hardware_vcpu_ratio_warning")
|
||||
except Exception: # noqa: BLE001
|
||||
return DEFAULT_VCPU_RATIO_WARNING
|
||||
|
||||
|
||||
def format_memory(gigabytes):
|
||||
"""RAM as vendors label it: 768 GB, 1,5 TB."""
|
||||
if gigabytes in (None, ""):
|
||||
return "—"
|
||||
gigabytes = Decimal(str(gigabytes))
|
||||
if gigabytes >= 1024:
|
||||
text = f"{gigabytes / 1024:.2f}".rstrip("0").rstrip(".")
|
||||
return f"{text} TB".replace(".", ",")
|
||||
text = f"{gigabytes:.1f}".rstrip("0").rstrip(".")
|
||||
return f"{text} GB".replace(".", ",")
|
||||
|
||||
|
||||
def format_clock(ghz):
|
||||
if ghz in (None, ""):
|
||||
return "—"
|
||||
text = f"{Decimal(str(ghz)):.2f}".rstrip("0").rstrip(".")
|
||||
return f"{text} GHz".replace(".", ",")
|
||||
|
||||
|
||||
def format_ratio(value):
|
||||
if value is None:
|
||||
return "—"
|
||||
return f"{value:.1f}".replace(".", ",") + " : 1"
|
||||
|
||||
|
||||
def percent(part, whole):
|
||||
if not whole:
|
||||
return None
|
||||
return round(float(part) / float(whole) * 100)
|
||||
|
||||
|
||||
@dataclass
|
||||
class Host:
|
||||
"""One physical host; cores/threads/memory are None when no hardware is recorded."""
|
||||
|
||||
name: str
|
||||
cores: int | None = None
|
||||
threads: int | None = None
|
||||
memory_gb: float | None = None
|
||||
vcpus: float = 0
|
||||
vm_memory_gb: float = 0
|
||||
vm_count: int = 0
|
||||
|
||||
@property
|
||||
def complete(self):
|
||||
return bool(self.cores and self.memory_gb)
|
||||
|
||||
|
||||
@dataclass
|
||||
class Capacity:
|
||||
hosts: list = field(default_factory=list)
|
||||
vm_count: int = 0
|
||||
vcpus: float = 0
|
||||
vm_memory_gb: float = 0
|
||||
unplaced_vm_count: int = 0
|
||||
|
||||
@property
|
||||
def known_hosts(self):
|
||||
return [host for host in self.hosts if host.complete]
|
||||
|
||||
@property
|
||||
def missing_hosts(self):
|
||||
return [host for host in self.hosts if not host.complete]
|
||||
|
||||
@property
|
||||
def cores(self):
|
||||
return sum(host.cores or 0 for host in self.hosts)
|
||||
|
||||
@property
|
||||
def threads(self):
|
||||
return sum(host.threads or 0 for host in self.hosts)
|
||||
|
||||
@property
|
||||
def memory_gb(self):
|
||||
return sum(host.memory_gb or 0 for host in self.hosts)
|
||||
|
||||
@property
|
||||
def vcpu_per_core(self):
|
||||
return self.vcpus / self.cores if self.cores else None
|
||||
|
||||
@property
|
||||
def vcpu_per_thread(self):
|
||||
return self.vcpus / self.threads if self.threads else None
|
||||
|
||||
@property
|
||||
def memory_percent(self):
|
||||
return percent(self.vm_memory_gb, self.memory_gb)
|
||||
|
||||
@property
|
||||
def failover_memory_gb(self):
|
||||
"""RAM left if the largest host fails (N+1); None with fewer than two known hosts."""
|
||||
known = self.known_hosts
|
||||
if len(known) < 2:
|
||||
return None
|
||||
return self.memory_gb - max(host.memory_gb for host in known)
|
||||
|
||||
@property
|
||||
def failover_ok(self):
|
||||
reserve = self.failover_memory_gb
|
||||
return None if reserve is None else self.vm_memory_gb <= reserve
|
||||
|
||||
def warnings(self, ratio_warning=DEFAULT_VCPU_RATIO_WARNING):
|
||||
"""(level, text) tuples for the capacity panel."""
|
||||
result = []
|
||||
if self.missing_hosts:
|
||||
names = ", ".join(host.name for host in self.missing_hosts)
|
||||
result.append(("warning", f"CPU/RAM fehlt bei: {names}"))
|
||||
if self.memory_gb and self.vm_memory_gb > self.memory_gb:
|
||||
result.append(("danger", "Die VMs haben mehr RAM zugewiesen, als die Hosts haben."))
|
||||
elif self.failover_ok is False:
|
||||
result.append(("warning", "Fällt der größte Host aus, reicht der RAM nicht für alle VMs (N+1)."))
|
||||
ratio = self.vcpu_per_core
|
||||
if ratio_warning and ratio is not None and ratio > ratio_warning:
|
||||
result.append(("warning", f"Mehr als {ratio_warning} vCPUs pro physischem Kern."))
|
||||
return result
|
||||
|
||||
|
||||
def build_capacity(hosts, vms):
|
||||
"""Aggregate hosts and VMs.
|
||||
|
||||
hosts: iterable of Host (memory in GB).
|
||||
vms: iterable of (host name or None, vcpus, memory in MB, status).
|
||||
"""
|
||||
capacity = Capacity(hosts=list(hosts))
|
||||
by_name = {host.name: host for host in capacity.hosts}
|
||||
for host_name, vcpus, memory_mb, status in vms:
|
||||
if status in INACTIVE_VM_STATUSES:
|
||||
continue
|
||||
vcpus = float(vcpus or 0)
|
||||
memory_gb = (memory_mb or 0) / 1024
|
||||
capacity.vm_count += 1
|
||||
capacity.vcpus += vcpus
|
||||
capacity.vm_memory_gb += memory_gb
|
||||
host = by_name.get(host_name)
|
||||
if host is None:
|
||||
capacity.unplaced_vm_count += 1
|
||||
else:
|
||||
host.vm_count += 1
|
||||
host.vcpus += vcpus
|
||||
host.vm_memory_gb += memory_gb
|
||||
return capacity
|
||||
@@ -0,0 +1,76 @@
|
||||
import django_filters
|
||||
from dcim.models import Device
|
||||
from django.db.models import Q
|
||||
from netbox.filtersets import NetBoxModelFilterSet
|
||||
from tenancy.models import Tenant
|
||||
from virtualization.models import Cluster
|
||||
|
||||
from .models import CPUManufacturerChoices, CPUModel, DeviceHardware, MemoryTypeChoices
|
||||
|
||||
|
||||
class CPUModelFilterSet(NetBoxModelFilterSet):
|
||||
manufacturer = django_filters.MultipleChoiceFilter(choices=CPUManufacturerChoices)
|
||||
family = django_filters.CharFilter(lookup_expr="icontains")
|
||||
socket = django_filters.CharFilter(lookup_expr="iexact")
|
||||
cores = django_filters.NumberFilter()
|
||||
cores__gte = django_filters.NumberFilter(field_name="cores", lookup_expr="gte", label="Kerne ab")
|
||||
cores__lte = django_filters.NumberFilter(field_name="cores", lookup_expr="lte", label="Kerne bis")
|
||||
launch_year = django_filters.NumberFilter()
|
||||
launch_year__gte = django_filters.NumberFilter(field_name="launch_year", lookup_expr="gte", label="Ab Jahr")
|
||||
in_use = django_filters.BooleanFilter(method="filter_in_use", label="In Verwendung")
|
||||
|
||||
class Meta:
|
||||
model = CPUModel
|
||||
fields = ("id", "name", "max_sockets", "builtin")
|
||||
|
||||
def search(self, queryset, name, value):
|
||||
value = value.strip()
|
||||
if not value:
|
||||
return queryset
|
||||
query = Q()
|
||||
# "Gold 6338", "epyc 7543" or "intel 6338": every word must match somewhere.
|
||||
for word in value.split():
|
||||
query &= (
|
||||
Q(name__icontains=word)
|
||||
| Q(family__icontains=word)
|
||||
| Q(manufacturer__iexact=word)
|
||||
| Q(socket__iexact=word)
|
||||
)
|
||||
return queryset.filter(query)
|
||||
|
||||
def filter_in_use(self, queryset, name, value):
|
||||
if value is None:
|
||||
return queryset
|
||||
return queryset.filter(devices__isnull=not value).distinct()
|
||||
|
||||
|
||||
class DeviceHardwareFilterSet(NetBoxModelFilterSet):
|
||||
device_id = django_filters.ModelMultipleChoiceFilter(queryset=Device.objects.all(), label="Gerät (ID)")
|
||||
device = django_filters.ModelMultipleChoiceFilter(
|
||||
field_name="device__name", queryset=Device.objects.all(), to_field_name="name", label="Gerät (Name)"
|
||||
)
|
||||
cpu_id = django_filters.ModelMultipleChoiceFilter(queryset=CPUModel.objects.all(), label="CPU-Modell (ID)")
|
||||
cluster_id = django_filters.ModelMultipleChoiceFilter(
|
||||
field_name="device__cluster", queryset=Cluster.objects.all(), label="Cluster (ID)"
|
||||
)
|
||||
manufacturer = django_filters.MultipleChoiceFilter(field_name="cpu__manufacturer", choices=CPUManufacturerChoices)
|
||||
memory_type = django_filters.MultipleChoiceFilter(choices=MemoryTypeChoices)
|
||||
memory_gb__gte = django_filters.NumberFilter(field_name="memory_gb", lookup_expr="gte", label="RAM ab (GB)")
|
||||
# Read by the global tenant filter middleware, which may pass several tenants of a group.
|
||||
tenant_id = django_filters.ModelMultipleChoiceFilter(
|
||||
field_name="device__tenant", queryset=Tenant.objects.all(), label="Mandant (ID)"
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = DeviceHardware
|
||||
fields = ("id", "cpu_count", "memory_gb")
|
||||
|
||||
def search(self, queryset, name, value):
|
||||
if not value.strip():
|
||||
return queryset
|
||||
return queryset.filter(
|
||||
Q(device__name__icontains=value)
|
||||
| Q(cpu__name__icontains=value)
|
||||
| Q(cpu__family__icontains=value)
|
||||
| Q(description__icontains=value)
|
||||
)
|
||||
@@ -0,0 +1,172 @@
|
||||
from dcim.models import Device
|
||||
from django import forms
|
||||
from netbox.forms import NetBoxModelFilterSetForm, NetBoxModelForm, NetBoxModelImportForm
|
||||
from utilities.forms.fields import (
|
||||
CommentField,
|
||||
CSVChoiceField,
|
||||
CSVModelChoiceField,
|
||||
DynamicModelChoiceField,
|
||||
DynamicModelMultipleChoiceField,
|
||||
TagFilterField,
|
||||
)
|
||||
from utilities.forms.rendering import FieldSet
|
||||
from virtualization.models import Cluster
|
||||
|
||||
from .models import CPUManufacturerChoices, CPUModel, DeviceHardware, MemoryTypeChoices
|
||||
|
||||
|
||||
class CPUModelForm(NetBoxModelForm):
|
||||
fieldsets = (
|
||||
FieldSet("manufacturer", "family", "name", "socket", "launch_year", name="CPU"),
|
||||
FieldSet("cores", "threads", "base_clock_ghz", "boost_clock_ghz", "tdp_watts", "max_sockets", name="Leistung"),
|
||||
FieldSet("description", "tags", name="Sonstiges"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = CPUModel
|
||||
fields = (
|
||||
"manufacturer",
|
||||
"family",
|
||||
"name",
|
||||
"socket",
|
||||
"launch_year",
|
||||
"cores",
|
||||
"threads",
|
||||
"base_clock_ghz",
|
||||
"boost_clock_ghz",
|
||||
"tdp_watts",
|
||||
"max_sockets",
|
||||
"description",
|
||||
"tags",
|
||||
)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
# Edited catalogue entries keep their values when the catalogue is refreshed.
|
||||
if self.instance.pk and self.instance.builtin and self.has_changed():
|
||||
self.instance.customized = True
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class CPUModelImportForm(NetBoxModelImportForm):
|
||||
manufacturer = CSVChoiceField(label="Hersteller", choices=CPUManufacturerChoices)
|
||||
|
||||
class Meta:
|
||||
model = CPUModel
|
||||
fields = (
|
||||
"manufacturer",
|
||||
"family",
|
||||
"name",
|
||||
"socket",
|
||||
"launch_year",
|
||||
"cores",
|
||||
"threads",
|
||||
"base_clock_ghz",
|
||||
"boost_clock_ghz",
|
||||
"tdp_watts",
|
||||
"max_sockets",
|
||||
"description",
|
||||
"tags",
|
||||
)
|
||||
|
||||
|
||||
class CPUModelFilterForm(NetBoxModelFilterSetForm):
|
||||
model = CPUModel
|
||||
fieldsets = (
|
||||
FieldSet("q", "filter_id", "tag"),
|
||||
FieldSet("manufacturer", "family", "socket", "cores__gte", "launch_year__gte", "in_use", name="CPU"),
|
||||
)
|
||||
manufacturer = forms.MultipleChoiceField(label="Hersteller", choices=CPUManufacturerChoices, required=False)
|
||||
family = forms.CharField(label="Familie", required=False)
|
||||
socket = forms.CharField(label="Sockel", required=False)
|
||||
cores__gte = forms.IntegerField(label="Kerne ab", required=False)
|
||||
launch_year__gte = forms.IntegerField(label="Ab Jahr", required=False)
|
||||
in_use = forms.NullBooleanField(
|
||||
label="In Verwendung",
|
||||
required=False,
|
||||
widget=forms.Select(choices=(("", "—"), ("true", "Ja"), ("false", "Nein"))),
|
||||
)
|
||||
tag = TagFilterField(model)
|
||||
|
||||
|
||||
class DeviceHardwareForm(NetBoxModelForm):
|
||||
device = DynamicModelChoiceField(label="Gerät", queryset=Device.objects.all(), selector=True)
|
||||
cpu = DynamicModelChoiceField(
|
||||
label="CPU-Modell",
|
||||
queryset=CPUModel.objects.all(),
|
||||
required=False,
|
||||
help_text="Suche nach Modell oder Familie, z. B. „6338“, „Gold 6338“ oder „EPYC 7543“.",
|
||||
)
|
||||
comments = CommentField()
|
||||
|
||||
fieldsets = (
|
||||
FieldSet("device", name="Gerät"),
|
||||
FieldSet("cpu", "cpu_count", name="CPU"),
|
||||
FieldSet(
|
||||
"memory_modules", "memory_module_gb", "memory_gb", "memory_type", "memory_speed_mts", name="Arbeitsspeicher"
|
||||
),
|
||||
FieldSet("description", "tags", name="Sonstiges"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = DeviceHardware
|
||||
fields = (
|
||||
"device",
|
||||
"cpu",
|
||||
"cpu_count",
|
||||
"memory_modules",
|
||||
"memory_module_gb",
|
||||
"memory_gb",
|
||||
"memory_type",
|
||||
"memory_speed_mts",
|
||||
"description",
|
||||
"comments",
|
||||
"tags",
|
||||
)
|
||||
help_texts = {
|
||||
"memory_gb": "Leer lassen, um ihn aus Anzahl × Größe der Module zu berechnen.",
|
||||
}
|
||||
|
||||
|
||||
class DeviceHardwareImportForm(NetBoxModelImportForm):
|
||||
device = CSVModelChoiceField(
|
||||
label="Gerät", queryset=Device.objects.all(), to_field_name="name", help_text="Name des Geräts"
|
||||
)
|
||||
cpu = CSVModelChoiceField(
|
||||
label="CPU-Modell",
|
||||
queryset=CPUModel.objects.all(),
|
||||
to_field_name="name",
|
||||
required=False,
|
||||
help_text="Modellname aus dem Katalog, z. B. Xeon Gold 6338",
|
||||
)
|
||||
memory_type = CSVChoiceField(label="RAM-Typ", choices=MemoryTypeChoices, required=False)
|
||||
|
||||
class Meta:
|
||||
model = DeviceHardware
|
||||
fields = (
|
||||
"device",
|
||||
"cpu",
|
||||
"cpu_count",
|
||||
"memory_gb",
|
||||
"memory_type",
|
||||
"memory_modules",
|
||||
"memory_module_gb",
|
||||
"memory_speed_mts",
|
||||
"description",
|
||||
"comments",
|
||||
"tags",
|
||||
)
|
||||
|
||||
|
||||
class DeviceHardwareFilterForm(NetBoxModelFilterSetForm):
|
||||
model = DeviceHardware
|
||||
fieldsets = (
|
||||
FieldSet("q", "filter_id", "tag"),
|
||||
FieldSet("device_id", "cluster_id", "cpu_id", "manufacturer", "memory_type", "memory_gb__gte", name="Hardware"),
|
||||
)
|
||||
device_id = DynamicModelMultipleChoiceField(queryset=Device.objects.all(), required=False, label="Gerät")
|
||||
cluster_id = DynamicModelMultipleChoiceField(queryset=Cluster.objects.all(), required=False, label="Cluster")
|
||||
cpu_id = DynamicModelMultipleChoiceField(queryset=CPUModel.objects.all(), required=False, label="CPU-Modell")
|
||||
manufacturer = forms.MultipleChoiceField(label="Hersteller", choices=CPUManufacturerChoices, required=False)
|
||||
memory_type = forms.MultipleChoiceField(label="RAM-Typ", choices=MemoryTypeChoices, required=False)
|
||||
memory_gb__gte = forms.IntegerField(label="RAM ab (GB)", required=False)
|
||||
tag = TagFilterField(model)
|
||||
@@ -0,0 +1,82 @@
|
||||
import django_tables2 as tables
|
||||
|
||||
|
||||
def _record(device):
|
||||
return getattr(device, "netbox_utilities_hardware", None)
|
||||
|
||||
|
||||
class DeviceCPUColumn(tables.Column):
|
||||
def render(self, record):
|
||||
hardware = _record(record)
|
||||
return hardware.cpu_display if hardware and hardware.cpu_id else "—"
|
||||
|
||||
def value(self, record):
|
||||
hardware = _record(record)
|
||||
return hardware.cpu_display if hardware and hardware.cpu_id else ""
|
||||
|
||||
|
||||
class DeviceCoresColumn(tables.Column):
|
||||
def render(self, record):
|
||||
hardware = _record(record)
|
||||
if not hardware or not hardware.cpu_id:
|
||||
return "—"
|
||||
return f"{hardware.total_cores} / {hardware.total_threads}"
|
||||
|
||||
def value(self, record):
|
||||
hardware = _record(record)
|
||||
return hardware.total_cores if hardware and hardware.cpu_id else ""
|
||||
|
||||
|
||||
class DeviceMemoryColumn(tables.Column):
|
||||
def render(self, record):
|
||||
hardware = _record(record)
|
||||
return hardware.memory_display if hardware and hardware.memory_gb else "—"
|
||||
|
||||
def value(self, record):
|
||||
hardware = _record(record)
|
||||
return hardware.memory_gb if hardware and hardware.memory_gb else ""
|
||||
|
||||
|
||||
class ClusterCapacityColumn(tables.Column):
|
||||
"""vCPU:core ratio and RAM allocation of a cluster, e.g. "3,2 : 1 · 74 %"."""
|
||||
|
||||
@staticmethod
|
||||
def capacity(record):
|
||||
from dcim.models import Device
|
||||
from virtualization.models import VirtualMachine
|
||||
|
||||
from .hardware import build_capacity
|
||||
from .hardware_views import host_entry, vm_rows
|
||||
|
||||
hosts = Device.objects.filter(cluster=record).select_related("netbox_utilities_hardware__cpu")
|
||||
vms = VirtualMachine.objects.filter(cluster=record).select_related("device")
|
||||
return build_capacity([host_entry(device) for device in hosts], vm_rows(vms))
|
||||
|
||||
def render(self, record):
|
||||
from .hardware import format_ratio
|
||||
|
||||
capacity = self.capacity(record)
|
||||
if not capacity.cores:
|
||||
return "—"
|
||||
memory = f" · {capacity.memory_percent} % RAM" if capacity.memory_percent is not None else ""
|
||||
return f"{format_ratio(capacity.vcpu_per_core)}{memory}"
|
||||
|
||||
def value(self, record):
|
||||
return self.render(record)
|
||||
|
||||
|
||||
def install_hardware_support():
|
||||
from dcim.tables import DeviceTable
|
||||
from utilities.tables import register_table_column
|
||||
from virtualization.tables import ClusterTable
|
||||
|
||||
common = {"accessor": tables.A("pk"), "orderable": False, "empty_values": ()}
|
||||
register_table_column(DeviceCPUColumn(verbose_name="CPU", **common), "netbox_utilities_cpu", DeviceTable)
|
||||
register_table_column(
|
||||
DeviceCoresColumn(verbose_name="Kerne / Threads", **common), "netbox_utilities_cores", DeviceTable
|
||||
)
|
||||
register_table_column(DeviceMemoryColumn(verbose_name="RAM", **common), "netbox_utilities_memory", DeviceTable)
|
||||
# Runs a few queries per row, so it is only shown when added under "Configure Table".
|
||||
register_table_column(
|
||||
ClusterCapacityColumn(verbose_name="vCPU : Kern · RAM", **common), "netbox_utilities_capacity", ClusterTable
|
||||
)
|
||||
@@ -0,0 +1,119 @@
|
||||
import django_tables2 as tables
|
||||
from netbox.tables import NetBoxTable, columns
|
||||
|
||||
from . import hardware
|
||||
from .models import CPUModel, DeviceHardware
|
||||
|
||||
|
||||
class ClockColumn(tables.Column):
|
||||
def render(self, value):
|
||||
return hardware.format_clock(value)
|
||||
|
||||
|
||||
class MemoryColumn(tables.Column):
|
||||
def render(self, value):
|
||||
return hardware.format_memory(value)
|
||||
|
||||
|
||||
class CPUModelTable(NetBoxTable):
|
||||
name = tables.Column(linkify=True, verbose_name="Modell")
|
||||
manufacturer = columns.ChoiceFieldColumn(verbose_name="Hersteller")
|
||||
family = tables.Column(verbose_name="Familie")
|
||||
cores = tables.Column(verbose_name="Kerne")
|
||||
threads = tables.Column(verbose_name="Threads")
|
||||
base_clock_ghz = ClockColumn(verbose_name="Basistakt")
|
||||
boost_clock_ghz = ClockColumn(verbose_name="Turbo")
|
||||
tdp_watts = tables.Column(verbose_name="TDP (W)")
|
||||
socket = tables.Column(verbose_name="Sockel")
|
||||
launch_year = tables.Column(verbose_name="Jahr")
|
||||
max_sockets = tables.Column(verbose_name="Max. Sockel")
|
||||
builtin = columns.BooleanColumn(verbose_name="Katalog")
|
||||
device_count = columns.LinkedCountColumn(
|
||||
viewname="plugins:netbox_utilities:devicehardware_list",
|
||||
url_params={"cpu_id": "pk"},
|
||||
verbose_name="Geräte",
|
||||
)
|
||||
tags = columns.TagColumn(url_name="plugins:netbox_utilities:cpumodel_list")
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = CPUModel
|
||||
fields = (
|
||||
"pk",
|
||||
"id",
|
||||
"name",
|
||||
"manufacturer",
|
||||
"family",
|
||||
"cores",
|
||||
"threads",
|
||||
"base_clock_ghz",
|
||||
"boost_clock_ghz",
|
||||
"tdp_watts",
|
||||
"socket",
|
||||
"launch_year",
|
||||
"max_sockets",
|
||||
"builtin",
|
||||
"device_count",
|
||||
"description",
|
||||
"tags",
|
||||
"created",
|
||||
"last_updated",
|
||||
)
|
||||
default_columns = (
|
||||
"name",
|
||||
"family",
|
||||
"cores",
|
||||
"threads",
|
||||
"base_clock_ghz",
|
||||
"boost_clock_ghz",
|
||||
"socket",
|
||||
"launch_year",
|
||||
"device_count",
|
||||
)
|
||||
|
||||
|
||||
class DeviceHardwareTable(NetBoxTable):
|
||||
device = tables.Column(linkify=True, verbose_name="Gerät")
|
||||
cluster = tables.Column(accessor=tables.A("device__cluster"), linkify=True, verbose_name="Cluster")
|
||||
cpu = tables.Column(linkify=True, verbose_name="CPU-Modell")
|
||||
cpu_count = tables.Column(verbose_name="CPUs")
|
||||
total_cores = tables.Column(verbose_name="Kerne", orderable=False)
|
||||
total_threads = tables.Column(verbose_name="Threads", orderable=False)
|
||||
memory_gb = MemoryColumn(verbose_name="RAM")
|
||||
memory_type = columns.ChoiceFieldColumn(verbose_name="RAM-Typ")
|
||||
memory_detail = tables.Column(verbose_name="Bestückung", orderable=False)
|
||||
comments = columns.MarkdownColumn()
|
||||
tags = columns.TagColumn(url_name="plugins:netbox_utilities:devicehardware_list")
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = DeviceHardware
|
||||
fields = (
|
||||
"pk",
|
||||
"id",
|
||||
"device",
|
||||
"cluster",
|
||||
"cpu",
|
||||
"cpu_count",
|
||||
"total_cores",
|
||||
"total_threads",
|
||||
"memory_gb",
|
||||
"memory_type",
|
||||
"memory_modules",
|
||||
"memory_module_gb",
|
||||
"memory_speed_mts",
|
||||
"memory_detail",
|
||||
"description",
|
||||
"comments",
|
||||
"tags",
|
||||
"created",
|
||||
"last_updated",
|
||||
)
|
||||
default_columns = (
|
||||
"device",
|
||||
"cluster",
|
||||
"cpu",
|
||||
"cpu_count",
|
||||
"total_cores",
|
||||
"total_threads",
|
||||
"memory_gb",
|
||||
"memory_detail",
|
||||
)
|
||||
@@ -0,0 +1,212 @@
|
||||
from dcim.models import Device
|
||||
from django.db.models import Count
|
||||
from django.urls import reverse
|
||||
from netbox.views import generic
|
||||
from utilities.views import register_model_view
|
||||
from virtualization.models import VirtualMachine
|
||||
|
||||
from . import hardware, hardware_filtersets, hardware_forms, hardware_tables
|
||||
from .models import CPUModel, DeviceHardware
|
||||
|
||||
|
||||
def host_entry(device):
|
||||
"""hardware.Host for a device, with or without recorded CPU/RAM."""
|
||||
record = getattr(device, "netbox_utilities_hardware", None)
|
||||
if record is None:
|
||||
return hardware.Host(name=device.name)
|
||||
return hardware.Host(
|
||||
name=device.name,
|
||||
cores=record.total_cores,
|
||||
threads=record.total_threads,
|
||||
memory_gb=record.memory_gb,
|
||||
)
|
||||
|
||||
|
||||
def vm_rows(vms):
|
||||
return [(vm.device.name if vm.device_id else None, vm.vcpus, vm.memory, vm.status) for vm in vms]
|
||||
|
||||
|
||||
def capacity_context(capacity):
|
||||
return {
|
||||
"capacity": capacity,
|
||||
"vcpu_per_core": hardware.format_ratio(capacity.vcpu_per_core),
|
||||
"vcpu_per_thread": hardware.format_ratio(capacity.vcpu_per_thread),
|
||||
"memory": hardware.format_memory(capacity.memory_gb),
|
||||
"vm_memory": hardware.format_memory(round(capacity.vm_memory_gb, 1)),
|
||||
"failover_memory": hardware.format_memory(capacity.failover_memory_gb),
|
||||
"capacity_warnings": capacity.warnings(hardware.vcpu_ratio_warning()),
|
||||
}
|
||||
|
||||
|
||||
def device_hardware_context(request, device):
|
||||
"""Panel on the device page: CPU/RAM and, for virtualization hosts, the VMs running on it."""
|
||||
record = DeviceHardware.objects.filter(device=device).select_related("cpu").first()
|
||||
context = {
|
||||
"record": record,
|
||||
"can_add": request.user.has_perm("netbox_utilities.add_devicehardware"),
|
||||
"can_change": request.user.has_perm("netbox_utilities.change_devicehardware"),
|
||||
"add_url": f"{reverse('plugins:netbox_utilities:devicehardware_add')}?device={device.pk}"
|
||||
f"&return_url={device.get_absolute_url()}",
|
||||
}
|
||||
vms = list(VirtualMachine.objects.restrict(request.user, "view").filter(device=device))
|
||||
if vms or device.cluster_id:
|
||||
capacity = hardware.build_capacity([host_entry(device)], vm_rows(vms))
|
||||
context.update(capacity_context(capacity))
|
||||
context["host"] = capacity.hosts[0]
|
||||
context["vm_list_url"] = f"{reverse('virtualization:virtualmachine_list')}?device_id={device.pk}"
|
||||
return context
|
||||
|
||||
|
||||
def cluster_capacity_context(request, cluster):
|
||||
hosts = list(
|
||||
Device.objects.restrict(request.user, "view")
|
||||
.filter(cluster=cluster)
|
||||
.select_related("netbox_utilities_hardware__cpu")
|
||||
.order_by("name")
|
||||
)
|
||||
vms = VirtualMachine.objects.restrict(request.user, "view").filter(cluster=cluster).select_related("device")
|
||||
capacity = hardware.build_capacity([host_entry(device) for device in hosts], vm_rows(vms))
|
||||
rows = []
|
||||
for device, host in zip(hosts, capacity.hosts, strict=True):
|
||||
record = getattr(device, "netbox_utilities_hardware", None)
|
||||
rows.append(
|
||||
{
|
||||
"device": device,
|
||||
"record": record,
|
||||
"host": host,
|
||||
"memory": hardware.format_memory(host.memory_gb),
|
||||
"vm_memory": hardware.format_memory(round(host.vm_memory_gb, 1)),
|
||||
"memory_percent": hardware.percent(host.vm_memory_gb, host.memory_gb),
|
||||
"vcpu_per_core": hardware.format_ratio(host.vcpus / host.cores if host.cores else None),
|
||||
}
|
||||
)
|
||||
return {
|
||||
**capacity_context(capacity),
|
||||
"rows": rows,
|
||||
"hardware_list_url": f"{reverse('plugins:netbox_utilities:devicehardware_list')}?cluster_id={cluster.pk}",
|
||||
"can_add": request.user.has_perm("netbox_utilities.add_devicehardware"),
|
||||
}
|
||||
|
||||
|
||||
def vm_host_context(request, vm):
|
||||
"""Panel on the VM page: the host's CPU and what share of it the VM gets."""
|
||||
device = vm.device
|
||||
if device is None and vm.cluster_id:
|
||||
hosts = Device.objects.filter(cluster_id=vm.cluster_id)
|
||||
records = list(DeviceHardware.objects.filter(device__in=hosts).select_related("cpu", "device"))
|
||||
else:
|
||||
records = list(DeviceHardware.objects.filter(device=device).select_related("cpu", "device")) if device else []
|
||||
cpus = sorted({str(record.cpu) for record in records if record.cpu_id})
|
||||
smallest = min((record.total_threads for record in records if record.total_threads), default=None)
|
||||
return {
|
||||
"device": device,
|
||||
"records": records,
|
||||
"cpus": cpus,
|
||||
"vcpus": vm.vcpus,
|
||||
"smallest_threads": smallest,
|
||||
"vcpu_share": hardware.percent(vm.vcpus or 0, smallest),
|
||||
"oversized": bool(smallest and vm.vcpus and vm.vcpus > smallest),
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# CPU models
|
||||
#
|
||||
|
||||
|
||||
@register_model_view(CPUModel, "list", path="", detail=False)
|
||||
class CPUModelListView(generic.ObjectListView):
|
||||
queryset = CPUModel.objects.annotate(device_count=Count("devices"))
|
||||
table = hardware_tables.CPUModelTable
|
||||
filterset = hardware_filtersets.CPUModelFilterSet
|
||||
filterset_form = hardware_forms.CPUModelFilterForm
|
||||
|
||||
|
||||
@register_model_view(CPUModel)
|
||||
class CPUModelView(generic.ObjectView):
|
||||
queryset = CPUModel.objects.all()
|
||||
|
||||
def get_extra_context(self, request, instance):
|
||||
records = DeviceHardware.objects.restrict(request.user, "view").filter(cpu=instance)
|
||||
return {
|
||||
"devices_table": hardware_tables.DeviceHardwareTable(
|
||||
records.select_related("device", "device__cluster", "cpu"), orderable=False
|
||||
),
|
||||
"device_count": records.count(),
|
||||
}
|
||||
|
||||
|
||||
@register_model_view(CPUModel, "add", detail=False)
|
||||
@register_model_view(CPUModel, "edit")
|
||||
class CPUModelEditView(generic.ObjectEditView):
|
||||
queryset = CPUModel.objects.all()
|
||||
form = hardware_forms.CPUModelForm
|
||||
|
||||
|
||||
@register_model_view(CPUModel, "delete")
|
||||
class CPUModelDeleteView(generic.ObjectDeleteView):
|
||||
queryset = CPUModel.objects.all()
|
||||
|
||||
|
||||
@register_model_view(CPUModel, "bulk_import", path="import", detail=False)
|
||||
class CPUModelBulkImportView(generic.BulkImportView):
|
||||
queryset = CPUModel.objects.all()
|
||||
model_form = hardware_forms.CPUModelImportForm
|
||||
|
||||
|
||||
@register_model_view(CPUModel, "bulk_delete", path="delete", detail=False)
|
||||
class CPUModelBulkDeleteView(generic.BulkDeleteView):
|
||||
queryset = CPUModel.objects.annotate(device_count=Count("devices"))
|
||||
filterset = hardware_filtersets.CPUModelFilterSet
|
||||
table = hardware_tables.CPUModelTable
|
||||
|
||||
|
||||
#
|
||||
# CPU & RAM per device
|
||||
#
|
||||
|
||||
|
||||
@register_model_view(DeviceHardware, "list", path="", detail=False)
|
||||
class DeviceHardwareListView(generic.ObjectListView):
|
||||
queryset = DeviceHardware.objects.select_related("device", "device__cluster", "cpu")
|
||||
table = hardware_tables.DeviceHardwareTable
|
||||
filterset = hardware_filtersets.DeviceHardwareFilterSet
|
||||
filterset_form = hardware_forms.DeviceHardwareFilterForm
|
||||
|
||||
|
||||
@register_model_view(DeviceHardware)
|
||||
class DeviceHardwareView(generic.ObjectView):
|
||||
queryset = DeviceHardware.objects.select_related("device", "cpu")
|
||||
|
||||
def get_extra_context(self, request, instance):
|
||||
return device_hardware_context(request, instance.device)
|
||||
|
||||
|
||||
@register_model_view(DeviceHardware, "add", detail=False)
|
||||
@register_model_view(DeviceHardware, "edit")
|
||||
class DeviceHardwareEditView(generic.ObjectEditView):
|
||||
queryset = DeviceHardware.objects.all()
|
||||
form = hardware_forms.DeviceHardwareForm
|
||||
|
||||
def get_return_url(self, request, obj=None):
|
||||
if obj is not None and obj.pk and obj.device_id and "return_url" not in request.GET:
|
||||
return obj.device.get_absolute_url()
|
||||
return super().get_return_url(request, obj)
|
||||
|
||||
|
||||
@register_model_view(DeviceHardware, "delete")
|
||||
class DeviceHardwareDeleteView(generic.ObjectDeleteView):
|
||||
queryset = DeviceHardware.objects.all()
|
||||
|
||||
|
||||
@register_model_view(DeviceHardware, "bulk_import", path="import", detail=False)
|
||||
class DeviceHardwareBulkImportView(generic.BulkImportView):
|
||||
queryset = DeviceHardware.objects.all()
|
||||
model_form = hardware_forms.DeviceHardwareImportForm
|
||||
|
||||
|
||||
@register_model_view(DeviceHardware, "bulk_delete", path="delete", detail=False)
|
||||
class DeviceHardwareBulkDeleteView(generic.BulkDeleteView):
|
||||
queryset = DeviceHardware.objects.select_related("device", "cpu")
|
||||
filterset = hardware_filtersets.DeviceHardwareFilterSet
|
||||
table = hardware_tables.DeviceHardwareTable
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,22 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from netbox_utilities import cpu_catalog
|
||||
from netbox_utilities.models import CPUModel
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Load or refresh the built-in Intel/AMD server CPU catalogue."
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
"--force",
|
||||
action="store_true",
|
||||
help="Also reset catalogue entries that were edited in the UI.",
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
created, updated = cpu_catalog.sync(CPUModel, force=options["force"])
|
||||
total = len(list(cpu_catalog.entries()))
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(f"CPU-Katalog: {created} neu, {updated} aktualisiert ({total} Modelle im Katalog).")
|
||||
)
|
||||
@@ -0,0 +1,196 @@
|
||||
import django.core.validators
|
||||
import django.db.models.deletion
|
||||
import taggit.managers
|
||||
import utilities.json
|
||||
from django.db import migrations, models
|
||||
|
||||
MANUFACTURER_CHOICES = [("intel", "Intel"), ("amd", "AMD"), ("other", "Sonstiges")]
|
||||
MEMORY_TYPE_CHOICES = [("ddr3", "DDR3"), ("ddr4", "DDR4"), ("ddr5", "DDR5"), ("other", "Sonstiges")]
|
||||
|
||||
|
||||
def netbox_model_fields():
|
||||
return [
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||
("created", models.DateTimeField(auto_now_add=True, null=True)),
|
||||
("last_updated", models.DateTimeField(auto_now=True, null=True)),
|
||||
(
|
||||
"custom_field_data",
|
||||
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def tags_field():
|
||||
return ("tags", taggit.managers.TaggableManager(through="extras.TaggedItem", to="extras.Tag"))
|
||||
|
||||
|
||||
def load_cpu_catalog(apps, schema_editor):
|
||||
from netbox_utilities import cpu_catalog
|
||||
|
||||
cpu_catalog.sync(apps.get_model("netbox_utilities", "CPUModel"))
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("dcim", "__latest__"),
|
||||
("extras", "__latest__"),
|
||||
("netbox_utilities", "0010_disk_bays"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="CPUModel",
|
||||
fields=[
|
||||
*netbox_model_fields(),
|
||||
(
|
||||
"manufacturer",
|
||||
models.CharField(choices=MANUFACTURER_CHOICES, max_length=20, verbose_name="Hersteller"),
|
||||
),
|
||||
(
|
||||
"family",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
help_text="z. B. Xeon Scalable 3. Gen (Ice Lake-SP)",
|
||||
max_length=100,
|
||||
verbose_name="Familie",
|
||||
),
|
||||
),
|
||||
(
|
||||
"name",
|
||||
models.CharField(
|
||||
help_text="z. B. Xeon Gold 6338 oder EPYC 7543", max_length=100, verbose_name="Modell"
|
||||
),
|
||||
),
|
||||
(
|
||||
"cores",
|
||||
models.PositiveSmallIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(1024),
|
||||
],
|
||||
verbose_name="Kerne",
|
||||
),
|
||||
),
|
||||
(
|
||||
"threads",
|
||||
models.PositiveSmallIntegerField(
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(2048),
|
||||
],
|
||||
verbose_name="Threads",
|
||||
),
|
||||
),
|
||||
("base_clock_ghz", models.DecimalField(decimal_places=2, max_digits=4, verbose_name="Basistakt (GHz)")),
|
||||
(
|
||||
"boost_clock_ghz",
|
||||
models.DecimalField(
|
||||
blank=True, decimal_places=2, max_digits=4, null=True, verbose_name="Turbo (GHz)"
|
||||
),
|
||||
),
|
||||
("tdp_watts", models.PositiveSmallIntegerField(blank=True, null=True, verbose_name="TDP (W)")),
|
||||
("socket", models.CharField(blank=True, max_length=30, verbose_name="Sockel")),
|
||||
(
|
||||
"launch_year",
|
||||
models.PositiveSmallIntegerField(blank=True, null=True, verbose_name="Erscheinungsjahr"),
|
||||
),
|
||||
(
|
||||
"max_sockets",
|
||||
models.PositiveSmallIntegerField(
|
||||
default=2,
|
||||
help_text="Wie viele CPUs dieses Modells ein System höchstens haben kann.",
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(8),
|
||||
],
|
||||
verbose_name="Max. Sockel",
|
||||
),
|
||||
),
|
||||
("builtin", models.BooleanField(default=False, editable=False, verbose_name="Aus dem Katalog")),
|
||||
("customized", models.BooleanField(default=False, editable=False, verbose_name="Angepasst")),
|
||||
("description", models.CharField(blank=True, max_length=200, verbose_name="Beschreibung")),
|
||||
tags_field(),
|
||||
],
|
||||
options={
|
||||
"ordering": ("manufacturer", "-launch_year", "name"),
|
||||
"verbose_name": "CPU-Modell",
|
||||
"verbose_name_plural": "CPU-Modelle",
|
||||
"constraints": [
|
||||
models.UniqueConstraint(
|
||||
fields=("manufacturer", "name"), name="netbox_utilities_cpumodel_unique_name"
|
||||
)
|
||||
],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="DeviceHardware",
|
||||
fields=[
|
||||
*netbox_model_fields(),
|
||||
(
|
||||
"device",
|
||||
models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="netbox_utilities_hardware",
|
||||
to="dcim.device",
|
||||
verbose_name="Gerät",
|
||||
),
|
||||
),
|
||||
(
|
||||
"cpu",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name="devices",
|
||||
to="netbox_utilities.cpumodel",
|
||||
verbose_name="CPU-Modell",
|
||||
),
|
||||
),
|
||||
(
|
||||
"cpu_count",
|
||||
models.PositiveSmallIntegerField(
|
||||
default=1,
|
||||
help_text="Bestückte Sockel",
|
||||
validators=[
|
||||
django.core.validators.MinValueValidator(1),
|
||||
django.core.validators.MaxValueValidator(8),
|
||||
],
|
||||
verbose_name="Anzahl CPUs",
|
||||
),
|
||||
),
|
||||
("memory_gb", models.PositiveIntegerField(blank=True, null=True, verbose_name="RAM gesamt (GB)")),
|
||||
(
|
||||
"memory_type",
|
||||
models.CharField(blank=True, choices=MEMORY_TYPE_CHOICES, max_length=20, verbose_name="RAM-Typ"),
|
||||
),
|
||||
(
|
||||
"memory_modules",
|
||||
models.PositiveSmallIntegerField(
|
||||
blank=True,
|
||||
null=True,
|
||||
validators=[django.core.validators.MaxValueValidator(256)],
|
||||
verbose_name="Anzahl Module",
|
||||
),
|
||||
),
|
||||
(
|
||||
"memory_module_gb",
|
||||
models.PositiveIntegerField(blank=True, null=True, verbose_name="Modulgröße (GB)"),
|
||||
),
|
||||
(
|
||||
"memory_speed_mts",
|
||||
models.PositiveIntegerField(
|
||||
blank=True, help_text="z. B. 3200 oder 4800", null=True, verbose_name="Takt (MT/s)"
|
||||
),
|
||||
),
|
||||
("description", models.CharField(blank=True, max_length=200, verbose_name="Beschreibung")),
|
||||
("comments", models.TextField(blank=True, verbose_name="Kommentare")),
|
||||
tags_field(),
|
||||
],
|
||||
options={
|
||||
"ordering": ("device",),
|
||||
"verbose_name": "CPU & RAM",
|
||||
"verbose_name_plural": "CPU & RAM",
|
||||
},
|
||||
),
|
||||
migrations.RunPython(load_cpu_catalog, migrations.RunPython.noop),
|
||||
]
|
||||
+162
-1
@@ -7,7 +7,7 @@ from django.utils import timezone
|
||||
from netbox.models import NetBoxModel
|
||||
from utilities.choices import ChoiceSet
|
||||
|
||||
from . import disks
|
||||
from . import disks, hardware
|
||||
|
||||
|
||||
class NavigationPreference(models.Model):
|
||||
@@ -497,3 +497,164 @@ class Disk(NetBoxModel):
|
||||
if self.status == disks.STATUS_REPLACED and not self.removal_date:
|
||||
self.removal_date = timezone.localdate()
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
|
||||
#
|
||||
# CPU & RAM
|
||||
#
|
||||
|
||||
|
||||
class CPUManufacturerChoices(ChoiceSet):
|
||||
CHOICES = [
|
||||
("intel", "Intel"),
|
||||
("amd", "AMD"),
|
||||
("other", "Sonstiges"),
|
||||
]
|
||||
|
||||
|
||||
class MemoryTypeChoices(ChoiceSet):
|
||||
CHOICES = list(hardware.MEMORY_TYPES.items())
|
||||
|
||||
|
||||
class CPUModel(NetBoxModel):
|
||||
"""One entry of the CPU catalogue; the built-in entries come from cpu_catalog.py."""
|
||||
|
||||
manufacturer = models.CharField("Hersteller", max_length=20, choices=CPUManufacturerChoices)
|
||||
family = models.CharField(
|
||||
"Familie", max_length=100, blank=True, help_text="z. B. Xeon Scalable 3. Gen (Ice Lake-SP)"
|
||||
)
|
||||
name = models.CharField("Modell", max_length=100, help_text="z. B. Xeon Gold 6338 oder EPYC 7543")
|
||||
cores = models.PositiveSmallIntegerField("Kerne", validators=[MinValueValidator(1), MaxValueValidator(1024)])
|
||||
threads = models.PositiveSmallIntegerField("Threads", validators=[MinValueValidator(1), MaxValueValidator(2048)])
|
||||
base_clock_ghz = models.DecimalField("Basistakt (GHz)", max_digits=4, decimal_places=2)
|
||||
boost_clock_ghz = models.DecimalField("Turbo (GHz)", max_digits=4, decimal_places=2, blank=True, null=True)
|
||||
tdp_watts = models.PositiveSmallIntegerField("TDP (W)", blank=True, null=True)
|
||||
socket = models.CharField("Sockel", max_length=30, blank=True)
|
||||
launch_year = models.PositiveSmallIntegerField("Erscheinungsjahr", blank=True, null=True)
|
||||
max_sockets = models.PositiveSmallIntegerField(
|
||||
"Max. Sockel",
|
||||
default=2,
|
||||
validators=[MinValueValidator(1), MaxValueValidator(8)],
|
||||
help_text="Wie viele CPUs dieses Modells ein System höchstens haben kann.",
|
||||
)
|
||||
builtin = models.BooleanField("Aus dem Katalog", default=False, editable=False)
|
||||
customized = models.BooleanField("Angepasst", default=False, editable=False)
|
||||
description = models.CharField("Beschreibung", max_length=200, blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ("manufacturer", "-launch_year", "name")
|
||||
constraints = (
|
||||
models.UniqueConstraint(fields=("manufacturer", "name"), name="netbox_utilities_cpumodel_unique_name"),
|
||||
)
|
||||
verbose_name = "CPU-Modell"
|
||||
verbose_name_plural = "CPU-Modelle"
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.get_manufacturer_display()} {self.name}" if self.manufacturer != "other" else self.name
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse("plugins:netbox_utilities:cpumodel", args=[self.pk])
|
||||
|
||||
@property
|
||||
def clock_display(self):
|
||||
base = hardware.format_clock(self.base_clock_ghz)
|
||||
return f"{base} / {hardware.format_clock(self.boost_clock_ghz)}" if self.boost_clock_ghz else base
|
||||
|
||||
@property
|
||||
def summary(self):
|
||||
""" "32 Kerne / 64 Threads, 2,0 / 3,2 GHz" for selects and panels."""
|
||||
return f"{self.cores} Kerne / {self.threads} Threads, {self.clock_display}"
|
||||
|
||||
def clean(self):
|
||||
super().clean()
|
||||
if self.cores and self.threads and self.threads < self.cores:
|
||||
raise ValidationError({"threads": "Es kann nicht weniger Threads als Kerne geben."})
|
||||
if self.base_clock_ghz and self.boost_clock_ghz and self.boost_clock_ghz < self.base_clock_ghz:
|
||||
raise ValidationError({"boost_clock_ghz": "Der Turbo-Takt liegt unter dem Basistakt."})
|
||||
|
||||
|
||||
class DeviceHardware(NetBoxModel):
|
||||
"""CPU and RAM of one device (server or virtualization host)."""
|
||||
|
||||
device = models.OneToOneField(
|
||||
"dcim.Device",
|
||||
on_delete=models.CASCADE,
|
||||
related_name="netbox_utilities_hardware",
|
||||
verbose_name="Gerät",
|
||||
)
|
||||
cpu = models.ForeignKey(
|
||||
CPUModel,
|
||||
on_delete=models.PROTECT,
|
||||
related_name="devices",
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name="CPU-Modell",
|
||||
)
|
||||
cpu_count = models.PositiveSmallIntegerField(
|
||||
"Anzahl CPUs",
|
||||
default=1,
|
||||
validators=[MinValueValidator(1), MaxValueValidator(8)],
|
||||
help_text="Bestückte Sockel",
|
||||
)
|
||||
memory_gb = models.PositiveIntegerField("RAM gesamt (GB)", blank=True, null=True)
|
||||
memory_type = models.CharField("RAM-Typ", max_length=20, choices=MemoryTypeChoices, blank=True)
|
||||
memory_modules = models.PositiveSmallIntegerField(
|
||||
"Anzahl Module", blank=True, null=True, validators=[MaxValueValidator(256)]
|
||||
)
|
||||
memory_module_gb = models.PositiveIntegerField("Modulgröße (GB)", blank=True, null=True)
|
||||
memory_speed_mts = models.PositiveIntegerField(
|
||||
"Takt (MT/s)", blank=True, null=True, help_text="z. B. 3200 oder 4800"
|
||||
)
|
||||
description = models.CharField("Beschreibung", max_length=200, blank=True)
|
||||
comments = models.TextField("Kommentare", blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ("device",)
|
||||
verbose_name = "CPU & RAM"
|
||||
verbose_name_plural = "CPU & RAM"
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.device} – CPU & RAM"
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse("plugins:netbox_utilities:devicehardware", args=[self.pk])
|
||||
|
||||
@property
|
||||
def total_cores(self):
|
||||
return self.cpu.cores * self.cpu_count if self.cpu_id else None
|
||||
|
||||
@property
|
||||
def total_threads(self):
|
||||
return self.cpu.threads * self.cpu_count if self.cpu_id else None
|
||||
|
||||
@property
|
||||
def cpu_display(self):
|
||||
if not self.cpu_id:
|
||||
return "—"
|
||||
return f"{self.cpu_count} × {self.cpu}" if self.cpu_count > 1 else str(self.cpu)
|
||||
|
||||
@property
|
||||
def memory_display(self):
|
||||
return hardware.format_memory(self.memory_gb)
|
||||
|
||||
@property
|
||||
def memory_detail(self):
|
||||
""" "12 × 32 GB DDR4-3200"."""
|
||||
parts = []
|
||||
if self.memory_modules and self.memory_module_gb:
|
||||
parts.append(f"{self.memory_modules} × {self.memory_module_gb} GB")
|
||||
kind = self.get_memory_type_display() if self.memory_type else ""
|
||||
if kind and self.memory_speed_mts:
|
||||
kind = f"{kind}-{self.memory_speed_mts}"
|
||||
elif self.memory_speed_mts:
|
||||
kind = f"{self.memory_speed_mts} MT/s"
|
||||
if kind:
|
||||
parts.append(kind)
|
||||
return " ".join(parts)
|
||||
|
||||
def clean(self):
|
||||
super().clean()
|
||||
if not self.memory_gb and self.memory_modules and self.memory_module_gb:
|
||||
self.memory_gb = self.memory_modules * self.memory_module_gb
|
||||
if self.cpu_id and self.cpu_count and self.cpu_count > self.cpu.max_sockets:
|
||||
raise ValidationError({"cpu_count": f"{self.cpu} unterstützt höchstens {self.cpu.max_sockets} Sockel."})
|
||||
@@ -19,10 +19,10 @@ menu_items = (
|
||||
),
|
||||
)
|
||||
|
||||
# Own top-level menu for disks; the disk entry opens the list grouped by device.
|
||||
# Own top-level menu for server hardware; the disk entry opens the list grouped by device.
|
||||
menu = PluginMenu(
|
||||
label="Datenträger",
|
||||
icon_class="mdi mdi-harddisk",
|
||||
label="Hardware",
|
||||
icon_class="mdi mdi-server",
|
||||
groups=(
|
||||
(
|
||||
"Datenträger",
|
||||
@@ -58,5 +58,42 @@ menu = PluginMenu(
|
||||
),
|
||||
),
|
||||
),
|
||||
(
|
||||
"CPU & RAM",
|
||||
(
|
||||
PluginMenuItem(
|
||||
link="plugins:netbox_utilities:devicehardware_list",
|
||||
link_text="CPU & RAM",
|
||||
permissions=("netbox_utilities.view_devicehardware",),
|
||||
buttons=(
|
||||
PluginMenuButton(
|
||||
link="plugins:netbox_utilities:devicehardware_add",
|
||||
title="Hinzufügen",
|
||||
icon_class="mdi mdi-plus-thick",
|
||||
permissions=("netbox_utilities.add_devicehardware",),
|
||||
),
|
||||
PluginMenuButton(
|
||||
link="plugins:netbox_utilities:devicehardware_bulk_import",
|
||||
title="Importieren",
|
||||
icon_class="mdi mdi-upload",
|
||||
permissions=("netbox_utilities.add_devicehardware",),
|
||||
),
|
||||
),
|
||||
),
|
||||
PluginMenuItem(
|
||||
link="plugins:netbox_utilities:cpumodel_list",
|
||||
link_text="CPU-Modelle",
|
||||
permissions=("netbox_utilities.view_cpumodel",),
|
||||
buttons=(
|
||||
PluginMenuButton(
|
||||
link="plugins:netbox_utilities:cpumodel_add",
|
||||
title="Hinzufügen",
|
||||
icon_class="mdi mdi-plus-thick",
|
||||
permissions=("netbox_utilities.add_cpumodel",),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -15,6 +15,10 @@ def connection_vlans_enabled():
|
||||
return bool(get_plugin_config("netbox_utilities", "connection_vlans_enabled"))
|
||||
|
||||
|
||||
def hardware_enabled():
|
||||
return bool(get_plugin_config("netbox_utilities", "hardware_enabled"))
|
||||
|
||||
|
||||
def offline_svg_export_enabled():
|
||||
return bool(get_plugin_config("netbox_utilities", "offline_svg_export_enabled"))
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from netbox.search import SearchIndex
|
||||
|
||||
from .models import Disk, RAIDGroup
|
||||
from .models import CPUModel, Disk, RAIDGroup
|
||||
|
||||
|
||||
class DiskIndex(SearchIndex):
|
||||
@@ -25,4 +25,15 @@ class RAIDGroupIndex(SearchIndex):
|
||||
display_attrs = ("device", "level")
|
||||
|
||||
|
||||
indexes = [DiskIndex, RAIDGroupIndex]
|
||||
class CPUModelIndex(SearchIndex):
|
||||
model = CPUModel
|
||||
fields = (
|
||||
("name", 100),
|
||||
("family", 300),
|
||||
("socket", 500),
|
||||
("description", 500),
|
||||
)
|
||||
display_attrs = ("manufacturer", "cores", "threads", "base_clock_ghz")
|
||||
|
||||
|
||||
indexes = [DiskIndex, RAIDGroupIndex, CPUModelIndex]
|
||||
@@ -21,6 +21,7 @@ from .navigation_helpers import (
|
||||
)
|
||||
from .runtime import (
|
||||
connection_vlans_enabled,
|
||||
hardware_enabled,
|
||||
navigation_customization_enabled,
|
||||
offline_svg_export_enabled,
|
||||
tenant_filter_enabled,
|
||||
@@ -110,6 +111,9 @@ class DeviceUtilitiesContent(PluginTemplateExtension):
|
||||
return self.render("netbox_utilities/device_bulk_module_button.html")
|
||||
|
||||
def right_page(self):
|
||||
return self._hardware_panel() + self._rack_width_panel()
|
||||
|
||||
def _rack_width_panel(self):
|
||||
placement = DeviceRackPlacement.objects.filter(device=self.context["object"]).first()
|
||||
if placement is None:
|
||||
return ""
|
||||
@@ -121,6 +125,47 @@ class DeviceUtilitiesContent(PluginTemplateExtension):
|
||||
},
|
||||
)
|
||||
|
||||
def _hardware_panel(self):
|
||||
request, device = self.context["request"], self.context["object"]
|
||||
if not hardware_enabled() or not request.user.has_perm("netbox_utilities.view_devicehardware"):
|
||||
return ""
|
||||
from . import hardware
|
||||
from .hardware_views import device_hardware_context
|
||||
|
||||
context = device_hardware_context(request, device)
|
||||
if context["record"] is None and not hardware.supports_hardware(device):
|
||||
return ""
|
||||
return self.render("netbox_utilities/device_hardware_panel.html", context)
|
||||
|
||||
|
||||
class ClusterHardwareContent(PluginTemplateExtension):
|
||||
models = ["virtualization.cluster"]
|
||||
|
||||
def full_width_page(self):
|
||||
request = self.context["request"]
|
||||
if not hardware_enabled() or not request.user.has_perm("netbox_utilities.view_devicehardware"):
|
||||
return ""
|
||||
from .hardware_views import cluster_capacity_context
|
||||
|
||||
return self.render(
|
||||
"netbox_utilities/cluster_capacity_panel.html", cluster_capacity_context(request, self.context["object"])
|
||||
)
|
||||
|
||||
|
||||
class VirtualMachineHardwareContent(PluginTemplateExtension):
|
||||
models = ["virtualization.virtualmachine"]
|
||||
|
||||
def right_page(self):
|
||||
request = self.context["request"]
|
||||
if not hardware_enabled() or not request.user.has_perm("netbox_utilities.view_devicehardware"):
|
||||
return ""
|
||||
from .hardware_views import vm_host_context
|
||||
|
||||
vm = self.context["object"]
|
||||
if vm.device_id is None and vm.cluster_id is None:
|
||||
return ""
|
||||
return self.render("netbox_utilities/vm_host_panel.html", vm_host_context(request, vm))
|
||||
|
||||
|
||||
class ConnectionVLANContent(PluginTemplateExtension):
|
||||
models = ["dcim.cable", "wireless.wirelesslink"]
|
||||
@@ -174,4 +219,6 @@ template_extensions = [
|
||||
DeviceUtilitiesContent,
|
||||
ConnectionVLANContent,
|
||||
RackUtilitiesContent,
|
||||
ClusterHardwareContent,
|
||||
VirtualMachineHardwareContent,
|
||||
]
|
||||
@@ -0,0 +1,48 @@
|
||||
<div class="card">
|
||||
<h2 class="card-header d-flex align-items-center">
|
||||
<span class="me-auto"><i class="mdi mdi-chip me-1" aria-hidden="true"></i>Kapazität (CPU & RAM)</span>
|
||||
<a href="{{ hardware_list_url }}" class="btn btn-sm btn-outline-secondary">Hardware-Liste</a>
|
||||
</h2>
|
||||
{% if not rows %}
|
||||
<div class="card-body text-muted">Dem Cluster sind keine Hosts (Geräte) zugeordnet.</div>
|
||||
{% else %}
|
||||
<div class="row g-0">
|
||||
<div class="col-12 col-xl-5 border-end">
|
||||
{% include 'netbox_utilities/inc/hardware_capacity.html' %}
|
||||
</div>
|
||||
<div class="col-12 col-xl-7">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-sm align-middle mb-0">
|
||||
<thead>
|
||||
<tr><th>Host</th><th>CPU</th><th>Kerne / Threads</th><th>RAM</th><th>VMs</th><th>vCPU : Kern</th><th>RAM belegt</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
<td><a href="{{ row.device.get_absolute_url }}">{{ row.device }}</a></td>
|
||||
<td class="small">
|
||||
{% if row.record and row.record.cpu %}{{ row.record.cpu_display }}
|
||||
{% elif can_add %}<a href="{% url 'plugins:netbox_utilities:devicehardware_add' %}?device={{ row.device.pk }}&return_url={{ request.path|urlencode }}" class="text-warning">erfassen</a>
|
||||
{% else %}<span class="text-warning">fehlt</span>{% endif %}
|
||||
</td>
|
||||
<td>{% if row.host.cores %}{{ row.host.cores }} / {{ row.host.threads }}{% else %}—{% endif %}</td>
|
||||
<td>{{ row.memory }}</td>
|
||||
<td>{{ row.host.vm_count }} <span class="text-muted small">({{ row.host.vcpus|floatformat:"-1" }} vCPU, {{ row.vm_memory }})</span></td>
|
||||
<td>{{ row.vcpu_per_core }}</td>
|
||||
<td>
|
||||
{% if row.memory_percent is not None %}
|
||||
<span class="badge {% if row.memory_percent > 100 %}text-bg-danger{% elif row.memory_percent > 85 %}text-bg-warning{% else %}text-bg-success{% endif %}">{{ row.memory_percent }} %</span>
|
||||
{% else %}—{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">
|
||||
Gezählt werden alle VMs außer „Offline“ und „Außer Betrieb“. VMs ohne festen Host zählen nur zur Cluster-Summe.
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
{% extends 'generic/object.html' %}
|
||||
{% load helpers %}
|
||||
{% load render_table from django_tables2 %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row mb-3">
|
||||
<div class="col col-12 col-xl-6">
|
||||
<div class="card">
|
||||
<h2 class="card-header">CPU-Modell</h2>
|
||||
<table class="table table-hover attr-table">
|
||||
<tr><th scope="row">Hersteller</th><td>{{ object.get_manufacturer_display }}</td></tr>
|
||||
<tr><th scope="row">Modell</th><td>{{ object.name }}</td></tr>
|
||||
<tr><th scope="row">Familie</th><td>{{ object.family|placeholder }}</td></tr>
|
||||
<tr><th scope="row">Sockel</th><td>{{ object.socket|placeholder }}</td></tr>
|
||||
<tr><th scope="row">Erscheinungsjahr</th><td>{{ object.launch_year|placeholder }}</td></tr>
|
||||
<tr><th scope="row">Max. Sockel</th><td>{{ object.max_sockets }}</td></tr>
|
||||
<tr><th scope="row">Beschreibung</th><td>{{ object.description|placeholder }}</td></tr>
|
||||
<tr>
|
||||
<th scope="row">Herkunft</th>
|
||||
<td>
|
||||
{% if object.builtin %}Katalog{% if object.customized %} <span class="badge text-bg-warning">angepasst</span>{% endif %}
|
||||
{% else %}Selbst angelegt{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% include 'inc/panels/tags.html' %}
|
||||
{% include 'inc/panels/custom_fields.html' %}
|
||||
</div>
|
||||
<div class="col col-12 col-xl-6">
|
||||
<div class="card">
|
||||
<h2 class="card-header">Leistung</h2>
|
||||
<table class="table table-hover attr-table">
|
||||
<tr><th scope="row">Kerne</th><td>{{ object.cores }}</td></tr>
|
||||
<tr><th scope="row">Threads</th><td>{{ object.threads }}</td></tr>
|
||||
<tr><th scope="row">Takt (Basis / Turbo)</th><td>{{ object.clock_display }}</td></tr>
|
||||
<tr><th scope="row">TDP</th><td>{% if object.tdp_watts %}{{ object.tdp_watts }} W{% else %}{{ ""|placeholder }}{% endif %}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2 class="card-header">Geräte mit diesem Modell <span class="badge text-bg-secondary">{{ device_count }}</span></h2>
|
||||
<div class="table-responsive">{% render_table devices_table 'inc/table.html' %}</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,24 @@
|
||||
<div class="card">
|
||||
<h2 class="card-header d-flex align-items-center">
|
||||
<span class="me-auto"><i class="mdi mdi-chip me-1" aria-hidden="true"></i>CPU & RAM</span>
|
||||
{% if record and can_change %}
|
||||
<a href="{% url 'plugins:netbox_utilities:devicehardware_edit' pk=record.pk %}?return_url={{ request.path|urlencode }}" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="mdi mdi-pencil" aria-hidden="true"></i> Bearbeiten
|
||||
</a>
|
||||
{% elif not record and can_add %}
|
||||
<a href="{{ add_url }}" class="btn btn-sm btn-primary"><i class="mdi mdi-plus-thick" aria-hidden="true"></i> Erfassen</a>
|
||||
{% endif %}
|
||||
</h2>
|
||||
{% if record %}
|
||||
{% include 'netbox_utilities/inc/hardware_record.html' %}
|
||||
{% else %}
|
||||
<div class="card-body text-muted">Noch keine CPU und kein RAM erfasst.</div>
|
||||
{% endif %}
|
||||
{% if capacity %}
|
||||
<h3 class="card-header border-top h5 d-flex align-items-center">
|
||||
<span class="me-auto">Virtualisierung</span>
|
||||
<a href="{{ vm_list_url }}" class="btn btn-sm btn-outline-secondary">VMs anzeigen</a>
|
||||
</h3>
|
||||
{% include 'netbox_utilities/inc/hardware_capacity.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
{% extends 'generic/object.html' %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row mb-3">
|
||||
<div class="col col-12 col-xl-6">
|
||||
<div class="card">
|
||||
<h2 class="card-header">Gerät</h2>
|
||||
<table class="table table-hover attr-table mb-0">
|
||||
<tr><th scope="row">Gerät</th><td>{{ object.device|linkify }}</td></tr>
|
||||
<tr><th scope="row">Cluster</th><td>{{ object.device.cluster|linkify|placeholder }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2 class="card-header">CPU & RAM</h2>
|
||||
{% include 'netbox_utilities/inc/hardware_record.html' with record=object %}
|
||||
</div>
|
||||
{% include 'inc/panels/tags.html' %}
|
||||
{% include 'inc/panels/custom_fields.html' %}
|
||||
{% include 'inc/panels/comments.html' %}
|
||||
</div>
|
||||
<div class="col col-12 col-xl-6">
|
||||
{% if capacity %}
|
||||
<div class="card">
|
||||
<h2 class="card-header">Virtualisierung</h2>
|
||||
{% include 'netbox_utilities/inc/hardware_capacity.html' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,44 @@
|
||||
{# Capacity of one host or a whole cluster versus its VMs; expects the context of hardware_views.capacity_context. #}
|
||||
{% for level, text in capacity_warnings %}
|
||||
<div class="alert alert-{{ level }} py-2 mb-2 small"><i class="mdi mdi-alert" aria-hidden="true"></i> {{ text }}</div>
|
||||
{% endfor %}
|
||||
<table class="table table-hover attr-table mb-0">
|
||||
<tr>
|
||||
<th scope="row">Physisch</th>
|
||||
<td>
|
||||
{% if capacity.cores %}{{ capacity.cores }} Kerne / {{ capacity.threads }} Threads{% else %}<span class="text-muted">—</span>{% endif %}
|
||||
· {{ memory }} RAM
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">VMs</th>
|
||||
<td>
|
||||
{{ capacity.vm_count }} VM{{ capacity.vm_count|pluralize:",s" }} · {{ capacity.vcpus|floatformat:"-1" }} vCPUs · {{ vm_memory }} RAM
|
||||
{% if capacity.unplaced_vm_count %}<div class="small text-muted">davon {{ capacity.unplaced_vm_count }} ohne festen Host</div>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">vCPU : Kern</th>
|
||||
<td>{{ vcpu_per_core }} <span class="text-muted small">({{ vcpu_per_thread }} je Thread)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">RAM zugewiesen</th>
|
||||
<td>
|
||||
{% if capacity.memory_percent is not None %}
|
||||
<div class="progress" role="progressbar" aria-valuenow="{{ capacity.memory_percent }}" aria-valuemin="0" aria-valuemax="100" style="height: 1.1rem">
|
||||
<div class="progress-bar {% if capacity.memory_percent > 100 %}bg-danger{% elif capacity.memory_percent > 85 %}bg-warning{% else %}bg-success{% endif %}"
|
||||
style="width: {% if capacity.memory_percent > 100 %}100{% else %}{{ capacity.memory_percent }}{% endif %}%">{{ capacity.memory_percent }} %</div>
|
||||
</div>
|
||||
{% else %}<span class="text-muted">—</span>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if capacity.failover_memory_gb is not None %}
|
||||
<tr>
|
||||
<th scope="row">RAM bei Host-Ausfall</th>
|
||||
<td>
|
||||
{{ failover_memory }}
|
||||
{% if capacity.failover_ok %}<span class="badge text-bg-success">N+1 OK</span>{% else %}<span class="badge text-bg-warning">N+1 nicht erfüllt</span>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
@@ -0,0 +1,23 @@
|
||||
{# CPU and RAM rows of one DeviceHardware record. #}
|
||||
<table class="table table-hover attr-table mb-0">
|
||||
<tr>
|
||||
<th scope="row">CPU</th>
|
||||
<td>
|
||||
{% if record.cpu %}
|
||||
{% if record.cpu_count > 1 %}{{ record.cpu_count }} × {% endif %}<a href="{{ record.cpu.get_absolute_url }}">{{ record.cpu }}</a>
|
||||
<div class="small text-muted">{{ record.cpu.summary }}{% if record.cpu.socket %} · {{ record.cpu.socket }}{% endif %}</div>
|
||||
{% else %}<span class="text-muted">—</span>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if record.cpu %}
|
||||
<tr><th scope="row">Gesamt</th><td>{{ record.total_cores }} Kerne / {{ record.total_threads }} Threads</td></tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<th scope="row">RAM</th>
|
||||
<td>
|
||||
{{ record.memory_display }}
|
||||
{% if record.memory_detail %}<div class="small text-muted">{{ record.memory_detail }}</div>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if record.description %}<tr><th scope="row">Beschreibung</th><td>{{ record.description }}</td></tr>{% endif %}
|
||||
</table>
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="card">
|
||||
<h2 class="card-header"><i class="mdi mdi-chip me-1" aria-hidden="true"></i>Host-Hardware</h2>
|
||||
{% if not records %}
|
||||
<div class="card-body text-muted">
|
||||
{% if device %}Für den Host <a href="{{ device.get_absolute_url }}">{{ device }}</a> ist noch keine CPU erfasst.
|
||||
{% else %}Die VM hat keinen Host und ihr Cluster keine Hosts mit erfasster CPU.{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<table class="table table-hover attr-table mb-0">
|
||||
<tr>
|
||||
<th scope="row">{% if device %}Host{% else %}Cluster-Hosts{% endif %}</th>
|
||||
<td>
|
||||
{% for record in records %}<a href="{{ record.device.get_absolute_url }}">{{ record.device }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr><th scope="row">CPU</th><td>{{ cpus|join:", "|default:"—" }}</td></tr>
|
||||
{% if smallest_threads %}
|
||||
<tr>
|
||||
<th scope="row">vCPUs</th>
|
||||
<td>
|
||||
{{ vcpus|floatformat:"-1"|default:"—" }} von {{ smallest_threads }} Threads{% if not device %} (kleinster Host){% endif %}
|
||||
{% if vcpu_share is not None %}<span class="text-muted small">· {{ vcpu_share }} %</span>{% endif %}
|
||||
{% if oversized %}<div class="text-danger small">Die VM hat mehr vCPUs, als der Host Threads hat.</div>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,118 @@
|
||||
from collections import Counter
|
||||
from types import SimpleNamespace
|
||||
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
from netbox_utilities import cpu_catalog, hardware
|
||||
|
||||
|
||||
class CatalogTest(SimpleTestCase):
|
||||
entries = list(cpu_catalog.entries())
|
||||
|
||||
def test_covers_intel_and_amd_since_2012(self):
|
||||
self.assertGreater(len(self.entries), 600)
|
||||
self.assertEqual({entry["manufacturer"] for entry in self.entries}, {"intel", "amd"})
|
||||
self.assertEqual(min(entry["launch_year"] for entry in self.entries), 2012)
|
||||
|
||||
def test_names_are_unique(self):
|
||||
names = Counter((entry["manufacturer"], entry["name"].casefold()) for entry in self.entries)
|
||||
self.assertEqual([name for name, count in names.items() if count > 1], [])
|
||||
|
||||
def test_values_are_plausible(self):
|
||||
for entry in self.entries:
|
||||
with self.subTest(cpu=entry["name"]):
|
||||
self.assertIn(entry["threads"], (entry["cores"], entry["cores"] * 2))
|
||||
self.assertTrue(1 <= entry["base_clock_ghz"] <= 5)
|
||||
if entry["boost_clock_ghz"]:
|
||||
self.assertGreaterEqual(entry["boost_clock_ghz"], entry["base_clock_ghz"])
|
||||
self.assertIn(entry["max_sockets"], (1, 2, 4, 8))
|
||||
|
||||
def test_verified_samples(self):
|
||||
by_name = {entry["name"]: entry for entry in self.entries}
|
||||
samples = {
|
||||
"Xeon Gold 6338": (32, 64, 2.0, 3.2),
|
||||
"Xeon E5-2690 v4": (14, 28, 2.6, 3.5),
|
||||
"Xeon Platinum 8480+": (56, 112, 2.0, 3.8),
|
||||
"Xeon 6740E": (96, 96, 2.4, 3.2),
|
||||
"EPYC 7543": (32, 64, 2.8, 3.7),
|
||||
"EPYC 9655": (96, 192, 2.5, 4.5),
|
||||
"Opteron 6380": (16, 16, 2.5, 3.4),
|
||||
}
|
||||
for name, (cores, threads, base, boost) in samples.items():
|
||||
with self.subTest(cpu=name):
|
||||
entry = by_name[name]
|
||||
self.assertEqual(
|
||||
(entry["cores"], entry["threads"], entry["base_clock_ghz"], entry["boost_clock_ghz"]),
|
||||
(cores, threads, base, boost),
|
||||
)
|
||||
|
||||
def test_epyc_p_models_are_single_socket(self):
|
||||
by_name = {entry["name"]: entry for entry in self.entries}
|
||||
self.assertEqual(by_name["EPYC 7402P"]["max_sockets"], 1)
|
||||
self.assertEqual(by_name["EPYC 4484PX"]["max_sockets"], 1)
|
||||
self.assertEqual(by_name["EPYC 7402"]["max_sockets"], 2)
|
||||
|
||||
|
||||
class FormatTest(SimpleTestCase):
|
||||
def test_memory(self):
|
||||
self.assertEqual(hardware.format_memory(768), "768 GB")
|
||||
self.assertEqual(hardware.format_memory(1536), "1,5 TB")
|
||||
self.assertEqual(hardware.format_memory(12.5), "12,5 GB")
|
||||
self.assertEqual(hardware.format_memory(None), "—")
|
||||
|
||||
def test_clock_and_ratio(self):
|
||||
self.assertEqual(hardware.format_clock(2.0), "2 GHz")
|
||||
self.assertEqual(hardware.format_clock(3.35), "3,35 GHz")
|
||||
self.assertEqual(hardware.format_ratio(3.25), "3,2 : 1")
|
||||
self.assertEqual(hardware.format_ratio(None), "—")
|
||||
|
||||
|
||||
class SupportTest(SimpleTestCase):
|
||||
def test_servers_and_cluster_hosts(self):
|
||||
server = SimpleNamespace(cluster_id=None, role=SimpleNamespace(name="server"))
|
||||
host = SimpleNamespace(cluster_id=3, role=SimpleNamespace(name="Hypervisor"))
|
||||
switch = SimpleNamespace(cluster_id=None, role=SimpleNamespace(name="Switch"))
|
||||
self.assertTrue(hardware.supports_hardware(server, ["Server"]))
|
||||
self.assertTrue(hardware.supports_hardware(host, ["Server"]))
|
||||
self.assertFalse(hardware.supports_hardware(switch, ["Server"]))
|
||||
|
||||
|
||||
class CapacityTest(SimpleTestCase):
|
||||
def hosts(self):
|
||||
return [
|
||||
hardware.Host("esx01", cores=32, threads=64, memory_gb=512),
|
||||
hardware.Host("esx02", cores=32, threads=64, memory_gb=512),
|
||||
hardware.Host("esx03", cores=32, threads=64, memory_gb=768),
|
||||
]
|
||||
|
||||
def test_totals_ratio_and_failover(self):
|
||||
vms = [
|
||||
("esx01", 8, 64 * 1024, "active"),
|
||||
("esx02", 16, 128 * 1024, "active"),
|
||||
(None, 4, 32 * 1024, "planned"),
|
||||
("esx03", 64, 512 * 1024, "offline"),
|
||||
]
|
||||
capacity = hardware.build_capacity(self.hosts(), vms)
|
||||
self.assertEqual((capacity.cores, capacity.threads, capacity.memory_gb), (96, 192, 1792))
|
||||
self.assertEqual((capacity.vm_count, capacity.vcpus, capacity.vm_memory_gb), (3, 28, 224))
|
||||
self.assertEqual(capacity.unplaced_vm_count, 1)
|
||||
self.assertAlmostEqual(capacity.vcpu_per_core, 28 / 96)
|
||||
self.assertEqual(capacity.memory_percent, 12)
|
||||
self.assertEqual(capacity.failover_memory_gb, 1024)
|
||||
self.assertTrue(capacity.failover_ok)
|
||||
self.assertEqual(capacity.warnings(), [])
|
||||
self.assertEqual(capacity.hosts[0].vcpus, 8)
|
||||
|
||||
def test_warnings(self):
|
||||
hosts = [*self.hosts(), hardware.Host("esx04")]
|
||||
vms = [("esx01", 600, 1200 * 1024, "active")]
|
||||
levels = [level for level, _ in hardware.build_capacity(hosts, vms).warnings(ratio_warning=4)]
|
||||
self.assertEqual(levels, ["warning", "warning", "warning"])
|
||||
vms = [("esx01", 8, 2000 * 1024, "active")]
|
||||
texts = [text for _, text in hardware.build_capacity(self.hosts(), vms).warnings()]
|
||||
self.assertIn("Die VMs haben mehr RAM zugewiesen, als die Hosts haben.", texts)
|
||||
|
||||
def test_single_host_has_no_failover(self):
|
||||
capacity = hardware.build_capacity(self.hosts()[:1], [])
|
||||
self.assertIsNone(capacity.failover_memory_gb)
|
||||
self.assertEqual(capacity.vcpu_per_core, 0)
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.urls import include, path
|
||||
from utilities.urls import get_model_urls
|
||||
|
||||
from . import disk_views, views
|
||||
from . import disk_views, hardware_views, views # noqa: F401 - hardware_views registers its model views
|
||||
|
||||
app_name = "netbox_utilities"
|
||||
|
||||
@@ -27,6 +27,11 @@ urlpatterns = [
|
||||
path("raid-groups/<int:pk>/", include(get_model_urls("netbox_utilities", "raidgroup"))),
|
||||
path("disk-templates/", include(get_model_urls("netbox_utilities", "diskbaytemplate", detail=False))),
|
||||
path("disk-templates/<int:pk>/", include(get_model_urls("netbox_utilities", "diskbaytemplate"))),
|
||||
# CPU & RAM
|
||||
path("cpu-models/", include(get_model_urls("netbox_utilities", "cpumodel", detail=False))),
|
||||
path("cpu-models/<int:pk>/", include(get_model_urls("netbox_utilities", "cpumodel"))),
|
||||
path("hardware/", include(get_model_urls("netbox_utilities", "devicehardware", detail=False))),
|
||||
path("hardware/<int:pk>/", include(get_model_urls("netbox_utilities", "devicehardware"))),
|
||||
path("devices/<int:pk>/disks/setup/", disk_views.DeviceDiskSetupView.as_view(), name="device_disk_setup"),
|
||||
path("devices/<int:pk>/disks/fill/", disk_views.DeviceDiskBulkFillView.as_view(), name="device_disk_fill"),
|
||||
path("devices/<int:pk>/disks/move/", disk_views.DeviceDiskMoveView.as_view(), name="device_disk_move"),
|
||||
|
||||
Reference in new issue
Block a user