Access to other disks in server

knireis

Member
Feb 3, 2011
55
0
6
I installed proxmox on my home server. But i have 2 more disks containing data in the same server. How can i make these disks (and the data written on them) available to my vm's?
 
login on the Proxmox VE console or via SSH:

find the name of the disk, e.g. with:
Code:
fdisk -l

and add a line to your /etc/qemu-server/VMID.conf file corresponding to your disk/partition layout:

Code:
ide1: /dev/sdb2
 
ok thanks,
now 1 more thing i would like to know. Is there a possibility to add files (or maybe a partition) to the proxmox installation harddisk which can be accessed by a vm?
 
ok thanks,
now 1 more thing i would like to know. Is there a possibility to add files (or maybe a partition) to the proxmox installation harddisk which can be accessed by a vm?
Hi,
for an openvz-vm yes - with bind-mounts.
For kvm-vm you need software to serve the files. like nfs-server and nfs-mounts inside the client. Perhaps not the best way (but sometimes usefull).

Udo
 
login on the Proxmox VE console or via SSH:

find the name of the disk, e.g. with:
Code:
fdisk -l

and add a line to your /etc/qemu-server/VMID.conf file corresponding to your disk/partition layout:

Code:
ide1: /dev/sdb2

I'm still confused about this, I added the line to the vmid.conf and the disk shows up in the webinterface under hardware device list for the vm as a harddrive.
But when i login the vm and do fdisk -l , I cannot find the harddisk. So how do i mount it in the vm's filesystem?
 
I'm still confused about this, I added the line to the vmid.conf and the disk shows up in the webinterface under hardware device list for the vm as a harddrive.
But when i login the vm and do fdisk -l , I cannot find the harddisk. So how do i mount it in the vm's filesystem?
Hi,
you add an partition to the VM as disk. so you don't have an partitiontable inside the VM - it's a plain partition.
somethink like "mount /dev/hdb /data" should work. If there nothing else on the disk, you can use sdb instead of sdb2 - than you have the whole disk inside the vm.

Udo
 
Hi,
you add an partition to the VM as disk. so you don't have an partitiontable inside the VM - it's a plain partition.
somethink like "mount /dev/hdb /data" should work. If there nothing else on the disk, you can use sdb instead of sdb2 - than you have the whole disk inside the vm.

Udo

ok, I'll try that, and for more disks i just add like ide2: /dev/sdc1 and ide3: /dev/sdd1?
 
i deleted the cdrom since i dont use it anymore after install, how does that work with virtio, can i foind some more info about that?
 
I managed to get the drives show up in the webinterface under hardware in the guest as virtio 0:1 virtio 0:2 and so on. But I can't get them to mount by the: mount /dev/sdb /data command. Do i need to specify more in the command? I've tried all kinds of things but no luck.
 
I managed to get the drives show up in the webinterface under hardware in the guest as virtio 0:1 virtio 0:2 and so on. But I can't get them to mount by the: mount /dev/sdb /data command. Do i need to specify more in the command? I've tried all kinds of things but no luck.
Hi,
if you use virtio, your disk named "vda", "vdb" and so on. With sdb you don't have luck... (you can look with fdisk -l for the devices - but you will get an error, because vda hasn't a partitiontable (because is an partition)).

Udo
 
Hi,
if you use virtio, your disk named "vda", "vdb" and so on. With sdb you don't have luck... (you can look with fdisk -l for the devices - but you will get an error, because vda hasn't a partitiontable (because is an partition)).

Udo
thanks!
 
Greetings,
I am evaluating Proxmox VE, pveversion gives pve-manager/1.8/5754.

I have the same requirement (make a block device visible to one or more vm's). I have two KVM-based virtual machines, VMID 101 and 102, but I don't see any files under /etc/qemu-server.

Where do I configure which block device is visible to which vm?

Best regards,

George
 
Greetings,

Update:

I created a logical volume in the same volume group (vg1) as is used to host the vm's disk image logical volume:

lvcreate -L 10G -n vm-102-disk-2 vg1

And tagged it

lvchange --addtag pve-vm-102 /dev/vg1/vm-102-disk-2

I added to the file /etc/qemu-server/102.conf (on the machine the vm is running on, which is why I couldn't see it before, duh) the line

ide1: vg1:vm-102-disk-2

The second disk is now visible with the correct capacity under the Hardware tag on the Virtual Machine Configuration page.

But the vm's operating system (Linux) still can't see the second disk even after reboot (fdisk -l doesn't show the device).

Best regards,

George
 
OK, worked it out: the machine should be stopped and started, rebooting the OS is not enough. Seems to work OK now.

Best regards,

George
 
Greetings,

Update:

I created a logical volume in the same volume group (vg1) as is used to host the vm's disk image logical volume:

lvcreate -L 10G -n vm-102-disk-2 vg1

And tagged it

lvchange --addtag pve-vm-102 /dev/vg1/vm-102-disk-2

I added to the file /etc/qemu-server/102.conf (on the machine the vm is running on, which is why I couldn't see it before, duh) the line

ide1: vg1:vm-102-disk-2

The second disk is now visible with the correct capacity under the Hardware tag on the Virtual Machine Configuration page.

But the vm's operating system (Linux) still can't see the second disk even after reboot (fdisk -l doesn't show the device).

Best regards,

George
Hi,
this don't must be done handmade - exactly the same do the web-gui for you (if you define the storage right).

Udo
 
Hi Udo,

Thanks for the quick reply.

The storage I am using is of type LVM; the physical volume seen by Proxmox is a volume on a Fibre Channel SAN, and the VM images are logical volumes in a new volume group vg1 which includes this physical volume.

What is the correct way to create a new logical volume and make it visible to an existing VM as a second disk?

I got it to work OK from the command line but of course I'd like to know what the correct way to do this is.

Best regards,

George
 

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!