def get_disk_bus_for_disk_dev(virt_type, disk_dev):

    if disk_dev.startswith('hd'):
        return "ide"
    elif disk_dev.startswith('sd'):
        # Reverse mapping 'sd' is not reliable
        # there are many possible mappings. So
        # this picks the most likely mappings
        if virt_type == "xen":
            return "xen"
        elif virt_type == "parallels":
            return "sata"
        else:
            return "scsi"
    elif disk_dev.startswith('vd'):
        return "virtio"
    elif disk_dev.startswith('fd'):
        return "fdc"
    elif disk_dev.startswith('xvd'):
        return "xen"
    elif disk_dev.startswith('ubd'):
        return "uml"
    else:
        raise exception.NovaException(
            _("Unable to determine disk bus for '%s'") %
            disk_dev[:1])
Determine the disk bus for a disk device.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/libvirt/blockinfo.py/get_disk_bus_for_disk_dev