bb-Ricardo / netbox-sync

Sync objects from VMware or redfish sources to NetBox
MIT License
290 stars 65 forks source link

Add support for Virtual disks introduced in Netbox 3.7 #364

Closed smasharov closed 9 months ago

smasharov commented 9 months ago

New version of Netbox supports several virtual disks per VM

bb-Ricardo commented 9 months ago

Hi, yes I have seen this feature in the announcement. Would like to support this as well. But I'm using a helm chart for my test environment and currently stuck with 3.5.9 cause the author does not update it. Let's see If I get it to work

bb-Ricardo commented 9 months ago

great, now having 3.7.1 up and running.

Will look into supporting the new virtual disk components

bb-Ricardo commented 9 months ago

Hi @smasharov, @patschi, @vacumet,

I just added the support to the latest development branch. Can you please check it out and see if it works for you?

Thank you

patschi commented 9 months ago

Thank you so much, Ricardo!

It seems to work fine in my environment:

image image

smasharov commented 9 months ago

It works, but if the disk size is less than 1Gb it creates it with zero size. Maybe it is worth to set them as the minimal 1Gb in such cases? I think the size should be rounded up all the times.

bb-Ricardo commented 9 months ago

Hi, great that it works, Valid point regarding the size. Will try to set it to 1 GB and also add the actual size to the description

patschi commented 9 months ago

I just had two thoughts:

  1. I don't like the wording Independent_persistent, it looks a bit off. Maybe Independent-Persistent or so.
  2. It would be nice to have the assigned Storage Policy of the individual disk added to the description.
bb-Ricardo commented 9 months ago

Do you have an example of independent persistant?

patschi commented 9 months ago

Here: image

Just looks a bit off, IMHO.

bb-Ricardo commented 9 months ago

Ahh, thank you. This comes straight from the vCenter API. I could change it to look a bit nicer. Thanks for the hint.

bb-Ricardo commented 9 months ago

Hi,

just pushed another commit with the improved description.

I tried to find Storage Policy of the virtual disk but it seems you need an additional connection to the 'VMware Storage Policy Server' to query this information. I'm currently using vcsim for my test environment and this seems not supported.

patschi commented 9 months ago

I see. Okay. I just saw the Virtual Disk object in netbox do also have tags support. It would be a general awesome feature if Storage Policies might be applied to disk objects with the name of the storage policy. That would be great to sort/filter. (e.g. any VMs running on vSAN using RAID-1, etc)

But that's probably opening another can of worms in terms of integration. I can test scripts or whatsoever on my vCenter, if that helps.

bb-Ricardo commented 9 months ago

Would be great if we could close this issue and open a separate one for the storage policy.