Commit 6198c469 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #39476 from rootfs/azure-logging

Automatic merge from submit-queue azure disk: add logging on disk attach **What this PR does / why we need it**: While we were debugging a failed azure disk attach, we were missing logging information to identify the root cause. This fix logs information at each stage of attach to help identify where problem is once it happens again. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: NONE
parents 98a4c6ba 7dae0547
...@@ -94,6 +94,7 @@ func (attacher *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.Node ...@@ -94,6 +94,7 @@ func (attacher *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.Node
// Volume is already attached to node. // Volume is already attached to node.
glog.V(4).Infof("Attach operation is successful. volume %q is already attached to node %q at lun %d.", volumeSource.DiskName, instanceid, lun) glog.V(4).Infof("Attach operation is successful. volume %q is already attached to node %q at lun %d.", volumeSource.DiskName, instanceid, lun)
} else { } else {
glog.V(4).Infof("GetDiskLun returned: %v. Initiating attaching volume %q to node %q.", err, volumeSource.DataDiskURI, nodeName)
getLunMutex.LockKey(instanceid) getLunMutex.LockKey(instanceid)
defer getLunMutex.UnlockKey(instanceid) defer getLunMutex.UnlockKey(instanceid)
...@@ -102,7 +103,7 @@ func (attacher *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.Node ...@@ -102,7 +103,7 @@ func (attacher *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.Node
glog.Warningf("no LUN available for instance %q", nodeName) glog.Warningf("no LUN available for instance %q", nodeName)
return "", fmt.Errorf("all LUNs are used, cannot attach volume %q to instance %q", volumeSource.DiskName, instanceid) return "", fmt.Errorf("all LUNs are used, cannot attach volume %q to instance %q", volumeSource.DiskName, instanceid)
} }
glog.V(4).Infof("Trying to attach volume %q lun %d to node %q.", volumeSource.DataDiskURI, lun, nodeName)
err = attacher.azureProvider.AttachDisk(volumeSource.DiskName, volumeSource.DataDiskURI, nodeName, lun, compute.CachingTypes(*volumeSource.CachingMode)) err = attacher.azureProvider.AttachDisk(volumeSource.DiskName, volumeSource.DataDiskURI, nodeName, lun, compute.CachingTypes(*volumeSource.CachingMode))
if err == nil { if err == nil {
glog.V(4).Infof("Attach operation successful: volume %q attached to node %q.", volumeSource.DataDiskURI, nodeName) glog.V(4).Infof("Attach operation successful: volume %q attached to node %q.", volumeSource.DataDiskURI, nodeName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment