티스토리 뷰

Xenserver Metadata Backup 하기

 

방법:

 

 

12월 5일 VM VDI 삭제 장애 발생

미리 메타데이터 백업을 해놓았다면 살렸을 가능서도 있음

생각했으면 바로 실행을 해야 함.

 

    XenServer Virtual Machine Storage Recovery

    Document ID: CTX128097 /   Created On: 2011. 3. 28   /   Updated On: 2012. 3. 10

    Average Rating:

    clip_image001

    (1 ratings)

    View products this document applies to

    clip_image002

    Symptoms

    You install XenServer on a host and cannot start any virtual machines after the XenServer reboots.

    This article provides background and a simple workaround to avoid or resolve this issue.

    IMPORTANT!! This procedure should be fully tested and understood in a development environment prior to implementing it on a production environment. Restoring a volume on a working volume can result in virtual machines not booting or data loss.

    Background

    During the XenServer installation, if you present a volume through the Host Bus Adapter (HBA) to the XenServer, you are given the selection during the installation to select the disks to use for virtual machine storage. If you select the secondary disk, which might be used already by other hosts in a pool, it results in a complete removal of the existing Storage Repository (SR) with virtual machines.

    Installing XenServer on a host with attached storage through an HBA is not recommended. If your host uses an HBA, you can install XenServer with the HBA installed, but the following recommendations are made:

    1. Un-map the Logical Units (LUNs) on the switch from the host during the installation.
    2. Disconnect the Fiber cables during the installation.
    3. Ensure you are mapping the LUNs to the correct host.

    Workaround

    If you currently have virtual machines running in a shared volume, the change in the logical or physical volume is not recognized until you scan the volume or reboot the XenServer.

    1. If virtual machines are currently running, back up all the virtual machine data because they might not boot up or data might not be retrievable after making a recovery attempt.
    2. Use your existing backup solution to back up the virtual machines as a whole to try and recover data if needed.

    Identify your SR’s Universally Unique Identifier (UUID)

    1. Open the command line in the XenServer host.
    2. Run the following command:
      xe sr-list name-label=<Name of your SR>.

    clip_image003

    1. Make note of your UUID.
    2. Scan your SR with the following command and see if you get an error like the screen shot below:
      xe sr-scan=<UUID of your SR>

    clip_image004

    Identify your logical volume

    1. Change to directory /etc/lvm/backup with the command: 
      cd /etc/lvm/backup.
    2. Identify the file which has the UUID of your SR from the previous step.

    clip_image005

    Note: This screen shot show the output as XSLocalEXT; it is normally VG_XenStorage-<UUID>.

    1. Open the file and identify the physical volume for the logical volume using the cat <filename> | more command.

    clip_image006

    1. Identify your physical volume.

    clip_image007

    1. Use the command fdisk –l and identify what disk the SR should be located.

    clip_image008

    Make note of the disk (/dev/sda) and partition where your SR is located (/dev/sda4).

    1. Run the following command: 
      pvdisplay /dev/<device where your think the SR should be>

    clip_image009

    1. The UUID of the physical volume should be the same as the UUID for the physical volume displayed in the file from the previous step.
    2. If the physical volume UUIDs are not the same then the physical volume has changed; run the procedure below to recover the logical volume on the new physical volume.

    Recovery

    Once you have identified that your physical volume is different than the one noted in the logical volume file, you must recover the logical volume on the physical volume using the following steps.

    1. Back up the file VG_XenStorage-<UUID of your SR> in /etc/lvm/backup directory with the following command:
      cp /etc/lvm/backup/<filename> /etc/lvm/backup/orig.<filename>
    2. Use a text editor like VI to modify the file with a new PV UUID that is presented in the format identified from previous step.
    3. Restore the LVM using the followings commands:
      Back up the current LVM:
      # cd /etc
      # cp –dpR lvm lvm-<YEAR><MONTH><DAY>-<HOUR><MINUTE> (Actual Date)
      # vgcfgbackup
      # cd /etc/backup
      Test Recovery:
      # vgcfgrestore VG_XenStorage-<UUID of the volume to be restored> --test –f VG_XenStorage-<UUID of the volume to be restored>
      Recover the Volume:
      # vgcfgrestore VG_XenStorage-<UUID of the volume to be restored> –f VG_XenStorage-<UUID of the volume to be restored>
      Scan the SR:
      #xe sr-scan uuid=<UUID of the SR to be restored>
    4. Attempt to plug your Physical Block Device (PBD) on your SR.

    More Information

    Refer to the procedure in CTX117508 – How to Recover a Deleted XenServer Virtual Machine as a guide for this recovery process.

    This document applies to:

    원본 위치 <http://support.citrix.com/article/CTX128097>

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함