5

In our company we're using Hyper-V (Windows Server 2012) hypervisor and VM to organize our in-company services in our data-center. I am supposed to set up Ubuntu 12.04 LTS guest for our main database (Postgresql). My sysadmins gave me a SSH connections do VM (Ubuntu is already there). Disks are dynamically resizeable VHDX files. XFS file system has a lot of creation and mounting options. I've read lots of material about XFS possibilities but they're basically so-called bare-metal guidelines (depending on RAID and disks parameters and physical layout). I don't really know which one are relevant in my case. Especially two things bothers me:

  • Does partition alignment matters in VM environment? Should I ask my sysadmins about physical RAID parameters (disk count, stripe size)? And set my XFS according to them?
  • Allocation Groups (AG) and xfs parallel I/O feature. As far as I understand the concept: we divide file-system in parts and FS could try to perform let's say two writes in parallel if they're going into two different AGs. Could I really achieve this with dynamically resizable VHDXs since it's not physical device with real space to divide?

Because of virtualization it's really cloud computing in my point of view. I don't have any guarantee where VHDXs reside and how long there will be there (it's my hypervisor admins job). So maybe I'm looking totally at wrong issues as far as setting storage for DB in Hyper-V environment is concerned? If so, could you please recommend me topics that I should check out

ewwhite
  • 194,921
  • 91
  • 434
  • 799

1 Answers1

2

I understand that your backing storage may change and you may not have knowledge of the underlying hardware. The following is pretty safe for me in virtualized environments:

Today, my XFS creation and mount options look like:

mkfs.xfs -f -l size=256m,version=2 -s size=4096 /dev/sdX

Where "sdX" is the device name. That's a 256 Megabyte log and a 4k sector size.

Mount options are typically:

noatime,logbufs=8,logbsize=256k,nobarrier

Those are no access-time, no write barriers, and modified log buffer/block sizes.

Using a modern OS, make sure that your partitions are aligned. Using fdisk, change your display units to sectors. Heed the warning:

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

A properly aligned partition under RHEL6:

Disk /dev/zd32: 644.2 GB, 644245094400 bytes
13 heads, 12 sectors/track, 8065969 cylinders, total 1258291200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 8192 bytes
I/O size (minimum/optimal): 8192 bytes / 8192 bytes
Disk identifier: 0x04d26b4d

     Device Boot      Start         End      Blocks   Id  System
/dev/zd32p1            2048  1258291199   629144576   83  Linux
ewwhite
  • 194,921
  • 91
  • 434
  • 799