Successfully converted kvm to openvz - need help

kumarullal

Renowned Member
Jun 17, 2009
184
0
81
LA, USA
Hi I successfully managed to converted the kvm image of asterisk pbx based on Centos into openvz container image by following http://wiki.openvz.org/Physical_to_container

I also have downloaded the openvz image of mgate (proxmox mail gateway)

I compared the proxmox mail gateway, mgate container (105) conf file located in /etc/vz/conf/105.conf with
the one I created located at /etc/vz/conf/211.conf

I made some adjustments in my newly created conf file according to what was set in 105.
When I started the container 211, I got the beautiful root prompt on CLI.
The only problem I found was that the network was not showing up.
when I tried run the ifconfig eth0. It told me that could not find the eth device.
I have added an attachament of the screenshot in this post.

Here is the conf file I have for my container 211

# PVE default config for 256MB RAM

ONBOOT="no"

# Primary parameters
NUMPROC="1024:1024"
NUMTCPSOCK="9223372036854775807:9223372036854775807"
NUMOTHERSOCK="9223372036854775807:9223372036854775807"
VMGUARPAGES="262144:9223372036854775807"

# Secondary parameters
KMEMSIZE="9223372036854775807:9223372036854775807"
OOMGUARPAGES="262144:9223372036854775807"
PRIVVMPAGES="262144:274644"
TCPSNDBUF="9223372036854775807:9223372036854775807"
TCPRCVBUF="9223372036854775807:9223372036854775807"
OTHERSOCKBUF="9223372036854775807:9223372036854775807"
DGRAMRCVBUF="9223372036854775807:9223372036854775807"

# Auxiliary parameters
NUMFILE="9223372036854775807:9223372036854775807"
NUMFLOCK="9223372036854775807:9223372036854775807"
NUMPTY="255:255"
NUMSIGINFO="1024:1024"
DCACHESIZE="9223372036854775807:9223372036854775807"
LOCKEDPAGES="131072:131072"
SHMPAGES="9223372036854775807:9223372036854775807"
NUMIPTENT="9223372036854775807:9223372036854775807"
PHYSPAGES="0:9223372036854775807"

# Disk quota parameters
DISKSPACE="29360128:32296140"
DISKINODES="5600000:6160000"
QUOTATIME="0"
QUOTAUGIDLIMIT="0"

# CPU fair sheduler parameter
CPUUNITS="1000"
CPUS="1"
VE_ROOT="/var/lib/vz/root/$VEID"
VE_PRIVATE="/var/lib/vz/private/$VEID"
OSTEMPLATE="centos-5.0-aah_2.7_i386"
ORIGIN_SAMPLE="pve.auto"
IP_ADDRESS="192.168.45.51"
HOSTNAME="asterisk1.abc.com"
DESCRIPTION="aah"
NAMESERVER="192.168.45.1"
SEARCHDOMAIN="abc.com"

See Attachment as well.
Please let me know where am I going wrong.
Thanks in advance
 

Attachments

  • openvz.JPG
    openvz.JPG
    56.3 KB · Views: 7
Last edited:
This is the INIT Log

starting init logger
Welcome to  CentOS release 4.2 (Final)
 Press 'I' to enter interactive startup.
Starting udev: [FAILED]
Initializing hardware... storage network audio done[ OK ]
raidautorun: failed to open /dev/md0: 13
Configuring kernel parameters: net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
error: permission denied on key 'kernel.sysrq'
error: permission denied on key 'kernel.core_uses_pid'
[FAILED]
hwclock is unable to get I/O port access: the iopl(3) call failed.
Setting clock (localtime): Fri Jun 26 18:09:24 EDT 2009 [ OK ]
Setting hostname asterisk1: [ OK ]
Your system appears to have shut down uncleanly
Press Y within 5 seconds to force file system integrity check... Press Y within 4 seconds to force file system integrity check... Press Y within 3 seconds to force file system integrity check... Press Y within 2 seconds to force file system integrity check... Press Y within 1 seconds to force file system integrity check...
Remounting root filesystem in read-write mode: mount: permission denied
[FAILED]
Mounting local filesystems: [ OK ]
Enabling local filesystem quotas: [ OK ]
/etc/rc.d/rc.sysinit: line 760: /dev/urandom: Permission denied
Enabling swap space: [ OK ]
 
OpenVZ has 2 different network modes - venet and veth. If you need an eth0 device you need to use veth (bridged) mode.
 
Thanks for your reply.
Managed to do this by this command
vzctl set 101 --netif_add eth0 --save

The network error stopped but there are number of other error.
First of all I want to understand, since KVM image is a Virtual machine image. So when I import the machin using rsysc,
Why should we exclude the dev (Devices), proc and temp directory from the KVM image.
the rsync command I used
rsync -arvpz --numeric-ids --exclude dev --exclude proc --exclude tmp
-e "ssh -l root@192.168.0.100" root@192.168.0.100:/ /vz/private/211/
Secondly Why should we disable udev.
Because I am getting number of errors pertaining to tty0 not found, tty9 not found.
These are present in the original KVM images's /dev directory.
Number of services are failing to start.
I have spent more than 4 days just trying to figure this out with various permutations and combinations
Your help will be greatly appreciated.
 
Last edited:

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!