Skip to content

Commit

Permalink
[SBD] Implement NetAPP ONTAP SAN Driver Support (#1135)
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshuvar authored and wisererik committed Dec 24, 2019
1 parent c17ceb1 commit 650a0a0
Show file tree
Hide file tree
Showing 603 changed files with 228,420 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ language: go
go_import_path: github.com/opensds/opensds

go:
- 1.11.x
- 1.12.x
- 1.13.x
- tip

env:
Expand Down
6 changes: 6 additions & 0 deletions contrib/drivers/drivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/opensds/opensds/contrib/drivers/huawei/oceanstor"
"github.com/opensds/opensds/contrib/drivers/ibm/spectrumscale"
"github.com/opensds/opensds/contrib/drivers/lvm"
"github.com/opensds/opensds/contrib/drivers/netapp/ontap"
"github.com/opensds/opensds/contrib/drivers/openstack/cinder"
"github.com/opensds/opensds/contrib/drivers/utils/config"
"github.com/opensds/opensds/pkg/model"
Expand Down Expand Up @@ -111,6 +112,9 @@ func Init(resourceType string) VolumeDriver {
case config.FujitsuEternusDriverType:
d = &eternus.Driver{}
break
case config.NetappOntapSanDriverType:
d = &ontap.SANDriver{}
break
default:
d = &sample.Driver{}
break
Expand Down Expand Up @@ -139,6 +143,8 @@ func Clean(d VolumeDriver) VolumeDriver {
break
case *eternus.Driver:
break
case *ontap.SANDriver:
break
default:
break
}
Expand Down
32 changes: 32 additions & 0 deletions contrib/drivers/netapp/ontap/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2019 The OpenSDS Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific l

package ontap

// default value for driver
const (
defaultConfPath = "/etc/opensds/driver/netapp_ontap_san.yaml"
DefaultAZ = "default"
volumePrefix = "opensds_"
snapshotPrefix = "opensds_snapshot_"
naaPrefix = "60a98000" //Applicable to Clustered Data ONTAP and Data ONTAP 7-Mode
KLvPath = "lunPath"
KLvIdFormat = "NAA"
StorageDriverName = "ontap-san"
driverContext = "csi"
VolumeVersion = "1"
SnapshotVersion = "1"
accessMode = ""
volumeMode = "Block"
bytesGiB = 1073741824
)
48 changes: 48 additions & 0 deletions contrib/drivers/netapp/ontap/model.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2019 The OpenSDS Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.

package ontap

import (
"github.com/netapp/trident/storage_drivers/ontap"
. "github.com/opensds/opensds/contrib/drivers/utils/config"
)

type BackendOptions struct {
Version int `yaml:"version"`
StorageDriverName string `yaml:"storageDriverName"`
ManagementLIF string `yaml:"managementLIF"`
DataLIF string `yaml:"dataLIF"`
Svm string `yaml:"svm"`
IgroupName string `yaml:"igroupName"`
Username string `yaml:"username"`
Password string `yaml:"password"`
}

type ONTAPConfig struct {
BackendOptions `yaml:"backendOptions"`
Pool map[string]PoolProperties `yaml:"pool,flow"`
}

type SANDriver struct {
sanStorageDriver *ontap.SANStorageDriver
conf *ONTAPConfig
}

type Pool struct {
PoolId int `json:"poolId"`
TotalCapacity int64 `json:"totalCapacity"`
AllocCapacity int64 `json:"allocatedCapacity"`
UsedCapacity int64 `json:"usedCapacity"`
}
Loading

0 comments on commit 650a0a0

Please sign in to comment.