VDI not Available

VDI not Available

book

Article ID: CTX131201

calendar_today

Updated On:

Description

“The VDI is not available” message is displayed in XenCenter after attempting to start a Virtual Machine (VM).

Background

The additional details of “VDI is not available” error are not displayed. This article describes the error messages, the reasons for VDI not available error message, extract from the storage management code, and records in the /var/log/SMlog along with possible causes and resolution to the issue.
The errors have been grouped based on the storage activity occurring at the time they were displayed.

SR-Scan / VDI load

The lvs command is used to get the list of logical volumes (LV). The vhd-util scan is used to verify Virtual Disk Images (VDI) information without activating the logical volumes.
If the VHD is corrupted, vhd-util is unable to read this data and it fails.
The following error is generated:
The VDI is not available
Error scanning VDI <uuid>

Errors can be caused by logical volumes being manually removed or by LV metadata corruption.
Errors returned in this case are:
The VDI is not available LV scan error
The VDI is not available LV not found

Errors occur if unable to read the VDI and IO retry fails when collecting VDI information:
Errors returned in this case are:
The VDI is not available
<VDI UUID> not found

Failure getting VDI parameters:
The VDI is not available
VDI <VDI UUID> unavailable <VDI UUID> <Path To VDI>

VDI-Attach

A check for a journal on the VDI occurs and if one exists, we do not attach VDI. This is because an operation is ongoing or was not properly completed.
Error returned in this case:
The VDI is not available
Interrupted operation detected on this VDI, scan SR first to trigger auto-repair.

If the Logical Volume (LV) has been removed or missing and the attach is called, the following error is returned:
The VDI is not available
Could not find <Path to VDI>

Error returned in this case:
The VDI is not available
VDI <VDI UUID> unavailable

When performing the VDI attach process, a check is performed to determine if the VDI is already attached.
Error returned in this case:
The VDI is not available
VDI already attached RW <VDI UUID>

During VDI Attach for iSCSI LUN, if the device path cannot be found in /dev/disk or /dev/sd* the attach fails.
Error returned in this case:
The VDI is not available path for VDI not found.

During path check, if the path is not found, a failure occurs.
Error returned in this case:
The VDI is not available unable to query SCSIid

VDI-detach

When performing a detach of LV based VHDs, a deflate operation is performed on snapshots.
Error returned in this case:
The VDI is not available deflate

VDI-Resize

If the VDI that is being resized is hidden:
Error returned in this case:
The VDI is not available hidden VDI

If the VDI is missing:
Error returned in this case:
The VDI is not available
VDI <VDI UUID> unavailable

Snapshot

If a LV in the chain has been removed or missing, the following error is generated:
The VDI is not available
VDI unavailable: <Path to VDI>

If the SR is inaccessible, a failure occurs to get the chain depth.
Error in this case:
The VDI is not available failed to get VHD depth.

If the chain depth is over 30 then a failure occurs.
Error in this case:
The VDI is not available SnapshotChainTooLong.

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Resolution

To resolve this error, complete the following procedure:

  1. Run the following command on each host to verify that the VM is shut down and is not running on any of the hosts:
    list_domains | grep <VM UUID>
    For Example [root@localhost log]# list_domains | grep c4615dc5-a7ff-bf10-e675-49e64a749fb5

  2. If the response indicates any running VM, then the machine must be shut down and reset the VDI, to allow the VM to start without error.

  3. The resetvdis.py script allows a single VDI to be reset without having to stop all VM running on the same storage repository.
    Using the VDI UUID from the error message the resetvdis.py command syntax is:
    /opt/xensource/sm/resetvdis.py single <VDI UUID>

    WARNING! calling with 'all' on an attached SR, or using --force may cause DATA CORRUPTION if the VDI is still attached somewhere.

    Always manually double-check that the VDI is not in use before running this script.
    To manually check if a VDI is still attached, use the following command on each host:
    tap-ctl list | grep <VDI UUID>


Problem Cause

The most common occurrence of the VDI is not available message is VDI already attached RW.
Following are the causes of the preceding issue:

  • The VM crashed or was interrupted during shut down.

  • XenMotion failed in the VM, or XenMotion was interrupted.

  • The VM Storage Repository is out of disk space

  • Loss of connection to NFS Server

The VM becomes unresponsive where it is off, but the XenServer does not receive the signal about the shutting down of the VM.

Issue/Introduction

This article contains information to resolve Error: "VDI not Available".

Additional Information

CTX138234 - Error: "VDI Not Available"