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

Fixes for volume creation #93

Merged
merged 3 commits into from
Apr 3, 2024
Merged

Conversation

okrause
Copy link
Contributor

@okrause okrause commented Mar 19, 2024

I took a stab at fixing the two recent issues. I successfully tested volume creation, re-applies, changes and deletes of NFSv4 CVS-Performance volumes and NFSv3 CVS-Software volumes.

- Fix for issue NetApp#90
- Fix for issue NetApp#92
@okrause
Copy link
Contributor Author

okrause commented Mar 19, 2024

@wenjun666 Please have a look.

@okrause
Copy link
Contributor Author

okrause commented Mar 19, 2024

The fix has merge conflicts, since it reverts most changes from latest commit f3a8f75

@okrause
Copy link
Contributor Author

okrause commented Mar 20, 2024

Here my environment specific code I used to test the changes.

# local variables
locals {
  network = "cvs-prd-shared-vpc"
  volume_name = "terraform-nfs-example"
  region = "us-west4"
  size = 1024
  service_level = "premium"
}

resource "netapp-gcp_volume" "gcp-volume-nfs" {
  name = local.volume_name
  region = local.region
  protocol_types = ["NFSv4"]
  network = local.network
  # When working with shared VPC, specify project number of host project
  # shared_vpc_project_number = "<hosting_project_number>"
  size = local.size
  service_level = local.service_level
  # storage_class: choose "software for CVS, choose "hardware" for CVS-Performance
  storage_class = "hardware"
  # zone: For storage_class = "software" specification of zone is required
  # zone = "europe-west1-b"
 
  # up to 5 export rules
  export_policy {
    rule {
      allowed_clients = "10.0.1.0/24"
      access          = "ReadWrite"
      has_root_access = true
      nfsv3 {
        checked = false
      }
      nfsv4 {
        checked = true
      }
    }
  }
}

resource "netapp-gcp_volume" "nfs_cvs" {
  name                     = "cvs-volume"
  pool_id                  = "6f37bb03-9da9-5682-661f-717a670ca507"
  size                     = 128
  volume_path              = "test"
  region                   = "us-east1"
  zone                     = "us-east1-b"
  network                  = local.network
  regional_ha              = true
  storage_class            = "software"
  service_level            = "standard"
  delete_on_creation_error = true
  protocol_types           = ["NFSv3"]
  export_policy {
    rule {
      access          = "ReadWrite"
      allowed_clients = "10.0.0.0/8"
      has_root_access = true
      nfsv3 {
        checked = true
      }
      nfsv4 {
        checked = false
      }
    }
  }
  unix_permissions = "0755"
}

One caveat: To make it work and generate stable plans, CVS-SO volumes need the full

      nfsv3 {
        checked = true
      }
      nfsv4 {
        checked = false
      }

in the HCL code. You cannot omit the nfsv4 part.

Also, I found out that changes e.g. to size still trigger the "Modification of Root Access is not available for SO volumes" error. The PR is incomplete.

@okrause
Copy link
Contributor Author

okrause commented Mar 20, 2024

The new commit is supposed to make changes/updates of CVS-Software volumes work.

@wenjun666 wenjun666 merged commit fea179e into NetApp:master Apr 3, 2024
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

Successfully merging this pull request may close these issues.

2 participants