[Users] re-thin a disk

--_000_9BE6F493F83A594DA60C45E6A09DC5AC23B81776AUSP01DAG0201_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have a virtual machine with a 500GB thin-provisioned disk, and on it is a= bout 2GB of data. Due to a pvmove operation I am running, the 500GB disk w= ith 2GB of data is growing and growing and is currently 180GB in size, and = im sure it will go all the way to the 500GB before it stops. When this process is finished, is there a way to re-thin the disk back down= to the proper size again? What about the export/import process? Would th= at export it to the data size, not the block size? Thanks, jonathan ________________________________ This is a PRIVATE message. If you are not the intended recipient, please de= lete without copying and kindly advise us by e-mail of the mistake in deliv= ery. NOTE: Regardless of content, this e-mail shall not operate to bind SKO= POS to any order or other contract unless pursuant to explicit written agre= ement or government initiative expressly permitting the use of e-mail for s= uch purpose. --_000_9BE6F493F83A594DA60C45E6A09DC5AC23B81776AUSP01DAG0201_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
<style> <!-- @font-face {font-family:Calibri} @font-face {font-family:Tahoma} p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif"} a:link, span.MsoHyperlink {color:blue; text-decoration:underline} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline} p.MsoAcetate, li.MsoAcetate, div.MsoAcetate {margin:0in; margin-bottom:.0001pt; font-size:8.0pt; font-family:"Tahoma","sans-serif"} span.EmailStyle17 {font-family:"Calibri","sans-serif"; color:windowtext} span.BalloonTextChar {font-family:"Tahoma","sans-serif"} .MsoChpDefault {font-family:"Calibri","sans-serif"} @page WordSection1 {margin:1.0in 1.0in 1.0in 1.0in} div.WordSection1 {} --> </style> </head> <body lang=3D"EN-US" link=3D"blue" vlink=3D"purple"> <div class=3D"WordSection1"> <p class=3D"MsoNormal">I have a virtual machine with a 500GB thin-provision= ed disk, and on it is about 2GB of data. Due to a pvmove operation I = am running, the 500GB disk with 2GB of data is growing and growing and is c= urrently 180GB in size, and im sure it will go all the way to the 500GB before it stops.</p> <p class=3D"MsoNormal"> </p> <p class=3D"MsoNormal">When this process is finished, is there a way to re-= thin the disk back down to the proper size again? What about the expo= rt/import process? Would that export it to the data size, not the blo= ck size?</p> <p class=3D"MsoNormal"> </p> <p class=3D"MsoNormal">Thanks,</p> <p class=3D"MsoNormal">jonathan</p> </div> <br> <hr> <font color=3D"Gray" face=3D"Arial" size=3D"1">This is a PRIVATE message. I= f you are not the intended recipient, please delete without copying and kin= dly advise us by e-mail of the mistake in delivery. NOTE: Regardless of con= tent, this e-mail shall not operate to bind SKOPOS to any order or other contract unless pursuant to explicit wri= tten agreement or government initiative expressly permitting the use of e-m= ail for such purpose.</font> </body> </html> --_000_9BE6F493F83A594DA60C45E6A09DC5AC23B81776AUSP01DAG0201_--

--_000_5F9E965F5A80BC468BE5F40576769F091027B51Aexchange21_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 b25zIDIwMTMtMDMtMTMga2xvY2thbiAyMToyMyArMDAwMCBza3JldiBKb25hdGhhbiBIb3JuZToN CkkgaGF2ZSBhIHZpcnR1YWwgbWFjaGluZSB3aXRoIGEgNTAwR0IgdGhpbi1wcm92aXNpb25lZCBk aXNrLCBhbmQgb24gaXQgaXMgYWJvdXQgMkdCIG9mIGRhdGEuICBEdWUgdG8gYSBwdm1vdmUgb3Bl cmF0aW9uIEkgYW0gcnVubmluZywgdGhlIDUwMEdCIGRpc2sgd2l0aCAyR0Igb2YgZGF0YSBpcyBn cm93aW5nIGFuZCBncm93aW5nIGFuZCBpcyBjdXJyZW50bHkgMTgwR0IgaW4gc2l6ZSwgYW5kIGlt IHN1cmUgaXQgd2lsbCBnbyBhbGwgdGhlIHdheSB0byB0aGUgNTAwR0IgYmVmb3JlIGl0IHN0b3Bz Lg0KDQoNCg0KV2hlbiB0aGlzIHByb2Nlc3MgaXMgZmluaXNoZWQsIGl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g ZGVsaXZlcnkuIE5PVEU6IFJlZ2FyZGxlc3Mgb2YgY29udGVudCwgdGhpcyBlLW1haWwgc2hhbGwg bm90IG9wZXJhdGUgdG8gYmluZA0KIFNLT1BPUyB0byBhbnkgb3JkZXIgb3Igb3RoZXIgY29udHJh Y3QgdW5sZXNzIHB1cnN1YW50IHRvIGV4cGxpY2l0IHdyaXR0ZW4gYWdyZWVtZW50IG9yIGdvdmVy bm1lbnQgaW5pdGlhdGl2ZSBleHByZXNzbHkgcGVybWl0dGluZyB0aGUgdXNlIG9mIGUtbWFpbCBm b3Igc3VjaCBwdXJwb3NlLjwvZm9udD48L2ZvbnQ+PGJyPg0KPC9ibG9ja3F1b3RlPg0KPGJyPg0K PC9ib2R5Pg0KPC9odG1sPg0K --_000_5F9E965F5A80BC468BE5F40576769F091027B51Aexchange21_--

On Wed, Mar 13, 2013 at 09:23:04PM +0000, Jonathan Horne wrote:
I have a virtual machine with a 500GB thin-provisioned disk, and on it is about 2GB of data. Due to a pvmove operation I am running, the 500GB disk with 2GB of data is growing and growing and is currently 180GB in size, and im sure it will go all the way to the 500GB before it stops.
When this process is finished, is there a way to re-thin the disk back down to the proper size again? What about the export/import process? Would that export it to the data size, not the block size?
There's not a way to do this in-place currently, although we're working on it. If you can accept a copy, then 'qemu-img convert' will automatically sparsify disks, although it only works if there is no left-over data in the blocks. Also requiring a copy, virt-sparsify can fully sparsify a disk even if it has left-over but unused data blocks. See also: http://libguestfs.org/virt-sparsify.1.html http://libguestfs.org/guestfs-faq.1.html#why-doesnt-virt-sparsify-work-on-th... - - - Your question also made me wonder if there was a tool to do an in-place sparsification of a thin provisioned DM device, but there doesn't seem to be anything for that. *If* such a tool did exist, then you could use it in conjunction with the following guestfish command: http://libguestfs.org/guestfish.1.html#zero-free-space ie. something like: guestfish -a /dev/vg/guest
<fs> run <fs> list-filesystems # for each filesystem do: <fs> mount /dev/XXX / <fs> zero-free-space / <fs> umount /
followed by running the non-existent thinning tool. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
participants (3)
-
Jonathan Horne
-
Karli Sjöberg
-
Richard W.M. Jones