hyper2kvm

BusLogic Controller Auto-Fix

Overview

The BusLogic auto-fix feature automatically detects and fixes VMDKs with BusLogic SCSI controllers during migration, enabling successful conversion to KVM/libvirt without requiring VMware reconfiguration.

Problem Statement

BusLogic Controller Limitations

BusLogic is a legacy SCSI controller that:

Traditional Workaround

Previously, the only solution was:

  1. Power off VM in VMware
  2. Change controller from BusLogic to LSI Logic or PVSCSI
  3. Power on VM to verify it boots
  4. Export VMDK
  5. Migrate to KVM

Problem: Requires VMware access and VM downtime.

Solution: Automatic Descriptor Rewriting

The auto-fix feature eliminates the need for VMware reconfiguration by:

  1. Detecting BusLogic controller during VMDK inspection
  2. Automatically rewriting the VMDK descriptor
  3. Changing ddb.adapterType = "buslogic""lsilogic"
  4. Using the fixed VMDK for conversion
  5. Injecting virtio drivers into guest initramfs

Why LSI Logic?

How It Works

Detection Phase

During VMDK inspection, the inspector parses the VMDK descriptor and detects:

ddb.adapterType = "buslogic"

This triggers a FATAL risk:

❌ [FATAL] Legacy controller 'buslogic' unsupported on KVM - no driver available

Auto-Fix Phase

When BusLogic is detected, the auto-fix automatically:

  1. Reads VMDK descriptor
    with open(vmdk_path, 'r', errors='ignore') as f:
        lines = f.readlines()
    
  2. Rewrites adapter type
    OLD: ddb.adapterType = "buslogic"
    NEW: ddb.adapterType = "lsilogic"
    
  3. Creates temporary fixed VMDK
    • Uses workdir location (respects workdir config)
    • Avoids /tmp space issues
    • Path: {workdir}/hyper2kvm-buslogic-fix-{random}/
  4. Copies extent file (if present)
    • For split VMDKs: filename-flat.vmdk
    • Preserves original permissions and timestamps
  5. Returns fixed VMDK path
    • Pipeline uses fixed VMDK for conversion
    • Original VMDK remains unchanged

Conversion Phase

The fixed VMDK is used for the rest of the migration pipeline:

Boot Phase

  1. VM starts with libvirt virtio disk controller
  2. Guest expects LSI Logic (from rewritten descriptor)
  3. Initramfs contains virtio drivers (injected by hyper2kvm)
  4. Virtio drivers load successfully
  5. Root filesystem mounts
  6. Boot completes → login screen appears

Configuration

Automatic (Default Behavior)

The auto-fix is always enabled when BusLogic is detected. No configuration needed.

YAML Configuration

cmd: local
vmdk: /path/to/buslogic.vmdk
output_dir: /output/directory
workdir: /home/user/tmp  # Use location with adequate space

# Ensure virtio drivers are injected
regen_initramfs: true
initramfs_add_drivers:
  - virtio
  - virtio_blk
  - virtio_scsi
  - virtio_net
  - virtio_pci

update_grub: true
fstab_mode: stabilize-all

Important Settings

workdir: Set to a location with sufficient disk space

regen_initramfs: Must be true (default)

Console Output

Auto-Fix Triggered

🔍 Migration Risk Analysis:
  ❌ [FATAL] Legacy controller 'buslogic' unsupported on KVM - no driver available

======================================================================
⚠️  FATAL: 1 CRITICAL risk(s) detected!
======================================================================
   ❌ Legacy controller 'buslogic' unsupported on KVM - no driver available

🔧 ATTEMPTING AUTOMATIC BUSLOGIC FIX...
   Rewriting VMDK descriptor: BusLogic → LSI Logic
   (LSI Logic has KVM driver + virtio injection support)

🔧 Auto-fixing BusLogic controller...
   Changing: ddb.adapterType = "buslogic" → "lsilogic"
   Old: ddb.adapterType = "buslogic"
   New: ddb.adapterType = "lsilogic"
   Copied extent: filename-flat.vmdk
   ✅ Fixed VMDK: /workdir/hyper2kvm-buslogic-fix-xxxxx/filename.vmdk

   ✅ BusLogic auto-fix complete!
   Using fixed VMDK: /workdir/hyper2kvm-buslogic-fix-xxxxx/filename.vmdk

💡 Recommended solutions:
   ✅ BusLogic auto-fixed: Descriptor rewritten to LSI Logic
      Migration will continue with virtio driver injection

✅ FATAL RISK AUTO-FIXED: Continuing migration with fixed VMDK
======================================================================

Conversion Continues

📌 Using auto-fixed VMDK: /workdir/hyper2kvm-buslogic-fix-xxxxx/filename.vmdk

➡️ Offline filesystem fixes
...
Running (guestfs): dracut -f --kver 4.18.0-432.el8.x86_64 --add-drivers virtio_blk virtio_scsi virtio_net
...
✅ Conversion complete

Example: RHEL 8.8 with BusLogic

Source VMDK

File: Auto-esx8.0-rhel8.8-multi-same-specifications.vmdk
OS: Red Hat Enterprise Linux 8.8 Beta
Controller: BusLogic (FATAL)

Migration Command

sudo python -m hyper2kvm --config /path/to/config.yaml

Configuration

cmd: local
vmdk: /home/ssahani/Downloads/Auto-esx8.0-rhel8.8-multi-same-specifications.vmdk
output_dir: /home/ssahani/rhel88-buslogic-autofix
to_output: rhel88-autofix.qcow2
out_format: qcow2
workdir: /home/ssahani/tmp

regen_initramfs: true
initramfs_add_drivers:
  - virtio
  - virtio_blk
  - virtio_scsi
  - virtio_net
  - virtio_pci

update_grub: true
fstab_mode: stabilize-all
verbose: 2

Results

✅ Auto-fix: SUCCESS
   Descriptor rewritten: buslogic → lsilogic
   Extent copied: 16 GB

✅ Conversion: SUCCESS
   VMDK → qcow2: 16 GB → 7.4 GB
   Virtio drivers injected

✅ Deployment: SUCCESS
   VM Name: rhel88-buslogic-fixed
   Status: running
   VNC: vnc://localhost:0

✅ Boot: SUCCESS
   Login screen visible via VNC
   VM fully operational

Technical Details

VMDK Descriptor Format

Original (BusLogic):

# Disk DescriptorFile
version=1
CID=12345678
parentCID=ffffffff
createType="vmfs"

# Extent description
RW 33554432 VMFS "Auto-esx8.0-rhel8.8-multi-same-specifications-flat.vmdk"

# The Disk Data Base
ddb.adapterType = "buslogic"
ddb.geometry.cylinders = "2088"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"

Fixed (LSI Logic):

# Disk DescriptorFile
version=1
CID=12345678
parentCID=ffffffff
createType="vmfs"

# Extent description
RW 33554432 VMFS "Auto-esx8.0-rhel8.8-multi-same-specifications-flat.vmdk"

# The Disk Data Base
ddb.adapterType = "lsilogic"  # ← Changed from "buslogic"
ddb.geometry.cylinders = "2088"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"

Code Implementation

File: hyper2kvm/orchestrator/disk_processor.py

Method: _fix_buslogic_controller(vmdk_path: Path) -> Path

Location: Lines 288-345

Integration:

Supported Scenarios

Monolithic VMDKs (descriptor + extent in same file) ✅ Split VMDKs (separate descriptor + extent files) ✅ Sparse VMDKsFlat VMDKsVMFS-backed VMDKsThin-provisioned VMDKs

Unsupported Scenarios

Multi-disk VMs (each disk fixed independently) ❌ Snapshot chains (consolidate snapshots first) ❌ Linked clones (export as full clone first)

Troubleshooting

Auto-Fix Failed: No Space Left

Error:

❌ BusLogic auto-fix failed: [Errno 28] No space left on device

Solution: Set workdir to a location with adequate space:

workdir: /home/user/large-disk/tmp

VM Doesn’t Boot After Auto-Fix

Symptoms:

Causes:

  1. Virtio drivers not injected
  2. Initramfs rebuild failed

Solution: Check conversion logs for:

Running (guestfs): dracut -f --kver <version> --add-drivers virtio_blk virtio_scsi virtio_net

If missing, ensure regen_initramfs: true in config.

Original VMDK Modified

Concern: “Will auto-fix modify my original VMDK?”

Answer: NO. The auto-fix:

Performance Impact

Storage Requirements

Original VMDK Temporary Fixed VMDK Total Space Needed
16 GB 16 GB 32 GB
50 GB 50 GB 100 GB
100 GB 100 GB 200 GB

Note: Temporary copy deleted after conversion completes.

Time Impact

Comparison: Before vs After

Before Auto-Fix

1. User: "Migrate this BusLogic VMDK"
2. hyper2kvm: ❌ FATAL: BusLogic unsupported - ABORT
3. User: Must go to VMware, change controller, re-export
4. User: Retry migration with fixed VMDK

Total time: Hours (VMware access required)

After Auto-Fix

1. User: "Migrate this BusLogic VMDK"
2. hyper2kvm: ⚠️  BusLogic detected → Auto-fixing...
3. hyper2kvm: ✅ Fixed → Continuing migration
4. User: VM boots successfully

Total time: Minutes (no VMware access needed)

Integration with Other Features

Works With

Conflicts With

Security Considerations

Descriptor Modification

The auto-fix only modifies:

Original VMDK Integrity

Temporary Files

Future Enhancements

Planned

Under Consideration

FAQ

Q: Does this modify my VMware VM?

A: No. The auto-fix operates on the exported VMDK file, not the VMware VM. Your VMware VM remains completely unchanged.

Q: Can I disable auto-fix?

A: Currently, auto-fix is always enabled when BusLogic is detected. To disable, use --skip-vmdk-inspection (but this skips ALL inspection, not just auto-fix).

Q: What if auto-fix fails?

A: Migration continues with original VMDK (non-blocking). A warning is logged:

❌ BusLogic auto-fix failed: <reason>
   Migration will continue with original VMDK

VM may not boot, but you’ll get a migration report with details.

Q: Does this work for Windows VMs?

A: Yes, but Windows requires additional virtio driver injection (separate feature). For Windows:

  1. BusLogic → LSI Logic descriptor rewrite (this feature)
  2. Virtio drivers injected into Windows registry/drivers folder (Windows support feature)

Q: Can I use the fixed VMDK in VMware?

A: Yes! The fixed VMDK has LSI Logic controller, which VMware fully supports. You can:

References

External Resources

Changelog

v1.0.0 (2026-01-29)

Support

For issues with BusLogic auto-fix:

  1. Check conversion logs for auto-fix messages
  2. Verify workdir has sufficient space
  3. Ensure regen_initramfs: true in config
  4. Check VM console logs for boot errors
  5. Report issues: https://github.com/ssahani/hyper2kvm/issues

Author

Feature implemented based on user feedback:

“ok I cant see the login screen can we change the buslogic dynamically if we detected so”

Result: Automatic BusLogic detection and descriptor rewriting. VM boots successfully.