记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。

VM Fails to Boot with Error: The VDI is not available or SR Scan Fails after Snapshot with Error:There was an SR Backend Failure


A Virtual Machine (VM) does not boot or you cannot run a successful Storage Repository (SR) scan after creating a snapshot.

You receive the following error message when starting a VM: 
“The VDI is not available”

- Or -

When you run the SR scan command, you get the following error output:

There was an SR backend failure.
status: non-zero exit
stdout: 
stderr: Traceback (most recent call last):
File "/opt/xensource/sm/LVMoISCSISR", line 245, in ?
SRCommand.run(LVHDoISCSISR, DRIVER_INFO)
File "/opt/xensource/sm/SRCommand.py", line 148, in run
sr = driver(cmd, cmd.sr_uuid)
File "/opt/xensource/sm/SR.py", line 118, in __init__
self.load(sr_uuid)
File "/opt/xensource/sm/LVMoISCSISR", line 90, in load
self._pathrefresh(LVHDoISCSISR)
File "/opt/xensource/sm/SR.py", line 362, in _pathrefresh
super(obj, self).load(self.uuid)
File "/opt/xensource/sm/LVHDSR.py", line 275, in load
self._undoAllJournals()
File "/opt/xensource/sm/LVHDSR.py", line 66, in wrapper
ret = op(self, *args)
File "/opt/xensource/sm/LVHDSR.py", line 581, in _undoAllJournals
self._undoAllClones()
File "/opt/xensource/sm/LVHDSR.py", line 518, in _undoAllClones
self._undoClone(uuid, val)
File "/opt/xensource/sm/LVHDSR.py", line 548, in _undoClone
self.lvmCache.setHidden(base.name, False)
File "/opt/xensource/sm/lvmcache.py", line 39, in wrapper
ret = op(self, *args)
TypeError: setHidden() takes exactly 2 arguments (3 given)

This issue is specific to:

• Hosts that have been upgraded from version 5.0 to version 5.5 and have previously existing Logical Volumes in a shared LVM SR.

• Triggering a live snapshot for a VM based on an upgraded LVM VDI running on a slave.

This does not apply to suspended VMs, or VMs that are powered off.

Status

Citrix has released dedicated Hotfix XS55E001 to resolve this issue. Follow CTX122142 - Hotfix XS55E001 - For XenServer 5.5 to apply it.
Hotfox XS55E001 is replacement of workaround below workaround.

Requirements

XenServer 5.5 Installation
Access to XenServer Console on Master or by using PuTTY

Background

Starting a VM after creating a snapshot on a slave in a pool might create a faulty clone volume that is not recognized by the SR scan script; causing the VDI to be inaccessible.

Workaround

Caution! Read the Status section of this article. Back up the Logical Unit before attempting any changes.

Use the following procedure to remove the clone logical volume:

1. Open a console on the master or use PuTTY ssh client.

2. Back up LVM metadata
# vgcfgbackup

3. Run the following command to see if there is a clone that is causing the SR not to be scanned.
# lvscan | grep clo

4. If you see an entry with clone, then proceed to the next step. 
Inactive /dev/ VG_ XenStorage-8d418f1a-107e-472f-5453-b24c88e7428e/clone_8e4b4263-f9af-45f3-b97e-afa5481ea2a1
The format of the clone journal volume should look something like: 
clone_<UUID A>_<UUID B>_<UUID C>
for example:
clone_39995443-46c7-4757-94d5-72b3f0342a4a_09166c8f-3497-4fdb-b1df-1bab511211d0_9266c58f-9b30-442e-9a61-65cea9fd99a3

5. Remove the clone logical volume. Note: Make sure the correct Logical Volume is deleted.
# lvremove /dev/ VG_ XenStorage-8d418f1a-107e-472f-5453-b24c88e7428e/clone_8e4b4263-f9af-45f3-b97e-afa5481ea2a1

6. Run the following command to scan the SR:
xe sr-scan uuid=<UUID of SR for the VM>.

7. Attempt to start the VM.

Example of steps:

1. Backup LVM metadata
# vgcfgbackup

2. Find the faulty clone volume with command lvscan | grep clone.
This command outputs the clone volume
For Example:
Inactive /dev/ VG_ XenStorage-8d418f1a-107e-472f-5453-b24c88e7428e/clone_8e4b4263-f9af-45f3-b97e-afa5481ea2a1

Note
: The associated volume is VG_XenStorage-8d418f1a-107e-472f-5453-b24c88e7428e

3. Remove logical volume
# lvremove /dev/ VG_ XenStorage-8d418f1a-107e-472f-5453-b24c88e7428e/clone_8e4b4263-f9af-45f3-b97e-afa5481ea2a

4. Scan the SR 
# xe sr-scan uuid=<uuid of SR>.

5. Attempt to boot VM.

For future snapshots, migrate the virtual machines that you are going to snapshot to the Pool Master before executing the snapshot function. Snapshot should be performed on the pool master.

Caution! Do not remove any logical volume without knowing if it has any issues; this permanently deletes the volume.

More Information

CTX122142 - Hotfix XS55E001 - For XenServer 5.5





网站已经关闭评论