IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 670 forks source link

ibm_is_backup_policy_plan CreateBackupPolicyPlanWithContext failed The requested operation is not implemented. #5764

Closed nrocaalh closed 1 week ago

nrocaalh commented 2 weeks ago

Community Note

Terraform CLI and Terraform IBM Provider Version

Affected Resource(s)

Terraform Configuration Files

resource "ibm_is_backup_policy" "policy_test1" {
    name                = "policytest1"
    resource_group      = data.ibm_resource_group.group.id

    match_user_tags = ["backuppolicy:policy1"]

    **match_resource_type = "instance"**
    included_content   = ["data_volumes","boot_volume"]

    scope   { crn = var.crn}
}

resource "ibm_is_backup_policy_plan" "policy_test1" {
    backup_policy_id = ibm_is_backup_policy.policy_test1.id
    name             = "policytest1"
    cron_spec        = "0 7 * * *"

  clone_policy {
    zones                 = ["eu-de-1", "eu-de-2"]
    max_snapshots     = 7
  }
}

Debug Output

[ERROR] CreateBackupPolicyPlanWithContext failed The requested operation is not implemented. https://gist.github.com/nrocaalh/81bbdf00de40d80b9bb7b06627e9e934

Expected Behavior

Creation of the policy and the plan for the policy.

Actual Behavior

Although the policy is created, the plan ends in error and it's not created.

Steps to Reproduce

I tried different parameters, and when the match_resource_type parameter is set to "instance", the plan ends with an error. Without this parameter, the plan is created successfully.

  1. terraform apply

Important Factoids

References

backup policy -> https://registry.terraform.io/providers/IBM-cloud/ibm/latest/docs/resources/is_backup_policy backup plan -> https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/is_backup_policy_plan

ujjwal-ibm commented 2 weeks ago

looking at it

ujjwal-ibm commented 2 weeks ago

@nrocaalh seems like fast resource for resource type instance is not supported yet,

When you're creating a plan for a policy that is for multi-volume backups , fast snapshot restore is not available.

https://cloud.ibm.com/docs/vpc?topic=vpc-create-backup-policy-and-plan&interface=ui#backup-plan-ui

https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui#backup-service-limitations

nrocaalh commented 2 weeks ago

Hi, Just to clarify, we don't configure the fast restore. What we are trying to configure is to create a plan to create snapshots of all the volumes attached on the instance. As the documentation says : "to create backups of all the Block Storage for VPC volumes that are attached to a specific virtual server instance as members of a consistency group. When you configure backups for a consistency group, you can choose to include the boot volume or leave it out. When you create multi-volume backups, you add the tag to the virtual server instance."

With the plan configured like this it fails:

resource "ibm_is_backup_policy_plan" "policy_test1" {
    backup_policy_id = ibm_is_backup_policy.policy_test1.id
    name             = "policytest1"
    cron_spec        = "0 7 * * *"

  clone_policy {
    zones                 = ["eu-de-1", "eu-de-2"]
    max_snapshots     = 7
  }
}
nrocaalh commented 2 weeks ago

Hi,

We created the plan with these parameters and without the clone policy, and it worked:

resource "ibm_is_backup_policy_plan" "policy_test1" {
    backup_policy_id = ibm_is_backup_policy.policy_test1.id
    name             = "policytest1"
    cron_spec        = "0 7 * * *"

}