2.6.8 Managing Servers in a Server Pool

Once your server pool is fully set up, you can manage the servers that belong to the server pool.

To add a server to the server pool, you send a PUT request to the following URI:

https://hostname:port/ovm/core/wsapi/rest/ServerPool/id/addServer
Note

The first server that you add to a server pool is automatically promoted to the Master server for the pool. It is possible to modify the server pool object to set the ID for the Master server at a later stage.

Similarly, to remove a server, send a PUT request to:

https://hostname:port/ovm/core/wsapi/rest/ServerPool/id/removeServer
Note

Remove the Master server from the pool after all other servers have been removed

In both cases, the body of your request should contain an XML or JSON object that describes the server that you are managing. These two request types are good examples of action-style activities as described in Section 2.3, “What URI Mappings are Available and How do They Work?”.

It is interesting to note that these operations create associations between server objects and the server pool object. In many ways it may appear as though the server is treated as a child object of the server pool, this is not strictly true although the methods may behave similarly. To distinguish between operations on child objects and operations on associations, the API uses the add/remove nomenclature for methods that add or remove an association, and uses the create/delete nomenclature for methods that add or remove a child object. This may become clearer when studying the examples below.