opentelekomcloud / terraform-provider-opentelekomcloud

Terraform OpenTelekomCloud provider
https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest
Mozilla Public License 2.0
84 stars 76 forks source link

DCS4/5 - The selected cache engine type is not supported #1897

Closed uli-max closed 1 year ago

uli-max commented 2 years ago

Terraform provider version

Terraform v1.1.7 on darwin_arm64

Affected Resource(s)

opentelekomcloud_dcs_instance_v1

Terraform Configuration Files


variable "vpc_cidr" {
  default = "10.10.0.0/16"
}

module "vpc" {
  source = "registry.terraform.io/iits-consulting/project-factory/opentelekomcloud//modules/vpc"
  version = "4.2.2"
  name = "test-vpc"
  cidr_block = var.vpc_cidr
  subnets = {
    "private-subnet" = cidrsubnet(var.vpc_cidr, 1, 0)
  }
 # tags = local.tags
}
resource "opentelekomcloud_networking_secgroup_v2" "secgroup_1" {
  name = "secgroup_1"
  description = "secgroup_1"
}

data "opentelekomcloud_dcs_az_v1" "az_1" {
  port = "8002"
}

data "opentelekomcloud_dcs_product_v1" "product_1" {
  spec_code = "dcs.master_standby"
}

resource "opentelekomcloud_dcs_instance_v1" "instance_1" {
  name = "test-cache"
  engine_version = "5.0.9"
  password = "0TCTestP@ssw0rd"
  engine = "Redis"
  capacity = 2
  vpc_id = module.vpc.vpc.id

  security_group_id = opentelekomcloud_networking_secgroup_v2.secgroup_1.id
  subnet_id = module.vpc.subnets["private-subnet"].id
  # subnet_id = "6c909f94-9f2f-4b3d-9831-bafd8a6c3ba8"
  available_zones = [data.opentelekomcloud_dcs_az_v1.az_1.id]
  product_id = data.opentelekomcloud_dcs_product_v1.product_1.id
  backup_policy {
    save_days = 1
    backup_type = "manual"
    begin_at = "00:00-01:00"
    period_type = "weekly"
    backup_at = [1, 2, 4, 6]
  }
}

Debug Output/Panic Output

opentelekomcloud_dcs_instance_v1.instance_1: Creating... ╷ │ Error: error creating DCS instance: Bad request with: [POST https://dcs.eu-de.otc.t-systems.com/v1.0/d4766cdbf7d749e49603005a53b2f41d/instances], error message: {"error":{"code":"111400007","message":"The selected cache engine type is not supported.","ext_message":null}} │ │ with opentelekomcloud_dcs_instance_v1.instance_1, │ on main.tf line 48, in resource "opentelekomcloud_dcs_instance_v1" "instance_1": │ 48: resource "opentelekomcloud_dcs_instance_v1" "instance_1" { │ ╵

Steps to Reproduce

  1. terraform apply

Expected Behavior

The DCS instance should be created. We even tried to use as version "5", "5.0" and "5.0.9"

Actual Behavior

Well it should be possible to create the actual versions. Please also refresh doucmentation and examples for the slightly changes in DCS/Redis 4/5 against DCS/Redis 3

Important Factoids

None

References

None

enriquec-kaia commented 2 years ago

I am also running into this problem, is there a workaround for this issue at the moment?

anton-sidelnikov commented 2 years ago

@uli-max @enriquec-kaia on which region you tries to create DCS?

anton-sidelnikov commented 2 years ago

Probably your problem with right choose of spec_code (flavor) for instance

enriquec-kaia commented 2 years ago

I am trying to create the DCS in eu-de-01 (primary), and eu-de-02. Let me change the spec_code (flavor) and see if I can get it to provision the redis 5.0 cluster

anton-sidelnikov commented 2 years ago

https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/1912/files - added example

enriquec-kaia commented 2 years ago

thank you @anton-sidelnikov ... got one more question, what is the correlation of the spec_code (flavor) and the capacity? ... I was able to successfully create a redis 5.0 cluster by using your example pointed above ... thank you for that

anton-sidelnikov commented 2 years ago

Released with updated doc, please check

anton-sidelnikov commented 2 years ago

thank you @anton-sidelnikov ... got one more question, what is the correlation of the spec_code (flavor) and the capacity? ... I was able to successfully create a redis 5.0 cluster by using your example pointed above ... thank you for that

For versions above 3.0, the last number of flavor point to capacity, redis.ha.xu1.large.r2.2 = capacity 2 redis.ha.xu1.tiny.r2.128 = capacity 0.125 (tiny) something like than, but we also do not have proper mapping docs.

enriquec-kaia commented 2 years ago

I am running into the following issue ... when product_id is set to redis.ha.xu1.large.r3.4 instance type master\standby the cluster gets provisioned properly, when I tried to provisioned a single_node instance type (smaller) with the following product_id redis.single.xu1.tiny.128 I am receiving the error below

error message: {"error":{"code":"111400086","message":"only master standby instance is support this action","ext_message":null}}

it seems like only ha types (flavors/produc_id) are supported, but I wanted to ask I've upgraded to the latest opentelekomcloud version 1.31.2 ... any help is appreciate it

anton-sidelnikov commented 2 years ago

I am running into the following issue ... when product_id is set to redis.ha.xu1.large.r3.4 instance type master\standby the cluster gets provisioned properly, when I tried to provisioned a single_node instance type (smaller) with the following product_id redis.single.xu1.tiny.128 I am receiving the error below

error message: {"error":{"code":"111400086","message":"only master standby instance is support this action","ext_message":null}}

it seems like only ha types (flavors/produc_id) are supported, but I wanted to ask I've upgraded to the latest opentelekomcloud version 1.31.2 ... any help is appreciate it

Please attach your config

anton-sidelnikov commented 2 years ago

this works for single node

data "opentelekomcloud_dcs_az_v1" "az_1" {
  port = "8002"
  code = "eu-de-01"
}

data "opentelekomcloud_dcs_product_v1" "product_1" {
  spec_code = "redis.ha.xu1.large.r3.4"
}

resource "opentelekomcloud_dcs_instance_v1" "instance_1" {
  name              = "instance"
  engine_version    = "5.0"
  password          = "Hungarian_rapsody"
  engine            = "Redis"
  capacity          = 4
  vpc_id            = data.opentelekomcloud_vpc_subnet_v1.shared_subnet.vpc_id
  security_group_id = data.opentelekomcloud_networking_secgroup_v2.default_secgroup.id
  subnet_id         = data.opentelekomcloud_vpc_subnet_v1.shared_subnet.network_id
  available_zones   = [data.opentelekomcloud_dcs_az_v1.az_1.id]
  product_id        = data.opentelekomcloud_dcs_product_v1.product_1.id
}