hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : VPS Hosting : make centos image for xen
Reply

Forum Jump

make centos image for xen

Reply Post New Thread In VPS Hosting Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
WHT Addict
 
Join Date: Mar 2007
Posts: 170

make centos image for xen


now I have been trying to get it to work, but cant get it going...

how do I make centos run on xen?



Sponsored Links
  #2  
Old
Web Hosting Master
 
Join Date: Jun 2008
Posts: 1,471
There are some pretty good guides on HowToForge:
http://www.howtoforge.com/ubuntu-8.0...u-repositories

  #3  
Old
Web Hosting Evangelist
 
Join Date: Oct 2007
Location: Northampton, UK
Posts: 548
I wrote a quick guide a while back for getting a dom0/domU running which might be useful - http://sysadminman.net/blog/archives/39

Matt

__________________
SysAdminMan - Asterisk PBX hosting - FreePBX, A2Billing and Elastix

Sponsored Links
  #4  
Old
The VPS Guru
 
Join Date: Dec 2005
Location: Berkshire, UK
Posts: 3,047
Or you can save yourself some hassle and get some premade images for Xen from www.jailtime.org

Note: Root login is disabled by default so you will need to edit /etc/ssh/sshd_config

__________________
Chris Elliott
System Administrator (RHCSA/RHCE/LFCS)

  #5  
Old
Junior Guru
 
Join Date: Dec 2001
Location: Northern Virginia
Posts: 238
Here is a helpful guide on how this can be done: http://wiki.centos.org/HowTos/Xen/InstallingCentOSDomU

__________________
Two Way Walkie Talkie App

  #6  
Old
Newbie
 
Join Date: Jul 2008
Posts: 23
Quote:
Originally Posted by The Universes View Post
There are some pretty good guides on HowToForge:
http://www.howtoforge.com/ubuntu-8.0...u-repositories
thanks for this

  #7  
Old
Web Hosting Master
 
Join Date: Aug 2004
Location: Shanghai
Posts: 1,449
Hi,

I think that using IMAGES is quite a bad way of doing things, when you have all the tools in hands to do NETWORK setup of your domU. What tool? Well, very simple: yum !!!

Yes, with only few calls, you can ask yum to setup a full operating system using a network repository. Here's our script (that is in open source):

PHP Code:
   1 #!/bin/bash
   

   3 CACHEDIR
="/var/cache/yum"      # where yum caches stuff -- is created as a subdir
   
4                                # of the destination chroot
   

   6 
# FIXME perhaps after installation the script can modify the target machine's yum config to point to our Squid proxy
   
#       or define http_proxy inside the machine.  that would make upgrades for customers much much faster.
   
# better idea: instead of using a web cache, use a stash on the machine, we rsync the new RPMs into it once it's finished
   
# we would need a mutex (flock or fcntl based?) that mutially excludes the critical section
  
10 # the critical section is both the yum and the rsync process
  
11 # we also need to rsync packages from the stash into the var cache on the vps, and a mutex to lock out if another yum is running, just as in the first scenario
  
12 # cannot use a symlink because its chrooted for the duration of the process
  
13 # at any case, the repo names for different distros need to be different, otherwise the caches will clash horribly
  
14 # FIXME once that is done, we can stop using apt-proxy or apt-cacher
  
15 # FIXME try to make it for suse, mandriva or any other rpm-based distro
  
16 
  17 YUMENVIRON
="$1"                # where the yum config is generated and deployed
  
18 INSTALLROOT="$2"               # destination directory / chroot for installation
  
19 
  20 
if [ "$INSTALLROOT== "" -! -"$INSTALLROOT-"$YUMENVIRON== "" ] ; then
  21         
echo "usage: centos-installer /yum/environment (will be created) /destination/directory (must exist)"
  
22         echo "dest dir MUST BE an absolute path"
  
23         exit 126
  24 fi
  25 
  26 set 
-e
  27 set 
-x
  28 
  29 which rpm 
>/dev/null 2>&|| { echo "rpm is not installed.  please install rpm." ; exit 124 ; }
  
30 
  31 
# sometimes when the RPM database is inconsistent, yum fails but exits with success status
  
32 # we make sure the db is in good health
  
33 mkdir -/var/lib/rpm
  34 rpm 
--rebuilddb
  35 
  36 
# set distro ver
  
37 releasever=5
  38 
  39 
# detect architecture
  
40 ARCH=`uname -m`
  
41 if [ "$ARCH== x86_64 ] ; then
  42         exclude
="*.i386 *.i586 *.i686"
  
43         basearch=x86_64
  44 elif 
"$ARCH== i686 ] ; then
  45         exclude
="*.x86_64"
  
46         basearch=i386
  47 
else
  
48         echo "Unknown architecture: $ARCH -- stopping centos-installer"
  
49         exit 3
  50 fi
  51 
  52 
# make yum environment
  
53 
  54 mkdir 
-"$YUMENVIRON"/{pluginconf.d,repos.d"$CACHEDIR" "$INSTALLROOT/var/log"
  
55 
  56 
# In case the folder is not there:
  
57 mkdir -/var/lib/rpm
  58 
  59 
# configure yum:
  
60 
  61 cat 
"$YUMENVIRON/yum.conf" << EOF
  62 
[main]
  
63 reposdir=$YUMENVIRON/repos.d
  64 pluginconfpath
=$YUMENVIRON/pluginconf.d
  65 cachedir
=$CACHEDIR
  66 installroot
=$INSTALLROOT
  67 exclude
=$exclude
  68 keepcache
=1
  69 
#debuglevel=4
  
70 #errorlevel=4
  
71 pkgpolicy=newest
  72 distroverpkg
=centos-release
  73 tolerant
=1
  74 exactarch
=1
  75 obsoletes
=1
  76 gpgcheck
=1
  77 plugins
=1
  78 metadata_expire
=1800
  79 EOF
  80 
  81 cat 
"$YUMENVIRON/pluginconf.d/installonlyn.conf" << EOF
  82 
[main]
  
83 enabled=1
  84 tokeep
=5
  85 EOF
  86 
  87 cat 
"$YUMENVIRON/repos.d/CentOS-Base.repo" << EOF
  88 
[base]
  
89 name=CentOS-Base
  90 
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  
91 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  
92 gpgcheck=1
  93 gpgkey
=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  
94 
  95 
[updates]
  
96 name=CentOS-Updates
  97 
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
  
98 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  
99 gpgcheck=1
 100 gpgkey
=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
101 
 102 
[addons]
 
103 name=CentOS-Addons
 104 
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
 
105 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
 
106 gpgcheck=1
 107 gpgkey
=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
108 
 109 
[extras]
 
110 name=CentOS-Extras
 111 
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
 
112 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
 
113 gpgcheck=1
 114 gpgkey
=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
115 
 116 
[centosplus]
 
117 name=CentOS-Plus
 118 
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
 
119 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
 
120 gpgcheck=1
 121 gpgkey
=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
122 EOF
 123 
 124 
# unleash yum
 
125 
 126 export LANG
=C
 127 exec yum 
-"$YUMENVIRON/yum.conf" -y install basesystem centos-release yum wget 
This comes directly from the Git of our open source project dtc-xen. We use that script in a Debian dom0, and it's performing quite ok if there are no network problems (very rarely the case, and anyway, yum can try another mirror if the first one fails).

I just hope that moderators wont have the silly idea to report as self-promotion when I'm just helping somebody...

Thomas

__________________
GPLHost:>_ open source hosting worldwide (I'm founder, CEO & official Debian Developer)
Servers & our leading control panel and our Xen VPS hosting, which are already included in Debian and Ubuntu
Available in: Kuala Lumpur, Singapore, Sydney, Seattle, Atlanta, Paris, London, Barcelona, Zurich, Israel

  #8  
Old
WHT Addict
 
Join Date: Mar 2007
Posts: 170
#7 looks good. the only reason I wanted to use images was to have a local copy to not use so much bandthwith

  #9  
Old
Web Hosting Master
 
Join Date: Aug 2004
Location: Shanghai
Posts: 1,449
Yes, and with a proxy, it's as fast as if it was in local, and things will be downloaded ONCE and for all...

Thomas

__________________
GPLHost:>_ open source hosting worldwide (I'm founder, CEO & official Debian Developer)
Servers & our leading control panel and our Xen VPS hosting, which are already included in Debian and Ubuntu
Available in: Kuala Lumpur, Singapore, Sydney, Seattle, Atlanta, Paris, London, Barcelona, Zurich, Israel

Reply

Related posts from TheWhir.com
Title Type Date Posted
LeaseWeb Netherlands Chosen to Host 20 Years Worth of Debian Linux Distributions Web Hosting News 2014-10-15 00:22:01
eTail East 2014 Web Hosting Events 2014-07-09 10:49:39
Red Hat Takes Active Role in CentOS Project to Drive New Technology Adoption Web Hosting News 2014-01-08 12:00:22
Solar VPS Becomes Official Mirror for Centos and Ubuntu Web Hosting News 2013-04-16 11:03:34
Inerol Solutions Launches XEN VPS Hosting Service Web Hosting News 2014-05-23 15:46:53


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?