Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th June 2009, 16:13
kumarullal kumarullal is offline
Junior Member
 
Join Date: Jun 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to convert a KVM image in to an openvz container in Proxmox?

Hi Falko,
I followed your article "How To Convert Physical Systems And Xen VMs Into OpenVZ Containers (Debian Etch)"
I need some clarification.
I am using proxmox. So KVM and openvz reside on the same system.
I have setup up a kvm image of centos based asterisk system just the way I want it. Now, I want to convert that into an openvz container.

so what should I do to apply your instructions in proxmox's context.

You instructions

" server1/server2:

apt-get install rsync

Now let's transfer server1's files to the OpenVZ container:

server2:

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/ "

After that is answered, what value should I put in your example
" vzctl set 211 --ostemplate debian-4.0-i386-minimal --save "

The Os is centos 5.

Thanks in advance
kumar

Last edited by kumarullal; 25th June 2009 at 16:18.
Reply With Quote
Sponsored Links
  #2  
Old 26th June 2009, 03:01
kumarullal kumarullal is offline
Junior Member
 
Join Date: Jun 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Got stuck

I could rsync my asterisk pbx based on Centos 5 with Ip 192.168.45.6 to my Proxmox server 192.168.45.183

It imported the files and everything.
According to your instructions

vzctl set 211 --onboot yes --save
vzctl set 211 --hostname server1.example.com --save
vzctl set 211 --ipadd 192.168.0.100 --save
vzctl set 211 --numothersock 120 --save
vzctl set 211 --nameserver 145.253.2.75 --nameserver 213.191.92.86 --save
vzctl set 211 --diskspace 10000000:11000000 --save

How do I set Swap and memory ?

Next,
I followed the remaining instructions

sed -i -e '/getty/d' /vz/private/211/etc/inittab
rm -f /vz/private/211/etc/mtab
ln -s /proc/mounts /vz/private/211/etc/mtab

cp /vz/private/211/etc/fstab /vz/private/211/etc/fstab.old
grep devpts /vz/private/211/etc/fstab.old > /vz/private/211/etc/fstab
mkdir /vz/private/211/dev
mknod --mode 666 /vz/private/211/dev/ptmx c 5 2
mkdir /vz/private/211/dev/pts
cp -a /dev/ttyp* /dev/ptyp* /vz/private/211/dev/
rm -f /vz/private/211/dev/null
mknod --mode 666 /vz/private/211/dev/null c 1 3
mknod --mode 444 /vz/private/211/dev/urandom c 1 9
mkdir /vz/private/211/proc

But I got stuck at
cat /dev/null > /vz/private/211/etc/network/interfaces

Since I have Centos Running, I dont have the interfaces file.
So which is the file equivalent to interfaces, in Centos
For example
the path to all the config files in Centos is
/vz/private/211/etc/sysconfig/network-scripts.
Then there are number of files there.
So which is the correct file.

And finally

According to your command
cat /dev/null > /vz/private/211/etc/network/interfaces
When I lookup up the /dev/null file, it is totally empty.
So why is this step required?

Thanks in advance.
Reply With Quote
  #3  
Old 26th June 2009, 14:17
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
 
Default

Quote:
Originally Posted by kumarullal View Post
But I got stuck at
cat /dev/null > /vz/private/211/etc/network/interfaces

Since I have Centos Running, I dont have the interfaces file.
So which is the file equivalent to interfaces, in Centos
For example
the path to all the config files in Centos is
/vz/private/211/etc/sysconfig/network-scripts.
[B]Then there are number of files there.
So which is the correct file.
I haven't tried this with CentOS, but I guess it's /etc/sysconfig/network-scripts/ifcfg-eth0. According to http://wiki.openvz.org/Physical_to_container you must set
Code:
ONBOOT=no
in that file.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Emergency -- Need to Restore File from Clonezilla image jkrell HOWTO-Related Questions 6 24th April 2009 14:18
OpenVZ - How to install guest OS on container satimis Server Operation 7 20th October 2008 12:58
vmware image convert to iso kraja HOWTO-Related Questions 0 9th September 2007 20:39
KErnel not showing all my memory Jorem Kernel Questions 8 13th April 2006 12:59


All times are GMT +2. The time now is 10:24.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.