ganetimgr needs a set of RAPI credentials to communicate with a cluster. These need to be created manually. The next steps need to be repeated for every cluster you wish to administer with ganetimgr.
Create (or edit if it already exists) the
/var/lib/ganeti/rapi/users file on every node at the cluster like this:
<user> <pass> write
You can replace
read so that ganetimgr can only view the cluster resources, but most of the ganetimgr functionality will be disabled.
Login to the ganetimgr platform and go to the admin interface. You can do so from the sidebar:
cluster option from the Ganeti section.
From here you can manage the you cluster pool. Normally this list is empty now. Select the “Add” cluster option:
An explanation about some of the settings:
Hostnameis the fully qualified domain name of the cluster
Slugis a friendly name for the cluster
Portis the port the RAPI daemon listens to on the master node. Unless you manually changed it this should be 5080
Username/Passwordare the credentials created earlier for the cluster
Fast instance creationis an option to submit instance creation requests through the admin interface instead of going through the normal application procedure.
Cluster uses gnt-networkis a soon to be deprecated option about network options for new instances. If you use routed networks (though gnt-network) this should be on.
ganetimgr autodiscovers any network available through gnt-network on the cluster during the instance creation. You can also hardcode any other networks (e.g. bridged vlans) from the admin interface
- Link is the name of the network device found on the cluster.
- Mode is the network mode for the interface can be routed or bridged.
- Groups ties the network to a specific user group. When a user from that group submits an application this network is autoselected.
We have integrated oauth2 support.
The endpoints the API provides are:
which fetches all the instances of the current user. Optionally the api user can pass a get parameter named ‘tag’ which filters all instances by the specific tag.
will fetch us only the instances tagged with “ganetimgr:filterby:thistag”
which lists user details (username, email, password, id)
In order to add oauth2 you have to install:
And insert in installed apps:
- Create a new application using URL::
- Use implicit authorization grant type
- Set the redirect URLs to the desired ones
- To get a response with the access_token, use::
- by adding the access_token in the request to
/instances/lists/?access_token=<token>you get a list of all the user instances.