Merge pull request #96673 from jsafrane/fix-cinder-16

Fix Cinder volume detection on OpenStack Train
This commit is contained in:
Kubernetes Prow Robot 2020-12-08 18:35:31 -08:00 committed by GitHub
commit 31fd5671ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -491,11 +491,14 @@ func (os *OpenStack) CreateVolume(name string, size int, vtype, availability str
func (os *OpenStack) GetDevicePathBySerialID(volumeID string) string {
// Build a list of candidate device paths.
// Certain Nova drivers will set the disk serial ID, including the Cinder volume id.
// Newer OpenStacks may not truncate the volumeID to 20 chars.
candidateDeviceNodes := []string{
// KVM
fmt.Sprintf("virtio-%s", volumeID[:20]),
fmt.Sprintf("virtio-%s", volumeID),
// KVM virtio-scsi
fmt.Sprintf("scsi-0QEMU_QEMU_HARDDISK_%s", volumeID[:20]),
fmt.Sprintf("scsi-0QEMU_QEMU_HARDDISK_%s", volumeID),
// ESXi
fmt.Sprintf("wwn-0x%s", strings.Replace(volumeID, "-", "", -1)),
}