Tải bản đầy đủ - 0 (trang)
Chapter 2. A Quick Tour with the Xen LiveCD

Chapter 2. A Quick Tour with the Xen LiveCD

Tải bản đầy đủ - 0trang

stepping:8

cpuMHz:2161.338

cachesize:2048KB

fdiv_bug:no

hlt_bug:no

f00f_bug:no

coma_bug:no

fpu:yes

fpu_exception:yes

cpuidlevel:10

wp:yes

flags:fputscmsrpaemcecx8apicmtrrmcacmovpa

bogomips:4323.93processor:1

vendor_id:GenuineIntel

cpufamily:6

model:14

modelname:GenuineIntel(R)CPUT2600@2.16G

stepping:8

cpuMHz:2161.338

cachesize:2048KB

fdiv_bug:no

hlt_bug:no

f00f_bug:no

coma_bug:no

fpu:yes

fpu_exception:yes

cpuidlevel:10

wp:yes

flags:fputscmsrpaemcecx8apicmtrrmcacmovpa

bogomips:4323.93

localhost:/#

























Chapter2.AQuickTourwiththeXen

LiveCD

IfyouareinterestedintryingXenoutforyourself,thequickest

methodisoftentheLiveCDprovidedbytheCitrixXenServer

ProductGroup.ItallowsyoutotryXenonyourcomputer

withoutinstallingXenorevenchangingyourcurrentsystem

configuration.ThischapterwalksyouthroughusingtheLiveCD

step-by-step.Intheprocess,yougetatasteofstartingand

managingguestimagesandotherbasicXencommands.



RunningtheLiveCD

TheXenLiveCDrunsentirelywithinyourmachine'smain

memory(RAM)anddoesnotrequireanyinstallationtoa

physicalharddisk.Itcanbeusedtotestforhardware

compatibilityandtofamiliarizeyourselfwithsomeofthebasic

Xenadministrationcommandsbeforecommittingtoafull

installationofXen.

TheresultsinthischapterwereobtainedonanIBMThinkPad

laptop.SpecificallyweusedaT60pmodelequippedwithan

IntelCoreDuoprocessorand2GBofRAM.Listing2.1givesthe

detailsofthetestsystem.Youmightnotbeabletosuccessfully

usetheLiveCDyourselfbecauseitdoesnotsupportall

hardwareconfigurations.Additionally,theLiveCDhasbeen

showntoworkwithVMware.

Listing2.1.DetailsoftheTestSystem

CodeView:



localhost:/#cat/proc/cpuinfo

processor:0

vendor_id:GenuineIntel

cpufamily:6

model:14

modelname:GenuineIntel(R)CPUT2600@2.16G



stepping:8

cpuMHz:2161.338

cachesize:2048KB

fdiv_bug:no

hlt_bug:no

f00f_bug:no

coma_bug:no

fpu:yes

fpu_exception:yes

cpuidlevel:10

wp:yes

flags:fputscmsrpaemcecx8apicmtrrmcacmovpa

bogomips:4323.93processor:1

vendor_id:GenuineIntel

cpufamily:6

model:14

modelname:GenuineIntel(R)CPUT2600@2.16G

stepping:8

cpuMHz:2161.338

cachesize:2048KB

fdiv_bug:no

hlt_bug:no

f00f_bug:no

coma_bug:no

fpu:yes

fpu_exception:yes

cpuidlevel:10

wp:yes

flags:fputscmsrpaemcecx8apicmtrrmcacmovpa

bogomips:4323.93

localhost:/#

























Step1:DownloadingtheLiveCDImage

andCreatingtheCD

Theversionusedwhenwritingthisbookwasapproximately

674MBandwasdownloadedfrom

http://bits.xensource.com/oss-xen/release/3.0.3-0/iso/livecdxen-3.0.3-0.iso.Wehaveamirroredcopyofthisversiononthe

bookWebsite(runningxen.com).Youcanlookforamore

currentXenLiveCDathttp://xen.org/download/.

TheLiveCDfileisanISOimageandneedstobewrittentoaCD

beforeitcanbeused.OncedownloadedandwrittentoCD,

simplyinsertthediscintoyourcomputer'sCD-ROMorDVDROMdriveandrebootthemachine.Notethatyourcomputer

mustbesettobootfromtheCDorDVD-ROMdriveinyour

BIOSsettings.ThemajorbenefitoftheLiveCDisthatitdoes

notinstallXen,butinsteadbootsaspecialXenadministrative

host(referredtoasDomain0)fromtheCDandnotfromyour

localharddisk.TheDomain0isthehostplatformthattheXen

managementtoolsresideon.Guestdomains,orguests,other

thanDomain0areunprivilegeddomains,referredtoas

DomainUorDomU.Theseguestdomainsaretherunning

operatingsystemwewanttovirtualize.

Domain0andtheunderlyingXenhypervisorgainaprivileged,

administrativepositioninthesystemduringboot.TheXen

hypervisorisinsertedintheGRUBmenuandbootsfirst.The

hypervisorthenstartsDomain0.Finally,configurationfilesin

Domain0areconsulted,whichinstructittostartpreviously

createdguestdomains.Theseconfigurationfilesarediscussed

inmoredetailinChapter6,"ManagingUnprivilegedDomains."

TheLiveCDcontainsboththeDomain0andXenguestimages

onthesamedisc.WhenusingtheXenLiveCD,notethatitis

operatingfromdiscandmemoryonly,thusguestsrunslower

thaniftheywereinstallednativelyonthelocalharddisk.



Step2:ChoosingaDomain0Imagefrom

theGRUBMenu

TheXenLiveCDcontainsseveralDomain0images.Whenyou

firstboottheLiveCDyouseeaGRandUnifiedBootloader

(GRUB)menu.Thismenuallowsyoutoselectwhichhost

environmentyouwanttoboot.

InFigure2.1,sevenoptionsareavailableatthebootloader

menu.ThefirsttwooptionsareDebianbased,thesecondtwo

optionsareCentOS(aRedHadEnterpriseLinuxderivative)

based,followedbytwoOpenSUSEoptions,andfinallyastock

(thatis,notXen-aware)Debiankernel.

Figure2.1.LiveCDGRUBmenushowingbootchoices:

Debian-basedDom0(intextmodeornot),CentOS-based

Dom0(intextmodeornot),OpenSUSE-basedDom0(in

textmodeornot),orDebianonnativekernel

[Viewfullsizeimage]



OfthesixXen-awareDomain0kernelslocatedatthetopofthe

list,youwillnoticethatforeachdistributionlisted,thereare

bothgraphicalandtextmodeoptions.Ifyouareoperatingona

systemthathasenoughresources,youmayuseagraphical

option(anythatdoesnotspecify"textmode"),whichprovides



manyoftheamenitiesexpectedfromamoderncomputing

environment.Ifyoursystemhaslimitedresourcesorthe

graphicalenvironmentselectionsdonotworkforyou,

alternativelytrythetextmodeoptions.

Ifyouareunsureofwhichimagetoselect,theDebianversion

isrecommendedsimplybecausetheresultingwallpaper

selectioniseasierontheeyes.Afteryouhavemadeyour

selection,abootupsequencesimilartomostLinuxboot

proceduresrollsby.Onthehardwarewetested,boottimewas

undertwominutes,andwewerepresentedwithagraphical

logonscreen.



Step3:LoggingInandtheDesktop

TheloginscreenshowninFigure2.2istheGNOMEDisplay

Manager(GDM),whichdescribestheloginprocessabovethe

textentryfield.Theinstructionsastestedinourenvironment

werefora"root"logonusingthepassword"xensource."Ifthe

loginissuccessful,theGDMpromptdisappears,andyouare

presentedwithalogofortheXfceDesktopenvironment.

Figure2.2.LoggingintotheDebianDomain0desktop

[Viewfullsizeimage]



Xfceisalightweightgraphicaldesktopenvironmentforvarious

Linuxsystems.XfcemakesanexcellentXenhosting

environmentduetoitsrelativelylightresourceconsumption.

However,foryourownXensystems,youcanchoosetodeploy

GNOME,KDE,oranyotherwindowingenvironmentyouprefer.

AfterXfcehasfullyloaded,apanelappearsatthetopandat

thebottomofthedesktop.Additionally,twoterminalwindows

openalongwithaninstanceoftheFirefoxWebbrowsershowing



somehelpdocumentationtogetyoustarted.Theuppermost

terminaldefaultstodisplayingthexentopcommandoutput.

Figure2.3showsanexampleofthefulldesktop.Thexentop

utilityisasimpleconsole-basedapplicationtoviewvirtual

guestsandtheirresourceallocation/consumptioninrealtime.

Thesecondconsoleprovidesinstructionsabovetheprompton

howtocreatevirtualguestsusingonlythecommandline.

Figure2.3.Thedesktopautomaticallydisplaysa

"WelcometotheXenLiveCD!"file,xentop,andaterminal

window

[Viewfullsizeimage]



Figure2.4showsxentopoutputbeforethecreationofany

guests.NotetheDomain0showsupintheoutput.Later

chaptersexplainthedetailsofthexentopoutput.Fornow,itis

enoughtoknowthateachgueststartedappearsinthislist.

Figure2.4.xentopoutputshowingonlyDomain0



[Viewfullsizeimage]



Youmayalsobewonderingwhatotherinterestingcommands

andXentoolscomeinstalledontheXenLiveCD.Listing2.2

showsalistofXencommandsavailableontheLiveCD.Though

wedonotuseallthesecommandsinthischapter,theyareall

availableontheLiveCD.Laterchaptersdiscussmanyofthese

commandsinfurtherdetail.

Listing2.2.XenCommands

localhost:~#xen

xen-bugtoolxenstore-chmodxenstore-write

xenbakedxenstore-controlxenstored

xenconsxenstore-existsxentop

xenconsoledxenstore-listxentrace

xendxenstore-lsxentrace_format

xenmon.pyxenstore-readxentrace_setmask

xenperfxenstore-rmxentrace_setsize

localhost:~#



Step4:CreatingGuests

Youcanfollowtheinstructionsinthesecondconsolewindow

(showninListing2.3)tocreateanumberofvirtualmachine

guestsusingthexmcreatecommand.The-coptionspecifies

toopenanintialconsoletothenewvirtualmachineoncethe

virtualmachinecreationiscompleted.Thelastargument

providedisthelocationofaconfigurationfilethatcontainsall

thedetailsaboutthetypeofguesttocreate.Youlearnmore

aboutthislaterinthebook.Fornow,theLiveCDcomeswitha

numberofpremadeconfigurationfilesasshowninListing2.3.

Allyouneedtodoischooseoneofthese.

Ifyouspecifythe/root/deb-confconfigurationfile,yougeta

newDebianguest.Similarly,the/root/centos-conffilegives

youCentOSguest,and/root/opensuse-confgivesyouan

OpenSUSEguest.Thesechoicesshouldbefamiliarfromthe

GRUBmenuwherewehavesimilarchoicesforDomain0.Itis

importanttorecognizethatthechoiceofguesttypeis

completelyindependentoftheDomain0choice.Youcanhave

CentOSandOpenSUSEguestsonaDebianDomain0andvice

versa.

Listing2.3.WelcomeMessagewithInstructionsforGuest

Creation

WelcometotheXenLiveCDv1.6!

TostartaDebian'etch'guest,type:

#xmcreate-c/root/deb-confname=my-vm-name

TostartaCentOS4.1guest,type:

#xmcreate-c/root/centos-confname=my-vm-name

TostartanOpenSUSE10.0guest,type:

#xmcreate-c/root/opensuse-confname=my-vm-name

localhost:~#xmcreate-c/root/deb-conf

localhost:~#



Youcanspecifyadescriptivenameforeachvirtualguestyou

createwiththenameparameter.Forinstance,youmaychoose

touseaschemeassimpleasdebian_guest1forthenameof

yourfirstDebianguest;however,moredescriptiveschemes

mayhelpyouinthelongrun.Ifyoudonotspecifyanameon

thecommandline,xmcreatepromptsyouforone.

Listing2.4showstheresultofcreatingaDebianguestusing

the/root/deb-confconfigurationfile.(Note:Thexmlib

warningmessagescanbesafelyignoredinthiscase.)

Listing2.4.TraceofaDebian-BasedGuestCreation

CodeView:



Enternameforthedomain:debian_guest1

Usingconfigfile"/root/deb-conf".

/usr/lib/python2.4/xmllib.py:9:DeprecationWarning:Thexmllib

warnings.warn("Thexmllibmoduleisobsolete.Usexml.sax

Starteddomaindebian_guest1

i8042.c:Nocontrollerfound.

Loading,pleasewait...

INIT:version2.86booting

hostname:thespecifiedhostnameisinvalid

Startingthehotplugeventsdispatcher:udevd.

Synthesizingtheinitialhotplugevents...done.

Waitingfor/devtobefullypopulated...done.

Activatingswap...done.

Checkingrootfilesystem...fsck1.39(29-May-2006)

/tmp/rootdev:clean,34131/125184files,133922/250000blocks

done.

Settingthesystemclock..

Cleaningupifupdown....

Loadingmodules...done.

Settingthesystemclockagain..

Loadingdevice-mappersupport.

Checkingfilesystems...fsck1.39(29-May-2006)



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 2. A Quick Tour with the Xen LiveCD

Tải bản đầy đủ ngay(0 tr)

×