I'm really appreciated for your help, thank you! Best Regards, Jia-min 在 2014-3-5,20:35,"Alexandre DERUMIER" <aderumier@xxxxxxxxx> 写道: > Hello, > I don't use libvirt (i'm using proxmox solution + qemu 1.7). > > discard is supported since qemu 1.5, but i'm not sure about the rbd block driver. (maybe 1.6) > I'm using virtio-scsi in guest > > > > ----- Mail original ----- > > De: "ljm李嘉敏" <jm.li@xxxxxxxxx> > À: "Alexandre DERUMIER" <aderumier@xxxxxxxxx> > Cc: ceph-users@xxxxxxxx > Envoyé: Mercredi 5 Mars 2014 13:13:41 > Objet: 答复: Enabling discard/trim > > Hi Alexandre, > > Can you tell me the version of libvirt, qemu and OS you use? thanks. > > Thanks & Regards > Li JiaMin > > System Cloud Platform > 3#4F108 > > > -----邮件原件----- > 发件人: ljm李嘉敏 > 发送时间: 2014年3月5日 15:10 > 收件人: 'Alexandre DERUMIER' > 抄送: ceph-users@xxxxxxxx > 主题: 答复: Enabling discard/trim > > Thank you very much, I will have a try. > > Thanks & Regards > Li JiaMin > > System Cloud Platform > 3#4F108 > > > -----邮件原件----- > 发件人: Alexandre DERUMIER [mailto:aderumier@xxxxxxxxx] > 发送时间: 2014年3月5日 15:08 > 收件人: ljm李嘉敏 > 抄送: ceph-users@xxxxxxxx > 主题: Re: Enabling discard/trim > > 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