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

Bug report: "whitelists" is not optional for "huaweicloud_dcs_instance" with Redist 5.0 #576

Closed
namoshizun opened this issue Sep 28, 2020 · 7 comments
Assignees
Labels
waiting-response waiting response to close the issue

Comments

@namoshizun
Copy link

namoshizun commented Sep 28, 2020

Hiii,
This issue is related to an closed issue but I can't reopen that so decided to open a new one here.
After having upgraded to v1.19.0, I tried out the improved DCS resource which should allow security group id to be optional, and capacity be fractional, according to the documentation. The resource setup I used is below:

data "huaweicloud_dcs_product" "redis" {
  spec_code = "redis.single.au1.tiny.256"
}
data "huaweicloud_dcs_az" "dcs_zone" {
  code  = "cn-south-1c"
}
resource "random_password" "redis_password" {
  length  = 16
  special = true
  override_special = "-_=+"
  min_special      = 3
}

resource "huaweicloud_dcs_instance" "redis_cache" {
  name            = "${var.project_name}-${var.environment}-redis_cache"
  description     = "KV Redis cache"
  engine          = "Redis"
  engine_version  = "5.0"
  password        = random_password.redis_password.result
  capacity          = 0.25
  vpc_id            = data.huaweicloud_vpc_v1.vpc.id
  subnet_id         = huaweicloud_vpc_subnet_v1.subnet.id
  available_zones   = [ data.huaweicloud_dcs_az.dcs_zone.id ]
  product_id        = data.huaweicloud_dcs_product.redis.id
  save_days         = 1
  backup_type       = "manual"
  begin_at          = "00:00-01:00"
  period_type       = "weekly"
  backup_at         = [7]
  whitelist_enable  = false
}
# Required exports
output "REDIS_HOST" {
  value = huaweicloud_dcs_instance.redis_cache.ip
}
output "REDIS_PORT" {
  value = huaweicloud_dcs_instance.redis_cache.port
}

But then I ran into the following error....

Error: "security_group_id": one of `security_group_id,whitelists` must be specified

  on resources.tf line 171, in resource "huaweicloud_dcs_instance" "redis_cache":
 171: resource "huaweicloud_dcs_instance" "redis_cache" {



Error: capacity: must be a whole number, got 0.25

  on resources.tf line 171, in resource "huaweicloud_dcs_instance" "redis_cache":
 171: resource "huaweicloud_dcs_instance" "redis_cache" {
@ShiChangkuo
Copy link
Collaborator

@namoshizun sorry for late.

  • Error: "security_group_id": one of `security_group_id,whitelists` must be specified --- It's a bug when whitelist_enable = false, will fix it soon.

  • Error: capacity: must be a whole number, got 0.25 --- now the type of capacity is int, an error will be occurred with the value of 0.125, 0.25, 0.5. I will check it to the backend.

@namoshizun
Copy link
Author

@ShiChangkuo Thanks :D

@ShiChangkuo
Copy link
Collaborator

@namoshizun since the issue was fixed after v1.19.1 or later, can we close it now?

@ShiChangkuo ShiChangkuo added the waiting-response waiting response to close the issue label Nov 4, 2020
@namoshizun
Copy link
Author

@ShiChangkuo thanks! I'll try this out this week

@namoshizun
Copy link
Author

@ShiChangkuo
Sorry for the late reply! I've just now tried provisioning an instance using the spec below.

data "huaweicloud_dcs_product" "redis" {
  spec_code = "redis.single.xu1.tiny.256"
}
data "huaweicloud_dcs_az" "dcs_zone" {
  code  = "cn-south-1c"
}
resource "random_password" "redis_password" {
  length  = 16
  special = true
  override_special = "-_=+"
  min_special      = 3
}


resource "huaweicloud_dcs_instance" "redis_cache" {
  name            = "${var.project_name}-${var.environment}-redis_cache"
  description     = "KV Redis cache"
  engine          = "Redis"
  engine_version  = "5.0"
  password        = random_password.redis_password.result
  capacity          = 0.25
  vpc_id            = data.huaweicloud_vpc.vpc.id
  subnet_id         = huaweicloud_vpc_subnet.subnet.id
  available_zones   = [ data.huaweicloud_dcs_az.dcs_zone.id ]
  product_id        = data.huaweicloud_dcs_product.redis.id
  save_days         = 1
  backup_type       = "manual"
  begin_at          = "00:00-01:00"
  period_type       = "weekly"
  backup_at         = [7]
  whitelist_enable  = false
}

But still not luck.. I got this error

Error: Error creating HuaweiCloud instance: Bad request with: [POST https://dcs.cn-south-1.myhuaweicloud.com/v1.0/06c8c2c15a8025512ffcc00608570650/instances], error message: {"error":{"code":"111400086","message":"only master standby instance is support this action","ext_message":null}}

  on resources.tf line 33, in resource "huaweicloud_dcs_instance" "redis_cache":
  33: resource "huaweicloud_dcs_instance" "redis_cache" {

PS: I've upgraded to v1.19.2

@ShiChangkuo
Copy link
Collaborator

@namoshizun I also encounted the same error in cn-south-1, and provision a Redis instance with redis.ha.au1.tiny.256 in cn-north-4.

I have no idea about the error message even checking the Error Codes, maybe you can get a service tick to HuaweiCloud or try other spec_code or region.

@namoshizun
Copy link
Author

right i see...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-response waiting response to close the issue
Projects
None yet
Development

No branches or pull requests

2 participants