Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
37cb88ef
Unverified
Commit
37cb88ef
authored
Oct 19, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70012 from andyzhangx/azuredisk-logging
add more logging for azure disk diagnostics
parents
34196ac9
79a5bb62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
azure_controller_common.go
pkg/cloudprovider/providers/azure/azure_controller_common.go
+1
-1
attacher.go
pkg/volume/azure_dd/attacher.go
+9
-9
No files found.
pkg/cloudprovider/providers/azure/azure_controller_common.go
View file @
37cb88ef
...
@@ -128,7 +128,7 @@ func (c *controllerCommon) GetDiskLun(diskName, diskURI string, nodeName types.N
...
@@ -128,7 +128,7 @@ func (c *controllerCommon) GetDiskLun(diskName, diskURI string, nodeName types.N
(
disk
.
Vhd
!=
nil
&&
disk
.
Vhd
.
URI
!=
nil
&&
diskURI
!=
""
&&
*
disk
.
Vhd
.
URI
==
diskURI
)
||
(
disk
.
Vhd
!=
nil
&&
disk
.
Vhd
.
URI
!=
nil
&&
diskURI
!=
""
&&
*
disk
.
Vhd
.
URI
==
diskURI
)
||
(
disk
.
ManagedDisk
!=
nil
&&
*
disk
.
ManagedDisk
.
ID
==
diskURI
)
{
(
disk
.
ManagedDisk
!=
nil
&&
*
disk
.
ManagedDisk
.
ID
==
diskURI
)
{
// found the disk
// found the disk
glog
.
V
(
4
)
.
Infof
(
"azureDisk - find disk: lun %d name %q uri %q"
,
*
disk
.
Lun
,
diskName
,
diskURI
)
glog
.
V
(
2
)
.
Infof
(
"azureDisk - find disk: lun %d name %q uri %q"
,
*
disk
.
Lun
,
diskName
,
diskURI
)
return
*
disk
.
Lun
,
nil
return
*
disk
.
Lun
,
nil
}
}
}
}
...
...
pkg/volume/azure_dd/attacher.go
View file @
37cb88ef
...
@@ -87,9 +87,9 @@ func (a *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.NodeName) (
...
@@ -87,9 +87,9 @@ func (a *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.NodeName) (
if
err
==
nil
{
if
err
==
nil
{
// 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
(
2
)
.
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
)
glog
.
V
(
2
)
.
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
)
...
@@ -98,11 +98,11 @@ func (a *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.NodeName) (
...
@@ -98,11 +98,11 @@ func (a *azureDiskAttacher) Attach(spec *volume.Spec, nodeName types.NodeName) (
glog
.
Warningf
(
"no LUN available for instance %q (%v)"
,
nodeName
,
err
)
glog
.
Warningf
(
"no LUN available for instance %q (%v)"
,
nodeName
,
err
)
return
""
,
fmt
.
Errorf
(
"all LUNs are used, cannot attach volume %q to instance %q (%v)"
,
volumeSource
.
DiskName
,
instanceid
,
err
)
return
""
,
fmt
.
Errorf
(
"all LUNs are used, cannot attach volume %q to instance %q (%v)"
,
volumeSource
.
DiskName
,
instanceid
,
err
)
}
}
glog
.
V
(
4
)
.
Infof
(
"Trying to attach volume %q lun %d to node %q."
,
volumeSource
.
DataDiskURI
,
lun
,
nodeName
)
glog
.
V
(
2
)
.
Infof
(
"Trying to attach volume %q lun %d to node %q."
,
volumeSource
.
DataDiskURI
,
lun
,
nodeName
)
isManagedDisk
:=
(
*
volumeSource
.
Kind
==
v1
.
AzureManagedDisk
)
isManagedDisk
:=
(
*
volumeSource
.
Kind
==
v1
.
AzureManagedDisk
)
err
=
diskController
.
AttachDisk
(
isManagedDisk
,
volumeSource
.
DiskName
,
volumeSource
.
DataDiskURI
,
nodeName
,
lun
,
compute
.
CachingTypes
(
*
volumeSource
.
CachingMode
))
err
=
diskController
.
AttachDisk
(
isManagedDisk
,
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
(
2
)
.
Infof
(
"Attach operation successful: volume %q attached to node %q."
,
volumeSource
.
DataDiskURI
,
nodeName
)
}
else
{
}
else
{
glog
.
V
(
2
)
.
Infof
(
"Attach volume %q to instance %q failed with %v"
,
volumeSource
.
DataDiskURI
,
instanceid
,
err
)
glog
.
V
(
2
)
.
Infof
(
"Attach volume %q to instance %q failed with %v"
,
volumeSource
.
DataDiskURI
,
instanceid
,
err
)
return
""
,
fmt
.
Errorf
(
"Attach volume %q to instance %q failed with %v"
,
volumeSource
.
DiskName
,
instanceid
,
err
)
return
""
,
fmt
.
Errorf
(
"Attach volume %q to instance %q failed with %v"
,
volumeSource
.
DiskName
,
instanceid
,
err
)
...
@@ -167,13 +167,13 @@ func (a *azureDiskAttacher) WaitForAttach(spec *volume.Spec, devicePath string,
...
@@ -167,13 +167,13 @@ func (a *azureDiskAttacher) WaitForAttach(spec *volume.Spec, devicePath string,
nodeName
:=
types
.
NodeName
(
a
.
plugin
.
host
.
GetHostName
())
nodeName
:=
types
.
NodeName
(
a
.
plugin
.
host
.
GetHostName
())
diskName
:=
volumeSource
.
DiskName
diskName
:=
volumeSource
.
DiskName
glog
.
V
(
5
)
.
Infof
(
"azureDisk - WaitForAttach: begin to GetDiskLun by diskName(%s), DataDiskURI(%s), nodeName(%s), devicePath(%s)"
,
glog
.
V
(
2
)
.
Infof
(
"azureDisk - WaitForAttach: begin to GetDiskLun by diskName(%s), DataDiskURI(%s), nodeName(%s), devicePath(%s)"
,
diskName
,
volumeSource
.
DataDiskURI
,
nodeName
,
devicePath
)
diskName
,
volumeSource
.
DataDiskURI
,
nodeName
,
devicePath
)
lun
,
err
:=
diskController
.
GetDiskLun
(
diskName
,
volumeSource
.
DataDiskURI
,
nodeName
)
lun
,
err
:=
diskController
.
GetDiskLun
(
diskName
,
volumeSource
.
DataDiskURI
,
nodeName
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
glog
.
V
(
5
)
.
Infof
(
"azureDisk - WaitForAttach: GetDiskLun succeeded, got lun(%v)"
,
lun
)
glog
.
V
(
2
)
.
Infof
(
"azureDisk - WaitForAttach: GetDiskLun succeeded, got lun(%v)"
,
lun
)
exec
:=
a
.
plugin
.
host
.
GetExec
(
a
.
plugin
.
GetPluginName
())
exec
:=
a
.
plugin
.
host
.
GetExec
(
a
.
plugin
.
GetPluginName
())
io
:=
&
osIOHandler
{}
io
:=
&
osIOHandler
{}
...
@@ -281,7 +281,7 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
...
@@ -281,7 +281,7 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
return
nil
return
nil
}
}
glog
.
V
(
4
)
.
Infof
(
"detach %v from node %q"
,
diskURI
,
nodeName
)
glog
.
V
(
2
)
.
Infof
(
"detach %v from node %q"
,
diskURI
,
nodeName
)
diskController
,
err
:=
getDiskController
(
d
.
plugin
.
host
)
diskController
,
err
:=
getDiskController
(
d
.
plugin
.
host
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -304,9 +304,9 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
...
@@ -304,9 +304,9 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
func
(
detacher
*
azureDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
detacher
*
azureDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
err
:=
util
.
UnmountPath
(
deviceMountPath
,
detacher
.
plugin
.
host
.
GetMounter
(
detacher
.
plugin
.
GetPluginName
()))
err
:=
util
.
UnmountPath
(
deviceMountPath
,
detacher
.
plugin
.
host
.
GetMounter
(
detacher
.
plugin
.
GetPluginName
()))
if
err
==
nil
{
if
err
==
nil
{
glog
.
V
(
4
)
.
Infof
(
"azureDisk - Device %s was unmounted"
,
deviceMountPath
)
glog
.
V
(
2
)
.
Infof
(
"azureDisk - Device %s was unmounted"
,
deviceMountPath
)
}
else
{
}
else
{
glog
.
Info
f
(
"azureDisk - Device %s failed to unmount with error: %s"
,
deviceMountPath
,
err
.
Error
())
glog
.
Warning
f
(
"azureDisk - Device %s failed to unmount with error: %s"
,
deviceMountPath
,
err
.
Error
())
}
}
return
err
return
err
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment