Storage on XCP-ng

I am setting up a very small homelab with XCP-ng and I am wondering what is the easiest way to set up the storage.

The boot drive and storage for the VMs will be an SSD. But I will add two HD’s that I want to run in RAID1 for data storage. What is the easiest way to do the RAID1 setup? I do not plan to do any management after it has been set up. Just need to be sure that the VMs can reach and use the raid.

There’s 2 options

  • If you have a hardware RAID card, use that to setup your RAID1.
  • If you don’t have hardware RAID and each drive shows up in XCP-NG as an individual drive, you can do a ZFS Mirror on both of those drives for the same protection as RAID1
1 Like

Do you do the ZFS mirror after installing XCP-ng?

You’d do this after. Install XCP-NG, install to the SSD, select the SSD as the only Storage Repository, finish out the install, make sure you install XCP-NG extras to get ZFS.

Once the install is finished, you’ll want to SSH into the machine.

  • Get the Disk paths with lsblk
  • Create the zpool with zpool create -o ashift=12 -m /mnt/zfs tank mirror /dev/sdb /dev/sdc but use your disks
  • Add this as a Storage Repository with xe sr-create type=zfs content-type=user name-label=LocalZFS device-config:location=/mnt/zfs/
  • Run xsconsole to view the console, then go to Disks and Storage Repositories then Current Storage Repositories and you should see the LocalZFS repository you made earlier.

Additional reading / sources

**fixed some formatting

1 Like

Thank you, thank you and THANK YOU! :smiley:

Hi @Oceanwatcher The most straight forward place to set up storage is local storage, attached directly to the physical machine running XCP-ng. Setting up RAID and separate SSD for boot drives will complicate the configuration, and depending on exactly what the use case is, how you go about with configuring things.

Not sure what your budget is, but recently helped some guys get their home lab up with a used Dell PowerEdge R720XD (2.5 inch HDDs) with SSDs and mechanical HDDs. The SSDs and mechanical HDDs were configured in the HBA (RAID) controller setup before installing XCP-ng. After RAID setup, they configured XCP-ng with 2 local storage group repositories and ran some of the VMs from the SSDs and some from the mechanical. I guess you could configure a virtual drive in one array and attach it to a VM with a boot drive in the other array.

Hope this helps

1 Like