Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
229 views7 pages

Opennebula Create Centos VM With Contextualization

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 7

fo r

al gui es on $lou $ti$ a r $o p

ing put m

OpenNebula R 3.4.1- Create CENTOS VM With contextualization

Table of Contents
Creating CENTOS Desktop image file {using virsh}:..............................................................2 OpenNebula setup an !" Creation:........................................................................................# ..............................................................................................................................#

pla$e

fo r

al gui es on $lou $ti$ a r $o p

ing put m

This gui e assumes that% OpenNebula is alrea & installe an $onfigure

'(or OpenNebula installation refer m& gui e 'http:))$lou blab.files.*or press.$om)2+,2)+-)opennebula.#./.,.in.ubuntu.,2.+/.pre$ises.single.ma$hine.installation.for.learning.an . testing.purpose,.p f 0

1ou are going to $reate CENTOS Desktop !irtual ma$hines using OpenNebula . 2efore *e go in% 3 *oul like &ou to familiari4e fe* terms use in this gui e: One5ost : OpenNebula Server ma$hine 'ip:,62.,78.,.,9/ !"5ost : OpenNebula !irtual "a$hine 5ost :no e; 'ip: ,62.,78.,.6-0 : < free% =ava.base programming frame*ork that supports the pro$essing of large ata sets in a $lustere $omputing environment.

Creatin CENTOS !e"#top i$a e %ile &u"in 'ir"h()


,. 2. >ogin to !"5ost Create an image file for installing CENTOS #2 bit Desktop.
?emu.img $reate .f ra* )var)lib)one)$entos)$entos.img 8@

#. /.

Create a omain $reation s$ript ')var)lib)one)template) eplo&mentA,0for Centos image an save it in )var)lib)one)template) fol er Store the CENTOS 3SO file in )var)lib)one)iso) fol er
BnameC$entos.9+B)nameC Bmemor&C,+/8-97B)memor&C BosC Bt&pe ar$hDEi787EChvmB)t&peC Bboot evDEh E)C Bboot evDE$ romE)C B)osC BonArebootCrestartB)onArebootC BonA$rashCrestartB)onA$rashC B evi$esC BemulatorC)usr)bin)kvmB)emulatorC B isk t&peDEfileE evi$eDE iskEC Bsour$e fileDE)var)lib)one)$entos)$entos.imgE)C Btarget evDEh aE)C B river nameDE?emuE t&peDEra*E $a$heDE efaultE)C B) iskC B isk t&peDEfileE evi$eDE$ romEC B river nameDE?emuE t&peDEra*E)C Btarget evDEh $E busDEi eE)C Brea onl&)C Bsour$e fileDE)var)lib)one)iso)$entos.isoE)C Ba ress t&peDE riveE $ontrollerDE+E busDE,E unitDE+E)C B) iskC B$ontroller t&peDEi eE in eFDE+EC Ba ress t&peDEp$iE omainDE+F++++E busDE+F++E slotDE+F+,E fun$tionDE+F,E)C B)$ontrollerC BG..use one net*ork ..C Binterfa$e t&peDEnet*orkEC Bsour$e net*orkDE efaultE)C B)interfa$eC Bgraphi$s t&peDEvn$E portDE-69+E)C B) evi$esC BfeaturesC Ba$pi)C B)featuresC

pla$e

fo r

al gui es on $lou $ti$ a r $o p

ing put m

B) omainC

-. 7.

Start virtual shell b& t&ping HvirshI on the shell prompt. Start the installation of CENTOSSJ #2 bit Server image b& t&ping belo* in virsh K prompt virsh K $reate )var)lib)one)template) eplo&mentA, 1ou *ill get an output like the blo*:
Domain $entos.9+ $reate from )var)lib)one)template) eplo&mentA,

9.

Conne$t to the virtual instan$e using vn$% ',62.,78.,:,9/:9+0 an $omplete the installation. 3nstall onl& the CENTOS server Lse onl& HOpenSS5I as the a itional pa$kage Note the hostname as in )et$)hosts file. 1ou ma& nee it belo*. 5ave automati$ login enable

Lp ate r$.lo$al *ith


mount .t iso677+ ) ev)h b )mnt if ' .f )mnt)$onteFt.sh 0M then . )mnt)init.sh fi umount )mnt

ThatEs it. Ne have $reate a image file *ith an up ate to r$.lo$al. No* letEs move to OpenNebula server an pro$ee *ith further setup

OpenNebula setup and VM Creation:


,. 2. >ogin to OpenNebula One5ost Create t*o !" Templates for server an no e respe$tivel&.

,.

Create a Net*ork efinition template using follo*ing s$ript name:ubuntu.net


N<"E D Oubuntu.netO T1PE D Q<N@ED 2Q3D@E D br+ NETNOQRAS3SE DC KNETNOQRA<DDQESSD ,62.,78.2.+)2/ 3PAST<QT D ,62.,78.,.#+ 3PAEND D ,62.,78.,./6 !><N D NO NETNOQRA"<SR D 2--.2--.2--.+ K Custom <ttributes to be use in ConteFt @<TEN<1 D ,62.,78.,., DNS D ,62.,78.,.,

2.

2efore $reating a image efinition template % $op& Centos image.to )var)lib)one)var atastores
$p $entos.img )var)lib)one)var) atastores)$entos.img

pla$e

fo r

al gui es on $lou $ti$ a r $o p

ing put m

$ho*n onea min:onea min )var)lib)one)var) atastores)$entos.img

#.

Create a image

efinition template using follo*ing s$ript atastores)$entos.img

)var)lib)one)template) ebain.img N<"E D O$entos esktopO SOLQCE D ))var)lib)one)var T1PE D OS

/.

Create HoneIimages using above efinitions an $hange permissions.


oneimage $reate ebain.img . efault

-.

Che$k the status using Honeimage listI $omman . 1ou shoul get an output like belo*. The ST<T shoul be Er &E instea of EerrE.
3D LSEQ @QOLP N<"E S3SE T1PE ,+ onea min onea min $entosA eskt +" OS QE@T3"E +7)22 ,6:-#:+# PL2 No PEQ No ST<T Q!"S r & ,

7.

"ake the images persistent 'make &our $hoi$e. Nh&T% Qea further...0 . 1ou $an make it persistent uring image $reation itself. The reason 3 am oing it as a separate step is% &ou shoul make persistent images onl& after &ou are through *ith both opennebula pro$esses. '2e sure: &ou have the original image file inta$t. Do not elete it. Persistent images *ill have ever&thing &ou o in an instan$e save in it% provi e &ou follo*e the $orre$t HoneI pro$esses 'gra$eful shut o*n et$.00. <n&time if &ou nee to start ever&thing from the beginning % &ou nee the original image file inta$t. Do not even $reate a umm& oneimage using the original image file.
oneimage persistent ,+

9.

Che$k the status no* using Honeimage listI $omman an $he$k the value of HPEQI $olumn.
3D LSEQ @QOLP N<"E S3SE T1PE ,+ onea min onea min $entos eskt +" OS QE@T3"E +7)22 ,6:--:+# PL2 No PEQ 1es ST<T Q!"S r & ,

8.

Create a !" Template file H ebain.oneI an store the follo*ing $ontent in it


CONTEUT D ' hostname D $entosV!"3D% ipApubli$ D OVN3C'3P% NETNOQRDWOubuntu.netWO0O%username D $entosV!"3D% ns D OVNETNOQR'DNS% NETNOQRA3DD,0O%pass*or D Opass*or O% files D O)var)lib)one).ssh)i Arsa.pub )var)lib)one)$entos)init.shO 0 KC<P<C3T1 Definition N<"EDserver CPLD, "E"OQ1D,+2/ K OS image% mappe to h a. D3SRD' DQ3!EQDra*% QE<DON>1Dno% 3"<@EA3D D 8% T<Q@ETDh a% T1PED isk 0 (E<TLQESD' <CP3D&es 0 K 3)O Devi$es Se$tion @Q<P53CSD' T1PEDvn$ 0 KNETNOQR Se$tion: N3CD' 3PD,62.,78.,./9% net*ork D Oubuntu.netO 0 KOS an 2OOT Options Se$tion

pla$e

fo r

al gui es on $lou $ti$ a r $o p

ing put m

OSD' <QC5Di787% 2OOTDh 0 KQ<N Se$tion Q<ND' T1PEDkvm 0

6.

3n or er to automate% letEs use follo*ing shell s$ript. The s$ript is self eFplanator&.This s$ript *ill take the CONTEUT information as a input. ,+. Create a shell s$ript to uploa $onteFt values to the Debain Desktop %ile) *'ar*lib*one*CENTOS*init."h
e$ho nameserver VDNS C )et$)resolve.$onf $ho*n .Q VLSEQN<"E )home)VLSEQN<"E K repla$e the efault hostname 'name takein uring image file $reation0 *ith name of Lbuntu server K 1ou ma& $hange the value .no e7,7. *ith the hostname spe$ifie uing Lbuntu image $reation. Kse .i .e Es)no e7,7)EOV{5OSTN<"E}OE)gE )et$)hosts K$omment line ,29.+.,., server in )et$)hosts Kse .i .e Es)EO,29.+.,.,W no e7,7OE)EOK,29.+.,.,W no e7,7OE)gE )et$)hosts Kup ate host file *ith 3P a ress of Lbuntu server e$ho V3PAPL2>3C V5OSTN<"E CC )et$)hosts Kup ate )et$)net*ork)interfa$es file *ith stati$ 3P. 1ou ma& $hange the @ate*a& as in &our environment. Kse .i .e Es) h$p)stati$)gE )et$)s&s$onfig)net*ork.s$ripts)if$fg.eth+ se .i .e Es)3P<DDQ)3P<DDQ V3PAPL2>3C)gE )et$)s&s$onfig)net*ork.s$ripts)if$fg.eth+ se .i .e Es)NET"<SR)NET"<SR 2--.2--.2--.+)gE )et$)s&s$onfig)net*ork.s$ripts)if$fg.eth+ Ke$ho 3P<DDQ V3PAPL2>3C CC )et$)s&s$onfig)net*ork.s$ripts)if$fg.eth+ KKe$ho NET"<SR 2--.2--.2--.+ CC )et$)s&s$onfig)net*ork.s$ripts)if$fg.eth+ Ke$ho gate*a& ,62.,78.,., CC )et$)s&s$onfig)net*ork.s$ripts)if$fg.eth+ K up ate )et$)resolv.$onf *ith ns. 1ou ma& $hange the DNS a ress as in &our environment.

se .i .e Es),62.,78.,22.,),62.,78.,.,)gE )et$)resolv.$onf K restart net*orking )et$)init. )net*ork restart

,,. Create a !" for server


onevm $reate CENTOS.one

,2. ssh to the instan$e. 1ou kno* the 3P of both server',62.,78.2.-+0


ssh BusernameCX,62.,78.,./9

,#. Che$k if ever&thing as per the $onteFt se$tion an init s$ripts has been eFe$ute . 3n short make a $he$k for the follo*ing. "ake $orre$ts if re?uire . The image is persistent. So &ou *hat ever $hanges &ou o *ill be save . 1ou $an make $orre$tions if an& to the $onteFt se$tion an )or the init s$ripts for a later eFe$ution.
3n server ma$hine: $at )et$)hosts . shoul have server an no e, host name entries along *ith 3Ps. 3P ,29.+.+., is onl& for lo$alhost.

pla$e

fo r

al gui es on $lou $ti$ a r $o p

ing put m

$at )et$)resolv.$onf $at )et$)net*ork)interfa$es

pla$e

Y shoul have $orre$t DNS Y shoul have stati$ 3P setting *ith gate*a&

fo r

al gui es on $lou $ti$ a r $o p

ing put m

+% ,ou li#e- thi" tutorial . po"t ,our co$$ent" to clou-.b.lab/zoho.co$

pla$e

You might also like