-
Notifications
You must be signed in to change notification settings - Fork 47
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
Support NVMe_FC protocol #39
base: developing
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -948,3 +948,26 @@ func RemoveRoCEDevice(device string) ([]string, string, error) { | |
|
||
return devices, multiPathName, nil | ||
} | ||
|
||
// RemoveNvmeFcDevice remove dm device if present | ||
func RemoveNvmeFcDevice(device string) (string, error) { | ||
var multiPathName string | ||
var err error | ||
if strings.HasPrefix(device, "dm") { | ||
multiPathName = device | ||
// devices: nvme0n1, nvme2n1, | ||
_, err = getDeviceFromDM(multiPathName) | ||
if err != nil { | ||
log.Warningf("Get the devices from the multipath %s error: %v", multiPathName, err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As this is just warning, this means the sys class has issues and we are ignoring it. Further when you try to flush the device without having the sysfs entries, will it create issues? |
||
} | ||
|
||
// just flush the dm path. no need to delete device on host, when delete the storage mapping | ||
// the device will be automatically deleted. | ||
err := FlushDMDevice(multiPathName) | ||
if err == nil { | ||
multiPathName = "" | ||
} | ||
} | ||
|
||
return multiPathName, nil | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package nvme | ||
|
||
import ( | ||
"connector" | ||
"time" | ||
"utils/log" | ||
) | ||
|
||
func tryDisConnectVolume(tgtLunWWN string, checkDeviceAvailable bool) error { | ||
device, err := connector.GetDevice(nil, tgtLunWWN, checkDeviceAvailable) | ||
if err != nil { | ||
log.Warningf("Get device of WWN %s error: %v", tgtLunWWN, err) | ||
return err | ||
} | ||
|
||
multiPathName, err := connector.RemoveNvmeFcDevice(device) | ||
if err != nil { | ||
log.Errorf("Remove device %s error: %v", device, err) | ||
return err | ||
} | ||
|
||
if multiPathName != "" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is multipath device, then the device flush attempt has already been done |
||
time.Sleep(time.Second * intNumThree) | ||
err = connector.FlushDMDevice(device) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
|
||
return nil | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: huawei-csi-configmap | ||
namespace: kube-system | ||
data: | ||
csi.json: | | ||
{ | ||
"backends": [ | ||
{ | ||
"storage": "oceanstor-san", | ||
"name": "***", | ||
"urls": ["https://*.*.*.*:8088", "https://*.*.*.*:8088"], | ||
"pools": ["***", "***"], | ||
"parameters": {"protocol": "fc-nvme"} | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is valid only for DM multipath. If other multipath like Ultrapath or EMCPP comes then we will have to put other checks