Solution Verified in:
- OpenNebula: 5.10, 6.X
This step-by-step tutorial will help users to easily set up the OpenNebula cli utilities on a machine that is not the OpenNebula frontend. The Goal is to be able to control the OpenNebula daemon remotely.
The machine needs access to the server ports where oned and oneflow are running, by default, 2633 and 2474.
Step 1: CLI Utilities Installation
You need to install the required dependencies. Make sure you are using the OpenNebula repositories, then proceed to install:
# On Debian/Ubuntu apt install opennebula-tools # On Centos yum install opennebula
Alternatively install the gem
Step 2: Environment Configuration
Create the authentication file AKA one_auth with the user credentials you will use. We will use oneadmin as example
mkdir -p "$HOME/.one" echo 'oneadmin:password' > "$HOME/.one/one_auth"
Assuming the frontend hostname is frontend and oned running on port 2633
export ONE_XMLRPC="http://frontend:2633/RPC2" export ONE_AUTH="$HOME/.one_auth"
Not setting the environment variables will cause the cli utilities to fallback to the default values for the authentication file and the server address. In this example the environment variable has the default location for the authentication file, therefore no need to export it, but the ONE_XMLRPC defaults to localhost which is not where oned is running.
echo 'export ONE_XMLRPC="http://frontend:2633/RPC2"' >> ~/.bashrc
Step 3: Environment Configuration for oneflow
By default, oneflows listens only on the frontend localhost, you need to edit /etc/one/oneflow-server.conf and update:
# Host and port where OneFlow server will run :host: 127.0.0.1
with the frontend hostname or the IP where it can be accessed. Then proceed to restart oneflow
systemctl restart opennebula-flow
In this case you also need to add the following to your
The flow commands will fallback to the one_auth default file location for authentication, however you can also set the environment variables ONEFLOW_URL, ONEFLOW_USER and ONEFLOW_PASSWORD in your
~/.bashrc file for greater customization. This variable has to be set up because the flow endpoint default value is localhost.