Skip to content

Commit

Permalink
Added the ability to define a custom name for a storage backend. This…
Browse files Browse the repository at this point in the history
… enhancement enables adding multiple instances of the same backend with different policies.

Closes #93
Closes #111
  • Loading branch information
kangarlou committed Apr 18, 2018
1 parent 43498fd commit 4b5cdff
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 61 deletions.
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@
# Project
###############################################################################

test-yaml
input/backend-aws-ebs-real.json
reset_demo.sh
bin/trident*
coverage/**
vendor/
launcher/launcher
launcher/docker-build/launcher
kubernetes-yaml/trident-deployment-local.yaml
launcher/kubernetes-yaml/launcher-pod-local.yaml
launcher/config/
trident-installer.tar.gz
trident-installer/*.yaml
trident-installer/setup
trident
*.pem
*.csr
Expand Down
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@
- Prevented exit if a startup error occurs so Docker and Kubernetes don't restart Trident continuously.
- Fixed an issue where SolidFire cloned volumes were not updated with new QoS values.
- **Kubernetes:** Trident no longer emits SCSI bus rescan errors into log.
- **Kubernetes:** Fixed incorrect association of volumes with backends after backend update (Issue [#111](https://github.com/NetApp/trident/issues/111)).
- **Docker:** iSCSI device discovery and removal is faster, more granular, and more reliable.
- **Docker:** Fixed default size handling (Issue [#102](https://github.com/NetApp/trident/issues/102)).
- **Docker:** Client interfaces start immediately to avoid Docker plugin timeouts.

**Enhancements:**
- Added FQDN support for the management and data LIF of ONTAP backends.
- For Kubernetes 1.9+, CHAP secrets will be created in Trident's namespace instead of the PVC's namespace.
- For Kubernetes 1.9+, CHAP secrets will be created in Trident's namespace
instead of the PVC's namespace.
- Return new HTTP codes from REST interface to indicate Trident startup status.
- Set the minimum supported SolidFire Element version to 8.0.
- **Docker:** The aggregate attribute in ONTAP config files is now optional.
- SolidFire defaults to use CHAP if Kubernetes version is >= 1.7 and a `trident` access group doesn't exist. Setting AccessGroup or UseCHAP in config overrides this behavior.

- **Kubernetes:** Added the ability to define a custom name for a storage
backend. This enhancement enables adding multiple instances of the same
backend with different policies (e.g., different snapshot policies), which
obviates extending the Trident storage class API to support new parameters
(Issue [#93](https://github.com/NetApp/trident/issues/93)).
- **Kubernetes:** Added the ability to rename an existing backend.
- **Docker:** The aggregate attribute in ONTAP config files is now optional.

## v18.01.0

**Fixes:**
Expand Down
48 changes: 25 additions & 23 deletions core/orchestrator_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,32 +404,34 @@ func (o *TridentOrchestrator) addStorageBackend(configJSON string) (*storage.Bac
// such volumes are likely to fail, so here we just warn the users about
// such volumes and mark them as orphaned.
for volName, vol := range o.volumes {
updatePersistentStore := false
volExternal, _ := storageBackend.Driver.GetVolumeExternal(vol.Config.InternalName)
if volExternal == nil {
if vol.Orphaned == false {
vol.Orphaned = true
updatePersistentStore = true
log.WithFields(log.Fields{
"volume": volName,
"backend": storageBackend.Name,
}).Warn("Backend update resulted in an orphaned volume!")
if vol.Backend == storageBackend.Name {
updatePersistentStore := false
volExternal, _ := storageBackend.Driver.GetVolumeExternal(vol.Config.InternalName)
if volExternal == nil {
if vol.Orphaned == false {
vol.Orphaned = true
updatePersistentStore = true
log.WithFields(log.Fields{
"volume": volName,
"backend": storageBackend.Name,
}).Warn("Backend update resulted in an orphaned volume!")
}
} else {
if vol.Orphaned == true {
vol.Orphaned = false
updatePersistentStore = true
log.WithFields(log.Fields{
"volume": volName,
"backend": storageBackend.Name,
}).Info("The volume is no longer orphaned as a result of the " +
"backend update.")
}
}
} else {
if vol.Orphaned == true {
vol.Orphaned = false
updatePersistentStore = true
log.WithFields(log.Fields{
"volume": volName,
"backend": storageBackend.Name,
}).Info("The volume is no longer orphaned as a result of the " +
"backend update.")
if updatePersistentStore {
o.updateVolumeOnPersistentStore(vol)
}
o.backends[storageBackend.Name].Volumes[volName] = vol
}
if updatePersistentStore {
o.updateVolumeOnPersistentStore(vol)
}
o.backends[storageBackend.Name].Volumes[volName] = vol
}

// Update storage class information
Expand Down
1 change: 1 addition & 0 deletions docs/kubernetes/operations/tasks/backends/element.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Parameter Description
================== =============================================================== ================================================
version Always 1
storageDriverName Always "solidfire-san"
backendName Custom name for the storage backend "solidfire\_" + storage (iSCSI) IP address
Endpoint MVIP for the SolidFire cluster with tenant credentials
SVIP Storage (iSCSI) IP address and port
TenantName Tenant name to use (created if not found)
Expand Down
1 change: 1 addition & 0 deletions docs/kubernetes/operations/tasks/backends/ontap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Parameter Description
================== =============================================================== ================================================
version Always 1
storageDriverName "ontap-nas", "ontap-nas-economy" or "ontap-san"
backendName Custom name for the storage backend Driver name + "_" + dataLIF
managementLIF IP address of a cluster or SVM management LIF "10.0.0.1"
dataLIF IP address of protocol LIF Derived by the SVM unless specified
svm Storage virtual machine to use Derived if an SVM managementLIF is specified
Expand Down
1 change: 1 addition & 0 deletions docs/kubernetes/operations/tasks/backends/santricity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Parameter Description
===================== =============================================================== ================================================
version Always 1
storageDriverName Always "eseries-iscsi"
backendName Custom name for the storage backend "eseries\_" + hostDataIP
webProxyHostname Hostname or IP address of the web services proxy
webProxyPort Port number of the web services proxy 80 for HTTP, 443 for HTTPS
webProxyUseHTTP Use HTTP instead of HTTPS to communicate to the proxy false
Expand Down
26 changes: 12 additions & 14 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions persistent_store/etcdv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ func (p *EtcdClientV3) DeleteBackend(backend *storage.Backend) error {
return nil
}

// RenameBackend renames a backend and updates the associated volumes on the persistent store
func (p *EtcdClientV3) RenameBackend(backend *storage.Backend) error {
return nil
}

// GetBackends retrieves all backends
func (p *EtcdClientV3) GetBackends() ([]*storage.BackendPersistent, error) {
backendList := make([]*storage.BackendPersistent, 0)
Expand Down
8 changes: 6 additions & 2 deletions storage_drivers/eseries/eseries_iscsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,12 @@ func (d *SANStorageDriver) Get(name string) error {

// GetStorageBackendSpecs retrieve storage capabilities and register pools with specified backend.
func (d *SANStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error {

backend.Name = "eseries_" + d.Config.HostDataIP
if d.Config.BackendName == "" {
// Use the old naming scheme if no name is specified
backend.Name = "eseries_" + d.Config.HostDataIP
} else {
backend.Name = d.Config.BackendName
}

// Get pools
pools, err := d.API.GetVolumePools("", 0, "")
Expand Down
8 changes: 7 additions & 1 deletion storage_drivers/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ func (d *StorageDriver) Get(name string) error {
}

func (d *StorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error {
backend.Name = d.Config.InstanceName
if d.Config.BackendName == "" {
// Use the old naming scheme if no backend is specified
backend.Name = d.Config.InstanceName
} else {
backend.Name = d.Config.BackendName
}

for name, pool := range d.Config.Pools {
vc := &storage.Pool{
Name: name,
Expand Down
8 changes: 6 additions & 2 deletions storage_drivers/ontap/ontap_nas.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,12 @@ func (d *NASStorageDriver) Get(name string) error {

// Retrieve storage backend capabilities
func (d *NASStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error {

backend.Name = "ontapnas_" + d.Config.DataLIF
if d.Config.BackendName == "" {
// Use the old naming scheme if no name is specified
backend.Name = "ontapnas_" + d.Config.DataLIF
} else {
backend.Name = d.Config.BackendName
}
poolAttrs := d.GetStoragePoolAttributes()
return getStorageBackendSpecsCommon(d, backend, poolAttrs)
}
Expand Down
8 changes: 6 additions & 2 deletions storage_drivers/ontap/ontap_nas_qtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,12 @@ func (d *NASQtreeStorageDriver) ensureDefaultExportPolicyRule() error {

// Retrieve storage backend capabilities
func (d *NASQtreeStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error {

backend.Name = "ontapnaseco_" + d.Config.DataLIF
if d.Config.BackendName == "" {
// Use the old naming scheme if no name is specified
backend.Name = "ontapnaseco_" + d.Config.DataLIF
} else {
backend.Name = d.Config.BackendName
}
poolAttrs := d.GetStoragePoolAttributes()
return getStorageBackendSpecsCommon(d, backend, poolAttrs)
}
Expand Down
8 changes: 6 additions & 2 deletions storage_drivers/ontap/ontap_san.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,12 @@ func (d *SANStorageDriver) Get(name string) error {

// Retrieve storage backend capabilities
func (d *SANStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error {

backend.Name = "ontapsan_" + d.Config.DataLIF
if d.Config.BackendName == "" {
// Use the old naming scheme if no name is specified
backend.Name = "ontapsan_" + d.Config.DataLIF
} else {
backend.Name = d.Config.BackendName
}
poolAttrs := d.GetStoragePoolAttributes()
return getStorageBackendSpecsCommon(d, backend, poolAttrs)
}
Expand Down
8 changes: 6 additions & 2 deletions storage_drivers/solidfire/solidfire_san.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,12 @@ func (d *SANStorageDriver) GetVolume(name string) (api.Volume, error) {

// GetStorageBackendSpecs retrieves storage backend capabilities
func (d *SANStorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error {

backend.Name = "solidfire_" + strings.Split(d.Config.SVIP, ":")[0]
if d.Config.BackendName == "" {
// Use the old naming scheme if no name is specified
backend.Name = "solidfire_" + strings.Split(d.Config.SVIP, ":")[0]
} else {
backend.Name = d.Config.BackendName
}

volTypes := *d.Client.VolumeTypes
if len(volTypes) == 0 {
Expand Down
1 change: 1 addition & 0 deletions storage_drivers/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
type CommonStorageDriverConfig struct {
Version int `json:"version"`
StorageDriverName string `json:"storageDriverName"`
BackendName string `json:"backendName"`
Debug bool `json:"debug"` // Unsupported!
DebugTraceFlags map[string]bool `json:"debugTraceFlags"` // Example: {"api":false, "method":true}
DisableDelete bool `json:"disableDelete"`
Expand Down

0 comments on commit 4b5cdff

Please sign in to comment.