Hyper-v iSCSI vhdx don't reconnect disk inside VM

Anonymous
2024-04-01T15:43:18+00:00

I have one iSCSI drive connected to the host where I put one .vhdx which is connected to VM.
From time-to-time iSCSI becomes disconnected because of some network failure and also .vhdx disappears inside VM when that happens.
After iSCSI reconnect drive is visible on host but .vhdx connected to VM don’t reconnect drive inside VM.

For now I have found only solution to manually edit hard drive location to different number > apply >return back location number > apply

Do anyone have idea how to fix this so that drive inside VM reappear after iSCSI drive on host reconnects back?

Windows for business | Windows Server | Storage high availability | Virtualization and Hyper-V

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-04-02T02:43:47+00:00

    Hi Admin,

    Good day!

    It sounds like you're experiencing issues with the iSCSI drive becoming disconnected from the host, causing the .vhdx file connected to the VM to disappear. When the iSCSI drive reconnects, the .vhdx file doesn't automatically reappear inside the VM.

    To address this issue and ensure that the .vhdx file reconnects to the VM after the iSCSI drive reconnects, you can try the following approaches:

    1. Ensure that your iSCSI configuration on both the host and the iSCSI target device is correctly set up. Verify that the network connections are stable and that there are no intermittent connectivity issues causing the disconnects.
    2. You can automate the process of reattaching the .vhdx file to the VM after the iSCSI drive reconnects by using PowerShell scripting. Write a PowerShell script that checks for the presence of the .vhdx file and, if it's not found, reattaches it to the VM. Schedule this script to run periodically or trigger it to run when the iSCSI drive reconnects.
    3. Create a scheduled task on the host system that monitors the status of the iSCSI connection. When the iSCSI drive reconnects, trigger the task to run a script that reattaches the .vhdx file to the VM.
    4. Ensure that Hyper-V Integration Services are installed and up-to-date on the VM. Integration Services help improve communication between the host and VM and may help with reattaching disks after a disconnect.
    5. Review the settings of the iSCSI Initiator on the host system. Look for options related to automatic reconnection or recovery after network disruptions. Adjust these settings as needed to improve the reliability of the iSCSI connection.
    6. If the issues persist and you continue to experience reliability problems with the iSCSI setup, consider alternative storage solutions such as direct-attached storage (DAS) or network-attached storage (NAS) that may offer more stable and reliable connectivity.

    By implementing these strategies, you should be able to improve the reliability of your iSCSI storage setup and ensure that the .vhdx file reconnects to the VM automatically after the iSCSI drive reconnects.

    Best Regards

    0 comments No comments
  2. Anonymous
    2024-04-02T07:35:12+00:00

    Thank you for the info.

    It looks like powershell will be the way if there is nothing to do on hyper-v side to automatically reattach disk.

    Maybe report this to Microsoft hyper-v product team to improve hyper-v to be smarter about this issue.

    1 person found this answer helpful.
    0 comments No comments