You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing an issue where I am trying to create a SDRS protection group, then add a server to it and have the protection group be enabled.
The issue seems to be that I am creating the protection group, which cannot be enabled yet because it's empty (has no opentelekomcloud_sdrs_protected_instance_v1). But to create a opentelekomcloud_sdrs_protected_instance_v1, I have to reference a opentelekomcloud_sdrs_protectiongroup_v1 which cannot be created because if is empty.
If I omit enabled = true from the config, terraform works but I have to enable the protection manually in the cloud console afterwards.
terraform {
required_providers {
opentelekomcloud={
source ="opentelekomcloud/opentelekomcloud"
version ="1.36.28"
}
}
}
# Get the ID of the latest imagedata"opentelekomcloud_images_image_v2""win_server_image_id" {
name=var.image_namemost_recent=true
}
# Create a keyresource"opentelekomcloud_compute_keypair_v2""create-keypair" {
name="redacted"
}
# Create Port with fixed IPresource"opentelekomcloud_networking_port_v2""create-port-1" {
name="port_1"admin_state_up="true"network_id="redacted"security_group_ids="redacted"fixed_ip {
subnet_id="redacted"ip_address=var.access_ip
}
}
# Create a server instanceresource"opentelekomcloud_compute_instance_v2""create-instance" {
name=var.ecs_nameregion=var.regionavailability_zone=var.azflavor_name=var.flavor_namekey_pair="redacted"#Boot Disk with OS Imageblock_device {
uuid=data.opentelekomcloud_images_image_v2.win_server_image_id.idsource_type="image"volume_size=120boot_index=0destination_type="volume"delete_on_termination=true
}
#DB Data Diskblock_device {
boot_index=-1delete_on_termination=truedestination_type="volume"source_type="blank"volume_size=2048volume_type="SSD"
}
#Log Diskblock_device {
boot_index=-1delete_on_termination=truedestination_type="volume"source_type="blank"volume_size=160volume_type="SSD"
}
#Network Card bound to the IP Port with the private and virtual IPsnetwork {
port=opentelekomcloud_networking_port_v2.create-port-1.idaccess_network=true
}
}
# Artificial x second delay after ecs creation to allow for Administrator password outputresource"time_sleep""wait_x_seconds" {
depends_on=[opentelekomcloud_compute_instance_v2.create-instance]
create_duration="300s"
}
# setup SDRS for the new ecsdata"opentelekomcloud_sdrs_domain_v1""dom_1" {}
resource"opentelekomcloud_sdrs_protectiongroup_v1""group_1" {
name="redacted"description="Created by terraform"source_availability_zone="eu-de-01"target_availability_zone="eu-de-02"domain_id=data.opentelekomcloud_sdrs_domain_v1.dom_1.idsource_vpc_id=var.sdrs_prodenable=true
}
resource"opentelekomcloud_sdrs_protected_instance_v1""instance_1" {
name="redacted"description="Created by terraform"group_id=opentelekomcloud_sdrs_protectiongroup_v1.group_1.idserver_id=opentelekomcloud_compute_instance_v2.create-instance.id
}
Debug Output/Panic Output
Visual Studio Code marks the line "enable = true" as Unexpected attribute: An attribute named "enable" is not expected here
Also, the error output is as follows:
module.otc-module.opentelekomcloud_sdrs_protectiongroup_v1.group_1: Creating...
╷
│ Error: error while enabling Protection Group: error enabling OpenTelekomcomCloud SDRS Protectiongroup: Bad request with: [POST https://sdrs.eu-de.otc.t-systems.com/v1/redacted/server-groups/redacted/action], error message: {"error":{"message":"Replication pair not found","code":"SDRS.1608"}}
│
│ with module.otc-module.opentelekomcloud_sdrs_protectiongroup_v1.group_1,
│ on ../terraform-common/otc-module-dbserver/main.tf line 92, in resource "opentelekomcloud_sdrs_protectiongroup_v1" "group_1":
│ 92: resource "opentelekomcloud_sdrs_protectiongroup_v1" "group_1" {
│
╵
Hi @Blogshot, kindly ensure you’re using the latest provider version and set the dr_type = "migration" attribute in opentelekomcloud_sdrs_protectiongroup_v1. Everything is working as expected on my end. I used your configuration for opentelekomcloud_sdrs_protectiongroup_v1 without enable = "true" initially and then enabled it during the second apply.
I am experiencing an issue where I am trying to create a SDRS protection group, then add a server to it and have the protection group be enabled.
The issue seems to be that I am creating the protection group, which cannot be enabled yet because it's empty (has no
opentelekomcloud_sdrs_protected_instance_v1
). But to create aopentelekomcloud_sdrs_protected_instance_v1
, I have to reference aopentelekomcloud_sdrs_protectiongroup_v1
which cannot be created because if is empty.If I omit
enabled = true
from the config, terraform works but I have to enable the protection manually in the cloud console afterwards.Terraform provider version
Terraform v1.9.8
Affected Resource(s)
opentelekomcloud_sdrs_protectiongroup_v1
Terraform Configuration Files
Debug Output/Panic Output
Visual Studio Code marks the line "enable = true" as
Unexpected attribute: An attribute named "enable" is not expected here
Also, the error output is as follows:
Steps to Reproduce
terraform apply
Expected Behavior
The SRDS should be created and enabled
Actual Behavior
Terraform errors out if
enabled = true
References
#2649
The text was updated successfully, but these errors were encountered: