From db3c5a7881b8a98701ffab7087421151c3affb62 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sat, 21 Oct 2017 03:20:22 +0000 Subject: [PATCH] fix#50150: azure disk mount failure on coreos add log message --- pkg/volume/azure_dd/azure_common_linux.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/volume/azure_dd/azure_common_linux.go b/pkg/volume/azure_dd/azure_common_linux.go index a0b647be55d..304a2bc2855 100644 --- a/pkg/volume/azure_dd/azure_common_linux.go +++ b/pkg/volume/azure_dd/azure_common_linux.go @@ -77,6 +77,19 @@ func findDiskByLunWithConstraint(lun int, io ioHandler, azureDisks []string) (st if len(arr) < 4 { continue } + if len(azureDisks) == 0 { + glog.V(4).Infof("/dev/disk/azure is not populated, now try to parse %v directly", name) + target, err := strconv.Atoi(arr[0]) + if err != nil { + glog.Errorf("failed to parse target from %v (%v), err %v", arr[0], name, err) + continue + } + // as observed, targets 0-3 are used by OS disks. Skip them + if target <= 3 { + continue + } + } + // extract LUN from the path. // LUN is the last index of the array, i.e. 1 in /sys/bus/scsi/devices/3:0:0:1 l, err := strconv.Atoi(arr[3])