Saturday, January 24, 2015

Adding storage to Proxmox VE

The 1 TB drives for my HP server came today. Scott at All Computer Parts was very helpful and quick to reply. I quickly went to hot-plugging them into my server running Proxmox VE.

After the drives spun-up, I logged into the HP System Management Homepage (download) and opened the HP Array Configuration Utility. From there, I selected 3 of the unassigned drives and created an array. I then crated a RAID 5 logical drive using all of the space available on the array (1.8 TB). Finally, I added the remaining drive as a hot-spare, by selecting the array, and clicking "Spare Management". This way, if one drive goes offline, the hot-spare will immediate take its place, and the array will be rebuilt.

The logical disk is immediately detected by the Linux kernel, evidenced by /var/log/messages:

Jan 23 22:38:40 dragster kernel: hpsa 0000:04:00.0: Direct-Access     device c0b0t0l1 added.
Jan 23 22:38:40 dragster kernel: scsi 0:0:0:1: Direct-Access     HP       LOGICAL VOLUME   6.40 PQ: 0 ANSI: 5
Jan 23 22:38:40 dragster kernel: sd 0:0:0:1: Attached scsi generic sg3 type 0
Jan 23 22:38:40 dragster kernel: sd 0:0:0:1: [sdb] 3906918832 512-byte logical blocks: (2.00 TB/1.81 TiB)
Jan 23 22:38:40 dragster kernel: sd 0:0:0:1: [sdb] Write Protect is off
Jan 23 22:38:40 dragster kernel: sd 0:0:0:1: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Jan 23 22:38:40 dragster kernel: sdb: unknown partition table
Jan 23 22:38:40 dragster kernel: sd 0:0:0:1: [sdb] Attached SCSI disk

Proxmox works well with LVM. It actually works directly with LVM volume groups, creating logical volumes on-the-fly for new VMs, etc. You can find detailed information on the Proxmox wiki, but the procedure was quite simple:

  1. Create the LVM physical volume on the physical disk: (In this case, the "physical disk" was a RAID logical disk)
    # pvcreate /dev/sdb
    Physical volume "/dev/sdb" successfully created

    Note that I created the physical volume directly on the block device, without partitioning the drive. LVM does not require a partition table, and I'm not booting to the disk, so there was no need.
  2. Create a LVM volume group from that single physical volume:
    # vgcreate raid5vg /dev/sdb
      Volume group "raid5vg" successfully created

And we're ready to go! List the LVM volume groups with the vgs command:

# vgs
  VG      #PV #LV #SN Attr   VSize  VFree
  pve       1   3   0 wz--n- 67.83g 8.50g
  raid5vg   1   1   0 wz--n-  1.82t 1.80t

Now it's time to tell Proxmox about the new storage. Log into the Proxmox web UI, and select the "Datacenter" node in the tree. On the Storage tab, select Add > LVM. On that dialog, we select the new volume group and given it a name (I made it the same as the vg).

And your storage is made available to Proxmox!

I went ahead and moved the couple VMs I had from the old main storage to the new array. You can do this by highlighting the Hard Disk on the VM's Hardware tab, and clicking "Move disk".

No comments:

Post a Comment