In this blog, we detail the powervc-resmgr command and subcommands that help you to easily manage your resources such as snapshots, groups, group snapshots, and resources associated with volumes.
Background
Fetching details and cleanup of resources such as groups, group snapshots, and volume snapshots in the transient status that is used to be a tedious task when creating instance snapshots, volumes, or virtual machine (VM) clones until PowerVC 2.1.0.
Overview
In PowerVC 2.1.0, we introduced the powervc-resmgr command that helps you to perform these tasks easily.
- Cleanup resources that are failed or stuck in an intermittent state.
- Display all the corresponding entities or resources that are associated with a resource.
- Reset the status of a given resource.
Prerequisites
To make sure only authorized PowerVC users access resources by using the powervc-resmgr command, you must update the required details in the /opt/ibm/powervc/powervcrc file and run commands from it.
Let us now look at the PowerVC resource manager commands in detail.
PowerVC resource manager subcommands
The powervc-resmgr command provides additional subcommands to manage resources in PowerVC.
· instance-snapshot. Manage instance snapshots and its associated resources.
· group. Manage groups and its associated resources.
· group-snapshot. Manage group snapshots and its associated resources.
· volume-resources. Manage the resources associated with volume.
1. powervc-resmgr instance-snapshot command
Run the powervc-resmgr instance-snapshot command to manage the instance snapshot and its associated resources.
Run the powervc-resmgr instance-snapshot display command to display the instance snapshots.
Run the powervc-resmgr instance-snapshot display -h command to show the associated help message.
Run the powervc-resmgr instance-snapshot cleanup -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/ddd90d1ff3134090a139209702cb29f5.png)
2. powervc-resmgr group command
Run the powervc-resmgr group command to manage groups and its associated resources.
![](https://dw1.s81c.com//IMWUC/MessageImages/628ca631c4444fc7bb73327de6d66759.png)
Run the powervc-resmgr group display -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/1674c172f5c642f9a530fa2fc7ed39dc.png)
Run the powervc-resmgr group display –group_id command to display volumes and associated resources of the group_id.
![](https://dw1.s81c.com//IMWUC/MessageImages/aef688afeb474fee9dea6b49c00d572a.png)
Run the powervc-resmgr group reset -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/69156a519f494962abd363e6e531d1b2.png)
Run the powervc-resmgr group cleanup -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/0d0b807a73cc48b8bfa9ff33f8c8bdca.png)
Run the powervc-resmgr group remove-vols-from-group -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/3f4835fac21e4b0093e0721588d0188a.png)
3. powervc-resmgr group-snapshot command
Run the powervc-resmgr group-snapshot command to manage group snapshots and its associated resources.
![](https://dw1.s81c.com//IMWUC/MessageImages/b69d5981d65a49bb8108d779b5e8301d.png)
Run the powervc-resmgr group-snapshot display -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/c8695de7de2a4e2cb95f4674d25f7d21.png)
Run the powervc-resmgr group-snapshot display --group_snapshot_id command to cleanup group snapshots and associated resources for the given group snapshot.
![](https://dw1.s81c.com//IMWUC/MessageImages/345fdfe385ba420c887119ac0fb869a8.png)
Run the powervc-resmgr group-snapshot reset -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/134acf67e66a452788404abbd140dc9a.png)
Run the powervc-resmgr group-snapshot cleanup -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/4025a6103c3d444d99fb9009e755736e.png)
4. powervc-resmgr volume-resources command
Run the powervc-resmgr volume-resources command to manage resources associated with volume. To get a view of all resources from the top volume level, you can use volume-resources to check if the volume has any group, group-snapshots or volume snapshots. Volume-resources displays information in a tabular format.
![](https://dw1.s81c.com//IMWUC/MessageImages/99f34915efed46108747d8c050bafc58.png)
Run the powervc-resmgr volume-resources display -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/30ce58596e2646169d7b6ace5011073f.png)
Run the powervc-resmgr volume-resources cleanup -h command to display the associated help message.
![](https://dw1.s81c.com//IMWUC/MessageImages/f6f7ab4743e347c2adf7541fe607d6d9.png)
Run the powervc-resmgr volume-resources cleanup command deletes all the associated resources including group, group-snapshots, and volume snapshots but not the volume. Hence, you need not perform individual resource cleanup.
![](https://dw1.s81c.com//IMWUC/MessageImages/eadd1cd61c154773ac95b0bd327ceeb6.png)
Example.
![](https://dw1.s81c.com//IMWUC/MessageImages/dc9d1fe9be394f79818cf99d17836e3c.png)
5. powervc-resmgr volume-delete command
The OpenStack cinder delete command does not allow users to delete the volume if it is in an in-use state, even if it does not have any associated VM to it. This is because there are some stale BDM attachment entries left behind due to some failed detach or VM delete operation.
The powervc-resmgr volume-delete command is a PowerVC custom volume-delete command that provides an additional capability to clean up the volumes if it is in-use but has no associated VM to it. The command checks for the instance if the volume is in-use, and accordingly deletes the stale volume attachment entries along with the volume cleanup. If the volume is stuck in some transient state, you can use the –force option to delete forcefully.
![](https://dw1.s81c.com//IMWUC/MessageImages/5d98e6f38cc4456f8e8b167c220f89cd.png)
Considerations
- No input validations are performed by using the powervc-resmgr command as all validations are done at the corresponding APIs that run in the backend. If you encounter any errors, you must check the log messages in the /var/log/cinder/resource_manager.log log file.
- When trying to cleanup volume snapshots by using the powervc-resmgr volume-resources cleanup command, and if volume is associated with any instance snapshot, you see a prompt to use the instance-snapshot cleanup command instead of the volume-resources cleanup command.
- When running the powervc-resmgr group-snapshot cleanup command, if any volume snapshots are stuck in a transient state, those volume snapshots are forcefully deleted during the group snapshot cleanup.
- With running the powervc-resmgr group cleanup command, volumes are removed from the group before deleting the group so that those volumes are intact.
Troubleshooting
· You can validate if the services are running by using the powervc-services cinder status command.
· You can check these log files if you encounter any errors.
- /var/log/cinder/resource_manager.log
- /var/log/cinder/api.log
- /var/log/cinder/volume-<<storage_host_id>>.log
If you have any questions, feel free to add your comments in the Comments section.
Keep watching our social outlets for more interesting information about PowerVC! Find and follow us on Facebook, LinkedIn, Twitter, and YouTube.
Blog authors
Rajni Kumari
Prashanth Kumar Reddy
Swapna Harriharan
Chhavi Agarwal