API Port for Coe Should Be User Configurable

Registered by Andrew Melton on 2015-04-23

Currently our api ports need to be part coded as the templates do not support providing custom values. A user should be able to provide a custom port for the templates to use for it's public api endpoint.

Blueprint information

Not started
Steven Dake
Andrew Melton
Surojit Pathak
Series goal:
Not started
Milestone target:

Related branches



Currently there exists baymodel.apiserver_port, but I think bay.apiserver_port may be a better location for that. The api server's port is something that I could see people changing on a per-bay basis and as such is something I think might be better located on the create-bay call instead of requiring a new baymodel for each different port.

(Kennan) Hi Sdake, we designed the baymodel as flavors, and just like nova flavors, it is cheap to create baymodels, and it is easy to maintain as single point of configuration. most of time, users work ok with default port, just like we keystone 5000, 35357, users not need to change it frequently, since each swarm cluster manager is the entrance point, after bay-creation.

Kennan, the downside of the proposal you make is that we may end up with a policy system that disables the creation of baymodels except for people with an admin role. --sdake

See also: https://blueprints.launchpad.net/magnum/+spec/magnum-api-address-url

Send mail to @Adrian about this:

Hi Adrian
If I summarize your option, it would be,

1) Have a function like this,

 magnum bay-create --name swarmbay --baymodel swarmbaymodel --baymodel-property-override apiserver_port=8766

And then magnum pass that property to override baymodel default properties, and create the bay.

2) You talked another BP, about adjust bay api_address to be a URL, For bay attribute api_address should be return format like following
tcp:// or


Update(Jul 19th)

Hi @Adrian as we discussed last time, we tried this way:
 magnum bay-create --name swarmbay --baymodel swarmbaymodel --baymodel-property-override apiserver_port=8766

This way, we not introduce any new baymodel, we just make baymodel-override property to be used during bay-creation time, Take swarm bay as example, every container cli would finally get

    def _docker_for_bay(bay):
        tcp_url = 'tcp://%s:2376' % bay.api_address
        return docker_client.DockerHTTPClient(

So here we need to make bay can get api url like protocal://<servername>:<port>, if we don't want to schmed for baymodel-override properties in bay db schema. We need to find ways to persist api_server_url,or else you can not get api port anymore.
I understood its becasue of that for you proposed a bp called

You means to implement that magnum-api-address-url first, and that ways, bay can get apiserver url from database. Right ?

Reassigned based on Midcycle discussion.


Work Items

This blueprint contains Public information 
Everyone can see this information.