Is it possible to export and import RHEV-M users to another RHEV environment?
Environment
- Red Hat Enterprise Virtualization (RHEV) 3.5
Issue
It is needed to clone the users and groups from one RHEV environment to another in some cases.
Resolution
There is currently no automated way of exporting and importing the users from RHEV-M, but there is and RFE for this functionality:
The REST-API can be used to read the information about the users and groups from one RHEV-M and create them in another RHEV-M. In order to make this task easier the rhevm-shell can be utilised:
- List the users from a specific domain used in RHEV-M:
# rhevm-shell -E 'list users --show-all --query "directory=example.com"'
- List the groups used in RHEV-M:
# rhevm-shell -E 'list groups --show-all"'
- List the permissions for groups and wolres:
# rhevm-shell -E 'list permissions --show-all'
- Create a user in a specific domain:
add user --user_name ${USER_NAME} --domain-name ${DOMAIN_NAME}
- Create a group in a specific domain:
add group --name ${GROUP_NAME} --domain-name ${DOMAIN_NAME}
- Assign a permission for a specific role
# add permission --role-id ${ROLE_ID} --user-id ${USER_ID}
Keep in mind that both of the RHEV manages have to be connected to the same domain.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
