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

Failed to attach slb to ess scaling group #314

Closed
RainFlying opened this issue Dec 19, 2017 · 7 comments
Closed

Failed to attach slb to ess scaling group #314

RainFlying opened this issue Dec 19, 2017 · 7 comments

Comments

@RainFlying
Copy link

loadbalancer.tf

resource "alicloud_slb" "lb" {
  name = "aliproxy-${var.instance_name}"
  internet = true
  internet_charge_type = "paybytraffic"
  #vswitch_id = "${var.vswitch_id}"

  listener = [
    {
      "instance_port" = "443"
      "lb_port" = "443"
      "lb_protocol" = "tcp"
      "bandwidth" = "-1"
      "health_check" = "on"
    }
  ]

  provisioner "local-exec" {
    command = "echo aliproxy-${var.instance_name} ${self.address} > slb.txt"
  }
}

output "address" {
  value = "${alicloud_slb.lb.address}"
}
resource "alicloud_ess_scaling_group" "scaling" {
  min_size = "${var.min_size}"
  max_size = "${var.max_size}"
  removal_policies = ["OldestInstance", "NewstInstance"]
  scaling_group_name = "${var.instance_name}"
  loadbalancer_ids = ["${alicloud_slb.lb.id}"]
  vswitch_id = "${var.ess_vswitch_id}"
}

resource "alicloud_ess_scaling_configuration" "config" {
  scaling_group_id = "${alicloud_ess_scaling_group.scaling.id}"
  image_id = "${var.image_id}"
  instance_type = "${var.instance_type}"
  #io_optimized = true
  security_group_id = "${var.security_group_id}"
  scaling_configuration_name = "${var.instance_name}"
  internet_charge_type = "PayByTraffic"
  internet_max_bandwidth_in = 200
  internet_max_bandwidth_out = 100
}

resource "alicloud_ess_scaling_rule" "maximum" {
  scaling_group_id = "${alicloud_ess_scaling_group.scaling.id}"
  adjustment_type = "TotalCapacity"
  adjustment_value = 100
  cooldown = 60
  scaling_rule_name = "up2maximum"
}

resource "alicloud_ess_scaling_rule" "back2normal" {
  scaling_group_id = "${alicloud_ess_scaling_group.scaling.id}"
  adjustment_type = "TotalCapacity"
  adjustment_value = 2
  cooldown = 60
  scaling_rule_name = "back2normal"
}

After run terrform apply,
loadbalancer and scaling group was created successfully,
however, the loadbalancer was not attached to the scaling group.
Also, the scaling configuration was not active so the scaling group was disabled.

@RainFlying
Copy link
Author

After upgraded the plugin to version 1.3.6, I got the following error message:

  • alicloud_ess_scaling_group.scaling: Aliyun API Error: RequestId: FEBBC095-B4F8-4229-B203-980F1D455F8C Status Code: 400 Code: IncorrectLoadBalancerStatus Message: The current status of the load balancer "lb-wz9sq3b3jjea6mwtqxelf" does not support this action.

SLB was created successfully and running perfectly.

@RainFlying
Copy link
Author

RainFlying commented Dec 19, 2017

The second run of "terraform apply" created the scaling group successfully.

@xiaozhu36
Copy link
Collaborator

Hi @RainFlying The issue has been fixed from the latest version 1.3.3, why your version is 1.3.6?

@RainFlying
Copy link
Author

Sorry, it was a typo. I'm using version 1.3.3.

@xiaozhu36
Copy link
Collaborator

Hi @RainFlying Does the issue still exist? If so, you can update to the latest version 1.5.0 and try again. Thanks a lot.

@RainFlying
Copy link
Author

@xiaozhu36 Hi, updated to version 1.5.0. Failed to create RDS instance. Check the following for the error message:

  • alicloud_db_instance.rds: 1 error(s) occurred:

  • alicloud_db_instance.rds: Error creating Alicloud db instance: &common.Error{ErrorResponse:common.ErrorResponse{Response:common.Response{RequestId:"A3DFA432-70E1-4033-8332-5294738002D3"}, HostId:"rds.aliyuncs.com", Code:"InternalError", Message:"The request processing has failed due to some unknown error, exception or failure."}, StatusCode:500}

@xiaozhu36
Copy link
Collaborator

Hi @RainFlying I am sorry for that. The issue has been fixed by version 1.5.2, and please be update. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants