Commit Graph

339 Commits

Author SHA1 Message Date
wu.chunyang 421721a3e1 Enable network_isolation by default
We have already tested this feature on our CI for an entire cycle.
It's ready to be enabled as the default value.

Change-Id: Ifbe862020f7c2b1f6684164d2a26bb5ceb37bec3
2024-04-02 15:19:29 +00:00
Bo Tran Van b127068c20 Add Datastore Version Registry Extension
Current, users can config default datastore registry for managers not by
verions. This make you can flexible when have some experimental
datastore.

With this patch, users with the administrator role can configure the
datastore registry external for each datastore version using a command,
without editing configuration files.

Story: #2010860
Task: #48534
Change-Id: I910a1ba4a9216ab29faeed03198113b4acb2cb81
2024-03-27 05:56:09 +00:00
wu.chunyang ab83ad7c85 db: Remove use of autocommit
Change-Id: I3f0d384f353069f1eb186bbfa2aa3d8afa969e05
2024-03-19 22:03:56 +08:00
Takashi Kajinami 235bd9acd7 Remove global default_password_length
This option was deprecated multiple cycles ago[1] in favor of
the datastore specific options.

[1] f4cbaf6ccd

Change-Id: I1b40fb528d5df52f132a1d8cf027a42d8b65d544
2024-01-30 03:09:33 +00:00
Takashi Kajinami 56c25337a6 The backup_aes_cbc_key option should be secret
This option takes a plain key data.

Change-Id: Ic8a438632ea93da93807c37374eee3b48d06f2d2
2024-01-13 01:04:11 +09:00
Bo Tran 8b6ff821a1 Cinder Support For Boot Volume
When use cinder to store data dir of database, also create rootdisk in cinder.

Story: #2009245
Task: #43418
Change-Id: Ia5841222c7a70cb0c88078575b4d8b4f7988d5e0
2023-12-13 09:12:18 +00:00
wu.chunyang b5e85ae2ae follow up: 3bbeeb87e0
fix typo

Change-Id: Ib7780066cce4b3f70c40ebc1280d5e86dae340a1
2023-10-25 17:47:35 +08:00
Bo Tran 4c83bb8862 Separate backup docker image for each database version
Co-Authored-By: wu.chunyang <wchy1001@gmail.com>

Story: #2010770
Task: #48087
Change-Id: I08063748e15de6767b437aa443311d41e25ed578
2023-09-21 01:21:32 +00:00
Zuul 651cee350f Merge "Fix postgresql database creation failures from prepare func" 2023-08-04 05:28:09 +00:00
wuchunyang 2f755b64b3 Add network isolation for trove
this PR adds a network_isolation config option for trove,
with network_isolation enabled, trove guest agent will
plug the user-defined port to database container by
docker host_nic network driver which is implemented in this PR.

docker host_nic network driver is a simple driver to plug host
nic to a container. this driver supports ipv4,ipv6 and dual-stack.

for more details please see the story.

story: 2010733
task: 47957

Change-Id: I35d6f8b81a2c5e847cbed3f5bc6095dc1d387165
2023-08-03 11:35:04 +00:00
wu.chunyang 8cd982be5c Fix postgresql database creation failures from prepare func
postgresql needs to restart during the bootstrap, but the postgres
driver still reports the healthy status.

this commit resets the healthy_counts when status is not healthy,
and make state_healthy_counts configurable.

Change-Id: I746b86326790dbc667f4f0d6dabcd1a656502273
2023-08-02 02:18:08 +00:00
likui 773115adce Remove the idle_timeout option.
The option was replaced 4 years ago[1] by connection_recycle_time. The
option is not anymore present in sqlalchemy. It's the good time to
remove it.

[1] 6634218415
[2] https://review.opendev.org/c/openstack/oslo.db/+/778441

Change-Id: Id288e09688062b007d57f09aebcd7c447e56f04d
2023-07-20 14:26:40 +08:00
wu.chunyang c1761147ba Don't ignore H306 pep8 check
H306: import in alphabeical order

Imports should be grouped in the following order:
standard library imports
related third party imports
local application/library specific imports
put a blank line between each group of imports.
https://docs.openstack.org/hacking/latest/user/hacking.html#imports

Change-Id: I2c188d27f0595ac3b2d71f4612d93829915e389c
2023-05-30 17:51:16 +08:00
Takashi Kajinami 8f7d01216a container_registry_password should be secret
The [guest_agent] container_registry_password option takes a credential
to access a container registry, thus its value should be hidden from
debug logs.

Story: 2010594
Task: 47456
Change-Id: I8f595fff616606a96e70d1712a3a2e65c85b3476
2023-02-20 07:37:46 +00:00
wu.chunyang c612dc6495 Fix the missing of guest-agent.conf in guest vm
This PS sets the injected_config_owner to ubuntu and the injected_config_group to root.
Story: 2010231
Task: 46023

Change-Id: I77f9d0332a123594eae434c6e1cc795242e4022d
2022-08-16 23:07:37 +08:00
wuchunyang 54c2579a35 Fix docker start failed in guest-agent
docker_insecure_registries is a StrOpt, but the default
value is '[]' which is true for a string.

Change-Id: I4b8841cc77324f274bc8210d328bc42ddef5d056
2022-08-09 23:50:03 +08:00
Hirotaka Wakabayashi 893c4b7aad Adds a configuration to use a local docker registry
This PR adds an configuration to use a local docker registry for
development and test purpose. Using this option in development,

* Developers can test images in local docker registry
* Developers don't mind DockerHub's pull ratelimit
* Developers can save bandwidth
* Developers can test database quickly

Story: 2010125
Task: 44793
Change-Id: I762702654bc4430b8432dd96bf869408b2947ff8
2022-07-02 17:26:55 +09:00
Hirotaka Wakabayashi 1580c4ca56 Adds new configurations for injected file owner
This PR adds configuration options for file owner information of
injected files in GuestVM to trove.conf. File owner information
should not be hardcoded as "trove" because it depends on user
environments.

Original problem is guest instance creation failure due to the lack of
guestagent configuration files because of the recent code chage[1].
That patch was introduced since Yoga.

[1]:https://review.opendev.org/c/openstack/trove/+/823632

Task: 45239
Story: 2010021
Change-Id: Iaccfe84c912025ec6d96e66ffa6ad7a4b9537b6e
2022-05-02 20:47:59 +09:00
Hirotaka Wakabayashi 92471bd4f3 Adds docker daemon config to injected files
This PR adds docker daemon config to injected files when
docker_bridge_network_ip option is defined in trove.conf.

Original problem is that Trove developers unable to transfer files
between GuestVMs and Controller host when controller host address
range is same with docker bridge network one.

Task: 44805
Story: 2009928
Change-Id: I6ad7eb7b2a7fb0686604b69d0175ec0d06f60384
2022-03-23 09:48:25 +09:00
Bo Tran 99df090a85 Adapt to file injection deprecation in nova
Story: #2009770
Task: #44247
Change-Id: I34d47e709a9a7478cb6a85d6e6e37da3f92e40b0
2022-01-24 17:06:05 +07:00
Lingxian Kong 02971d850b Add periodic task to remove postgres archived wal files
* Added a periodic task for postgresql datastore to clean up the
  archived WAL files.
* Added a check when creating incremental backups for postgresql.
* A new container image ``openstacktrove/db-backup-postgresql:1.1.2``
  is uploaded to docker hub.

Story: 2009066
Task: 42871
Change-Id: I235e2abf8c0405e143ded6fb48017d596b8b41a1
2021-07-23 22:16:20 +12:00
Lingxian Kong b050996b9f Use bridge network for db container
- Changed the network mode of database container to "bridge" and exposed
  the service ports.
- Use socket file to connect with the database.
- Upgrade the backup container image for postgressql.

Change-Id: Id5b119f8a474befc3a2cd6e061bbffc4ae5f7bb6
2021-06-22 19:10:14 +12:00
Dmitriy Rabotyagov 22b99fb05d Add taskmanager_manager option to common
Option `taskmanager_manager` does not have defaults and thus is required
to be set, otherwise trove-taskmanager will fail to start with
AttributeError. In the meanwhile this is not clear what value is expected
as option is not described anywhere.

This change moves option to the general list, which will make it
documented along with setting reasonable default.

Change-Id: I546ffe88b6e135c3f4c6f71b5aef03b92011bed8
2021-04-07 15:23:05 +00:00
Dmitriy Rabotyagov dfca9b1943 [doc] Add configuration reference
Config reference has been dropped for some reason several releases before.
We return configuration reference along with policy to the docs.

Change-Id: I0927466d18eca5572932fcf9e2ca6349b11ca847
2021-04-06 06:37:59 +00:00
Lingxian Kong 5640a61acb Change the default agent_heartbeat_expiry to 90s
By default, trove guest agent is sending health heartbeat msg for every
60s, so agent_heartbeat_expiry should be bigger than that.

Change-Id: I348a82aa948079b7bba5c172b8d57d5f5dee28a0
2021-02-18 17:34:01 +00:00
Lingxian Kong 52f7b67dc2 Support custom container registry for database images
Currently, trove guest agent is pulling container images from docker
hub, it's impossible to use private container registry, this patch
is adding that support.

Change-Id: I3d14810b43acbf5d2fe6afcc138d476e366042f4
2021-02-03 12:16:42 +13:00
Sam Morrison 5be23d1b20 Support ram quota
Set default to -1 so this is backwards compatible. Existing
installations will need to manully backfill quote usage for this
to work as expected.

Story: 2008293
Task: 41172

Change-Id: I455477a2e7a00f0d132971a2a684352967ac19b9
2020-11-11 09:51:26 +00:00
Sam Morrison e8287dfda9 Pass availability zone through to volume creation.
New config option `enable_volume_az` (defaults to false)
ensures that the instance and volume will be created in the same
availability zone.

Story: 2008313
Task: 41208

Change-Id: I62ea46991c7398fba4e5027d5170038624d5aec9
2020-11-09 00:50:49 +00:00
Lingxian Kong bd2b256a37 Fix restore encrypted backup
For the backups created prior to Victoria which may be encrypted, the restore
function in Victoria or later release should correctly decrypt the backup data.

Backup encryption from Victoria is disabled.

Bump the backup docker image tag to 1.1.0.

Change-Id: I7abf5563b22ab1914fa355c089a3793da07f2215
2020-10-29 23:19:03 +13:00
Lingxian Kong d1af33f17b Support mysql 8.0
* MySQL 5.7 and MySQL 8.0 need different percona-xtrabackup package version.
  Added Percona XtraBackup 8 support for MySQL 8.x backup and restore.
* Construct different backup container image names for MySQL 5.7 and MySQL 8.0
  based on the default option value.
* Two docker images are uploaded for backup/restore:
  openstacktrove/db-backup-mysql5.7:1.0.0 and
  openstacktrove/db-backup-mysql8.0:1.0.0. Trove guest agent can automatically
  choose the approriate one based on the datastore version.
* Added option "secure-file-priv=NULL" in MySQL config template to fix
  https://github.com/docker-library/mysql/issues/541.
* Stop using IDENTIFIED BY in GRANT clause (also REVOKE). Starting with MySQL 8
  creating a user implicitly using the GRANT command is not supported.

Story: #2008275
Task: #41143

Change-Id: Ibdec63324b1b39ba9b8a38dbe529da17bbb06767
2020-10-23 23:50:39 +13:00
Lingxian Kong 5482c54645 [Postgresql] Create replica
Change-Id: Ia00032074dc44a6fbfc1e2d5ab16d1734a1a732c
2020-09-11 13:48:32 +12:00
Lingxian Kong 4fb41b5198 Postgresql: Backup and restore
Change-Id: Icf08b7dc82ce501d82b45cf5412256a43716b6ae
2020-09-07 20:40:56 +12:00
Lingxian Kong 43d7aec774 Improve docker image for database backup/restore
* Decrease the image size by not installing unnecessary packages.
* Move the option 'backup_docker_image' to separate database config
  section.

Change-Id: I3362e1f8a7dc21b89c060352f2db2f138c16db07
2020-09-02 09:37:01 +12:00
Lingxian Kong d0cfb41b25 PostgreSQL support
Change-Id: I7c77b210f5a1438739daebffea104eda3bda1a45
2020-09-01 13:58:05 +12:00
Lingxian Kong 8daade000c Support to check if subnet is associated with router
Change-Id: I8041fbfdb01a7a1efa721c623ab3f43efd2cc0f0
2020-08-24 13:17:49 +12:00
Lingxian Kong cf3e9a6e74 Support to rebuild instance by admin
Change-Id: I48f8c6f997daeb6d82ff62b3325277d86fee2147
2020-08-06 20:38:11 +12: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 828e873846 Support backup strategy API
Change-Id: I0ddd7214dae6e29ddfaf045fdb282f4980a8afff
2020-07-17 11:35:53 +12:00
Lingxian Kong 5354172407 Support subnet and IP for instance creation
Support ``subnet_id`` and ``ip_address`` for creating instance. When
creating instance, trove will check the network conflicts between user's
network and the management network, additionally, the cloud admin is
able to define other reserved networks by configuring
``reserved_network_cidrs``.

Change-Id: Icc4eece2f265cb5a5c48c4f1024a9189d11b4687
2020-06-10 22:41:35 +12:00
Lingxian Kong 87b65e3c05 Support to generate config sample file
Change-Id: Ic9dc4630dd96227eb8a655c3aac223316d5a060e
2020-05-29 23:13:29 +12:00
Lingxian Kong aa1d4d2246 Datastore containerization
Significant changes:

* Using docker image to install datastore.
* Datastore image is common to different datastores.
* Using backup docker image to do backup and restore.
* Support MariaDB replication
* Set most of the functional jobs as non-voting as nested
  virtualization is not supported in CI.

Change-Id: Ia9c97a63a961eebc336b70d28dc77638144c1834
2020-05-27 10:31:50 +12:00
Lingxian Kong 429c39890e Support ip address type for instances
Include address type in getting instance response.

* Deprecate confip option network_label_regex as we don't reply on Nova
  to get addresses, network names don't make any sense.
* Add 'addresses' in instance API response, keep 'ip' as is but mark
  it deprecated in API doc, python-troveclient shouldn't break.

Story: 2007562
Task: 39445

Change-Id: Ia0458b5ddae8959ce29c17e444e1a51a026283cd
2020-04-26 09:56:50 +12:00
Minmin Ren 2547e4ef18 Support XFS disk format
Support XFS disk format

Story: #2005741
Task: #33405

Change-Id: Idc454000ce7ad95d2c461c87867704eba069bdf4
2020-03-24 02:36:58 +00:00
Lingxian Kong 602c4d42de Improve the function tests
- Execute test groups in serial to make sure no more than 2 database
  instance are created at the same time.
- Remove some unneccesary tests
- Remove unneeded datastore, e.g. 'Test_Datastore_1'
- Remove unsupported trovestack subcommands
- Move unsupported DIB elements to the 'deprecated-elements' folder
- Decrease default value of 'agent_call_high_timeout' to 5min
- Add initial_deplay for pooling task
- Use socket file to connect with database instead of using localhost
  IP

Change-Id: Ie5030a671fbeb453eafa6cbe04e08da7b52e33c9
2020-01-28 14:27:52 +13:00
Lingxian Kong dfe826402b Config admin clients as default
Change-Id: Ib4dc349ab7ed4193189ed6bc2bae699d51064998
2020-01-19 16:11:41 +13:00
Lingxian Kong 11b0b8d6f2 Fix mariadb CI - trove-scenario-mariadb-single
- Trove supports MariaDB 10.4
- From MariaDB 10.3, Mariabackup is used instead of Percona XtraBackup
  for backup functionality
- Some log improvements

Change-Id: Ibaa6fd7273b98451097b32fb6b881008a236be9f
2019-12-05 07:48:26 +13:00
Lingxian Kong f3bb46542b Use dedicated service credential config
The current admin credential config options are confusing

Change-Id: I92c15c065edf364b955f2243b3599e0b8cae8b4f
2019-10-10 11:49:04 +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 a1aa15282e Support management security group
Allow the cloud admin to control the security groups on the management
port of Trove instance, a new config option `management_security_groups`
is introduced for that purpose.

Change-Id: I4b22b87d37792be700d4ec7f78a7ea479ddb5814
Story: 2006466
Task: 36395
2019-09-02 10:06:49 +12:00
Sam Morrison 62a2385790 Add a designate V2 API dns driver
Change-Id: Iafb36333a37146787c57eded139b4c2e071d69b0
2019-08-14 22:09:27 +00:00