This PR uses glance to get a valid image_id when creating a cluster.
Clusters API currently checks the "image_id" column in "datastore_versions"
table, which has no valid image_id(NULL) since Victoria due to the
following code and docs change[1].
The original problem of this patch is that nova api throws BadRequest
exception with "Block Device Mapping is Invalid" message when creating
a cluster.
[1]: 1d24b65052
Task: 45004
Story: 2009982
Change-Id: I2a2932e261f47d9c8ec275bf9bd41b26983230c7
- The users need to specify the network to create Trove instance, but
trove-taskmanager will create port in that network for Nova instance
creation. Using port gives Trove more capabilities to define how the
database service is exposed.
- Deprecate ICMP protocol for the instance.
- Restrict 'nics' parameter for creating instance.
- Add 'access' parameter for creating instance.
- Add 'public_network_id' option in order to create floating IP for the
instance.
- Do not create records for security groups, but Trove can still delete
existing instances for backward compatibility.
- Delete unreasonable Host, Account, Storage API.
Story: 2006500
Task: 36468
Task: 36466
Change-Id: I80827e1ad5e6b130cbf94c2bb7a909c44d5cf1e5
Before create instance node for a cluster, it should validate
the flavor, the volume, the quotas and the networks. But only
galera_common valdiate the network, the other datastores miss.
Change-Id: I1233b47b57e2775d19627c1c7807988ddbe16130
Currently, galera_common cluster-create do the validation before call
_create_instances. But cluster-grow does not validate it. Add validation
could avoid some risks:
1.Flavor ID, nics NotFound exception. `Instance.create` also check this,
but do this thing before `Instance.create` is better.
2.Flavor, volume, nics of all intances NotEqual exception.
3.Quotas exteed exception. Although `Instance.create` check quotas for
single instance, we should check_quotas for all instances as a unit.
Since there already has a method `_validate_cluster_instances`.
Reuse the method could reduce code redundancy, but the method is not
so "common", unlike cluster-create, there is no num_instances limits for
cluster-grow. So, this patch move "check number of instances" code to
method `create`.
Change-Id: If25c3e66fc6f4ac83e434880d3f3fe66cb1d4fff
Now we just parse the volume_type parameter in cluster/service.py,
but it is not passed in the creat instance, which will be
supported here.
Change-Id: Iae790e54ebf1bd6cb968c3be4c3f5cd53e1082f7
Partial-Bug: #1622957
According bug description, when growing a database cluster,
instance names can overlap. To solve this problem, use
timestamp as instanceName replace of increase numbers.
Change-Id: I6849390c56a26de9df96c16dec0e1c1a6e58e097
Closes-Bug: #1642416
trove/common/strategies/cluster/experimental/galera_common/api.py.
Method "shrink" in class GaleraCommonCluster,when use DBInstance.find_all
should set argument deleted=False, otherwise it may missing raise a
ClusterShrinkMustNotLeaveClusterEmpty exception.
Same problem at galera_common/taskmanager.py. Method "shrink_cluster" in
GaleraCommonClusterTasks, call DBInstance.findall() with deleted=False
to exclude deleted nodes and that can avoid a NotFound error.
Change-Id: Ibb377630b830da06485fc17a1a723dc1055d9b01
Closes-Bug: 1699953
Implement configuration attach and detach API for clusters.
Implement rolling strategy for applying configuration changes
(both attach and detach follow the same pattern).
1. Persist the changes on all nodes (leaving nodes in RESTART_REQUIRED state).
2. Update Trove records.
3. Apply changes dynamically via one or all node(s) if possible
(and remove RESTART_REQUIRED flag from all nodes).
Notes:
The single instance implementation has been restructured (similar to above)
such that it always leaves the instance in one of the three states:
a) Unchanged
b) Changes persisted but not applied
(Instance has configuration attached but requires restart.
It is safe restart manually or detach the group to avoid
any changes)
c) Changes persisted and applied (if possible)
This implemenation should always leave the cluster (and each instance)
in a consistent state.
Runtime configuration will not be changed until it is first persisted
on all nodes.
If there is a failure during step 1) the cluster is still running
the old configuration. Some instances may have new configuration
persisted, but not applied.
The cluster will not have configuration attached unless it can
be applied to all nodes.
The individual nodes will have configuration attached as soon as it is
persisted on the guest.
It is safe to retry, reapplying the same configuration on a node is
noop.
It is safe to detach. Removing configuration from nodes without one
is a noop.
It is safe to detach the configuration from individual nodes via
single-instance API.
It is safe to attach the configuration to remaining nodes via
single-instance API and rerun cluster attach to update Trove records.
If 3) fails for whatewer reason the instances are left
in RESTART_REQUIRED state.
It is safe to retry or detach configuration or restart the
instances manually.
Also fixed various minor cluster issues.
Implements: blueprint cluster-configuration-groups
Change-Id: I7c0a22c6a0287128d0c37e100589c78173fd9c1a
Implement cluster rolling restart strategy.
Add support for Cassandra and PXC.
Add some missing cluster upgrade infrastructure.
Implements: blueprint cluster-restart
Co-Authored-By: Petr Malik <pmalik@tesora.com>
Co-Authored-By: Peter Stachowski <peter@tesora.com>
Change-Id: I21e654a8dd2dc6a74aa095604f78db4e96c70d64
The grow and shrink operations in Galera_common were eating exceptions.
This change passes the exceptions back and adds unit tests to
ensure such.
Change-Id: I3202d6d4daa77a8a185a427b31b2187eab4d82e9
Closes-bug: 1634627
This is an initial attempt at supporting multiple regions. It should
handle the mechanics of deploying an instance/volume to a remote
region. Additional changes may be required to allow the guest
agent on the instance to connect back to the originating region.
Co-Authored-By: Petr Malik <pmalik@tesora.com>
Change-Id: I780de59dae5f90955139ab8393cf7d59ff3a21f6
Since the nic is required to be specified in the cluster grow,
remove the unnecessary nic handling in the Galera cluster grow.
This would make it consistent with the way all the other clusters
are handling the nic parameter.
Change-Id: I136141b3db78b7a0a1804bb5e3d4ca5cf4bc3bb3
Closes-Bug: #1634629
When the module support was added, passing the modules to the
actual create was not done on the server side. This has been added.
Partial Bug: #1578917
Change-Id: I80c8e230f8bff550851f5cad146aa5976f45e5c4
In order to allow clusters to be all on the same hypervisor
(affinity) or all on different hypervisors (anti-affinity) a new
argument (locality) needed to be added to the Trove cluster-create API.
This changeset addresses the Trove server part of this feature.
'locality' can now be added to the ReST payload for a cluster-create
command and it is passed along as a scheduler hint to Nova.
The cluster scenario tests were enhanced to test that 'affinity'
works. Testing that 'anti-affinity' fails proved to be too
time consuming, since at present the only way for a cluster to
'fail' is to timeout (and that takes 10 hours).
The server-group is checked to make sure it is created properly,
and that it has been deleted after all the related instances are gone.
DocImpact: New functionality
Partially implements: blueprint replication-cluster-locality
Depends-On: Ie46cfa69ffe6a64760aca38c495563f5724bd0d0
Change-Id: I657bf5c023d0257e462cc39f57c16eb6ee83807a
* Replace map() with list-comprehension or regular loop to get the
same behaviour on Python 2 and Python 3.
* Remove test_galera_cluster and test_redis_cluster from
blacklist-py3.txt to run them on Python 3
Partially implements: blueprint trove-python3
Change-Id: Id373a0431b98ea7687dc82a48e82f16fedaac5a0
This would apply to any type of cluster that uses the galera strategy
while setting the nics on a create call. When we called cast to set()
the object was a list of lists. The set method can not has a list so
this was causesing a unhashable error.
The change is to make the instance_nics a list of strings (what we
originaly expected) to resolve this issue.
Change-Id: I6b04f8b580720e5791e0977a9347d031cdbf9710
Closes-Bug: #1570602
For MariaDB 10.1, the Galera clustering is included as part of
the base installation, so clustering for MariaDB is implemented
within the MariaDB datastore directly (rather than as a separate
datastore as was done with pxc).
Change Manifest:
- refactor galera clustering support from pxc to galera_common
- incorporate the galera_common component into MariaDB datastore
- a little cleanup of how pxc and mariadb were implementing the
mysql_common component
- refactored pxc unittests to pxc and galera specific tests
- implemented unittests for MariaDB
- implemented clustering unittests for MariaDB
- mariadb_supported scenario tests run (except replication
due to slave_of issues)
- cluster scenario tests run successfully
Change-Id: Ieae77cf9ff797472ef13f2532fff1e64bc654151
Implements-blueprint: mariadb-clustering