Opennebula Create Centos VM With Contextualization
Opennebula Create Centos VM With Contextualization
Opennebula Create Centos VM With Contextualization
ing put m
Table of Contents
Creating CENTOS Desktop image file {using virsh}:..............................................................2 OpenNebula setup an !" Creation:........................................................................................# ..............................................................................................................................#
pla$e
fo r
ing put m
'(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.
#. /.
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
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
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
,.
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
ing put m
#.
Create a image
/.
-.
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.
pla$e
fo r
ing put m
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.
,#. 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
ing put m
pla$e
Y shoul have $orre$t DNS Y shoul have stati$ 3P setting *ith gate*a&
fo r
ing put m
pla$e