netapp

package
v0.0.0-...-0e4e14f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2025 License: MPL-2.0 Imports: 50 Imported by: 0

README

This is a maintainer file for the Azure NetApp Files service.

This document gives insights into who is maintaining this service and includes details for why certain decisions in this service package have been made.

Mainteiners

  • paulomarquesc
  • orexii

Acceptance Tests

  • There is lack of SMB-related acceptance tests because it requires Active Directory Domain Controller infrastructure which is not easy to automate properly. SMB-related tests can only be tested if the infrastructure is setup beforehand which is not that trivial. We should not require SMB tests unless it comes with Domain Controller setup automation. Without automation, the SMB acceptance tests will fail and cause disruptions in CI/bulk testing.

  • New tests failing should not be accepted.

  • For Azure NetApp Files, some features are highly dependent on specific regions, that's why for some acceptance tests, we will see regions defined there instead of for example data.Locations.Primary within the templates, this is expected and should not be changed.

Polling functions

  • Some Netapp resources requires an extra type of polling mechanism. For example:
// Waiting for volume be completely provisioned
if err := waitForVolumeCreateOrUpdate(ctx, client, id); err != nil {
  return err
}

This is because some operations return from regular SDK polling as completed but due to several factors it is still in progress (e.g. ARM caching, software and hardware layer sync delays, etc.). These wait functions are necessary and should not be removed.

  • Do not approve Pull Requests that relies on <Create or Delete Operations>ThenPoll() methods, e.g. DeleteThenPoll(), we should not use those for volume related operations due to some unknown issues with Pandora, those for Azure NetApp Files are not reliable, causing errors from time to time (and depending on the operation, very frequently) like this:
pmarques [ ~/go/src/github.com/aoshfan/terraform-provider-customazurerm ]$ make acctests SERVICE='netapp' TESTARGS=' -parallel 5 -run=TestAccNetAppVolumeGroupSAPHana_crossRegionReplication -count=1' TESTTIMEOUT='1200m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/netapp -parallel 5 -run=TestAccNetAppVolumeGroupSAPHana_crossRegionReplication -count=1 -timeout 1200m -ldflags="-X=github.com/aoshfan/terraform-provider-customazurerm/version.ProviderVersion=acc"
=== RUN   TestAccNetAppVolumeGroupSAPHana_crossRegionReplication
=== PAUSE TestAccNetAppVolumeGroupSAPHana_crossRegionReplication
=== CONT  TestAccNetAppVolumeGroupSAPHana_crossRegionReplication
    testcase.go:173: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: deleting `volume`: deleting replicate Volume (Subscription: "66bc9830-19b6-4987-94d2-0e487be7aa47"
        Resource Group Name: "acctestRG-netapp-241202215210177839"
        Net App Account Name: "acctest-NetAppAccount-Secondary-241202215210177839"
        Capacity Pool Name: "acctest-NetAppPool-Secondary-241202215210177839"
        Volume Name: "acctest-NetAppVolume-1-Secondary-241202215210177839"): polling after VolumesDeleteReplication: `result.Status` was nil/empty - `op.Status` was "DeleteReplication" / `op.Properties.ProvisioningState` was ""

        deleting `volume`: deleting replicate Volume (Subscription:
        "66bc9830-19b6-4987-94d2-0e487be7aa47"
        Resource Group Name: "acctestRG-netapp-241202215210177839"
        Net App Account Name: "acctest-NetAppAccount-Secondary-241202215210177839"
        Capacity Pool Name: "acctest-NetAppPool-Secondary-241202215210177839"
        Volume Name: "acctest-NetAppVolume-1-Secondary-241202215210177839"): polling
        after VolumesDeleteReplication: `result.Status` was nil/empty - `op.Status`
        was "DeleteReplication" / `op.Properties.ProvisioningState` was ""
--- FAIL: TestAccNetAppVolumeGroupSAPHana_crossRegionReplication (1375.67s)
FAIL
FAIL    github.com/aoshfan/terraform-provider-customazurerm/internal/services/netapp        1375.697s
FAIL
make: *** [GNUmakefile:103: acctests] Error 1

Data loss prevention protection

  • Due to possibility of a volume to be deleted due to configuration changes on config file or changes made outside of Terraform, we have decided to not allow deletion of volumes by default. This is to prevent data loss. If you want to delete a volume, you need to set the feature block configuration prevent_deletion_if_contains_resources argument to true.

    In our tests we have added this block so the tests can delete the resources, but in production customers should not allow deletion of volumes by default.

features {
  resource_group {
    prevent_deletion_if_contains_resources = false
  }
}

Resource Group Deletion on Tests

  • A feature block configuration needs to be set to ensure tests conclude when Microsoft maintainers execute their testing. Due to some Microsoft subscription management policies, certain resources are created by default during the tests. This block allows the deletion of the resource group at the end of the tests.
  features {
    resource_group {
      prevent_deletion_if_contains_resources = false
    }
  }

Azure NetApp Files has features that requires disassociation, e.g. BackupPolicyId and SnapshotPolicyIds

  • For cases where a property must have its content removed, mostly Ids (BackupPolicyId or SnapshotPolicyIds), instead of using nil, use pointer.To(""), this will trigger ANF RP to update the resource and set the value to empty string, setting as nil won't trigger any action within ANF RP.

E.g.

// Removing SnapshotId
update := volumes.VolumePatch{
    Properties: &volumes.VolumePatchProperties{
        DataProtection: &volumes.VolumePatchPropertiesDataProtection{
            Snapshot: &volumes.VolumeSnapshotProperties{
                SnapshotPolicyId: pointer.To(""),
            },
        },
    },
}
// Removing BackupPolicyId
backupPolicyIdRemoval := volumes.VolumePatch{
    Properties: &volumes.VolumePatchProperties{
        DataProtection: &volumes.VolumePatchPropertiesDataProtection{
            Backup: &volumes.VolumeBackupProperties{
                BackupPolicyId: pointer.To(""),
            },
        },
    },
}

Computed attribute of a few configuration items

  • Azure NetApp Files resources are complex enough on the backend and a few configuration items must remain in computed = true state and not changed under any circumstance, otherwise, if it is a ForceNew = true type of configuration, it may result in data loss. The best example of this is the configuration called network_features, this must be computed = true at all times, Azure NetApp Files team will soon make changes to networking that will make the property network_features be changed from basic to standard and to prevent data loss, this configuration should stay as is, with computed = true set.
"network_features": {
    Type:     pluginsdk.TypeString,
    Optional: true,
    Computed: true,
    Default:  string(volumes.NetworkFeaturesBasic),
    ValidateFunc: validation.StringInSlice([]string{
        string(volumes.NetworkFeaturesBasic),
        string(volumes.NetworkFeaturesStandard),
    }, false),
},

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSlicesEquality

func ValidateSlicesEquality(source, new []string, caseSensitive bool) bool

Types

type NetAppAccountEncryptionDataSource

type NetAppAccountEncryptionDataSource struct{}

func (NetAppAccountEncryptionDataSource) Arguments

func (NetAppAccountEncryptionDataSource) Attributes

func (NetAppAccountEncryptionDataSource) IDValidationFunc

func (NetAppAccountEncryptionDataSource) ModelObject

func (r NetAppAccountEncryptionDataSource) ModelObject() interface{}

func (NetAppAccountEncryptionDataSource) Read

func (NetAppAccountEncryptionDataSource) ResourceType

func (r NetAppAccountEncryptionDataSource) ResourceType() string

type NetAppAccountEncryptionResource

type NetAppAccountEncryptionResource struct{}

func (NetAppAccountEncryptionResource) Arguments

func (NetAppAccountEncryptionResource) Attributes

func (NetAppAccountEncryptionResource) Create

func (NetAppAccountEncryptionResource) Delete

func (NetAppAccountEncryptionResource) IDValidationFunc

func (NetAppAccountEncryptionResource) ModelObject

func (r NetAppAccountEncryptionResource) ModelObject() interface{}

func (NetAppAccountEncryptionResource) Read

func (NetAppAccountEncryptionResource) ResourceType

func (r NetAppAccountEncryptionResource) ResourceType() string

func (NetAppAccountEncryptionResource) Update

type NetAppBackupPolicyDataSource

type NetAppBackupPolicyDataSource struct{}

func (NetAppBackupPolicyDataSource) Arguments

func (NetAppBackupPolicyDataSource) Attributes

func (NetAppBackupPolicyDataSource) IDValidationFunc

func (NetAppBackupPolicyDataSource) ModelObject

func (r NetAppBackupPolicyDataSource) ModelObject() interface{}

func (NetAppBackupPolicyDataSource) Read

func (NetAppBackupPolicyDataSource) ResourceType

func (r NetAppBackupPolicyDataSource) ResourceType() string

type NetAppBackupPolicyResource

type NetAppBackupPolicyResource struct{}

func (NetAppBackupPolicyResource) Arguments

func (NetAppBackupPolicyResource) Attributes

func (r NetAppBackupPolicyResource) Attributes() map[string]*pluginsdk.Schema

func (NetAppBackupPolicyResource) Create

func (NetAppBackupPolicyResource) Delete

func (NetAppBackupPolicyResource) IDValidationFunc

func (NetAppBackupPolicyResource) ModelObject

func (r NetAppBackupPolicyResource) ModelObject() interface{}

func (NetAppBackupPolicyResource) Read

func (NetAppBackupPolicyResource) ResourceType

func (r NetAppBackupPolicyResource) ResourceType() string

func (NetAppBackupPolicyResource) Update

type NetAppBackupVaultDataSource

type NetAppBackupVaultDataSource struct{}

func (NetAppBackupVaultDataSource) Arguments

func (NetAppBackupVaultDataSource) Attributes

func (r NetAppBackupVaultDataSource) Attributes() map[string]*pluginsdk.Schema

func (NetAppBackupVaultDataSource) IDValidationFunc

func (NetAppBackupVaultDataSource) ModelObject

func (r NetAppBackupVaultDataSource) ModelObject() interface{}

func (NetAppBackupVaultDataSource) Read

func (NetAppBackupVaultDataSource) ResourceType

func (r NetAppBackupVaultDataSource) ResourceType() string

type NetAppBackupVaultResource

type NetAppBackupVaultResource struct{}

func (NetAppBackupVaultResource) Arguments

func (r NetAppBackupVaultResource) Arguments() map[string]*pluginsdk.Schema

func (NetAppBackupVaultResource) Attributes

func (r NetAppBackupVaultResource) Attributes() map[string]*pluginsdk.Schema

func (NetAppBackupVaultResource) Create

func (NetAppBackupVaultResource) Delete

func (NetAppBackupVaultResource) IDValidationFunc

func (NetAppBackupVaultResource) ModelObject

func (r NetAppBackupVaultResource) ModelObject() interface{}

func (NetAppBackupVaultResource) Read

func (NetAppBackupVaultResource) ResourceType

func (r NetAppBackupVaultResource) ResourceType() string

func (NetAppBackupVaultResource) Update

type NetAppVolumeGroupOracleDataSource

type NetAppVolumeGroupOracleDataSource struct{}

func (NetAppVolumeGroupOracleDataSource) Arguments

func (NetAppVolumeGroupOracleDataSource) Attributes

func (NetAppVolumeGroupOracleDataSource) IDValidationFunc

func (NetAppVolumeGroupOracleDataSource) ModelObject

func (r NetAppVolumeGroupOracleDataSource) ModelObject() interface{}

func (NetAppVolumeGroupOracleDataSource) Read

func (NetAppVolumeGroupOracleDataSource) ResourceType

func (r NetAppVolumeGroupOracleDataSource) ResourceType() string

type NetAppVolumeGroupOracleResource

type NetAppVolumeGroupOracleResource struct{}

func (NetAppVolumeGroupOracleResource) Arguments

func (NetAppVolumeGroupOracleResource) Attributes

func (NetAppVolumeGroupOracleResource) Create

func (NetAppVolumeGroupOracleResource) Delete

func (NetAppVolumeGroupOracleResource) IDValidationFunc

func (NetAppVolumeGroupOracleResource) ModelObject

func (r NetAppVolumeGroupOracleResource) ModelObject() interface{}

func (NetAppVolumeGroupOracleResource) Read

func (NetAppVolumeGroupOracleResource) ResourceType

func (r NetAppVolumeGroupOracleResource) ResourceType() string

func (NetAppVolumeGroupOracleResource) Update

type NetAppVolumeGroupSAPHanaDataSource

type NetAppVolumeGroupSAPHanaDataSource struct{}

func (NetAppVolumeGroupSAPHanaDataSource) Arguments

func (NetAppVolumeGroupSAPHanaDataSource) Attributes

func (NetAppVolumeGroupSAPHanaDataSource) IDValidationFunc

func (NetAppVolumeGroupSAPHanaDataSource) ModelObject

func (r NetAppVolumeGroupSAPHanaDataSource) ModelObject() interface{}

func (NetAppVolumeGroupSAPHanaDataSource) Read

func (NetAppVolumeGroupSAPHanaDataSource) ResourceType

func (r NetAppVolumeGroupSAPHanaDataSource) ResourceType() string

type NetAppVolumeGroupSAPHanaResource

type NetAppVolumeGroupSAPHanaResource struct{}

func (NetAppVolumeGroupSAPHanaResource) Arguments

func (NetAppVolumeGroupSAPHanaResource) Attributes

func (NetAppVolumeGroupSAPHanaResource) Create

func (NetAppVolumeGroupSAPHanaResource) Delete

func (NetAppVolumeGroupSAPHanaResource) IDValidationFunc

func (NetAppVolumeGroupSAPHanaResource) ModelObject

func (r NetAppVolumeGroupSAPHanaResource) ModelObject() interface{}

func (NetAppVolumeGroupSAPHanaResource) Read

func (NetAppVolumeGroupSAPHanaResource) ResourceType

func (r NetAppVolumeGroupSAPHanaResource) ResourceType() string

func (NetAppVolumeGroupSAPHanaResource) Update

type NetAppVolumeQuotaRuleDataSource

type NetAppVolumeQuotaRuleDataSource struct{}

func (NetAppVolumeQuotaRuleDataSource) Arguments

func (NetAppVolumeQuotaRuleDataSource) Attributes

func (NetAppVolumeQuotaRuleDataSource) IDValidationFunc

func (NetAppVolumeQuotaRuleDataSource) ModelObject

func (r NetAppVolumeQuotaRuleDataSource) ModelObject() interface{}

func (NetAppVolumeQuotaRuleDataSource) Read

func (NetAppVolumeQuotaRuleDataSource) ResourceType

func (r NetAppVolumeQuotaRuleDataSource) ResourceType() string

type NetAppVolumeQuotaRuleResource

type NetAppVolumeQuotaRuleResource struct{}

func (NetAppVolumeQuotaRuleResource) Arguments

func (NetAppVolumeQuotaRuleResource) Attributes

func (NetAppVolumeQuotaRuleResource) Create

func (NetAppVolumeQuotaRuleResource) Delete

func (NetAppVolumeQuotaRuleResource) IDValidationFunc

func (NetAppVolumeQuotaRuleResource) ModelObject

func (r NetAppVolumeQuotaRuleResource) ModelObject() interface{}

func (NetAppVolumeQuotaRuleResource) Read

func (NetAppVolumeQuotaRuleResource) ResourceType

func (r NetAppVolumeQuotaRuleResource) ResourceType() string

func (NetAppVolumeQuotaRuleResource) Update

type Registration

type Registration struct{}

func (Registration) AssociatedGitHubLabel

func (r Registration) AssociatedGitHubLabel() string

func (Registration) DataSources

func (r Registration) DataSources() []sdk.DataSource

DataSources returns the typed DataSources supported by this service

func (Registration) Name

func (r Registration) Name() string

func (Registration) Resources

func (r Registration) Resources() []sdk.Resource

Resources returns the typed Resources supported by this service

func (Registration) SupportedDataSources

func (r Registration) SupportedDataSources() map[string]*pluginsdk.Resource

func (Registration) SupportedResources

func (r Registration) SupportedResources() map[string]*pluginsdk.Resource

func (Registration) WebsiteCategories

func (r Registration) WebsiteCategories() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL