os_compute_api:servers:create:attach_network does not account for networks='none' (or 'auto') and microversion 2.37
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Jianghua Wang |
Bug Description
Before microversion 2.37 the 'networks' key in the POST /servers request body could be omitted if you just wanted a port automatically allocated on an available network for the project.
With microversion >= 2.37, you must specify the networks key and it can be a specific network, or one of two enums: 'auto' or 'none'.
The 'auto' case is semantically the same as not specifying networks before microversion 2.37. If one is available to the project, it will be used. If more than one is available, the server create request fails since Nova can't decide which network to use. If none are available, the server does not get any networking.
The 'none' case is for specifically saying you don't want networking attached to the server.
The "os_compute_
That is only checked if specific networks are requested, but it's not accounting for the special 'auto' or 'none' cases.
This means that if you change the policy rule from it's default admin_or_owner to say admin-only, for example, and you are using microversion >= 2.37, where the "networks" key is required, server creates will always fail for non-admins, even if 'auto' or 'none' are specified.
summary: |
os_compute_api:servers:create:attach_network does not account for - networks='none' and microversion 2.37 + networks='none' (or 'auto') and microversion 2.37 |
Changed in nova: | |
assignee: | nobody → Jianghua Wang (wjh-fresh) |
when networks='none', it shouldn't verify the policy at all as no network will be attached. /developer. openstack. org/api- ref/compute/ ?expanded= create- server- detail:
But for network="auto", it should check policy rule as it does need a network attached:
https:/
auto tells the Compute service to use a network that is available to the project, if one exists. If one does not exist, the Compute service will attempt to automatically allocate a network for the project (if possible).