Problem
Sometimes when trying to delete a resource handler you will run into the error
unhashable type : NSXScope
This article is going to go over how to get around this and be able to delete the resource handler from CMP.
Cause
When trying to delete a resource handler that was previously attached to an NSX instance this can happen.
Workaround or Solution
Overview
We have to assign the NSXEdge and NSXScope objects in the database a hash function, because one does not exist for them normally.
Open shell_plus
SSH into your CloudBolt CMP instance
Run this command:
/opt/cloudbolt/manage.py shell_plus
to open an interactive python shell
Add a hash function to the two NSX objects
Enter these commands:
NSXEdge.__hash__ = super.__hash__ NSXScope.__hash__ = super.__hash__
Try to delete the resource handler
You can do this one of two ways.
In shell_plus, grab the ResourceHandler object like this:
rh = ResourceHandler.objects.get(id=<rh_id>)
Make sure you replace
<rh_id>
with the id of the resource handler you want to delete, this can be found in the URL while on the resource handlers details page.
Then run this command:
rh.delete()
to delete the resource handlerYou can also just navigate back to the CloudBolt UI and use the “Delete” button on the Resource Handlers details page as well.
0 Comments