0

In have a VG with a LV vms which contains mostly vmware vmdk-files. The VG has one big harddrive as PV and a SSD.

I wonder if there is a way to move the vmdk-files I currently need to the SSD in a transparent manner. The Files do not grow (or only very less)

With pvmove /dev/sdb1:1000-1999 /dev/sdc1 I can move the extends. The question is how to get the list of extends. The Files do not grow (or only very less) anymore, so one manual move would be ok. I see 2 steps:

  • Map the files on the filesystem (ext4 or xfs) to addresses on the LV
  • Map the LV adresses to extents addresses on the source PV for usage with pvmove

Do you think this is possible?

  • 2
    A couple of orthogonal suggestions: 1. Use two LVs, one for the HDD and one for the SSD. This will allow you to control which files are stored on which device. 2. Use one LV on the HDD but then put an LVM Cache layer on top of it that uses the SSD. I've not tried this but it should enable the system to cache the more frequently accessed parts of your LV on the SSD. – roaima Jan 31 '17 at 10:45
  • filefrag would give you the extents, but with filesystem metadata still on HDD, it might not give you the speed improvement you desire and fragmented LV have their own pitfalls. I'd create a dedicated LV on SSD... – frostschutz Jan 31 '17 at 10:53
  • The file may be split across many blocks in different places (and probably is, since VM images are typically sparse files that grow non-consecutively). I doubt that there's a practical solution other than putting those files in a separate LV. – Gilles Jan 31 '17 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.