Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to specify minimum database config when restoring backup or creating as a read only replica #5564

Open
tlcox opened this issue Aug 20, 2024 · 0 comments
Labels
service/Cloud Databases Issues related to Cloud Databases service/Key Management Services Issues related to Key Management Release service/Resource Management Issues related to Resource Manager or Resource controller Issues

Comments

@tlcox
Copy link

tlcox commented Aug 20, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

terraform -v
Terraform v1.5.7
on linux_arm64
+ provider registry.terraform.io/ibm-cloud/ibm v1.68.1

Your version of Terraform is out of date! The latest version
is 1.9.4. You can update by downloading from https://www.terraform.io/downloads.html

Note: that we haven't upgraded past 1.57 for reasons somewhat associated with BUSL, but also it doesn't like our state configuration when we have tested the latest version.

Affected Resource(s)

  • ibm_database

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

locals {
  environment          = "test"
}

data "ibm_resource_group" "admin_resource_group" {
  name = "cio-devex-data-lake-admin"
}

data "ibm_resource_instance" "cio_dars_admin_key_protect" {
  name              = "cio-dars-admin-key-protect"
  location          = "us-south"
  resource_group_id = data.ibm_resource_group.admin_resource_group.id
  service           = "kms"
}

resource "ibm_kms_key" "kms_key" {
  key_name     = "cio-dars-metadata-test-upgrade-postgres-${local.environment}"
  instance_id  = data.ibm_resource_instance.cio_dars_admin_key_protect.guid
  standard_key = false
  force_delete = true
}

resource "ibm_database" "postgres" {
  resource_group_id         = data.ibm_resource_group.admin_resource_group.id
  name                      = "cio-dars-metadata-test-upgrade-postgres-${local.environment}"
  service                   = "databases-for-postgresql"
  plan                      = "standard"
  location                  = "us-south"
  group {
    group_id = "member"
    memory {
      allocation_mb = 1024
    }
    disk {
      allocation_mb = 5120
    }
    members {
      allocation_count = 3
    }
    cpu {
      allocation_count = 0
    }
  }
  service_endpoints         = "public-and-private"
  key_protect_instance      = data.ibm_resource_instance.cio_dars_admin_key_protect.id
  key_protect_key           = ibm_kms_key.kms_key.id
  version                   = "16"
  backup_id                 = "crn:1234"
  # remote_leader_id          =  "crn:4567"
  timeouts {
    create = "120m"
    update = "120m"
    delete = "15m"
  }
}

Debug Output

https://gist.github.com/tlcox/dd715e3f87af39cd7986b3c23031909d

Expected Behavior

I should be able to create a database with the minimum specs while specifying them.

Actual Behavior

I get the error messages:

[root@4a440e43692a services]# │         "message": "Please contact the Service Provider for this error. [400, Bad Request] We were unable to complete your request: group.memory requires a minimum of 3072 megabytes, group.memory must be an increment of 384 megabytes, group.disk requires a minimum of 15360 megabytes, group.disk must be an increment of 3072 megabytes. Try again with valid values or contact support if the issue persists.",

Stating that disk must be a minimum of 15360 MB in increments of 3072 MB. And that the memory must be a minimum of 3072 MB in increments of 384 MB

Note that this is not the case if I don't specify the backup to restore from, this is how we provision our normal databases. The issue also doesn't occur if we define the database without specifying the disk or memory. In that case they provision the way we want with 5GB disk and 1GB memory.

This also occurs when I specify remote_leader_id instead of a backup crn. I have tried both since the whole point of this is to upgrade from Postgres 12 to 16 and these are the 2 methods for upgrading.

Steps to Reproduce

  1. terraform apply

Important Factoids

We would just remove the specified disk and memory usage limits to get the min spec database, but have the following concerns/challenges:

  1. We define our databases with an abstraction that sets the values of these fields by default, it is hard to parameterize this and also not set when empty. Note: I did try to apply it exactly as defined above just to ensure that the abstraction itself was not the problem.
  2. I have concerns around the other resource limitations that are logged such as the increment size, since it would prevent common DB storage sizes we use in our other higher environments. Such as 100 GB.

References

  • #0000
@github-actions github-actions bot added service/Cloud Databases Issues related to Cloud Databases service/Key Management Services Issues related to Key Management Release service/Resource Management Issues related to Resource Manager or Resource controller Issues labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Cloud Databases Issues related to Cloud Databases service/Key Management Services Issues related to Key Management Release service/Resource Management Issues related to Resource Manager or Resource controller Issues
Projects
None yet
Development

No branches or pull requests

1 participant