Highlighted
Vice Admiral Vice Admiral
Vice Admiral
969 views

(SA) Support Tip: How to delete a private Device Group owned by another user?

Sometimes a dynamic device group can cause a heavy load on the database during its recalculations.

If the recalculation takes more than 10 seconds there will be a warning printed in the twist server logs along with the device group id.

To get more information on this device group you can use the dgDump tool as follows:

/opt/opsware/support/bin/dgDump <device_group_id>

If this device group is private and it is owned by another user then it is not possible to delete it using the SA Java client.

However it can be deleted using the Twister web interface:

1. Open Twister in a browser window entering <Server_IP>:1032/twister as below:

https://<core-ip>:1032/twister

2. On the left side you’ll see packages, click com.opsware.device

3. Below that you can find Interfaces, click the DeviceGroupService, this will open a new window. Scroll down and search for the following method:

remove(DeviceGroupRef self)
Remove a device group.

Once you find it, click on “try it!”

If this prompts you a login screen, please enter your SA credentials. Then you will receive something like this:

DeviceGroupService.remove()
(self) DeviceGroupRef. name (type: java.lang.String)
id 0 (type: long)

Enter the id of the device group that needs to be deleted and click “Go”

This will delete it. 

To verify that it is deleted you may use the dgDump tool again.

Micro Focus Customer Support

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Labels (1)
10 Replies
Highlighted
Commodore Commodore
Commodore

I have all the perms possible and still don't have the perms to do this on my SA? seems that I would need PrivateDeviceGroup.write ,

 

So how did you make it work for you?

 

Pierre

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi Pierre,

Try with a Super Administrator

Mihai Lazar
Automate & Orchestrate Solution Architect

*If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
Highlighted
Commodore Commodore
Commodore

Thanks Mihai,

 

I'm already member of :

 Group NameDescription
User GroupOpsware System AdministratorsOpsware System Administration privileges
User GroupSuperusers

Complete access to all SA-managed objects and operations.

 

Any other idea?

 

Pierre

0 Likes
Highlighted
Commodore Commodore
Commodore

I'm also in the Super Administrators group.

 

Pierre

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

What SA version?

Mihai Lazar
Automate & Orchestrate Solution Architect

*If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
Highlighted
Commodore Commodore
Commodore

That would be 10.22

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

I don't think the Twist will let you remove private device groups belonging other users.
You would have to use the Spin to bypass the Twist's permission model.

spin.RoleClass.delete(<DG ID>, check_for_devices=0)

 

Highlighted
Commodore Commodore
Commodore

Bret, would you have a script example?

 

Thanks Pierre

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

I don't want to supply a script, which will become apparent why in a moment,  I will elaborate on what you need to do.

start python

# /opt/opsware/bin/python

Setup a spin context - I will assume you are on 10.2x or 10.60 with at least rollup 001 applied.   getContextByName was removed in 10.60 and then put back in a rollup.

>>> from coglib import spinwrapper
>>> from coglib import certmaster
>>> ctx = certmaster.getContextByName("spin","spin.srv","opsware-ca.crt")
>>> spin = spinwrapper.SpinWrapper(ctx=ctx)

Then that line I posted

>>>spin.RoleClass.delete(dg_id, check_for_devices=0)

*WARNING* if you give this call the wrong ID you will do great irreversible damage to your system.
The RoleClass is used for more than just DeviceGroups.  You have been warned.

I suggest you verify that you have the right object before you issue the delete call:

>>> spin.RoleClass.get(dg_id)

Eyeball that this is indeed the object you want removed.  Which is why I will not script this.  Script are easy to execute and screw your system in ways you never thought possible.

Brett

Highlighted
Commodore Commodore
Commodore

Perfectly understood. Thanks for the information and warnings Brett.

I'll re-read the doc on spin on 1004 before fooling around and cleaning users' "odd" private user groups.

Pierre

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.