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
383a42a4
Commit
383a42a4
authored
Mar 02, 2017
by
Ritesh H Shukla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support adding disks to more than one scsi adapter Fixes #42399
parent
c6206c19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
vsphere.go
pkg/cloudprovider/providers/vsphere/vsphere.go
+11
-10
No files found.
pkg/cloudprovider/providers/vsphere/vsphere.go
View file @
383a42a4
...
...
@@ -761,7 +761,15 @@ func (vs *VSphere) AttachDisk(vmDiskPath string, nodeName k8stypes.NodeName) (di
return
""
,
""
,
err
}
scsiController
=
getSCSIController
(
vmDevices
,
vs
.
cfg
.
Disk
.
SCSIControllerType
)
// Get VM device list
_
,
vmDevices
,
_
,
err
:=
getVirtualMachineDevices
(
ctx
,
vs
.
cfg
,
vs
.
client
,
vSphereInstance
)
if
err
!=
nil
{
glog
.
Errorf
(
"cannot get vmDevices for VM err=%s"
,
err
)
return
""
,
""
,
fmt
.
Errorf
(
"cannot get vmDevices for VM err=%s"
,
err
)
}
scsiControllersOfRequiredType
:=
getSCSIControllersOfType
(
vmDevices
,
diskControllerType
)
scsiController
:=
getAvailableSCSIController
(
scsiControllersOfRequiredType
)
if
scsiController
==
nil
{
glog
.
Errorf
(
"cannot find SCSI controller in VM"
)
// attempt clean up of scsi controller
...
...
@@ -1021,7 +1029,7 @@ func (vs *VSphere) DisksAreAttached(volPaths []string, nodeName k8stypes.NodeNam
}
func
checkDiskAttached
(
volPath
string
,
vmdevices
object
.
VirtualDeviceList
,
dc
*
object
.
Datacenter
,
client
*
govmomi
.
Client
)
(
bool
,
error
)
{
virtualDiskControllerKey
,
err
:=
getVirtualDiskControllerKey
(
volPath
,
vmdevices
,
dc
,
client
)
_
,
err
:=
getVirtualDiskControllerKey
(
volPath
,
vmdevices
,
dc
,
client
)
if
err
!=
nil
{
if
err
==
ErrNoDevicesFound
{
return
false
,
nil
...
...
@@ -1029,14 +1037,7 @@ func checkDiskAttached(volPath string, vmdevices object.VirtualDeviceList, dc *o
glog
.
Errorf
(
"Failed to check whether disk is attached. err: %s"
,
err
)
return
false
,
err
}
for
_
,
controllerType
:=
range
supportedSCSIControllerType
{
controllerkey
,
_
:=
getControllerKey
(
controllerType
,
vmdevices
)
if
controllerkey
==
virtualDiskControllerKey
{
return
true
,
nil
}
}
return
false
,
ErrNonSupportedControllerType
return
true
,
nil
}
// Returns the object key that denotes the controller object to which vmdk is attached.
...
...
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