Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
hypervisor:base:storage [2015/03/03 23:22] admin [Xen Storage Objects] |
hypervisor:base:storage [2015/03/05 01:39] admin [Create a Storage Repository] |
||
---|---|---|---|
Line 34: | Line 34: | ||
---- | ---- | ||
{{ :hypervisor:toolstack:xen-storage.png?direct&200 }} | {{ :hypervisor:toolstack:xen-storage.png?direct&200 }} | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Virtual Disk Data Formats ==== | ||
+ | ---- | ||
+ | There are three main types of mapping of physical storage to a VDI: | ||
+ | |||
+ | * **File-based VHD on a Filesystem**; VM images are stored as thin-provisioned VHD format files on either a local non-shared Filesystem (EXT type SR) or a shared NFS target (NFS type SR) | ||
+ | |||
+ | * **Logical Volume-based VHD on a LUN**; The default XenServer blockdevice-based storage inserts a Logical Volume manager on a disk, either a locally attached device (LVM type SR) or a SAN attached LUN over either Fibre Channel (LVMoHBA type SR), iSCSI (LVMoISCSI type SR) or SAS (LVMoHBA type Sr). VDIs are represented as volumes within the Volume manager and stored in VHD format to allow thin provisioning of reference nodes on snapshot and clone. | ||
+ | |||
+ | * **LUN per VDI**; LUNs are directly mapped to VMs as VDIs by SR types that provide an array-specific plugin (Netapp, Equallogic or StorageLink type SRs). The array storage abstraction therefore matches the VDI storage abstraction for environments that manage storage provisioning at an array level. | ||
---- | ---- | ||
Line 39: | Line 51: | ||
---- | ---- | ||
- | If you followed our [[hypervisor:base:debian|Debian Installation]] section, you should already have an LVM partition, thus a physical volume: | + | The following example illustrates the SR creation on a local non-shared Filesystem (ext). |
+ | |||
+ | If you follow the [[sample:base|Sample Configuration]] section of this wiki, you will have a LVM partition, thus a physical volume to use: | ||
<code> | <code> | ||
- | > pvdisplay | + | > sudo pvdisplay |
--- Physical volume --- | --- Physical volume --- | ||
- | PV Name /dev/sda2 | + | PV Name /dev/sde5 |
- | VG Name xenvg | + | VG Name Xvg0 |
- | PV Size 464.83 GiB / not usable 0 | + | PV Size 12.82 GiB / not usable 3.00 MiB |
Allocatable yes | Allocatable yes | ||
PE Size 4.00 MiB | PE Size 4.00 MiB | ||
- | Total PE 118996 | + | Total PE 3282 |
- | Free PE 112322 | + | Free PE 5 |
- | Allocated PE 6674 | + | Allocated PE 3277 |
- | PV UUID 4g97od-AZ1M-8sws-7ghY-YPaT-PsPR-mpO3iy | + | PV UUID sJOaJc-vZzX-1d8O-2R5i-jmi5-Gkj4-S4rxdJ |
</code> | </code> | ||
Along with a volume group: | Along with a volume group: | ||
<code> | <code> | ||
- | > vgdisplay | + | > sudo vgdisplay |
- | --- Volume group --- | + | |
- | VG Name xenvg | + | --- Volume group --- |
+ | VG Name Xvg0 | ||
System ID | System ID | ||
Format lvm2 | Format lvm2 | ||
Metadata Areas 1 | Metadata Areas 1 | ||
- | Metadata Sequence No 22 | + | Metadata Sequence No 7 |
VG Access read/write | VG Access read/write | ||
VG Status resizable | VG Status resizable | ||
MAX LV 0 | MAX LV 0 | ||
- | Cur LV 3 | + | Cur LV 1 |
- | Open LV 3 | + | Open LV 1 |
Max PV 0 | Max PV 0 | ||
Cur PV 1 | Cur PV 1 | ||
Act PV 1 | Act PV 1 | ||
- | VG Size 464.83 GiB | + | VG Size 12.82 GiB |
PE Size 4.00 MiB | PE Size 4.00 MiB | ||
- | Total PE 118996 | + | Total PE 3282 |
- | Alloc PE / Size 6674 / 26.07 GiB | + | Alloc PE / Size 3277 / 12.80 GiB |
- | Free PE / Size 112322 / 438.76 GiB | + | Free PE / Size 5 / 20.00 MiB |
- | VG UUID yf4fNc-5Nke-5SCd-Jqo6-ie9c-gH7r-8dCE66 | + | VG UUID Skt7yP-fl4B-IxvG-VUA4-KcJH-1Mho-2QASh8 |
</code> | </code> | ||
Line 83: | Line 99: | ||
If you do not already have a device to use as repository, create a logical volume on volume group. | If you do not already have a device to use as repository, create a logical volume on volume group. | ||
+ | |||
<code> | <code> | ||
- | > lvcreate --size 30G -n LocalStorage xenvg | + | > sudo lvcreate --size 13G -n Xsr0 Xvg0 |
</code> | </code> | ||
Line 94: | Line 111: | ||
You should see your partition in a line such as: | You should see your partition in a line such as: | ||
<code> | <code> | ||
- | Disk /dev/mapper/xenvg-LocalStorage: 32.2 GB, 32212254720 bytes | + | ... |
+ | Disk /dev/mapper/Xvg0-Xsr0: 13.7 GB, 13744734208 bytes | ||
+ | ... | ||
</code> | </code> | ||
==== Register the logical volume for use with XAPI ==== | ==== Register the logical volume for use with XAPI ==== | ||
<code> | <code> | ||
- | > xe sr-create type=ext name-label='Local Storage' device-config:device=/dev/mapper/xenvg-LocalStorage | + | > xe sr-create type=ext name-label='LocalStorage' device-config:device=/dev/mapper/xenvg-LocalStorage |
</code> | </code> | ||
This will take a while if the volume is large, it will return the SR UUID. | This will take a while if the volume is large, it will return the SR UUID. | ||
Line 105: | Line 124: | ||
Display the storage repository: | Display the storage repository: | ||
<code> | <code> | ||
- | > xe sr-list name-label='Local Storage' | + | > xe sr-list name-label='LocalStorage' |
</code> | </code> | ||
Line 142: | Line 161: | ||
Set the default SR | Set the default SR | ||
<code> | <code> | ||
- | > xe pool-param-set uuid=<pool-uuid> default-SR=<sr-uuid> | + | > xe pool-param-set uuid=<pool_uuid> default-SR=<sr_uuid> |
</code> | </code> | ||
===== Delete a Storage Repository ===== | ===== Delete a Storage Repository ===== | ||
Line 149: | Line 168: | ||
> xe sr-list | > xe sr-list | ||
</code> | </code> | ||
- | -> write down / take note of SR-UUID of the SR to delete | + | -> Copy / write down / take note of SR-UUID of the SR to delete |
2. Find the corresponding Physical Block Device (PBD): | 2. Find the corresponding Physical Block Device (PBD): | ||
<code> | <code> | ||
- | > xe pbd-list sr-uuid=your-SR-uuid | + | > xe pbd-list sr-uuid=<sr_uuid> |
</code> | </code> | ||
- | -> write down / take note of PBD-UUID of the PBD to unplug and delete | + | -> Copy / write down / take note of PBD-UUID of the PBD to unplug and delete |
3. Unplug the PBD: | 3. Unplug the PBD: | ||
<code> | <code> | ||
- | > xe pbd-unplug uuid=your-PBD-uuid | + | > xe pbd-unplug uuid=<pbd_uuid> |
</code> | </code> | ||
4. Delete PBD: | 4. Delete PBD: | ||
<code> | <code> | ||
- | > xe pbd-destroy uuid=your-PBD-uuid | + | > xe pbd-destroy uuid=<pbd_uuid> |
</code> | </code> | ||
5. Delete the association of your SR and the PBD: | 5. Delete the association of your SR and the PBD: | ||
<code> | <code> | ||
- | > xe sr-forget uuid=your-SR-uuid | + | > xe sr-forget uuid=<sr_uuid> |
</code> | </code> | ||