Appendix - rest-rdma Plugin
rest-rdma is a utility to send REST requests over IB to the UFM server. rest-rdma is distributed as a docker container that could serve as server and as client.
Deploy Plugin on UFM Appliance
Log into your UFM as admin.
Enter config mode. Run:
enable config terminal
NoteMake sure that UFM is running with
show ufm status
. If UFM is down then run withufm start
.Ensure that rest-rdma plugin is disabled with
show ufm plugin
commandPull the plugin container with
docker pull mellanox/ufm-plugin-rest-rdma:[version]
Run
ufm plugin rest-rdma add tag [version]
to enable the pluginCheck that plugin is up and running with
docker pull mellanox/ufm-plugin-rest-rdma:[version]
Deploy Plugin on Bare Metal Server
Verify that ufm is installed and running
Pull image from docker hub:
docker pull mellanox/ufm-plugin-rest-rdma:[version]
To load image run:
/opt/ufm/scripts/manage_ufm_plugins.py add -p rest-rdma
Deployment Client
To pull image from docker hub:
docker pull mellanox/ufm-plugin-rest-rdma:[version]
To start container as client (on any host in the same fabric as UFM server) run:
docker run -d --network=host --privileged --name=ufm-plugin-rest-rdma --rm -v /tmp/ibdiagnet:/tmp/ibdiagnet mellanox/ufm-plugin-rest-rdma:[version] client
To check that plugin is up and running run:
docker ps
Server
In server mode ufm_rdma.py
will started automatically and will be restarted if exit. If ufm_rdma.py server is not running – enter to the docker and run the following commands to start the server:
cd /opt/ufm/src/ufm-plugin-ufm-rest
./ufm_rdma.py -r server
Client
There are three options to run client:
From inside the docker, using custom script from the hosting server or using docker exec command from hosting server.
From inside the docker:
Enter to the docker using
docker exec -it ufm-plugin-rest-rdma bash
then
cd /opt/ufm/src/ufm-plugin-rest-rdma
Use
-h
help option to see available parameters./ufm_rdma.py -h
From hosting server run script located at
/opt/ufm/ufm-plugin-ufm-rest/ufm-rest-rdma_client.sh
inside dockerNotethat could be copied using command
cp <containerId>:/opt/ufm/ufm-plugin-ufm-rest/ufm-rest-rdma_client.sh /host/path/target
NoteExample:
./ufm-rest-rdma_client.sh -u admin -p password -t simple -a GET -w ufmRest/app/ufm_version
To see available options run:
./ufm-rest-rdma_client.sh -h
From hosting server using
docker exec
command.NoteTo run from inside docker, run:
docker exec ufm-plugin-rest-rdma
prior to the command.For example:
docker exec ufm-plugin-rest-rdma /opt/ufm/ufm-plugin-ufm-rest/src/ufm_rdma.py -r client -u admin -p password -t simple -a GET -w ufmRest/app/ufm_version
All the examples in this section are relevant for running the ufm-rest-rdma client from inside the docker.
If you must run ufm-rest-rdma using the client script, all quotation marks (") must be wrapped by a backslash (\).
For example,"running_mode": "once"
must become \"running_mode\":\"once\"
.
There are three types of user authentication flows supported by UFM and also by ufm-rest-rdma utility
Username/Password Authentication
to get UFM version
./ufm_rdma.py -r client -u admin -p password -t simple -a GET -w ufmRest/app/ufm_version
to get ibdiagnet run result
./ufm_rdma.py -r client -u admin -p password -t ibdiagnet -a POST -w ufmRest/reports/ibdiagnetPeriodic -l '{"general": {"name": "IBDiagnet_CMD_1234567890_199_88", "location": "local", "running_mode": "once"}, "command_flags": {"--pc": ""}}'
Client Certificate Authentication
need to pass path to client certificate file and name of UFM server machine:
./ufm_rdma.py -r client -t simple -a GET -w ufmRest/resources/modules -d /path/to/certificate/file/ufm-client.pfx -s ufm.azurehpc.core.azure-test.net
Client certificate file should be located INSIDE docker container.
Token Authentication
need to pass it for authentication
./ufm_rdma.py -r client -k OGUY7TwLvTmFkXyTkcsEWD9KKNvq6f -t simple -a GET -w ufmRestV3/app/ufm_version
Token could be generated using UFM UI.
If a token is used for client authentication, ufmRestV3
must be used.