Skip to content

Instantly share code, notes, and snippets.

@vduseev
Last active April 20, 2023 10:21
Show Gist options
  • Select an option

  • Save vduseev/3a40d680d592e4a01dac01b8429d6caa to your computer and use it in GitHub Desktop.

Select an option

Save vduseev/3a40d680d592e4a01dac01b8429d6caa to your computer and use it in GitHub Desktop.
Proxmox LVM pool

How to properly configure a VM data pool

Initial setup

  • HP DL360 Gen9
  • 2 RAID arrays
    • RAID0 running on SSD for OS
    • RAID6 running on SAS HDD for data

Configuration

  • Installed Proxmox through USB
  • Configured proper network
  • Proxmox partitions and configures OS disk itself, allocating space for image storage as well

Next, we need to create a new physical volume, based on RAID6 (delete any other existing volume groups for that disk, if present).

# Create physical disk based on the RAID device /dev/sdb
fdisk -c -u /dev/sdb
# Type 'n' for new partition
# Type 't' to choose partition type
# Choose 'Linux LVM' code or type 'lvm' as alias
# Write settings with 'w'

# Check that device appeared
fdisk -l

# Create Physical Volume for LVM
pvcreate /dev/sdb1

# Create Volume Group (it has to be vmdata)
vgcreate vmdata /dev/sdb1

# Create Logical Volume
# '-L 2000G' is 2TB size (extendable)
# '-T' choose thin volume (allows over-commit)
# '-c 64KiB' minimal chunk size is 64KiB with maximym volume being ~16TB
lvcreate -L 2000G -T -c 64K -n vmdata vmdata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment