Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


lvm_-_thin_provisioning

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
lvm_-_thin_provisioning [2014/06/23 12:12] – [LVM - Thin provisioning] adminlvm_-_thin_provisioning [2014/06/23 19:48] – [LVM - Thin provisioning] admin
Line 4: Line 4:
 <code> <code>
 # create thin pool # create thin pool
-lvcreate -L 200G vg_kvm1/thinpool+lvcreate -L 200G -T vg_kvm1/thinpool
  
 # create thin lv # create thin lv
 lvcreate -V32G -T vg_kvm1/thinpool -n thin_vmpxe lvcreate -V32G -T vg_kvm1/thinpool -n thin_vmpxe
 +
 +lvcreate -V1G -T vg001/mythinpool -n thinvolume
  
 # create thin pool and lv in one command # create thin pool and lv in one command
 lvcreate -L 200G -T vg_kvm1/thinpool -V32G -n thin_vmpxe lvcreate -L 200G -T vg_kvm1/thinpool -V32G -n thin_vmpxe
 </code> </code>
- 
-===Convert thick LV to thin LV in use by KVM guest=== 
-  * Shutdown access to lv, for example shut down KVM guest using that thick LV. <code>virsh shutdown vmpxe</code> 
-  * Create thin lv. <code>lvcreate -V16G -T vg_kvm1/thinpool -n thin_vmpxe</code> 
-  * Copy contents from thick to thin lv. <code>dd if=/dev/vg_kvm1/vmpxe of=/dev/vg_kvm1/thin_vmpxe 
- 
-##or use 'pv' to monitor progress. 
- 
-dd if=/dev/vg_kvm1/vmpxe | pv -s 32g | dd of=/dev/vg_kvm1/thin_vmpxe 
- 
-## free space not yet available: 
-lvs 
-  LV         VG      Attr       LSize   Pool     Origin Data%  Move Log Cpy%Sync Convert 
-  thin_vmpxe vg_kvm1 Vwi-aotz--  32.00g thinpool        100.00 
- 
-</code> 
-  * Edit KVM guest disk location. <code>virsh edit vmpxe</code> 
-  * Start KVM guest.<code>virsh start vmpxe --console</code> 
-  * Enable issue discards in lvm.conf, 'discard' in /etc/fstab, regenerate initramfs (dracut -f) 
- 
- 
- 
-create file xml: 
-  <controller type='scsi' model='virtio-scsi' index='0'/> 
-  # virsh attach-device --config Guest1 ~/virtio-scsi-controller.xml 
- 
-make sure discard=unmap, bus = scsi and address type is altered to scsi instead of pci:<code> 
-<disk type='file' device='disk'>  
-  <driver name='qemu' type='raw' discard='unmap'/> 
-  <source file='/guests/Fedora19.img'/> 
-  <target dev='sda' bus='scsi'/> 
-  <address type='drive' controller='0' bus='0' target='0' unit='0'/> 
-</disk></code> 
- 
- 
lvm_-_thin_provisioning.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1