dell / dell-terraform-providers

Terraform providers will provide easy and seamless integration with Dell Infrastructure.
Mozilla Public License 2.0
3 stars 1 forks source link

[BUG]: powerscale.QuotaResource unable to "terraform apply" after import due to Zone error. #10

Closed petew-nfx closed 7 months ago

petew-nfx commented 10 months ago

Bug Description

After importing a directory quota from the Powerscale cluster, "terraform apply" fails with error: Could not update Quota with error: do not update field Zone Zone is used at quota creation time to resolve personas, is not listed in the quota state, nor in the quota JSON returned by the REST api.

Resource or DataSource Name

Quota

Terraform Version

Terraform 1.6.6

OneFS Version

9.4.0.13

go Version

go 1.21.5

Operating System

MacOS Darwin Kernel Version 23.2.0

Terraform File Used

# powerscale_quota.some_path:
resource "powerscale_quota" "some_path" {
    container         = false
    enforced          = true
    include_snapshots = false
    path              = "/ifs/some_path"
    persona           = {}
    thresholds        = {
        advisory               = 0
        hard                   = 1048576
        soft                   = 0
        soft_grace             = 0
    }
    thresholds_on     = "fslogicalsize"
    type              = "directory"
}

Logs


% terraform apply 
....
powerscale_quota.studio_renderlinks: Modifying... [id=<Quota ID>]
╷
│ Error: Error updating quota
│
│   with powerscale_quota.some_path,
│   on quota_some_path.tf line 2, in resource "powerscale_quota" "some_path":
│    2: resource "powerscale_quota" "some_path" {
│
│ Could not update Quota <Quota ID> with error: do not update field Zone
...

### Steps to Reproduce

Create quota on cluster, not debug added to obtain Quota ID
isilon-cluster> isi --debug quota quota create /ifs/some_path directory --hard-threshold=1MB

Import quota 
tf-dir> terraform import powerscale_quota.some_path <quota ID>

Apply 
tf-dir> terraform apply

### Expected Behavior

terraform apply would would resolve successfully.

### Actual Behavior

terraform apply fails on Zone misalignment.

### Screenshots

_No response_

### Additional Information

_No response_
petew-nfx commented 10 months ago

If the quota is created via terraform, there is no problem. Only when importing from the cluster does the problem arise. The state of an imported directory quota contains "persona = {}" whereas the terraform created quota lacks a persona entry.

taohe1012 commented 9 months ago

hi @petew-nfx , thanks for reporting these two issues - importing then applying issue, and directory quota don't need persona issue. We will solve importing then applying issue, and remove persona from directory quota in our plan. welcome for more further comment, thanks.

forrestxia commented 7 months ago

Close since it's fixed in PR 127