Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions module/netbox/object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,7 @@ class NBVM(NetBoxObject):
def __init__(self, *args, **kwargs):
self.data_model = {
"name": 64,
"serial": 50,
"status": ["offline", "active", "planned", "staged", "failed", "decommissioning"],
"cluster": NBCluster,
"role": NBDeviceRole,
Expand Down
4 changes: 4 additions & 0 deletions module/sources/vmware/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,10 @@ def add_virtual_machine(self, obj):
if isinstance(comp, vim.vm.device.VirtualDisk)
]) / 1024 / 1024)

# Add adaptation for the new 'serial' field in NetBox 4.1.0 VM model
if version.parse(self.inventory.netbox_api_version) >= version.parse("4.1.0"):
vm_data["serial"] = vm_uuid

if platform is not None:
vm_data["platform"] = {"name": platform}
if annotation is not None:
Expand Down
Loading