netbox-sync icon indicating copy to clipboard operation
netbox-sync copied to clipboard

Installed via pip3.8 in venv

Open andrewm659 opened this issue 3 years ago • 13 comments

I'm installing netbox-sync via venv in /opt/dcim/netbox (symlinked to the correct folder) but I can't find it after installing via pip3.8.

andrewm659 avatar Sep 20 '22 14:09 andrewm659

Hi,

This is a bit short to make any assumptions. Can you paste all comands you used to install netbox sync and also how you start the script and what the output of this attempt looks like?

Thank you.

bb-Ricardo avatar Sep 20 '22 14:09 bb-Ricardo

Sure!

andrewm659 avatar Sep 20 '22 14:09 andrewm659

sudo su - netbox source /opt/dcim/netbox/venv/bin/activate pip3.8 install netbox-sync pip3.8 install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git

After running this I can't find the settings.ini or the netbox_sync.py.

I'm runningthis on AlmaLinux 8.6 btw.

andrewm659 avatar Sep 20 '22 14:09 andrewm659

Hi,

As far as I know, netbox-sync is not available via pip.

There are installation instructions included for RHEL 8 based systems in the README file.

Can you please try this and see if it works?

Thank you.

bb-Ricardo avatar Sep 20 '22 14:09 bb-Ricardo

I'll take a look and report back if I have issues. Thank you!

andrewm659 avatar Sep 20 '22 14:09 andrewm659

ok got it working manually. thanks! Still trying to figure out redfish though.

andrewm659 avatar Sep 20 '22 15:09 andrewm659

Got it working but getting the following error: 2022-09-23 14:25:57,416 - DEBUG: Processing 1 returned power port 2022-09-23 14:25:57,417 - INFO: Finished querying necessary objects from NetBox 2022-09-23 14:25:57,417 - DEBUG: Start resolving relations 2022-09-23 14:25:57,433 - DEBUG: Finished resolving relations 2022-09-23 14:25:57,433 - WARNING: Starting purge now. All objects with the tag 'NetBox-synced' will be deleted!!! 2022-09-23 14:25:57,433 - DEBUG: Iteration 1 trying to deleted all the objects. 2022-09-23 14:25:57,434 - DEBUG: Iteration 2 trying to deleted all the objects. 2022-09-23 14:25:57,435 - DEBUG: Iteration 3 trying to deleted all the objects. 2022-09-23 14:25:57,435 - DEBUG: Iteration 4 trying to deleted all the objects. 2022-09-23 14:25:57,436 - DEBUG: Iteration 5 trying to deleted all the objects. 2022-09-23 14:25:57,437 - DEBUG: Iteration 6 trying to deleted all the objects. 2022-09-23 14:25:57,437 - DEBUG: Iteration 7 trying to deleted all the objects. 2022-09-23 14:25:57,438 - DEBUG: Iteration 8 trying to deleted all the objects. 2022-09-23 14:25:57,439 - DEBUG: Iteration 9 trying to deleted all the objects. 2022-09-23 14:25:57,439 - DEBUG: Iteration 10 trying to deleted all the objects. 2022-09-23 14:25:57,440 - WARNING: Unfortunately we were not able to delete all objects. Sorry [netbox@dcim001 netbox-sync]$

andrewm659 avatar Sep 23 '22 19:09 andrewm659

Hi,

you try to purge all objects created by netbox-sync? Can you try to use DEBUG2 log level to get more information?

bb-Ricardo avatar Sep 23 '22 19:09 bb-Ricardo

Yes I used the -p to purge it all and the output I provided was from DEBUG3.

andrewm659 avatar Sep 23 '22 20:09 andrewm659

Are there still objets left in NetBox which are "pruneable"? quite a lot are shared objects which netbox-sync won't delete, like cluster or sites.

You can check the object definition here: https://github.com/bb-Ricardo/netbox-sync/blob/main/module/netbox/object_classes.py#L1172 If prune = False then this object won't be deleted.

Currently only these object will be removed:

  • devices
  • VMs
  • interfaces
  • IP addresses
  • inventory item
  • power port

bb-Ricardo avatar Sep 23 '22 21:09 bb-Ricardo

Yes. There are plenty of objects to be pruned. Stuff I entered manually.

andrewm659 avatar Sep 26 '22 19:09 andrewm659

Hi,

I don't really understand. You created objects manually and the script is meant to prune them?

bb-Ricardo avatar Sep 27 '22 04:09 bb-Ricardo

I assumed that it would do that. If not, I will delete all the objects I created and let the script do it.

andrewm659 avatar Sep 27 '22 18:09 andrewm659

As mentioned the Script only would delete objects created or adopted by the script.

I might just completely remove this option.

bb-Ricardo avatar Oct 11 '22 21:10 bb-Ricardo