OpenVZ container in new local storage

aft3rburn3r

New Member
May 16, 2012
5
0
0
Hello all, and first of all, big thx to developers of this good product for great job. I used proxmox 1.9 and migrated to 2.1 in my school. I'm using proxmox to create virtual appliance for my students to teach linux and windows server. I'v tryed hyper-v, vmware esxi, but proxmox i like the best =). Thx you ppl.

Now about a little strange thing. I'v just installed proxmox ve 2.1 on our server - HP proliant ml150g3 with 4 core xeon, 8Gb RAM and 2 SATA WD BLACK HDD 500Gb. I'v installed it on first hdd - sda. All is good, and works fine. But i want to add second hdd to use as local storage for virtual machines. I'v creater LVM on it, formated as ext3 and mounted in fstab to directory /var/lib/vm-data-disk. After that i'v attached this directory as local storage using web-interface. I'v selected to use it as iso,template,images,containers storage. I can upload to it iso and templates, can create KVM images, but when i'm creating OpenVZ container and using /var/lib/vm-data-disk as a storage, system creates container only in 'local' storage. In virtual appliance settings are listed new storage /var/lib/vm-data-disk, but the used space are same - 0. I looked on the file system, and yep - new container is in /var/lib/vz/root. In /var/lib/vm-data-disk there is no "root" directory. I'v checked access rights, created /var/lib/vm-data-disk/root directory, but system don't want to place container there. Only in default first "local" storage. Is this a bug or this is a feature?

Thx and good luck!proxmox.png
 
you should have a 'private' directory in your new storage.

check /var/lib/vm-data-disk/private/...
 
Wow - like in Fast and Furious movie - so fast response =). Thx. I checked - i have directory, tryed to recreate container - but don't work - still in "local" storage.proxmox.png
 
the /root is just a virtual filesystem, the real data is in /private and should be stored in the defined storage. works here.
 
Sorry don't understand you Tom. For me OpenVZ container is stored in /var/lib/vz/root directory, and /var/lib/vz/private is empty. And as i see root is not link to private. What you meen "/root is just virtual filesystem"? You want to say that it is virtual filesystem for linux in container? I know that and understand how openvz works. Or you want to say something another? I see directory 100 in /var/lib/vz/root, and there is a virtual linux filesystem tree. But i don't understand why it puts new container in default "local" location, and not in new. Thx.
 
Sorry don't understand you Tom. For me OpenVZ container is stored in /var/lib/vz/root directory, and /var/lib/vz/private is empty. And as i see root is not link to private. What you meen "/root is just virtual filesystem"? You want to say that it is virtual filesystem for linux in container? I know that and understand how openvz works. Or you want to say something another? I see directory 100 in /var/lib/vz/root, and there is a virtual linux filesystem tree. But i don't understand why it puts new container in default "local" location, and not in new. Thx.

All VPS files are located in /private/$ID. Then you run Openvz container /private/$ID catalog is mounted to /root/$ID

Using different /private/$ID location /root/$ID still leaves in /var/lib/vz
 
A-ha! Checked your explanation Nemesiz, and all is as you told. My trick with symlink was useless. When i checked filesystem i din't looked inside private directory =), symply looked inside /var/lib/vz/root and /var/lib/vm-data-disk. There is empty directory in /var/lib/vz/root with name same as vps id. And when vps starts - it mounts directory with same id from private catalog in my new local storage. All wors fine like you and Tom told. Simply i was stupid enough to not to look inside directories with vps id. Directory in root catalog is empty and directory with vps id in my new storage private catalog has full vps filesystem with vps id =). Thx for explanation. Works like a sharm.
 
Last edited: