Jump to content

Disk space for linux VMs


JohnB

Recommended Posts

I'm using unraid on a small server with 3 x 4GB disks (one as parity) and a small 128GB SSD as a cache disk.
It's all working wonderfully, I have disk shares that I feel are secure, and quite a few docker containers running services.

I now have a couple of debian linux VMs set up. They take space on the cache disk for their "main" disk and that is great for general speed but need some access to much more space on the main disk set too. 

If this was raw KVM on a basic linux install I would have used LVM to create a volume on the main disks and assigned that to the VM and let it create a disk in there but I don't seem to have an option line this on unraid.

The best option seems to be to export a share in the VM setup and use the 9p driver to mount the share inside the VM but this seems slow and inefficient for heavy use.

It will work if there is no good alternative but Is there a better way?

Link to comment

You can create a vdisk file on the array and add that to the VM.   KVM on UnRAID is the same as on any other Linux platform - it is just that UnRAID tries to provide a GUI to help with managing KVM VMs.   Note, however, that performance for writing to vdisk files held on the array is limited due to the overhead of all writes also needing to update parity.

Link to comment

In the past I have done what you're indicating - lvm doesn't really care about the precise nature of the 'physical disk' so it's quite possible to add a second vdisk - check that it's showing up as /dev/sd<whatever> and then do the usual pvcreate and add to an existing logical volume.

However, it's usually recommended not to mix performance levels when doing this as you'll always get the lower performance - so if you use one .raw or qcow image in SSD and another on the array (or spinning disk) you'll get the spinning disk performance.

Another way I've resolved this is to figure out where I need the extra space, allocate a new virtual disk - then add it where I need it. So for example if /home is the issue, I'd reboot in single user mode (init 1) then move the contents of /home to an alternate temporary location, get the new disk formatted/lvm'd - or otherwise ready to mount and edit fstab to add the new disk. Finally 'mount -a' and then move the items back to /home

Obviously, your disk assignments can be as complicated as you like, but this is one solution.

Del

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...