Skip to content

Commit

Permalink
Merge pull request #51217 from vmware/vSphereSCSIFix
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Attempt to Attach Volume fails for very first time on vSphere in 1.7 release

Before every attach, vSphere cloud provider checks if the SCSI controller is present on the VM. If not present, it will try to create one and attach the disk to that SCSI controller on VM. If already present, it will use the SCSI controller.

For the very first time when SCSI controller is not present on the VM, we try to create one and retrieve the SCSI controller for the disk to created on that SCSI controller. But in release 1.7, after successful creation of SCSI controller, we are not assigning back the SCSI controller to the existing "scsicontroller" variable. Because of this the very first time, attach of the disk will fail.

This problem is not observed on master, as we have taken care of this in vSphere cloud provider refactoring - #49164

@luomiao @divyenpatel @rohitjogvmw 

```release-note
vSphere: Fix attach volume failing on the first try.
```
  • Loading branch information
Kubernetes Submit Queue committed Aug 25, 2017
2 parents 8cb5c5f + 2b12be3 commit f3ecd68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cloudprovider/providers/vsphere/vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ func (vs *VSphere) AttachDisk(vmDiskPath string, storagePolicyID string, nodeNam
}

scsiControllersOfRequiredType := getSCSIControllersOfType(vmDevices, diskControllerType)
scsiController := getAvailableSCSIController(scsiControllersOfRequiredType)
scsiController = getAvailableSCSIController(scsiControllersOfRequiredType)
if scsiController == nil {
glog.Errorf("cannot find SCSI controller in VM")
// attempt clean up of scsi controller
Expand Down

0 comments on commit f3ecd68

Please sign in to comment.