Error: "SR BACKEND FAILURE 181" in XenServer

Error: "SR BACKEND FAILURE 181" in XenServer

book

Article ID: CTX131660

calendar_today

Updated On:

Description

After installation or upgrade to XenServer 6.0, user experiences issues with any storage related operations. The following error message appears:
“SR_BACKEND_FAILURE_181 Error In metadata Volume Operation For SR.”

The following entries appears in the log /var/log/SMlog file:

Error code: SR_BACKEND_FAILURE_181
Error parameters: , Error in Metadata volume operation for SR. opterr=VDI delete operation failed for parameters: /dev/VG_XenStorage-427796a3-6891-dcb7-681f-cc7c5463ea0a/MGT, 7b496cd3-9d9c-4cb4-b510-4613e65e7141. Error: not well-formed (invalid token): line 1, column 99,
[10146] 2011-11-27 08:05:10.977985 Raising exception [181, Error in Metadata volume operation for SR. [opterr=VDI delete operation failed for parameters: /dev/VG_XenStorage-511f729e-0f0e-a679-9b8e-4d7ed28f6537/MGT, 65f8e675-9416-4909-8cd1-b7d75af06762. Error: not well-formed (invalid token): line 1, column 65]]
[10146] 2011-11-27 08:05:10.978109 lock: released /var/lock/sm/511f729e-0f0e-a679-9b8e-4d7ed28f6537/sr [10146] 2011-11-27 08:05:10.979583 ***** sr_scan: EXCEPTION SR.SROSError, Error in Metadata volume operation for SR. [opterr=VDI delete operation failed for parameters: /dev/VG_XenStorage-511f729e-0f0e-a679-9b8e-4d7ed28f6537/MGT, 65f8e675-9416-4909-8cd1-b7d75af06762. Error: not well-formed (invalid token): line 1, column 65]

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

As a workaround, you can remove all special characters from the virtual machine name-label and description fields.  Contact Citrix Technical Support to assist you in resolving the issue. 
Note: Special character should not be used for the storage repository and description field.

In situation where the preceding workaround is unsuccessful, rebuild the SR MGT volume after removing the special characters:

  1. Run lvscan and search for the MGT volume for the respective Storage Repository (SR).
    Example: ACTIVE '/dev/VG_XenStorage-c14bee2a-44da-656a-5b99-865818c0a700/MGT' [4.00 MB] inherit

  1. Run a test to verify that the lv can be renamed:
    lvrename -t /dev/VG_Xenstorage- <SR-uuid>/MGT /dev/VG_Xenstorage- <SR-uuid>/MGT.bak

  1. When the preceding test is successful, run lvrename without the “-t” option:
    lvrename /dev/VG_Xenstorage- <SR-uuid>/MGT /dev/VG_Xenstorage-< SR-uuid>/MGT.bak

  1. Restart the master host in the pool or unplug and re-plug the Physical Block Device (PBD) on the Master Host for the respective SR to build a new MGT volume.
    Example:
    Find the Master Host UUID > xe pool-list params=master
    master ( RO)    : 9079cff1-c457-4e51-b924-8a9e1ec24179

  2. To find the master PBD, run > xe pbd-list sr-uuid= c14bee2a-44da-656a-5b99-865818c0a700 host-uuid=9079cff1-c457-4e51-b924-8a9e1ec24179
    uuid ( RO) : 99c6d7ec-75ef-1071-d925-5ff6b4667ecc
    host-uuid ( RO): 9079cff1-c457-4e51-b924-8a9e1ec24179
    sr-uuid ( RO): 20daa9a1-a9b2-ddc9-30a7-c4e15999a284
    device-config (MRO): device: /dev/sdb
    currently-attached ( RO): true

  3. Unplug the PBD for the master (using the PBD UUID from Step 5):
    xe pbd-unplug uuid=99c6d7ec-75ef-1071-d925-5ff6b4667ecc

  4. Re-Plug the PBD to attach the host to the SR again:
    xe pbd-plug uuid=99c6d7ec-75ef-1071-d925-5ff6b4667ecc

This process will rebuild the MGT volume with the updated information without the special characters in the virtual machine name or description that was previously causing the errors.

Solution

Refer to the following Knowledge Center articles for the current updates that address this issue as of 01/02/2013:
CTX135411 - Hotfix XS60E022 - For XenServer 6.0
CTX135623 - Hotfix XS602E013 - For XenServer 6.0.2


Problem Cause

XenServer does not properly store the incoming virtual machine name-label and description fields in management VDI (MGT).

Issue/Introduction

Error: SR_BACKEND_FAILURE_181 Error In metadata Volume Operation For SR.