Re: Enabling discard/trim

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

you should have -drive file=rbd:libvirt....,discard=on   in command line, to have discard enabled 

----- Mail original ----- 

De: "ljm李嘉敏" <jm.li@xxxxxxxxx> 
À: ceph-users@xxxxxxxx 
Envoyé: Mercredi 5 Mars 2014 02:37:52 
Objet:  Enabling discard/trim 



Dear all, 

I try to use ceph block device within my VM, and configure the vm following the steps in http://ceph.com/docs/dumpling/rbd/libvirt/ , 
eventually I can see the logical device in the VM. 

Then I want to enabling the discard/trim for this logical device, and add the parameter discard_granularity just as http://ceph.com/docs/master/rbd/qemu-rbd/ says. 
Within the VM, I mount this logical device with the option discard, but after I put and rm the file in it, then ftrim the mount point, the file is still in ceph cluster, not be deleted. 
Is there anything I miss?? Thank you. 


PS: 
The info of the vm. 
6 S 108 10693 1 0 80 0 - 860209 poll_s Mar04 ? 00:03:15 qemu-system-x86_64 -machine accel=kvm:tcg -name ceph -S -M pc-1.0 -m 1024 -smp 2,sockets=2,cores=1,threads=1 -uuid 110c2a64-959b-d1bb-7803-41bb83efd2ff -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/ceph.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device lsi,id=scsi0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/precise-server-cloudimg-amd64-disk1.img,if=none,id=drive-ide0-0-0,format=qcow2 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=rbd:libvirt-pool/new-libvirt-image:id=libvirt:key=xxxxxxxxxxxxx==:auth_supported=cephx\;none:mon_host=10.4.3.202\:6789\;10.4.3.203\:6789\;10.4.3.204\:6789,if=none,id=drive-scsi0-0-0,format=raw -device scsi-hd,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0 -netdev tap,fd=24,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:e6:6e:fa,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -set device.scsi0-0-0.discard_granularity=4096 

The info of mount within the vm. 
/dev/sda on /mnt/ceph type xfs (rw,discard) 
I also try ext4, but fail to enable discard too. 

The version of relative SW in my platform. 
Qemu : 1.4 
Libvirt : 1.0.2 
Ceph: 0.72.2 
Ubuntu : 12.04 , kernel: 3.5.0 

Thanks & Regards 
Li JiaMin 

System Cloud Platform 
3#4F108 





_______________________________________________ 
ceph-users mailing list 
ceph-users@xxxxxxxxxxxxxx 
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com 
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com





[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux