Use full instanceID as lun lock key
This is because the last part of VMSS instances are numbers, which may be same if there are multiple VMSS within same cluster.
This commit is contained in:
@@ -24,7 +24,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/arm/compute"
|
"github.com/Azure/azure-sdk-for-go/arm/compute"
|
||||||
@@ -70,9 +69,6 @@ func (a *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.NodeName) (
|
|||||||
glog.Warningf("failed to get azure instance id (%v)", err)
|
glog.Warningf("failed to get azure instance id (%v)", err)
|
||||||
return "", fmt.Errorf("failed to get azure instance id for node %q (%v)", nodeName, err)
|
return "", fmt.Errorf("failed to get azure instance id for node %q (%v)", nodeName, err)
|
||||||
}
|
}
|
||||||
if ind := strings.LastIndex(instanceid, "/"); ind >= 0 {
|
|
||||||
instanceid = instanceid[(ind + 1):]
|
|
||||||
}
|
|
||||||
|
|
||||||
diskController, err := getDiskController(a.plugin.host)
|
diskController, err := getDiskController(a.plugin.host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -272,14 +268,11 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
|
|||||||
return fmt.Errorf("invalid disk to detach: %q", diskURI)
|
return fmt.Errorf("invalid disk to detach: %q", diskURI)
|
||||||
}
|
}
|
||||||
|
|
||||||
instanceid, err := d.cloud.InstanceID(context.TODO(), nodeName)
|
_, err := d.cloud.InstanceID(context.TODO(), nodeName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Warningf("no instance id for node %q, skip detaching (%v)", nodeName, err)
|
glog.Warningf("no instance id for node %q, skip detaching (%v)", nodeName, err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if ind := strings.LastIndex(instanceid, "/"); ind >= 0 {
|
|
||||||
instanceid = instanceid[(ind + 1):]
|
|
||||||
}
|
|
||||||
|
|
||||||
glog.V(4).Infof("detach %v from node %q", diskURI, nodeName)
|
glog.V(4).Infof("detach %v from node %q", diskURI, nodeName)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user