- Deprecate in-tree Cinder volume driver for removal in X cycle in
favour of out-of-tree Cinder CSI plugin for Kubernetes.
- Set cinder_csi_enabled to True by default from V cycle.
- Add unit test for in-tree Cinder deprecation.
- Add mssing unit tests for resent docker_storage_driver deprecation.
Change-Id: I6f033049b5ff18c19866637efc8cf964272097f5
Story: 2007048
Task: 37873
The devicemapper and overlay storage driver are deprecated in
favor of overlay2 in docker, and will be removed in a future
release from docker. Users of the devicemapper and overlay
storage driver are recommended to migrate to a different
storage driver, such as overlay2. overlay2 will be set as
the default storage driver from Victoria cycle.
Task: 39526
Story: 2005201
Change-Id: Idfd784dc3f1bfbe6bce5671bc5a1ef69d82636b1
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
Remove hacking and friends from lower-constraints, those are not needed
for co-installing.
Change-Id: I926efaef501f190e78da9cab40c1e94203277258
Using comma delimited ipv4 address list to specify multi dns server
"8.8.8.8,114.114.114.114".
Task: 29465
Story: 2004994
Change-Id: I031247b0cc2ae417f18b2a5b9b3832e78ed9dafd
Now Magnum supports list, get, delete user's cluster/template by admin,
but not allowed for updating. We're seeing this could be a very useful
feature for us, since sometimes we need to help our customer to update
their templates or clusters on behalf.
Task: 30251
Story: 2005323
Change-Id: I3ab1d4583b5eb3d1c377e46fd73347c2477c3e08
Add a new hidden flag to cluster templates. This allows an operator to
keep a cluster public (accessible to all users) while not showing them
in cluster template listing.
Story: 2004941
Task: 29342
Change-Id: Ia2717ca960041753f6e772bf2d41c7f5a196dae6
After merging https://review.openstack.org/#/c/531066/
it would be interesting for admin users to be able to
delete clusters and cluster templates as well.
Related-Bug: #1740982
Change-Id: I91f909e8814b86fd5f8b555573238b99b47ffd03
The new config option 'disabled_drivers' is designed to address a
typical user case: As cloud provider, I'd like to only provide
some particular drivers, e.g. fedora atomic/k8s and don't expose
any other driver support. With this patch, when user create a new
template which is in 'disabled_drivers'. A BadRequest error will
be returned.
Closes-Bug: #1746961
Change-Id: Ib4c53ffed78a1847b2da9672e6348c88757ad66e
As an admin user, I'd like to access all clusters or templates across
all projects for operation purpose. Similar function is supported by
most of the other services, like Nova, Neutron, Cinder, Heat, etc.
Related-Bug: #1740982
Change-Id: Icaba09de79a3452286fb60fee80a53430317cba0
Allow any value to be passed on the docker_storage_driver field by turning it
into a StringField (was EnumField), and remove the constraints limiting the
values to 'devicemapper' and 'overlay'.
Change the docker storage setup to have a generic setup for all drivers with
the exception of 'devicemapper', which keeps its own specific storage config
function. For all others, do the same we already did for overlay (with two
cases for usage of a cinder volume or not) and simply set the storage driver
in the docker configuration to the value provided in the cluster template.
Change-Id: I9aa8f232ce64ece4d439c0a476f463820a499617
Closes-Bug: #1722522
Magnum API previously passed magnum.objects.cluster.Cluster objects as
the target argument to magnum.common.policy.enforce(). However, enforce()
expects target to be a mutable mapping, as it adds an entry for
trustee_domain_id which is used by the magnum policy.json. This causes
cluster detailed GET requests to fail with the following message:
AttributeError: 'Cluster' object has no attribute 'trustee_domain_id'
This change uses the as_dict() method of the magnum RPC objects to
provide a mutable mapping to the policy enforcer.
Change-Id: I54b136243afff9e0fadae3be4b36cad1679e5721
Closes-Bug: #1689797
UUID for keypair is no longer supported from heat and nova cli.
This patch suggest to remove the support message from magnum.
Closes-Bug: #1674211
Change-Id: Idb67fc86f067387060a381c9d2d0ed0f8c953c21
Keypair can now be added during Cluster create command. This allows
Clusters to be created from the same ClusterTemplate but have
different keypair values when created. If not specified on create
then the value from the ClusterTemplate will be used. Adds keypair_id
to Cluster object and uses of keypair_id will use the value from Cluster
instead of ClusterTemplate.
Added release note for new features in magnum and magnum CLI.
Change-Id: I177a5aa06f881156944a9f74c9ccc3cd2abac492
Implements: blueprint keypair-override-on-create
Currently server type can be set to any String, but it should
be restricted to only allowed types: vm/bm.
vm: virtual machine
bm: baremetal
With this patch it is restricted only to allowed types.
Change-Id: Ifbeff8621b26702e54ad088195fddcb7c35424b2
Closes-Bug: #1622432
This is patch 3 of 3 to change the internal usage of the terms
Bay and BayModel. This patch updates Bay to Cluster in DB and
Object as well as all the usages. No functionality should be
changed by this patch, just naming and db updates.
Change-Id: Ife04b0f944ded03ca932d70e09e6766d09cf5d9f
Implements: blueprint rename-bay-to-cluster
This patch is the first of 3 patches to change the internal
usage of the terms Bay and BayModel. This patch updates
BayModel to ClusterTemplate. No functionality should be
changed by this patch, just naming and db updates.
Change-Id: I0803e81be6482962be2878a8ea2c7480f89111ac
Implements: blueprint rename-bay-to-cluster
This patch fixes a few missed changes. It also updates Cluster
and ClusterTemplate with a few changes that were merged while the
main patch was a WIP. Updates changes from patches:
Idd02769f98078702404a11dc9f7a3339ce4e22eb and
I1abc5626f39958351935f4c711c19588651d2bc6
Change-Id: I509520d1af0f0e2c04d53359705973d6a6f97a26
Implements: blueprint rename-bay-to-cluster
Attributes which are mandatory (ie, required for object creation) should
not be removable. However, some attributes (such as baymodel.server_type)
are not required for object creation, but should not be removable if they
are set. This commit does the following:
- rename JsonPatchType.mandatory_attrs to non_removable_attrs to better
describe its meaning,
- change its return type to set-of-strings for faster lookup
- ensure all mandatory attributes on the type being patched are
included in the set of non-removable attributes,
- add a new field, JsonPatchType._extra_non_removable_attrs, which
should be a set of attributes that are not required for creation but
should not be removed if set.
Since the object to be patched does not exist at patch-validation time,
we leave the validation logic in methods of JsonPatchType and
subclasses. This means introspecting the types to be patched.
This patch is copied from ironic [1].
[1] https://review.openstack.org/#/c/240202/9
Change-Id: Ifcfc4e48a05d75b919a33ef463754c199da94a8e
Close-Bug: #1530771
This is the first of several patches to add new Cluster commands
that will replace the Bay terminalogy in Magnum. This patch adds
the new Cluster and ClusterTemplate commands in addition to the
Bay and Baymodel commands. Additional patches will be created
for client, docs, and additional functional tests.
Change-Id: Ie686281a6f98a1a9931158d2a79eee6ac21ed9a1
Implements: blueprint rename-bay-to-cluster
This patch adds floating_ip_enabled field to baymodel to specify
whether floating ip is used or not.
Change-Id: I99677221250480b43a4b95ebf460c43bc77090ad
Partially-Implements: blueprint bay-with-no-floating-ips
Adds the functionality to allow versioning of api methods
based by adding a decorator api_version("min_version",
"max_version"). This is similar to how nova implemented api
versioning but updated to work with pecan.
Change-Id: Ie18d92531487f7c107b5132b3d35f38bd0a37aa0
Implements: blueprint api-versioning
A param for the coe in baymodel currently reads 'mondatory',
it should be 'mandatory'.
Closes-Bug: #1605705
Change-Id: I519a7c4cc56d5c53ecaccaed07dfad774b4c4900
In magnum server side, docker_volume_size allowed minimum value is 1GB.
In fact, the minimum value should be 3GB when docker-storage-driver is
devicemapper, because the limitation of docker-storage-setup. So, I add
check on "--docker-volume-size". If "--docker-storage-driver=devicemapper",
the minimum docker-volume-size should be 3GB, otherwise it should 1GB.
Change-Id: I53c6a9c93ee156fa9afabdbd72a87bb4044d71ca
Closes-Bug: #1583878
Ironic template needs to specify fixed subnet name/ID.
And also user sometimes want to build his cluster on
his network which he built.
This patch adds fixed_subnet field to baymodel to specify
fixed subnet which bay will build on.
Change-Id: Ia21ad6e3e1472a0d078d08369ef62601034fcc17
Partial-Implements: blueprint magnum-baremetal-full-support
master_lb_enabled is a boolean field that determines if a bay's master
nodes should be load balanced. Defaults to False.
Change-Id: Icf8317432dec70c99c29a3af9edb0499bfd2439d
Partially-Implements: blueprint decouple-lbaas
Add a feature to Magnum to auto-generate human readable names,
like Docker does for un-named containers. Use this feature if
no name is specified upon the creation of a Bay/Baymodel.
Change-Id: I290fb4ad0692c63e6e40af3ec705f205c5ec66d3
Partially-Implements: blueprint auto-generate-name
* This parameter will be optional and users will be able to select
a supported driver, otherwise the default configuration will be
used.
* Add docker storage driver enum field to baymodel
* Add db upgrade file
* Update heat templates for kubernetes and swarm allowing only
devicemapper and overlay as docker_storage_driver values.
* Add configuration for OverlayFS on Fedora Atomic, if overlay is
incompatible bay creation will result a CREATE_FAILED status.
* Factor out configuration of docker storage drivers
* Update tests
* Add Release Notes
Partially-Implements: blueprint support-for-different-docker-storage-driver
Change-Id: Ib58cb734c4e9c90d5d83574852213d2e97359e92
Adding new column of `insecure_registry`, it indicates using insecure
registry when deploying a bay, it should be a validate url with port.
Partially-Implements: blueprint support-insecure-registry
Change-Id: Iaa28d6409264d1d2acd992a7fa14630bb6394852
In baymodel (https://github.com/openstack/magnum/blob/master/magnum/
api/controllers/v1/baymodel.py), we have an unset exception list:
baymodel.unset_fields_except(['uuid', 'name', 'image_id',
'apiserver_port', 'coe'])
In order for the new "--fields" option [1] to work better, this patch will
remove the expand option so that all fields are included by default.
[1] https://review.openstack.org/#/c/286950/
Change-Id: I1adffca9a7c6e013bed38530036dfc0aed918fdc
Closes-Bug: #1579236
We can not get public baymodel now.
Fix it by:
1. Union public baymodel when fetch baymodel from DB.
2. Don't apply policy checking if the baymodel is public
Closes-Bug: #1557977
Change-Id: Ie5b1432d06611cd697a55f67fd66207e1e757382
Now, when we update baymodel with the invalid flavor_id or
master_flavor_id parameters, the baymodel can be updated
successfully.
We need to validate the flavor_id, master_flavor, keypair and so on
before patching baymodel.
Closes-Bug: #1555490
Change-Id: I4ae3cd7c0be1161dacb6f0a80c5ee1b53d06d03d
As described in [1], we should pass bay or baymodel as target in
enforce. Otherwise we can not user generic-checks. We need this
check for some situations, for example only allow the user who
creates a bay can delete the bay.
http://docs.openstack.org/developer/oslo.policy/api/
oslo_policy.html#generic-checks
Change-Id: I60f8870dd1a2bb07efbadf5f16a453f0a2e0cb3d
Closes-Bug: #1553914
Now, when we create baymodel with the invalid flavor_id and
master_flavor_id parameters, the baymodel can be created
successfully.
We need to validate the flavor_id and master_flavor before
creating baymodel.
Change-Id: Id6768d8246c97d56e529cbc1cab6c8c7d28ca43a
Closed-Bug: #1547345
Rename get_rpc_resource to get_resource. Because there is no rpc
call in this method.
Change-Id: I4dfba86b9932c9def08959f7fb1df98b7bc41436
Closes-Bug: #1549650
Missing documentation was added to `http_proxy` and `https_proxy` BayModel
attrs.
Change-Id: I8dc0186fa4873eea1a31d93b5a0e992c473ec642
Closes-Bug: #1533142
Instead of allowing any volume_driver value to be accepted by the
baymodel API. When updating baymodel, the patch can limit the
volume_driver value for the different coe.
Co-Authored By: Kai Qiang Wu(Kennan)<wkqwu@cn.ibm.com>
Co-Authored By: Ton Ngo<ton@us.ibm.com>
Partially-Implements: blueprint magnum-integrate-with-cinder
Change-Id: Ic5efb9ca0d8dfb2092c63caba22a7214e78bba08
Instead of allowing any volume_driver value to be accepted by the
baymodel API. When creating baymodel, the patch can limit the
volume_driver value for the different coe.
Kubernetes <=> volume_driver = "cinder"
Swarm <=> volume_driver = "rexray"
Mesos <=> volume_driver = "rexray"
Co-Authored By: Kai Qiang Wu(Kennan)<wkqwu@cn.ibm.com>
Co-Authored By: Ton Ngo<ton@us.ibm.com>
Partially-Implements: blueprint magnum-integrate-with-cinder
Depends-On: I52c97e2b04ac636ddac611e3677c4ea3972220eb
Change-Id: I25f1cd005a39950c47f31a8b925f664909b79ee3
Adds volume_driver to the following:
1. api baymodel attribute
2. a new column to the baymodel db
3. objects.Note: Updates baymodel object version
4. Unit tests
Co-Authored By: Kai Qiang Wu(Kennan)<wkqwu@cn.ibm.com>
Co-Authored By: Ton Ngo<ton@us.ibm.com>
Partially-Implements: blueprint magnum-integrate-with-cinder
Change-Id: I25506bd39ab4be513ef99c39f8c52a502b300d92
Typo in the spelling of 'against' (written as 'agaist') is observed
in the comment of several files. Not everything was covered as part of
Idefb5d70dba554e2ea732af9d53f4bbe7e49e557.
Change-Id: Ie2ac2be3e18afdf644e02288f13f10c10f6bc723
Magnum baymodel requires some mandatory attrs, this patch adds them to
mandatory_attrs() of BayModelPatchType to forbid removing them when do
baymodel-update remove ${attr}
Closes-Bug: #1530506
Change-Id: Iea59fd4811835cda1f232a77f3f345ca7e374fa4
In API controller, "@expose.expose" should be on top of
"@policy.enforce_wsgi". Otherwise, the output won't have the correct
format and status code. That is because "@expose.expose" will format
the exception before sending the response.
In "enforce_wsgi", use decorator module instead of "functools.wraps".
That is because decorator is signature preserving, which is
necessary for other decorator to work.
Also, added unit tests to ensure the correct error message and status
code will return if the request cannot pass the policy check.
Change-Id: I8b77ba95124c13dd1a46700bc60105bc7e33a579
Related-Bug: #1520311
A new magnum.api.attr_validator.py module is introduced to do the
validation towards OpenStack resources. Currently in Baymodel-creation,
the image validation code is duplicated. We should reduce the
duplicated code and unify the validation both in Bay and Baymodel.
Change-Id: I8517024c77c6dc4082bf2ff6d0205d86e32fbfdc
Partial-Bug: #1522060
A new magnum.api.attr_validator.py module is introduced to do the
validation towards OpenStack resources. Currently in Baymodel-creation,
the keypair validation code is duplicated. We should reduce the
duplicated code and unify the validation both in Bay and Baymodel.
Change-Id: Iba1bfad00c97f90d28501e65b73eed33be05e40f
Partial-Bug: #1522060
We can not import magnum.api.validation because of circle reference.
We can reproduce this bug by "tox -egenconfig" or importing
magnum.api.validation in a python console.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "magnum/api/validation.py", line 20, in <module>
from magnum.api.controllers.v1 import utils as api_utils
File "magnum/api/controllers/v1/__init__.py", line 30, in <module>
from magnum.api.controllers.v1 import baymodel
File "magnum/api/controllers/v1/baymodel.py", line 29, in <module>
from magnum.api import validation
ImportError: cannot import name validation
Change-Id: Ib73d7f1d989b9bc860bfadafa52e9a83996f5de9
Closes-Bug: #1521840
Currently, we can not update a baymodel with baymodel name, this patch fixes
it by passing baymodel_ident instead of using baymodel_uuid.
Closes-Bug: #1516900
Change-Id: Ib372c06762fdb3918f391aefd25c43e6a2a5fca3