Dedicate entire (with content) hdd to VM

N

n0hc

Guest
Hey all! I have a proxmox server I am in the process of building and I am wanting to put my old file server into a VM. The hdd's (5 of them) have data already on them and I would like to "attatch" them to the VM so that when I setup the VM it will see the hdd's just as before in its standalone server. What is the easiest way to dedicate hardware through the host OS to the guest VM? Thanks!
 
I would like to make sure the hdd's are attatched to the VM correctly everytime with its UUID. Would create a /etc/qemu-server/<vmid>.conf be the way to do it? I could edit that file with the 4 UUID's but I am not sure of the format I need to do this in. Please let me know how I can or if there is a better method thanks!

[h=2]How can I assign a physical disk to a VM?[/h] You don't have to do anything at host level (i.e. not add to fstab or anything), just set is as available directly to the KVM guest:
qm set <vmid> -ide# /dev/sdb
Or:

qm set <vmid> -ide# /dev/disk/by-id/[your disk ID]
...since having the drive letter change (should you add a drive) might have unintended consequences.
Also see /etc/qemu-server/<vmid>.conf if you want to add it editing the conf file by hand (i.e. adding ide1: /dev/sdb2). After that you can run the VM as usual, and you will have the new storage device available inside it. Beware that you can't assign it to more than one running VM if the filesystem is not designed for such scenario.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!