Commit Graph

18 Commits

Author SHA1 Message Date
Takashi Natsume 8c94e21196 Fix deprecation warnings
Fix the following deprecation warnings.

* DeprecationWarning: Using the 'user' argument is deprecated
  in version '2.18' and will be removed in version '3.0',
  please use the 'user_id' argument instead

* DeprecationWarning: Property 'user' has moved to 'user_id'
  in version '2.6' and will be removed in version '3.0'

Change-Id: I18802ae1e2318eae3c62a26459178b259c728ac4
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-10-15 12:42:46 +00:00
Lingxian Kong ba046b2a14 Support online volume resize
Trove now supports to resize volume without downtime. To use this
feature, the version of Nova and Cinder needs to be at least Pike, the
config option ``cinder_service_type`` needs to be set to ``volumev3``.
The cloud admin can disable this feature by setting
``online_volume_resize=False``, default is enabled.

Change-Id: I000a4e90800454972dd39f2f82d286571bc0b96c
2020-07-24 13:55:51 +12:00
Lingxian Kong 650794eaf9 Remove all the resources when the Nova VM creation failed
Backport candidate for stable/train

Story: 2006664
Task:  36926

Change-Id: If0991e0cef40ca78752fcd509d8438e90c9557bc
2019-10-09 12:03:59 +13:00
Lingxian Kong c33fa67066 Support to create public trove instance
- 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
2019-09-11 11:28:00 +12:00
Lingxian Kong dfa5ce93d5 Improve devmode=flase when building the image
During debugging, the following changes are also included:

- Support to specify an image ID to run the integration test.
- Fix the reboot function bug.
- Remove the unsuccessful restart test.

How to run integration test with dev_mode=false:

    ADMIN_PASSWORD=password \
    SERVICE_PASSWORD=password \
    DEV_MODE=false \
    /opt/stack/trove/integration/scripts/trovestack gate-tests mysql mysql

Change-Id: I31d4ee579a554f4c98f9facb9fd4b7779665a3dd
2019-08-25 23:11:54 +12:00
Bartosz Zurkowski 59e8cb7e75 Extend cluster events
This patch extends adds a new field 'instance_ids' in payloads of two
cluster events:
     - DBaaSClusterShrink (during start and end notification),
     - DBaaSClusterGrow (during end notification).

Moreover, additional end notifications after growing and shrinking
cluster have been added.

The purpose of this change if to enable better integration with
tools for monitoring resources usage.

Change-Id: I2c39b2c3bff65f88e46944eda22209bdc92803bc
Signed-off-by: Kasper Hasior <k.hasior@samsung.com>
Co-Authored-By: Kasper Hasior <k.hasior@samsung.com>
Story: #2005520
Task: #30639
2019-05-12 02:06:42 +00:00
Amrith Kumar 109ff94951 Handle isotime deprecation in oslo_utils.timeutils
oslo_utils.timeutils is deprecating isotime(). In reality they are
deprecating some other things as well but Trove doesn't (currently)
use any of those things.

Much has been written on the subject of this deprecation. I think the
proposal to merely replace isotime with datetime.datetime.isoformat()
is a little simplistic. Well intentioned, but nonetheless I believe
that it is simplistic.

The primary issue I could find with oslo_utils.timeutils.isotime() was
the fact that it was naive. I think it could well have been fixed in
oslo_utils but for whatever reason(s) oslo decided not to want to go
that route.

The primary challenge from Trove's perspective is that I want to
respect the existing API contract while at the same time get an
implementation of time handling that is not identical in its flaws
with oslo_utils.timeutils.isotime().

This change set attempts to address that by making
trove.common.timeutils.isotime() that is aware. It also implements a
utcnow_aware() function that is aware.

ISO 8601 allows for four representations of timezone and those are

<time>Z
<time>[+-]hh:mm
<time>[+-]hhmm
<time>[+-]hh

Trove conventionally used the first one, even if the time wasn't
really a UTC time. That's one of the things being fixed here.

In review cp16net asked whether this change removes the 'Z' at the end
of time strings generated by the isotime() function. The answer is
NO. The new isotime() function performs identical to the old and now
deprecated function in oslo_utils.timeutils for UTC (Z) times.

There was a utcnow() function in trove.common.utils which just wrapped
datetime.datetime.utcnow(). That has been moved now to
trove.common.timeutils with the other new time related functions.

There were a couple of places in Trove where code was using
datetime.now() which was not ideal. Those have been corrected now as
well.

Unit tests have been proposed for the new routines.

Closes-Bug: #1532120
Change-Id: Ic5abf6669edd4f1a9fd62e61f437565aa887aebe
2017-06-09 16:22:11 +00:00
Gábor Antal ded64b45c6 Handle log message interpolation by the logger in common/
According to OpenStack Guideline[1], logged string message should be
interpolated by the logger.

[1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages

Change-Id: I946422e662b5efc453bfe76f3631ece1716dbb4c
Related-Bug: #1642552
2017-05-31 11:37:25 +00:00
Petr Malik 9bca402ec3 Add configuration support for clusters
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
2017-01-19 17:13:43 +00:00
Petr Malik 6e7fa196dc Add support for cluster restart
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
2017-01-13 11:41:09 -05:00
Jenkins de8f87a986 Merge "Cluster Upgrade" 2016-12-11 00:15:01 +00:00
Morgan Jones 3f93ff110b Multi-Region Support
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
2016-11-04 15:36:16 +00:00
Morgan Jones bea853a4cb Cluster Upgrade
Implement the framework for cluster upgrade, including the REST API
and the Cluster implementation with default BadRequest return.
This change does not include datastore implementations.

Implements blueprint: bp/cluster-upgrade
Depends-On: Iedb08c99bf8eb2a0b0d09e3c1ebd11965fdfff90
Change-Id: Ifde78a0ee80855e7e298b10a9ec2c8e535190205
2016-10-03 16:33:16 -04:00
Ali Adil cee1f8e6c7 Add command to delete BUILD instances and clusters
Sometimes an instance/cluster can be stuck in BUILD state forever.
Attempting to delete the instance in this state is currently not
allowed. Add force-delete and reset-status command. Reset-status
will reset the status of an instance to ERROR and cluster to NONE.

The reset-status command can only be used if the instance/cluster
is in BUILD or ERROR state. Resetting the status of an instance in
ERROR state can be useful as an instance might go ACTIVE after the
specified timeout. Once the status has been reset it is possible
for an instance to go ACTIVE if it receives a hearbeat from the
guestagent.

Force-delete will combine functionality of reset-status and delete.

Change-Id: I83f6cdcdd884e51d002295b0d1f07341990e512c
Depends-On: I957b4be5030e493e0eb8c6b6855d41b942b2823c
Partial-Bug: #1579141
2016-09-13 10:00:04 -04:00
Morgan Jones 2478c0d1d4 Implement Instance Upgrade
Implments Instance Upgrade functionality to support upgrading the
image of a Trove datastore instance from datastore_version to a
newer datastore_version of the same datastore.

This functionality builds on the Nova rebuild API to upgrade
the image of an instance with minimal downtime.

Includes datastore implementation of the upgrade functionality
for the Mysql based datastores.

Change-Id: Ie6e48d78ac07df52f686f359ca7fdadaae6ad064
Implements: blueprint image-upgrade
Depends-On: I6ec2ebb78019c014f87ba5d8cbfd284686c64f30
2016-09-08 11:32:14 -04:00
Peter Stachowski 2a9fa44364 Persist error messages and display on 'show'
When an error occurs in Trove, it is very difficult
to determine the cause without access to the
server logs. To make these errors available to
the end user, they are now persisted in the database
and can be viewed using the standard 'show' command.

Also fixed TESTS_USE_INSTANCE_ID test path, as it
somehow got broken over time.

Change-Id: I84ed28ee73a24a2dd6bdbf895662d26e406e9fae
Depends-On: I5d3339e9cbfd6aeb0c3ff6936fefa8dbe9e841f8
Implements: blueprint persist-error-message
2016-07-01 22:27:30 +00:00
Brandon Irizarry 64a869dbaf Fixed kwargs being defaulted to CONF values
The Trove code is full of numerous cases where kwargs are
defaulted to CONF values. This is an error-prone
way of setting up a default value, as python sets these one
time only. This fix accounts for that.

Change-Id: Icc0858ccb2d3e2584bf6f3d1542a7d631b251ac8
Closes-Bug: 1571076
2016-04-16 23:53:15 +00:00
Morgan Jones 5c29f40d5f Implement DBaaS Ceilometer Notifications
Defines and implements create|end|error notifications for
all state-changing Trove API calls.  Adds a notification to
the TroveContext to transfer the notification to the guest
and conductor so that errors on asynchronous commands can
be forwarded to the Conductor to be transferred to the
control plane bus.

Also did some cleanup on the existing notifications to bring
them all under a common framework in trove/common/notifications.py.
The trove.instance.exists notification was not integrated into
the new framework due to its close-coupling with the Nova
notification code.

Reworked the cluster action mechanism to move routing
functionality from the strategy to the Cluster base
class.  This was done to support tying notifications
to cluster specific actions.

Implements Blueprint: ceilometer-integration

Change-Id: I9c57d24f80d8d3116fc0cc8948094087a0495135
2016-02-27 00:16:28 +00:00