bl4ko / netbox-ssot

Microservice that synces objects from multiple sources into netbox and makes it automatic SSOT.
MIT License
22 stars 4 forks source link

vmware serialnumber input sanitation #143

Open TaLoN1x opened 1 month ago

TaLoN1x commented 1 month ago

Currently virtual appliances are being created as devices, in fact there is no physical devices and thing runs on a VM instead of physical device. This creates two problems:

ERROR (vc-test): failed to add vmware host virtual-vsan-host.local with error: unexpected status code: 400: {"serial":["Ensure this field has no more than 50 characters."]}

I'd suggest there are 2 things:

  1. Ignore malformed serial numbers (if sn is longer than 50 characters, that in real world rarely happens, ignore it in case device reports garbage)
  2. Investigate and remodel virtual appliances as part of compute cluster. (affects all currently supported hypervisors)

I will think of the second point for some time in detils

bl4ko commented 1 month ago

Yeah I aggree with this issue, but the problem is how netbox organizes objects. If you don't map virtual appliances that represent hosts to devices, then you lose useful netbox relation:

TaLoN1x commented 1 month ago

Virtual appliances are mostly Firewalls, Virtual Storage Devices, Virtual Switches, etc. This would not affect this functionality, in some cases would even enable the use of abstraction layer for capacity planning.

bl4ko commented 1 month ago

But you only have virtual machines object in netbox to represent virtual appliances. So would it make sense to create firewalls, virtual switches, etc. as virtual machines?

TaLoN1x commented 1 month ago

yes, but currently vsans, vswitches in vmware are being created as devices.

bl4ko commented 1 month ago

Would you be able to help me with this issue, e.g. provide some logic of how to implement this, and which devices to map to which virtualization appliances?

TaLoN1x commented 1 month ago

yes, I will dive deeper in this in a few days.