NOTE: If you're using StorageLink on, for example, EqualLogic arrays, the name of the LUN is in the format XenStorage${sr-uuid}${vdi-uuid}
First log in to the xenserver as root. For this example, we're assuming our VM is named 'web01'.
Get the UUID of the VM with the following commond:
[root@xenserver ~]# xe vm-list name-label=web01 params=uuid
uuid ( RO) : 39ccc7b9-9a7b-e13c-d381-b5e81fca5394
List all the VBDs assigned to the VM and their associated VDIs using the VM's uuid.
[root@xenserver ~]# xe vbd-list vm-uuid=39ccc7b9-9a7b-e13c-d381-b5e81fca5394 params=vdi-uuid,vdi-name-label
vdi-uuid ( RO) : 9c124393-bd7d-4223-a208-dc38ae6afdad
vdi-name-label ( RO): web01-root
vdi-uuid ( RO) : 2f8af49b-2cc1-4af8-80f2-15bee4de67bf
vdi-name-label ( RO): web01-swap
Notice the VDI that is assigned as the root disk for the VM, take note of the vdi-uuid value. Now we can see what SR the VDI is assigned to using the vdi-uuid value.
[root@xenserver ~]# xe vdi-list uuid=9c124393-bd7d-4223-a208-dc38ae6afdad params=uuid,sr-uuid
uuid ( RO) : 9c124393-bd7d-4223-a208-dc38ae6afdad
sr-uuid ( RO): 720183de-96e7-9b38-a97d-102324838b97
Using the sr-uuid and vdi-uuid, we can determine which LVM volume the root disk of the VM is assigned to. The path is /dev/VG_XenStorage-${sr-uuid}/VHD-${vdi-uuid} which you can verify by listing all the LVM volumes.
[root@xenserver ~]# lvdisplay
--- Logical volume ---
LV Name /dev/VG_XenStorage-720183de-96e7-9b38-a97d-102324838b97/VHD-9c124393-bd7d-4223-a208-dc38ae6afdad
VG Name VG_XenStorage-720183de-96e7-9b38-a97d-102324838b97
LV UUID a38GYk-1Bzg-2Syu-3Rfn-BVYE-DaW2-cVhPuM
LV Write Access read/write
LV Status available
# open 1
LV Size 260.52 GB
Current LE 66692
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:1
0 comments:
Post a Comment