OpenVZ/ LXC - alternatives?

sjau

New Member
Jul 9, 2014
8
0
1
Hi there

Still using old promox 3.4 because I like the file based approach of OpenVZ a lot. Especially having a vanially copy that I can just use to revert back by rsync.

Currently I use incron to check for some changes on the host system. If changes are detected, the OpenVZ container is launched, files processed, output created, container closed again and reverted by rsync to the previous state.

Because it's all in the same directory structure he host can actually put file into container tree before launching the container.

However, OpenVZ was removed for v4 and we have now LXC - which is again a full image based container like kvm (not sure if the terminology is right....). Anyway, my current approach won't work anymore.

So, are there other container that just embed themself into the Host file hierarchy that can be used with proxmox 4?
 

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,412
853
163
Use ZFS for LXC. This uses ZFS subvol and therefore you have access the files from the host, and you can resize without downtime. (also reduce).

And you have a much better replication mechanism, zfs send/receive.

See https://pve.proxmox.com/wiki/PVE-zsync
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
6,941
814
163
33
Vienna
also there are the commands:

Code:
pct push
pct pull

where you can put/get single files from/to containers
 

PanZvedavy

Member
Dec 27, 2012
22
0
21
Simply install one full kvm virtual on proxmox and then run openvz containers from inside that virtual. Simple, quick and clean solution for your needs.
 

PaulVM

Active Member
May 24, 2011
72
2
28
Can you detail?
You mean install a proxmox 3.4 into a KVM virtual inside a 4.x Proxmox?

Thanks, P.


P.S.: for the original question: I restore the containers using the tricks:

pct restore id backup.tar.gz --rootfs local:0

In a storage NOT in lvm-thin format, so I can access the files directly from the host ...
You can also mount the image using something like:
mount /dev/mapper/vm-1001-disk.... /mnt/vm1001
But, like you, I prefer the direct access :)
 

PanZvedavy

Member
Dec 27, 2012
22
0
21
Well , I didnt thought about this option, but nested virtualization is possible if you have proper hw for that.

My version is, that you install proxmox 4.x and create one full kvm and inside that kvm you will run all of your openVZ instances. Inside kvm you can use any implementation of openVZ. Main point is that openVZ is nearly dead project in virtualization-container world. There are new, well established players like docker, LXC and some others. Its time to move on and migrate.
 

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,412
853
163
Well , I didnt thought about this option, but nested virtualization is possible if you have proper hw for that.

you do not need nesting if you run OpenVZ 3.4 inside a VM on 4.x. Nesting is ONLY needed if you run KVM in side KVM.
 

PaulVM

Active Member
May 24, 2011
72
2
28
I can't understand.
What exactly mean "run OpenVZ 3.4 inside a VM on 4.x"?
How can do this?

N.B.: my real interest is moving some CentOS 5.x containers from 3.x to 4.x. Without convert it to KVM (because they require some hundred GB disk space and previous solutions based on KVM or KVM + NFS share had performance really poor compared to OpenVZ).

Thanks, P.
 

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,412
853
163
I can't understand.
What exactly mean "run OpenVZ 3.4 inside a VM on 4.x"?
How can do this?...
  1. Create a backup from your OpenVZ container
  2. Install Proxmox VE 4.4 on a new hardware.
  3. Install Proxmox VE 3.4 as VM guest inside Proxmox VE 4.4
  4. Restore your OpenVZ backup on this VM
 

PaulVM

Active Member
May 24, 2011
72
2
28
Ok. As I supposed. Nested Proxmox ;-)
Good for small containers.

Any tricks for running Centos 5.x on LXC?

Thanks, P.
 

PaulVM

Active Member
May 24, 2011
72
2
28
I don't know exactly why, but the documentation say this and if I try to restore a 5.x vzdump I obtain:

# pct restore 35259 vzdump-openvz-35259-2017_02_22-00_45_02.tar.gz --rootfs local:0
extracting archive '/tmp/vzdump-openvz-35259-2017_02_22-00_45_02.tar.gz'
Total bytes read: 12593602560 (12GiB, 33MiB/s)
Detected container architecture: i386
###########################################################
Converting OpenVZ configuration to LXC.
Please check the configuration and reconfigure the network.
###########################################################
unsupported centos release 'CentOS release 5.11 (Final)'

If you know some trick/workaround .... ;-)
 

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,412
853
163
centos 5 is more or less EOL, see:

https://en.wikipedia.org/wiki/CentOS

so I exepct it could be possible to add support for lxc, but as there are no security updates anymore you should upgrade to a newer version.
 

PaulVM

Active Member
May 24, 2011
72
2
28
I know the EOL, but as we all know, there are legacy applications that need to continue works also if after EOL (usually in Intranet).

If you know any warkaround to have it in a LXC container ... :)

Thanks, P.
 

LnxBil

Famous Member
Feb 21, 2015
5,621
650
133
Germany
Easiest thing would be to patch Proxmox VE to not throw away your vzdump immediately and try if it works. I did that with outdated Debian versions and it worked.
 

PaulVM

Active Member
May 24, 2011
72
2
28
How did you "patch Proxmox VE"?
Probably /usr/share/lxc/... is where to search, but if there is a way that doesn't require to understand and modify to much ...
In the meantime I simply changed the string "5.11" with a "6.7" in the /etc/centos-release container and the new backup had been accepted from pct restore.
The container seems work correctly (a part for annoyng kernel messages in /var/log/messages, but also centos 6.x have similar behavioural).
I suppose there are reasons if it isn't ufficially supported, but I can't find these reasons.
If anyone have some experience on this ...
Thanks, P.
 

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 your own in 60 seconds.

Buy now!