-
Notifications
You must be signed in to change notification settings - Fork 50
Add support for autoscale VM groups #213
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
Conversation
…-provider into add-autoscale-support
test failures due to: apache/cloudstack-go#119 |
let’s rerun tests once #119 is merged, lgtm otherwise. |
@Pearl1594 is it possible to add tests and documentation for the resources and data source. On testing found that on terraform destroy the plugin is crashing
|
is the cleanup option included via terraform https://cloudstack.apache.org/api/apidocs-4.21/apis/deleteAutoScaleVmGroup.html Also is it possible to include enable and disable autoscaling group support via terraform https://cloudstack.apache.org/api/apidocs-4.21/apis/disableAutoScaleVmGroup.html https://cloudstack.apache.org/api/apidocs-4.21/apis/enableAutoScaleVmGroup.html |
Thanks @kiranchavala. I am working on adding the support for those. |
@kiranchavala I've addressed your comments/concerns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Tested manually with the following
Apply, destroy worked
provider "cloudstack" {
api_url = var.cloudstack_api_url
api_key = var.cloudstack_api_key
secret_key = var.cloudstack_secret_key
}
data "cloudstack_counter" "existing_cpu_counter" {
id = "4b27ead4-8c8b-11f0-b0ae-1e0092000273"
}
resource "cloudstack_ipaddress" "lb_public_ip" {
network_id = "e14203af-6474-4a13-8384-5f63a894cf26"
zone = "05d9863d-bd94-41c2-bba8-251aab44637a"
}
resource "cloudstack_firewall" "http_firewall" {
ip_address_id = cloudstack_ipaddress.lb_public_ip.id
rule {
cidr_list = ["0.0.0.0/0"]
protocol = "tcp"
ports = ["80"]
}
}
resource "cloudstack_loadbalancer_rule" "autoscale_lb" {
name = "autoscale-lb-rule"
description = "Load balancer rule for autoscale group"
ip_address_id = cloudstack_ipaddress.lb_public_ip.id
network_id = "e14203af-6474-4a13-8384-5f63a894cf26"
algorithm = "roundrobin"
private_port = 80
public_port = 80
member_ids = []
}
resource "cloudstack_condition" "scale_up_condition" {
counter_id = data.cloudstack_counter.existing_cpu_counter.id
relational_operator = "GT"
threshold = 80.0
account_name = "admin"
domain_id = "1"
}
resource "cloudstack_condition" "scale_down_condition" {
counter_id = data.cloudstack_counter.existing_cpu_counter.id
relational_operator = "LT"
threshold = 20.0
account_name = "admin"
domain_id = "1"
}
resource "cloudstack_autoscale_policy" "scale_up_policy" {
name = "scale-up"
action = "scaleup"
duration = 300
quiet_time = 300
condition_ids = [cloudstack_condition.scale_up_condition.id]
}
resource "cloudstack_autoscale_policy" "scale_down_policy" {
name = "scale-down"
action = "scaledown"
duration = 300
quiet_time = 300
condition_ids = [cloudstack_condition.scale_down_condition.id]
}
resource "cloudstack_autoscale_vm_profile" "vm_profile" {
service_offering = "CKS"
template = "41b6337d-6abd-45ab-b799-a28b6f627cdb"
zone = "05d9863d-bd94-41c2-bba8-251aab44637a"
destroy_vm_grace_period = "30s"
counter_param_list = {
"snmpcommunity" = "public"
"snmpport" = "161"
}
user_data = base64encode(<<-EOF
#!/bin/bash
apt-get update -y
apt-get install -y apache2
a2enmod cgi
sed -i -e '/Options Indexes FollowSymLinks/s/$/ ExecCGI/' \
-e 's/DirectoryIndex index.html/DirectoryIndex index.py/' /etc/apache2/apache2.conf
cat << EOFCGI > /etc/apache2/conf-available/python-cgi.conf
<Directory "/var/www/html">
AddHandler cgi-script .py
Options +ExecCGI
</Directory>
EOFCGI
a2enconf python-cgi
cat << 'EOFPY' > /var/www/html/index.py
#!/usr/bin/env python3
import time
import socket
time.sleep(5)
print("Content-type: text/html\n\n")
print('<p style="text-align: center;">Hello World!!!</p>')
print('<p style="text-align: center;"><strong>Instance:</strong> {}</p>'.format(socket.gethostname()))
EOFPY
chmod 705 /var/www/html/index.py
systemctl enable apache2
systemctl restart apache2
EOF
)
user_data_details = {
"environment" = "autoscale"
"application" = "web-server"
}
account_name = "Admin"
domain_id = "1"
display = true
other_deploy_params = {
"rootdisksize" = "20"
}
}
resource "cloudstack_autoscale_vm_group" "vm_group" {
name = "simple-autoscale-group"
lbrule_id = cloudstack_loadbalancer_rule.autoscale_lb.id
min_members = 1
max_members = 5
vm_profile_id = cloudstack_autoscale_vm_profile.vm_profile.id
scaleup_policy_ids = [
cloudstack_autoscale_policy.scale_up_policy.id
]
scaledown_policy_ids = [
cloudstack_autoscale_policy.scale_down_policy.id
]
cleanup = true
}
output "network_id" {
description = "ID of the created isolated network"
value = "e14203af-6474-4a13-8384-5f63a894cf26"
}
output "network_cidr" {
description = "CIDR of the isolated network"
value = "10.1.1.0/24"
}
output "public_ip_address" {
description = "Public IP address for the load balancer"
value = cloudstack_ipaddress.lb_public_ip.ip_address
}
output "load_balancer_url" {
description = "URL to access the load balanced application"
value = "http://${cloudstack_ipaddress.lb_public_ip.ip_address}"
}
output "autoscale_group_id" {
description = "ID of the autoscale VM group"
value = cloudstack_autoscale_vm_group.vm_group.id
}
output "template_id" {
description = "ID of the registered Ubuntu template"
value = "41b6337d-6abd-45ab-b799-a28b6f627cdb"
}
output "load_balancer_members" {
description = "Current members of the load balancer"
value = cloudstack_loadbalancer_rule.autoscale_lb.member_ids
}
terraform apply
data.cloudstack_counter.existing_cpu_counter: Reading...
data.cloudstack_counter.existing_cpu_counter: Read complete after 0s [id=4b27ead4-8c8b-11f0-b0ae-1e0092000273]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
+ create
Terraform will perform the following actions:
# cloudstack_autoscale_policy.scale_down_policy will be created
+ resource "cloudstack_autoscale_policy" "scale_down_policy" {
+ action = "SCALEDOWN"
+ condition_ids = (known after apply)
+ duration = 300
+ id = (known after apply)
+ name = "scale-down"
+ quiet_time = 300
}
# cloudstack_autoscale_policy.scale_up_policy will be created
+ resource "cloudstack_autoscale_policy" "scale_up_policy" {
+ action = "SCALEUP"
+ condition_ids = (known after apply)
+ duration = 300
+ id = (known after apply)
+ name = "scale-up"
+ quiet_time = 300
}
# cloudstack_autoscale_vm_group.vm_group will be created
+ resource "cloudstack_autoscale_vm_group" "vm_group" {
+ cleanup = true
+ id = (known after apply)
+ lbrule_id = (known after apply)
+ max_members = 5
+ min_members = 1
+ name = "simple-autoscale-group"
+ scaledown_policy_ids = (known after apply)
+ scaleup_policy_ids = (known after apply)
+ state = "enable"
+ vm_profile_id = (known after apply)
}
# cloudstack_autoscale_vm_profile.vm_profile will be created
+ resource "cloudstack_autoscale_vm_profile" "vm_profile" {
+ account_name = "Admin"
+ counter_param_list = {
+ "snmpcommunity" = "public"
+ "snmpport" = "161"
}
+ destroy_vm_grace_period = "30s"
+ display = true
+ domain_id = "1"
+ id = (known after apply)
+ metadata = (known after apply)
+ other_deploy_params = {
+ "rootdisksize" = "20"
}
+ service_offering = "CKS"
+ template = "41b6337d-6abd-45ab-b799-a28b6f627cdb"
+ user_data = "IyEvYmluL2Jhc2gKYXB0LWdldCB1cGRhdGUgLXkKCmFwdC1nZXQgaW5zdGFsbCAteSBhcGFjaGUyCmEyZW5tb2QgY2dpCgpzZWQgLWkgLWUgJy9PcHRpb25zIEluZGV4ZXMgRm9sbG93U3ltTGlua3Mvcy8kLyBFeGVjQ0dJLycgXAogICAgICAgLWUgJ3MvRGlyZWN0b3J5SW5kZXggaW5kZXguaHRtbC9EaXJlY3RvcnlJbmRleCBpbmRleC5weS8nIC9ldGMvYXBhY2hlMi9hcGFjaGUyLmNvbmYKCmNhdCA8PCBFT0ZDR0kgPiAvZXRjL2FwYWNoZTIvY29uZi1hdmFpbGFibGUvcHl0aG9uLWNnaS5jb25mCjxEaXJlY3RvcnkgIi92YXIvd3d3L2h0bWwiPgogICAgQWRkSGFuZGxlciBjZ2ktc2NyaXB0IC5weQogICAgT3B0aW9ucyArRXhlY0NHSQo8L0RpcmVjdG9yeT4KRU9GQ0dJCgphMmVuY29uZiBweXRob24tY2dpCgpjYXQgPDwgJ0VPRlBZJyA+IC92YXIvd3d3L2h0bWwvaW5kZXgucHkKIyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwppbXBvcnQgdGltZQppbXBvcnQgc29ja2V0CnRpbWUuc2xlZXAoNSkKcHJpbnQoIkNvbnRlbnQtdHlwZTogdGV4dC9odG1sXG5cbiIpCnByaW50KCc8cCBzdHlsZT0idGV4dC1hbGlnbjogY2VudGVyOyI+SGVsbG8gV29ybGQhISE8L3A+JykKcHJpbnQoJzxwIHN0eWxlPSJ0ZXh0LWFsaWduOiBjZW50ZXI7Ij48c3Ryb25nPkluc3RhbmNlOjwvc3Ryb25nPiB7fTwvcD4nLmZvcm1hdChzb2NrZXQuZ2V0aG9zdG5hbWUoKSkpCkVPRlBZCgpjaG1vZCA3MDUgL3Zhci93d3cvaHRtbC9pbmRleC5weQoKc3lzdGVtY3RsIGVuYWJsZSBhcGFjaGUyCnN5c3RlbWN0bCByZXN0YXJ0IGFwYWNoZTIK"
+ user_data_details = {
+ "application" = "web-server"
+ "environment" = "autoscale"
}
+ zone = "05d9863d-bd94-41c2-bba8-251aab44637a"
}
# cloudstack_condition.scale_down_condition will be created
+ resource "cloudstack_condition" "scale_down_condition" {
+ account_name = "admin"
+ counter_id = "4b27ead4-8c8b-11f0-b0ae-1e0092000273"
+ domain_id = "1"
+ id = (known after apply)
+ relational_operator = "LT"
+ threshold = 20
}
# cloudstack_condition.scale_up_condition will be created
+ resource "cloudstack_condition" "scale_up_condition" {
+ account_name = "admin"
+ counter_id = "4b27ead4-8c8b-11f0-b0ae-1e0092000273"
+ domain_id = "1"
+ id = (known after apply)
+ relational_operator = "GT"
+ threshold = 80
}
# cloudstack_firewall.http_firewall will be created
+ resource "cloudstack_firewall" "http_firewall" {
+ id = (known after apply)
+ ip_address_id = (known after apply)
+ managed = false
+ parallelism = 2
+ project = (known after apply)
+ rule {
+ cidr_list = [
+ "0.0.0.0/0",
]
+ icmp_code = (known after apply)
+ icmp_type = (known after apply)
+ ports = [
+ "80",
]
+ protocol = "tcp"
+ uuids = (known after apply)
}
}
# cloudstack_ipaddress.lb_public_ip will be created
+ resource "cloudstack_ipaddress" "lb_public_ip" {
+ id = (known after apply)
+ ip_address = (known after apply)
+ is_portable = false
+ is_source_nat = (known after apply)
+ network_id = "e14203af-6474-4a13-8384-5f63a894cf26"
+ project = (known after apply)
+ tags = (known after apply)
+ zone = "05d9863d-bd94-41c2-bba8-251aab44637a"
}
# cloudstack_loadbalancer_rule.autoscale_lb will be created
+ resource "cloudstack_loadbalancer_rule" "autoscale_lb" {
+ algorithm = "roundrobin"
+ description = "Load balancer rule for autoscale group"
+ id = (known after apply)
+ ip_address_id = (known after apply)
+ name = "autoscale-lb-rule"
+ network_id = "e14203af-6474-4a13-8384-5f63a894cf26"
+ private_port = 80
+ project = (known after apply)
+ protocol = (known after apply)
+ public_port = 80
}
Plan: 9 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ autoscale_group_id = (known after apply)
+ load_balancer_url = (known after apply)
+ network_cidr = "10.1.1.0/24"
+ network_id = "e14203af-6474-4a13-8384-5f63a894cf26"
+ public_ip_address = (known after apply)
+ template_id = "41b6337d-6abd-45ab-b799-a28b6f627cdb"
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
cloudstack_ipaddress.lb_public_ip: Creating...
cloudstack_condition.scale_up_condition: Creating...
cloudstack_autoscale_vm_profile.vm_profile: Creating...
cloudstack_condition.scale_down_condition: Creating...
cloudstack_condition.scale_up_condition: Creation complete after 1s [id=a5a03cde-58bd-4ec6-a08c-9a545b78e004]
cloudstack_condition.scale_down_condition: Creation complete after 1s [id=70d682f7-e96a-4c9d-90c5-9d5a5e6a9514]
cloudstack_autoscale_policy.scale_down_policy: Creating...
cloudstack_autoscale_policy.scale_up_policy: Creating...
cloudstack_ipaddress.lb_public_ip: Creation complete after 1s [id=10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f]
cloudstack_loadbalancer_rule.autoscale_lb: Creating...
cloudstack_firewall.http_firewall: Creating...
cloudstack_autoscale_policy.scale_up_policy: Creation complete after 0s [id=57baea62-2a75-4d79-837b-c32490aabe35]
cloudstack_autoscale_policy.scale_down_policy: Creation complete after 0s [id=575264b1-e6e7-43fa-90f4-f3ebae2e54c8]
cloudstack_autoscale_vm_profile.vm_profile: Creation complete after 4s [id=e3b8c745-5c8e-478b-85ee-01666e09ef88]
cloudstack_firewall.http_firewall: Creation complete after 8s [id=10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f]
cloudstack_loadbalancer_rule.autoscale_lb: Still creating... [00m10s elapsed]
cloudstack_loadbalancer_rule.autoscale_lb: Creation complete after 12s [id=099b29f1-357a-4d1a-8f03-1f0910cd0c5b]
cloudstack_autoscale_vm_group.vm_group: Creating...
cloudstack_autoscale_vm_group.vm_group: Creation complete after 8s [id=dba7ced2-01ff-4615-82ba-7a3f9c362fbb]
Apply complete! Resources: 9 added, 0 changed, 0 destroyed.
Outputs:
autoscale_group_id = "dba7ced2-01ff-4615-82ba-7a3f9c362fbb"
load_balancer_url = "http://10.0.52.109"
network_cidr = "10.1.1.0/24"
network_id = "e14203af-6474-4a13-8384-5f63a894cf26"
public_ip_address = "10.0.52.109"
template_id = "41b6337d-6abd-45ab-b799-a28b6f627cdb"
╭─ ~/Desktop/cloudstack-India-demo/cloudstack-terraform copy ✔ ╱ 25s ╱ Azure subscription 1 ╱ 10:24:02 PM
╰─ terraform destroy
cloudstack_ipaddress.lb_public_ip: Refreshing state... [id=10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f]
data.cloudstack_counter.existing_cpu_counter: Reading...
cloudstack_autoscale_vm_profile.vm_profile: Refreshing state... [id=e3b8c745-5c8e-478b-85ee-01666e09ef88]
data.cloudstack_counter.existing_cpu_counter: Read complete after 0s [id=4b27ead4-8c8b-11f0-b0ae-1e0092000273]
cloudstack_condition.scale_up_condition: Refreshing state... [id=a5a03cde-58bd-4ec6-a08c-9a545b78e004]
cloudstack_condition.scale_down_condition: Refreshing state... [id=70d682f7-e96a-4c9d-90c5-9d5a5e6a9514]
cloudstack_loadbalancer_rule.autoscale_lb: Refreshing state... [id=099b29f1-357a-4d1a-8f03-1f0910cd0c5b]
cloudstack_firewall.http_firewall: Refreshing state... [id=10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f]
cloudstack_autoscale_policy.scale_down_policy: Refreshing state... [id=575264b1-e6e7-43fa-90f4-f3ebae2e54c8]
cloudstack_autoscale_policy.scale_up_policy: Refreshing state... [id=57baea62-2a75-4d79-837b-c32490aabe35]
cloudstack_autoscale_vm_group.vm_group: Refreshing state... [id=dba7ced2-01ff-4615-82ba-7a3f9c362fbb]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
- destroy
Terraform will perform the following actions:
# cloudstack_autoscale_policy.scale_down_policy will be destroyed
- resource "cloudstack_autoscale_policy" "scale_down_policy" {
- action = "SCALEDOWN" -> null
- condition_ids = [
- "70d682f7-e96a-4c9d-90c5-9d5a5e6a9514",
] -> null
- duration = 300 -> null
- id = "575264b1-e6e7-43fa-90f4-f3ebae2e54c8" -> null
- name = "scale-down" -> null
- quiet_time = 300 -> null
}
# cloudstack_autoscale_policy.scale_up_policy will be destroyed
- resource "cloudstack_autoscale_policy" "scale_up_policy" {
- action = "SCALEUP" -> null
- condition_ids = [
- "a5a03cde-58bd-4ec6-a08c-9a545b78e004",
] -> null
- duration = 300 -> null
- id = "57baea62-2a75-4d79-837b-c32490aabe35" -> null
- name = "scale-up" -> null
- quiet_time = 300 -> null
}
# cloudstack_autoscale_vm_group.vm_group will be destroyed
- resource "cloudstack_autoscale_vm_group" "vm_group" {
- cleanup = true -> null
- display = true -> null
- id = "dba7ced2-01ff-4615-82ba-7a3f9c362fbb" -> null
- interval = 30 -> null
- lbrule_id = "099b29f1-357a-4d1a-8f03-1f0910cd0c5b" -> null
- max_members = 5 -> null
- min_members = 1 -> null
- name = "simple-autoscale-group" -> null
- scaledown_policy_ids = [
- "575264b1-e6e7-43fa-90f4-f3ebae2e54c8",
] -> null
- scaleup_policy_ids = [
- "57baea62-2a75-4d79-837b-c32490aabe35",
] -> null
- state = "enable" -> null
- vm_profile_id = "e3b8c745-5c8e-478b-85ee-01666e09ef88" -> null
}
# cloudstack_autoscale_vm_profile.vm_profile will be destroyed
- resource "cloudstack_autoscale_vm_profile" "vm_profile" {
- account_name = "admin" -> null
- counter_param_list = {
- "snmpcommunity" = "public"
- "snmpport" = "161"
} -> null
- destroy_vm_grace_period = "30s" -> null
- display = false -> null
- domain_id = "16f19ba6-8c8b-11f0-b0ae-1e0092000273" -> null
- id = "e3b8c745-5c8e-478b-85ee-01666e09ef88" -> null
- metadata = {} -> null
- other_deploy_params = {
- "rootdisksize" = "20"
} -> null
- service_offering = "CKS" -> null
- template = "41b6337d-6abd-45ab-b799-a28b6f627cdb" -> null
- user_data = "IyEvYmluL2Jhc2gKYXB0LWdldCB1cGRhdGUgLXkKCmFwdC1nZXQgaW5zdGFsbCAteSBhcGFjaGUyCmEyZW5tb2QgY2dpCgpzZWQgLWkgLWUgJy9PcHRpb25zIEluZGV4ZXMgRm9sbG93U3ltTGlua3Mvcy8kLyBFeGVjQ0dJLycgXAogICAgICAgLWUgJ3MvRGlyZWN0b3J5SW5kZXggaW5kZXguaHRtbC9EaXJlY3RvcnlJbmRleCBpbmRleC5weS8nIC9ldGMvYXBhY2hlMi9hcGFjaGUyLmNvbmYKCmNhdCA8PCBFT0ZDR0kgPiAvZXRjL2FwYWNoZTIvY29uZi1hdmFpbGFibGUvcHl0aG9uLWNnaS5jb25mCjxEaXJlY3RvcnkgIi92YXIvd3d3L2h0bWwiPgogICAgQWRkSGFuZGxlciBjZ2ktc2NyaXB0IC5weQogICAgT3B0aW9ucyArRXhlY0NHSQo8L0RpcmVjdG9yeT4KRU9GQ0dJCgphMmVuY29uZiBweXRob24tY2dpCgpjYXQgPDwgJ0VPRlBZJyA+IC92YXIvd3d3L2h0bWwvaW5kZXgucHkKIyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwppbXBvcnQgdGltZQppbXBvcnQgc29ja2V0CnRpbWUuc2xlZXAoNSkKcHJpbnQoIkNvbnRlbnQtdHlwZTogdGV4dC9odG1sXG5cbiIpCnByaW50KCc8cCBzdHlsZT0idGV4dC1hbGlnbjogY2VudGVyOyI+SGVsbG8gV29ybGQhISE8L3A+JykKcHJpbnQoJzxwIHN0eWxlPSJ0ZXh0LWFsaWduOiBjZW50ZXI7Ij48c3Ryb25nPkluc3RhbmNlOjwvc3Ryb25nPiB7fTwvcD4nLmZvcm1hdChzb2NrZXQuZ2V0aG9zdG5hbWUoKSkpCkVPRlBZCgpjaG1vZCA3MDUgL3Zhci93d3cvaHRtbC9pbmRleC5weQoKc3lzdGVtY3RsIGVuYWJsZSBhcGFjaGUyCnN5c3RlbWN0bCByZXN0YXJ0IGFwYWNoZTIK" -> null
- user_data_details = {} -> null
- zone = "05d9863d-bd94-41c2-bba8-251aab44637a" -> null
}
# cloudstack_condition.scale_down_condition will be destroyed
- resource "cloudstack_condition" "scale_down_condition" {
- account_name = "admin" -> null
- counter_id = "4b27ead4-8c8b-11f0-b0ae-1e0092000273" -> null
- domain_id = "16f19ba6-8c8b-11f0-b0ae-1e0092000273" -> null
- id = "70d682f7-e96a-4c9d-90c5-9d5a5e6a9514" -> null
- relational_operator = "LT" -> null
- threshold = 20 -> null
}
# cloudstack_condition.scale_up_condition will be destroyed
- resource "cloudstack_condition" "scale_up_condition" {
- account_name = "admin" -> null
- counter_id = "4b27ead4-8c8b-11f0-b0ae-1e0092000273" -> null
- domain_id = "16f19ba6-8c8b-11f0-b0ae-1e0092000273" -> null
- id = "a5a03cde-58bd-4ec6-a08c-9a545b78e004" -> null
- relational_operator = "GT" -> null
- threshold = 80 -> null
}
# cloudstack_firewall.http_firewall will be destroyed
- resource "cloudstack_firewall" "http_firewall" {
- id = "10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f" -> null
- ip_address_id = "10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f" -> null
- managed = false -> null
- parallelism = 2 -> null
- rule {
- cidr_list = [
- "0.0.0.0/0",
] -> null
- icmp_code = 0 -> null
- icmp_type = 0 -> null
- ports = [
- "80",
] -> null
- protocol = "tcp" -> null
- uuids = {
- "80" = "016d7d1e-eaa9-47f4-bd13-2c39106143bf"
} -> null
}
}
# cloudstack_ipaddress.lb_public_ip will be destroyed
- resource "cloudstack_ipaddress" "lb_public_ip" {
- id = "10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f" -> null
- ip_address = "10.0.52.109" -> null
- is_portable = false -> null
- is_source_nat = false -> null
- network_id = "e14203af-6474-4a13-8384-5f63a894cf26" -> null
- tags = {} -> null
- zone = "05d9863d-bd94-41c2-bba8-251aab44637a" -> null
# (1 unchanged attribute hidden)
}
# cloudstack_loadbalancer_rule.autoscale_lb will be destroyed
- resource "cloudstack_loadbalancer_rule" "autoscale_lb" {
- algorithm = "roundrobin" -> null
- description = "Load balancer rule for autoscale group" -> null
- id = "099b29f1-357a-4d1a-8f03-1f0910cd0c5b" -> null
- ip_address_id = "10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f" -> null
- member_ids = [
- "2cbcf453-4904-4d83-9457-9a76ac9038d1",
] -> null
- name = "autoscale-lb-rule" -> null
- network_id = "e14203af-6474-4a13-8384-5f63a894cf26" -> null
- private_port = 80 -> null
- public_port = 80 -> null
# (2 unchanged attributes hidden)
}
Plan: 0 to add, 0 to change, 9 to destroy.
Changes to Outputs:
- autoscale_group_id = "dba7ced2-01ff-4615-82ba-7a3f9c362fbb" -> null
- load_balancer_members = [] -> null
- load_balancer_url = "http://10.0.52.109" -> null
- network_cidr = "10.1.1.0/24" -> null
- network_id = "e14203af-6474-4a13-8384-5f63a894cf26" -> null
- public_ip_address = "10.0.52.109" -> null
- template_id = "41b6337d-6abd-45ab-b799-a28b6f627cdb" -> null
Do you really want to destroy all resources?
Terraform will destroy all your managed infrastructure, as shown above.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
cloudstack_autoscale_vm_group.vm_group: Destroying... [id=dba7ced2-01ff-4615-82ba-7a3f9c362fbb]
cloudstack_firewall.http_firewall: Destroying... [id=10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f]
cloudstack_firewall.http_firewall: Destruction complete after 8s
cloudstack_autoscale_vm_group.vm_group: Still destroying... [id=dba7ced2-01ff-4615-82ba-7a3f9c362fbb, 00m10s elapsed]
cloudstack_autoscale_vm_group.vm_group: Still destroying... [id=dba7ced2-01ff-4615-82ba-7a3f9c362fbb, 00m20s elapsed]
cloudstack_autoscale_vm_group.vm_group: Still destroying... [id=dba7ced2-01ff-4615-82ba-7a3f9c362fbb, 00m30s elapsed]
cloudstack_autoscale_vm_group.vm_group: Destruction complete after 37s
cloudstack_loadbalancer_rule.autoscale_lb: Destroying... [id=099b29f1-357a-4d1a-8f03-1f0910cd0c5b]
cloudstack_autoscale_policy.scale_down_policy: Destroying... [id=575264b1-e6e7-43fa-90f4-f3ebae2e54c8]
cloudstack_autoscale_policy.scale_up_policy: Destroying... [id=57baea62-2a75-4d79-837b-c32490aabe35]
cloudstack_autoscale_vm_profile.vm_profile: Destroying... [id=e3b8c745-5c8e-478b-85ee-01666e09ef88]
cloudstack_autoscale_policy.scale_up_policy: Destruction complete after 1s
cloudstack_condition.scale_up_condition: Destroying... [id=a5a03cde-58bd-4ec6-a08c-9a545b78e004]
cloudstack_autoscale_policy.scale_down_policy: Destruction complete after 1s
cloudstack_condition.scale_down_condition: Destroying... [id=70d682f7-e96a-4c9d-90c5-9d5a5e6a9514]
cloudstack_autoscale_vm_profile.vm_profile: Destruction complete after 1s
cloudstack_condition.scale_up_condition: Destruction complete after 0s
cloudstack_condition.scale_down_condition: Destruction complete after 1s
cloudstack_loadbalancer_rule.autoscale_lb: Destruction complete after 8s
cloudstack_ipaddress.lb_public_ip: Destroying... [id=10ffaaf7-066c-43f3-a1d5-6c00bcca0f1f]
cloudstack_ipaddress.lb_public_ip: Destruction complete after 0s
Destroy complete! Resources: 9 destroyed.
@Pearl1594 can we add some tests if possible Also, will there be an issue if the upcoming terraform release includes this without a go release or will it work fine after a go release is performed |
@Pearl1594 can you look at the failing tests? |
@kiranchavala this fix will need to go-sdk change. Otherwise, it would fail. |
@DaanHoogland I think the failing tests are there because it needs go pr |
@DaanHoogland the test failures are because of the go-sdk change that's missing. |
also there is a conflict (now) |
can you create a release for that change? cc @vishesh92 @kiranchavala @shwstppr |
…-provider into add-autoscale-support
@Pearl1594 as discussed, hitting the following exception after
|
… lb rule associated to an asg or autoscale vm profile
Thanks for testing @kiranchavala . Can you please retest that scenario again. |
@Pearl1594 still hitting the same error |
@kiranchavala Im not able to reproduce the issue with the latest changes. |
Hitting the timeout issue Terraform is updating the resources when only "cloudstack_autoscale_vm_group" state is changed from enable to disable cloudstack_autoscale_vm_profile.vm_profile
|
Configuration:
On running the config, it successfully creates the resources and autoscale vm group:
Depends on: apache/cloudstack-go#119 , to test locally using this fix, checkout to the branch
fix-counter-response-object
on the cloudstack-go repo and add the following to the go.mod file in the tf repo: