Professional Documents
Culture Documents
Vmware Vmotion and Cpu Compatibility: Information Guide
Vmware Vmotion and Cpu Compatibility: Information Guide
Vmware Vmotion and Cpu Compatibility: Information Guide
Thisguidecoversthefollowingtopics:
Key Concepts
ThefollowingtermsandconceptsareimportanttounderstandingtheVMotiontechnologyandthe compatibilityconstraintsthataffectuseofVMotion. Host AphysicalserverthatispartoftheVMwareInfrastructurehardwareresourcepool.Thishostmaybe usedtorunoneormorevirtualmachines. Migration of a virtual machine Theprocessofmovinganentirevirtualmachinefromonehosttoanother. Completevirtualizationofallcomponentsofamachine,suchasCPU,BIOS,storagedisks,networking,and memoryallowstheentirestateofavirtualmachinetobecapturedbyasetofdatafiles.Therefore,movinga virtualmachinefromonehosttoanotheris,inessence,aspecializeddatatransferbetweentwohosts.Based onthestateofthevirtualmachineduringmigration,themigrationisreferredtoascoldorhot.
CPU microarchitecture Theinternalarchitecture,includingdesignandinteractionofdifferentcomponents, oftheCPU.ThemicroarchitectureofaCPUisanimplementationofaparticularinstructionsetarchitecture (ISA).DifferentmicroarchitecturesmightimplementthesameISAirrespectiveofCPUvendor.Forexample, IntelCorebasedCPUsdifferfromtheirP4counterpartinmicroarchitecture,butimplementthesamex86ISA. Privileged code Setofinstructionsthatrunatthehighestprivilegelevelandcanthereforeperform operationscriticaltothefunctioningofamachineandmayaffectallapplications.Onx86CPUs,thehighest privilegelevelis0.Typically,operatingsystemrelated(kernel)instructionsrunatthehighestprivilegelevel. Anyinstructionmayrunintheprivilegedmodeiftheoperatingsystemspecifiesthatitdoso. Nonprivileged code Instructionsthatbelongtoapplicationsoftware.Notallinstructionscanrunin nonprivilegedmode.Applicationssometimesneedtoperformprivilegedoperationsanduseservices(suchas APIs)providedbytheoperatingsystemtoachievethis.Onx86systems,applicationstypicallyrunata privilegelevelof3,thoughitiscorrectforapplicationsrunningatprivilegelevelsof1and2tobecategorized asnonprivilegedcode. CPUID instruction Anx86assemblyinstructionusedforprocessorandfeatureidentification.This instructionistheprescribedandstandardizedmethodforsoftwaretodeterminethesetoffeaturesand instructionsavailableonthecurrentCPU.
Applications of VMotion
Theabilitytomigratearunningvirtualmachineacrossdifferenthostswithoutanyperceivableimpacttothe enduseropensupawidearrayofapplications.SomeimportantapplicationsofVMotionare:
(http://www.vmware.com/download/shared_utilities.html).ForinformationonusingthisCPUIDISOimage, seeAppendixC:RelaxingVMwareVMotionCPUCompatibilityConstraintsonpage 11.Youcanalsouse theManagedObjectBrowserfeatureofESX,whichyoucanaccessusingaWebbrowser,todeterminetheset offeaturesavailableonthehostCPU. CPUvendorsrecommendthatapplicationsusetheCPUIDinstructionforfeaturedetermination.Wellbehaved systemandapplicationsoftwaredoesso.AtypicalapplicationdeterminesthesetofavailableCPUfeaturesby executingCPUIDonlyonceasitisstarting.Basedontheresults,theapplicationmightcontinuetousesomeof thesefeaturesuntilitisshutdown. However,notallapplicationsarewellbehaved.SincetheCPUIDinstructionwasintroducedonx86CPUsonly intheearly1990s,legacysoftwaremightnotfollowthisrecommendedmethodoffeaturedetectionandmight usecustommethodsinstead.ApplicationsmightusethesupportforaspecialinstructiononaparticularCPU asanindicationoftheavailabilityoffeaturesrepresentedbythatinstruction.Forinstance,existenceofthe ADDPDassemblyinstructioncouldimplypresenceofallSSE2instructions.Iftheapplicationexecutesthis specialinstructionoptimisticallyandreceivesanUnDefinedinstructionexception(#UD)fromtheCPU,it handlesthisexceptionandassumestheclassoffeaturesisunsupported.Becausetheapplicationhandlesand consumestheexception,thisprocessmaybetotallytransparenttotheenduser.Suchtrycatchabort exceptionsarebuiltintoolderapplicationsoftware,andtheapplicationsmaycontinuetoworknormallyeven iftheydonotadheretomethodsrecommendedbyCPUvendors. Therefore,itisimportanttonotethefollowing:
High-Performance Virtualization
Highperformancevirtualizationrequiresdeliveringvirtualizationatnearnativeperformance.Forthistobe technicallyfeasiblewhilemaintainingcorrectness,itisnecessarytoexecutemanyinstructionsdirectlyonthe underlyinghardware.Utilizingunderlyinghardwareresourcestofacilitatehighperformanceexecutionis trueofanyvirtualizationlayer.Thisensuresapplicationsrunninginsideavirtualmachinedonotencounter majorslowdowns.Thevirtualizationlayerinterceptsonlycertainselectinstructionsthatreallyrequire interceptionandsubsequentemulation. Thex86ISAallowsonlyinstructionsbelongingtotheoperatingsystemorkerneltobeinterceptedbythe traditionalvirtualizationlayerthatis,avirtualizationlayerthatdoesnotrelyonhardwaresupportfor virtualizationoronparavirtualization.Theseinstructionsrunatthehighestprivilegelevel,makingthem privilegedcode.Typically,instructionsthatrunatlowerprivilegelevel(nonprivilegedcode)arepassed throughtotheunderlyinghardwareunimpeded.TheCPUIDinstructioncanbeexecutedbytheoperating system(privilegedcode)aswellasbyapplications(nonprivilegedcode).Ifthisinstructionispartofan application,itexecutesdirectlyontheunderlyinghardware,therebygivinganapplicationalistoffeatures availableontheunderlyinghardware.IfCPUIDispartofprivilegedcode,thevirtualizationlayercanintercept itifemulationisneeded.Thismethodologyarisesfromattemptingtovirtualizetheinherently nonvirtualizablex86ISA(seeFormalRequirementsforVirtualizableThirdGenerationArchitecturesin Referencesonpage 7). Therefore,evenwhenapplicationsarerunningwithinavirtualmachine,thefollowingmaybetrue:
Live Migration
Migratinganentirevirtualmachinewhileitisrunningisusefulonlyifapplicationscontinuetooperate normallyaftermigration.Applicationstypicallyincludenonprivilegedinstructions,whichmightexecute directlyontheunderlyinghardwareCPU.Ifapplicationsaretocontinueperformingnormallyafteralive migration,theyneedtoexecuteinstructionsandutilizefeaturesthatwereavailableonthesourcehost hardwareevenwhentheyarerunningonthedestinationhosthardware.Thisisrequiredeventhoughthese applicationsareexecutingwithinthesamevirtualmachine. Coldmigration,ontheotherhand,ensuresthatthevirtualmachineandunderlyingapplicationsrestartafter migration.Becausetheapplicationsrestart,theyinitializeandquerytheCPUforavailablefeatures.This impliestheapplicationsutilizeonlyinstructionsandfeaturessupportedbythedestinationhosthardware (wherethevirtualmachineispoweredon).
Conclusion
Virtualizationisstillarelativelynewtechnologicalinnovation,andtheareaoflivemigrationofvirtual machinesisstillinitsinfancy.VMwareVMotionisanextremelyusefulandcriticalfeatureindatacentersto ensurebusinesscontinuity,resourceoptimization,andahostofotherbenefits.VirtualCenterperforms numerouscompatibilitychecksbeforeallowingmigrationwithVMotion.SomestringentCPUcompatibility checksforVMotionarenecessaryforproperfunctioningofavirtualmachineaftermigration.Thoughusers canoverridethesechecksandcompleteVMotionbyapplyingappropriatemasks,thevirtualmachinesand applicationsmaynotfunctionproperlyiftheyrelyonfeaturesparticulartotheunderlyinghardware.Thex86 CPUvendorsdidnotinitiallyenvisionlivemigrationofvirtualmachinesanddesignCPUstosupportit. VMwarehasworkedwithCPUvendorstosupportsuchfeatures,takingadvantageofIntelFlexMigrationand AMDVExtendedMigrationtechnologies.WithEnhancedVMotionCompatibility,VMwareInfrastructure worksinconjunctionwithhardwaretosupportlivemigrationofvirtualmachinesinawiderrangeof environments.EffectiveuseofenhancedVMotionalsodependsonusingapplicationsoftwarethatfollows recommendedguidelinestosupportCPUfeaturedetection.
References
VMware Infrastructure Documentation
TestingandUsingNewFeaturesinCPUs http://kb.vmware.com/kb/1005763 VMotionandCPUCompatibilityFAQ http://kb.vmware.com/kb/1005764 VMotionCPUCompatibilityRequirementsforIntelProcessors http://kb.vmware.com/kb/1991 VMotionCPUCompatibilityRequirementsforAMDProcessors http://kb.vmware.com/kb/1992 VMotionCPUCompatibilityMigrationsPreventedDuetoCPUMismatchHowtoOverrideMasks http://kb.vmware.com/kb/1993
Other References
Forinstance,forNXsupport,CPUID level 0x80000001 EDX:20shouldbeset. Thefamilyorextendedfamily,model,andsteppingbitssimplydescribeaCPU,whereasthefeatureand extendedfeaturebitsprovideinformationforusebyvariouskindsofsoftware.TheCPUIDinstructionbyitself doesnotrequireanyspecialprivilegesandthereforetheoperatingsystem(privilegedmode)oranyother application(nonprivilegedmode)canexecuteit. SpecificfeaturesandextendedfeaturesreturnedbytheCPUIDinstructionarecloselytiedtotheCPUsandare decidedbyCPUvendors.ForinformationaboutCPUDonIntelCPUs,refertoAP485IntelProcessor IdentificationandtheCPUIDInstruction,andforinformationaboutCPUIDonAMDCPUs,refertotheAMD CPUIDSpecification(seeReferencesonpage 7forlinks).
CPUvendorstring:TheCPUvendorstringispresentinCPUIDlevel0x0EBX,ECX,andEDXregisters. ThedefaultVirtualCentermasksrequirethisstringtomatchbetweensourceanddestinationCPUsfor VMotioncompatibility.Thismatchisrequiredbecausedifferentvendorsmaychoosetointerpret, implement,andextendthex86ISAdifferently. CPUfamily,extendedfamily:TheCPUfamilyispresentinCPUIDlevel0x1EAX:811.Theextended familyfieldispresentinCPUIDlevel0x1registerEAX:2027.ACPUfamilyiscompletelydefinedbythe combinationoffamily(sometimesreferredtoasthebasefamily)andtheextendedfamily.Thedefault VirtualCentermasksrequirethisvaluetomatchbecausedifferentCPUfamilies,evenfromthesame vendor,havedifferentsupportedinstructionsetsandfeatures. RDTSCP:ThisinstructioncanbeexecutedonlybyprivilegedcodeandisspecifictoAMDCPUs.Ifthis instructionissupportedbytheCPU,itisindicatedbyCPUIDlevel0x80000001hEAX:27beingset. VirtualCentersupportsmaskingthisfeaturebitandthereforedisablingitforapplicationsrunninginside VMwarevirtualmachines.ThisallowssuccessfulvalidationofCPUcompatibilitychecksandfacilitates VMotion. StreamingSIMDextensions(SSE)and3DNow!:Thesesetsofinstructionsareextensionstothex86ISA allowingCPUstoprocesssingleinstructionmultipledata(SIMD)instructionsthatarewidelyusedin multimediaapplications.DifferentCPUvendorschosetoextendthex86instructionsetindifferentways. InteldesignedtheSSEinstructions.AMDdesignedthe3DNow!extensions.
SSE3:SSE3isthethirdgenerationofSSEaddedtothex86instructionset.SupportforSSE3is indicatedbythevalueofCPUIDlevel0x1ECX:0.Ifthisfeatureisavailableonamachine,itcould potentiallybeusedbycertainmultimediaapplications.Ifsuchapplicationsaretocontinueoperating normallyaftermigrationwithVMotion,thisfeaturemustbeavailableinhardwareonthedestination host.VirtualCenterthereforerequiresthatthisfeaturematchbetweenthesourceanddestination hostsforVMotioncompatibility. SSSE3:SSSE3isthesetofsupplementalSSE3instructionsaddedonCPUsbasedontheIntelCore architecture.ThisfeatureiscurrentlyavailableonlyonIntelCPUs.Itisconsideredarevisionofthe SSE3instructionset.AswiththeSSE3instructions,ifthisfeatureisavailableonthesourcehost,it mustbeavailableonthedestinationhost.ExistenceofthisfeatureisconfirmedbythevalueofCPUID level0x1ECX:9. SSE4.1:Atthetimewewrotethisguide,SSE4.1instructionswereavailableonlyonIntelCPUs.This featureisthefirstsubsetofthefourthrevisionoftheSSEinstructionsandisavailableforapplications touse,ifsupportedbytheCPU.ThisfeatureisindicatedbythevalueofCPUIDlevel0x1ECX:19. SSE4.2:Atthetimewewrotethisguide,SSE4.2wasyettobeintroduced.Itwillbethesecondsubset ofthefourthgenerationofSSEinstructions.ThisfeatureisindicatedbythevalueofCPUIDlevel0x1 ECX:20. 3DNow!:The3DNow!instructionsprocessvectorfloatingpointoperations,whichaidmultimedia processing.TheseinstructionswerefirstmadeavailablebyAMD.Presenceofthisfeatureisdetected bythevalueofCPUIDlevel0x80000001EDX:31. 3DNow!Extensions:Extensionstothe3DNow!instructionswereintroducedbyAMD.Thisfeature isdetectedbythevalueofCPUIDlevel0x80000001EDX:30.
NoeXecute(NX)oreXecuteDisable(XD):Thisfeatureallowsprivilegedcode(kernellevel)tomark certainsectionsofmemoryascodeandothersasdata.ThismarkingpreventstheCPUfromexecuting dataregionsofmemory,onemethodusedbymalicioussoftwaretotakeunauthorizedcontrolofa machine.Suchusurpationisreferredtoasabufferoverflowattack.Presenceofthisfeatureisindicated byCPUIDlevel0x80000001EDX:20.Becausethisfeaturemaybeusedonlybyoperatingsystems (privilegedcode),VirtualCenterallowsuserstodisablethisfeatureandhideitfromtheguestoperating systemevenifitisavailableonhardware. Longmodesupport:CPUssupportinglongmodeallow64bitinstructions(64bitmode)aswellas32bit instructions(compatibilitymode)toexecute.ThissupportisindicatedbyCPUIDlevel0x80000001 EDX:29.IfaCPUsupportslongmode,capableapplicationsexecute64bitinstructions.VMwareproducts requirethisfeaturetobepresentwhenyoucreatea64bitvirtualmachinescapableofrunninga64bit guestoperatingsystem.VirtualCenterattemptstomatchthisfeaturebitwhenperformingcompatibility checksbeforeallowingmigrationwithVMotion.Thecompatibilitychecksforlongmodesupportare basedontheconfiguredoperatingsystemandsettingsforthevirtualmachine.VMwareproductssupport longmodeonlyifhardwarevirtualizationsupport(VTonIntelCPUsandAMDVonAMDCPUs)isalso availableonthehost. CMPXCHGinstructions:The8byteand16bytecompareandexchangeinstructionsarenewadditions availableoncertainnewerCPUs.TheirpresenceisindicatedbythevalueofCPUIDlevel0x1EDX:8(for CMPXCHG8B)andCPUIDlevel0x1ECX:13forCMPXCHG16B.Theseinstructionsmaybeusedbyany application,ifavailable.Therefore,VirtualCentermustmatchthisfeaturebetweensourceanddestination hostsbeforeallowingmigrationwithVMotion. FFXSR:TheFXSAVEandFXRSTORinstructionssaveandrestorex87,MMX,andXMMregistersusedin floatingpointoperations.CurrentAMDCPUsalsohaveoptimizedversionsoftheseinstructions:fast FXSAVEandfastFXRSTOR(FFXSR),indicatedbyCPUIDlevel0x80000001EDX:25,whichdonotsave andrestoreXMMregistersinthe64bitmodewhenexecutedbyprivilegedcode.Thisfeaturebitis unused(reserved)onIntelCPUs.BecauseapplicationscanquerytheCPUforthesefeaturesandusethem, VirtualCenterrequiresthesefeaturestomatchbetweensourceanddestinationwhenitperformsVMotion compatibilitychecks.
Prefetchinstructions:AMDCPUssupportPREFETCHandPREFETCHWinstructionstoloaddatainto theCPUsL1cache.Applicationsmayusetheseinstructions,ifavailable.Theseinstructionsareavailable onlyifCPUIDlevel0x80000001ECX:8isset.IntelCPUsdonotcurrentlysupportthisinstruction,andthis bitisreserved. MONITOR/MWAIT:IntelCPUsintroducedtheMONITORandMWAITinstructionsalongwiththeSSE3 extensions.Theyareprimarilyusedforthreadsynchronizationandthereforehavegenericusage. AvailabilityoftheseinstructionsisindicatedbyCPUIDlevel0x1ECX:3.RecentAMDCPUsnowalso supporttheseinstructions. Modelspecificregisters(MSR):Processorimplementationsprovidecertaincontrolregistersthatallow applicationstousefeaturesspecifictoaprocessor.SinceMSRsarespecifictoaprocessormodeland implementation,theymaynotbeavailableonothermodelsofthesameprocessorfamilyorothermodels fromthesamevendor.
Default Masks
StartingwithVirtualCenter2,defaultmasksaredefinedforeachguestoperatingsystem.ForVMotionchecks, eventhoughtheRentriesarehiddenfromthesoftwareinthevirtualmachine,theyarerequiredtomatch, becauseapplicationlevelsoftwaremaybeutilizingthefeaturesbyqueryingCPUIDdirectlyonhardware (withoutenhancedVMotionsupport).TheHvaluesarerequiredtomatchforVMotion,becausesoftwarein thevirtualmachineutilizesthesefeaturesinhardware.TheTvaluesindicatetheguestoperatingsystem cannotfunctionwithoutthesefeatures,thereforethefeaturesmustbesetinhardware(forexample,thelong
10
Override Masks
AnoverridemaskreplacestheexistingdefaultmaskvalueforaparticularCPUIDbit.Overridemaskshave animplicitemptyvalue(),whichmeansthereisnooverridevalueforthatbit.Overridemasksarepervirtual machineandarestoredinthevirtualmachinesconfigurationfile(.vmx).TooverrideaparticularCPUIDbit, youmustenteroverridevaluesfortheentireregisterforthecorrespondingCPUIDlevel.Forinstance,to disabletheSSSE3featureforsoftwareinthevirtualmachine,clearCPUIDlevel0x1hECX:9.Theoverride masktoaccomplishthisis:
Level 0x1h ECX: ---- ---- ---- ---- ---- --0- ---- ----
Final Mask
VirtualCentercalculatesthefinalmaskbyoverridingvaluesinthedefaultmaskusingthevaluesinthe overridemask,ifthereisone.ThisfinalmaskthenbecomespartoftheVirtualCenterconfigurationandis appliedtotheresultsoftheCPUIDinstruction. ContinuingwiththeSSSE3exampleabove,assumethedefaultmaskforCPUIDlevel0x1hECXis:
Level 0x1h ECX: RRRR RRRR RRRR RRR0 00xR R0H0 000H 0RRH
Youthenapplythefollowingoverridemask:
Level 0x1h ECX: ---- ---- ---- ---- ---- --0- ---- ----
ThisgivesyouafinalmaskforCPUIDLevel0x1hregisterECXof:
Level 0x1h ECX: RRRR RRRR RRRR RRR0 00xR R000 000H 0RRH
11
AssumingtheguestoperatingsystemusestheCPUIDinstructiontodetectfeaturessupportedbyaCPU,the featuresmaskedoutarenotavailabletotheguestoperatingsystemsoftware.Thevirtualmachinemustbe restartedsoapplicationsoftwareinthevirtualmachinecanrunfeaturedetection(viatheCPUIDinstruction) anduseonlythesetoffeaturesprescribedbytheoverridemasks. NOTETheserelaxationsarenotsupported. ThefollowingexampleshowshowtodisableSSE4.1instructionsonanIntelCPUsothatavirtualmachinecan bemigratedtoahostwithaCPUthatlacksthisfeature. NOTEThisfeatureisnotsupportedbecauseapplicationsoftwarethatreliesonrunningtheCPUIDinstruction forfeaturedetectiondirectlyonhardwarecandetectthisfeatureandmightrelyonit.Inanenvironmentthat supportsEVC,youdonotneedtobeconcernedwiththemaskingdescribedinthisappendix. TheexampleusesthefollowinghostsandCPUs:
host1.vmware.com:twocoreIntelPenrynCPU host2.vmware.com:fourcoreIntelKentsfieldCPU
ThismessageindicatesthattheCPUcompatibilitychecksperformedpriortomigrationfailed.TheCPUin host1.vmware.compossessesSSE4.1extensions,buttheCPUinhost2.vmware.comdoesnot.Youcan determinetheseCPUfeaturesbyexecutingtheCPUIDinstructiononthesehosts.Youcanobtaintheexact valueofthemismatchedbitsbyrunningtheCPUinformationutility(cpuid.iso)providedwithVMware Infrastructure3.YoucanuncompresstheISOimagefile(\images\cpuid.iso.gz)anduseittocreatea bootableCDROMthatprovidesCPUinformationaboutagivenhostbeforeyouinstallanoperatingsystem orESX.Runningthisutilityonthesourcehost(host1.vmware.com)givesthevalueofregisterswhenCPUIDis executedatvariouslevels.Youcanuseittoexaminethecauseofthemismatch. RuntheCPUIDimageonhost1.vmware.com(IntelPenrynCPU).Theoutputincludesthefollowingrelevant information:
Family: 06 Model: 17 Stepping: 4 ID1ECX ID1EDX ID81ECX ID81EDX 0x0008e3bd 0xbfebfbff 0x00000001 0x20100800
RuntheCPUIDimageonhost2.vmware.com(IntelKentsfieldCPU).Theoutputincludesthefollowing relevantinformation:
Family: 06 Model: 0f Stepping: 7 ID1ECX ID1EDX ID81ECX ID81EDX 0x0000e3bd 0xbfebfbff 0x00000001 0x20100800
12
CPUIDlevel0x1hECX(host2.vmware.com)0x0000e3bd
31 0 0 0 0 27 0 0 0 0 23 0 0 0 0 19 0 0 0 0 15 1 1 1 0 11 0 0 1 1 7 1 0 1 1 3 1 1 0 0 1
Theoverridemaskforeachvirtualmachineisstoredinitsconfiguration(.vmx)file. TomaskCPUIDlevel0x1hECX:19,applythefollowingmaskinVirtualCenter.
31 27 23 19 0 15 11 7 3 0
13
Forthenewmaskstotakeeffect,youmustrestartthevirtualmachine.Whenthenewmaskisineffect, migrationfromhost1.vmware.comtohost2.vmware.comshouldsucceed.
If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com VMware, Inc. 3401 Hillview Ave., Palo Alto, CA 94304 www.vmware.com Copyright 2008 VMware, Inc. All rights reserved. Protected by one or more of U.S. Patent Nos. 6,397,242, 6,496,847, 6,704,925, 6,711,672, 6,725,289, 6,735,601, 6,785,886, 6,789,156, 6,795,966, 6,880,022, 6,944,699, 6,961,806, 6,961,941, 7,069,413, 7,082,598, 7,089,377, 7,111,086, 7,111,145, 7,117,481, 7,149, 843, 7,155,558, 7,222,221, 7,260,815, 7,260,820, 7,269,683, 7,275,136, 7,277,998, 7,277,999, 7,278,030, 7,281,102, 7,290,253, and 7,356,679; patents pending. VMware, the VMware boxes logo and design, Virtual SMP and VMotion are registered trademarks or trademarks of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies. Revision 20080609 Item: EN-000039-00
14