How to make mounted disks visible to TKL container

J

jfontana

Guest
Hi,

After searching for a while, I have figured out how to make a mounted disk visible to the virtual machines (qm).

If I'm not mistaken, what you would do is:


qm set <vmid> --ide1 /dev/sdc2

I have a couple of TKL (TurnKey Linux) containers, though, that I would like to connect to some of the disks that I have mounted. How does one do this? I would really appreciate it if someone could help me.

Josep M.
 
AW: How to make mounted disks visible to TKL container

try bind mounts. (search forum)
 
Re: AW: How to make mounted disks visible to TKL container

Hi Tom,

Thanks very much for your response. I found some information on bind mounts but I'm afraid I'm not able to figure out how to implement this. What I found is the following but it is not clear to me what I have to substitute for the stuff in the claudators. Is there any documentation where this would be explained in some more detail? Is there any reference manual where I could find out for instance what ${DST} is? I imagine ${VE_CONFFILE} is some sort of configuration file but where do I go to find out which file this refers to? Buying the commercial support subscription would be the only way I could have access to some comprehensive documentation? It is fair enough and I can totally understand people working on this project have to support themselves. I'm just an individual, not a company, though, and my usage of Proxmox is stil very limited to justify this commitment. I'm using Proxmox to try to build a home server with different modular components.


CTID=777 cat << EOF > /etc/vz/conf/${CTID}.mount #!/bin/bash . /etc/vz/vz.conf . ${VE_CONFFILE} SRC=/mnt/disk DST=/mnt/disk if [ ! -e ${VE_ROOT}${DST} ]; then mkdir -p ${VE_ROOT}${DST}; fi mount -n -t simfs ${SRC} ${VE_ROOT}${DST} -o ${SRC} EOF chmod +x /etc/vz/conf/${CTID}.mount

If you want read-only mount, add -r option to mount command.
 
Re: AW: How to make mounted disks visible to TKL container

Hi again,

I tried to follow the instructions I found on binding mounts but I'm having a very strange problem.

Following the instructions I found here (http://forum.proxmox.com/threads/6265-mount-bind-mounted-harddrive), I was going to create the following file:

/etc/vz/conf/106.mount

I logged in as root just in case anybody wonders but when I try to save the file, I get the following message:

[ Error writing 106.conf: File exists ]

As far as I can tell, though, the file does NOT exist. At least not in that particular directory. Does anybody have any idea as to why this could be happening?

Thanks,

JM
 
Re: AW: How to make mounted disks visible to TKL container

As far as I can tell, though, the file does NOT exist. At least not in that particular directory.

The file exists on another node in the cluster, or a KVM with that ID already exists.
 
Re: AW: How to make mounted disks visible to TKL container

OK. Yes. You are right. I found it in:

/etc/qemu-server

Thanks very much.

Now I have 106.conf with the following contents:


ide1: /dev/sdb
ide2: /dev/sdc

These are my two additional hard drives. Just having done this is enough to be able to access them from the VM? Do I have to mount them once inside the VM?
I looked through the forums and I found that you should be able to assign these drives by doing:

$ qm set 106 -ide2 /dev/sdc

When I do this, though, I get an error message saying "unable to change media type". Looking through the forums I see other people got this error message (http://forum.proxmox.com/threads/9451-Adding-Multiple-Physical-Disks-to-VM) but
I see no solution. What am I doing wrong?

JM
 
Re: AW: How to make mounted disks visible to TKL container

$ qm set 106 -ide2 /dev/sdc

When I do this, though, I get an error message saying "unable to change media type".

Drive ide2 is already configured, but as cdrom? If so, remove it first.
 
Re: AW: How to make mounted disks visible to TKL container

Thanks Detmar.
I wasn't understanding the syntax of the qm command properly. I thought the -ide# was not the new -ide# I was assigning to the physical drive but the -ide# that had been assigned to the virtual disk of the VM itself. When I did 'qm config 106' I saw the following:

ide2: local:iso/ubuntu-12.04-desktop-amd64.iso,media=cdrom

Since I had installed Ubuntu in that VM I thought that -ide# was the one I had to use with the 'qm set' command. The instructions I had read were not really clear as to what -ide# was. I'm not the only one confused, I saw in the forums that other people had had exactly this problem.

After a bit of trying I noticed that in fact I could choose any number as long as it wasn't -ide2. So I managed to assign two different physical disks by simply assigning one to -ide1 and the other to -ide3, thus skipping -ide2.

JM
 

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!