Vous êtes sur la page 1sur 144

Developers Guide to Building vApps and Virtual Appliances

VMware Studio 2.1

This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs.

EN-000346-00

Developers Guide to Building vApps and Virtual Appliances

You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com

Copyright 20082010 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents. VMware is a registered trademark or trademark 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.

VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com

VMware, Inc.

Contents

AboutThisBook

GettingStartedwithVMwareStudio
1 IntroductiontoVMwareStudio 13
Overview 13 WhatIsavApp? 13 WhatIsaVirtualAppliance? 14 AudienceforVMwareStudio 14 KeyFeatures 15 ArchitectureofVMwareStudio 16 VirtualApplianceManagementInfrastructure(VAMI) 16 BuildSystem 17 VMwareStudioPluginforEclipse 17 IntegrationwithVMwarevCenterUpdateManager 18 RoadmapofThisManual 18 LinuxandEclipseDevelopers 18 WindowsDevelopers 18 DevelopersPlanningtoBuildvApps 18 AutomatingBuildsfromtheCommandLine 18 ISVsShippingVirtualAppliances 18

2 DeployingandUsingVMwareStudio 19
Prerequisites 19 DeployingVMwareStudio 20 DeploymentOptions 20 SupportedDistributionFormats 21 DeploymentProcedure 21 SecurityofSelfSignedSSLCertificate 22 ModifyingtheNetworkandTimeZoneSettings 22 ChoosingBetweenDHCPandStaticNetworkAddresses 22 ConfiguringStaticIPAddresses 23 ConfiguringtheNetworkProxy 23 ConfiguringDHCP 23 SettingtheTimeZone 24 UsingVMwareStudioWebConsole 24 AccessingtheVMwareStudioWebConsole 24 ShuttingDowntheVMwareStudioAppliance 24 SettingTimeZoneintheWebConsole 24 NetworkConfiguration 24

3 BuildingVMsandvAppswithVMwareStudio 27
OutlineofVMBuildProcedure 27 OutlineofvAppBuildProcedure 27 AcquiringtheOperatingSystemISO 28 RequirementsforBuilding64BitVMs 28 OutputFormats 28
VMware, Inc. 3

Developers Guide to Building vApps and Virtual Appliances

SupportedProductstoRunGeneratedVMsandvApps 28 VMwarevSphereUserPrivilegesforProvisioning 29 ESX/ESXiandvCenterServerUserPrivileges 29 ESX/ESXiandVirtualCenterUserPrivileges 30

DevelopingaLinuxBasedVM
4 CreatingaLinuxBasedVM 33
Overview 33 PrerequisitesOSandApplication 33 AccessingtheWebConsole 33 OperatingSystemISOImage 34 ISOofQualifyingCustomLinuxOS 34 FootprintReduction 35 ApplicationPackages 35 CreatingaVMBuildProfile 35 WebConsoleTabReference 37 DescriptionTab 37 HardwareTab 38 OSTab 39 ApplicationTab 40 ManagementTab 41 OutputTab 43 BuildSettingsTab 44 BuildingaVMfromtheBuildProfile 46 TestingtheGeneratedVM 46 ReiteratingtheBuildProcess 47 MigratingBuildProfilesfromStudio1.0or2.0 47 VMwareToolsInstalledinaGeneratedVM 47

5 PackagingaLinuxApplication 49
VMwareStudioMakePackage(mkpkg)Tool 49 OptionsoftheMakePackageTool 49 ExampleofCreatingaDEBPackage 50 ExampleofCreatinganRPMPackage 51 OperatingSystemNativeTools 52 DEBNativePackaging 52 RPMNativePackaging 52 TARArchiveasInputFormat 53 OperatingSystemFootprintReduction 54

6 AddingaLinuxManagementService 55
VMwareStudioVAMIService 55 DefaultManagementServices 56 ManagementServiceswithEclipse 56 CreatingaManagementService 57 service.xml 57 view.xml 57 CreatingaVanillaVM 58 UnderlyingCLI 58 ImportingaManagementService 58 CustomizingtheInitializationScript 59

VMware, Inc.

Contents

7 ManagingtheLinuxUpdateRepository 61
OverviewofUpdates 61 GeneratinganUpdate 62 UpdatesonCDROM 63 UpdatesRequiringReboot 64 DigitallySigninganUpdate 64 AddingYourEULAtoanUpdate 64 PublishinganUpdate 64 PublishinganUpdateRepositoryfromZIP 65 TestingAgainstaStagingUpdateRepository 66 DiagnosingFailedUpdates 66 UpdateRepositoryXML 67 SupportingCentralUpdateswithVMwarevCenterUpdateManager 67

8 UsingtheVMwareStudioPluginforEclipse 69
RequirementsofVMwareStudioPluginforEclipse 69 GettingStartedwithVMwareStudioPluginforEclipse 69 PackagingApplicationstoRunInaVirtualMachine 70 CreatingManagementServices 71 AdditionalEclipseFeatures 71 UninstallingtheEclipsePlugin 72 NewFeaturesinStudio2.1 72

DevelopingaWindowsBasedVM
9 CreatingaWindowsBasedVM 75
Overview 75 PrerequisitesOSandApplication 75 AccessingtheWebConsole 75 OperatingSystemISOImage 76 WindowsApplicationPackages 76 CreatingaVMBuildProfile 76 AdditionalFieldsforWindowsReference 77 OSTab 77 ApplicationTab 79 BuildingaVMfromtheBuildProfile 80 TestingtheGeneratedVM 80 ReiteratingtheBuildProcess 81

10 PackagingaWindowsApplication 83
AboutVMwareStudioPackageforWindows 83 RepositoryofWindowsApplicationPackages 83 CreatingaWindowsApplicationPackage 84 RegisteredExitCodes 85 EnvironmentVariableswheninstallingPackages 85

DevelopingavAppforvSphere
11 CreatingavAppfromVMBuilds 89
IntroductiontoBuildingavApp 89 Prerequisites 89

VMware, Inc.

Developers Guide to Building vApps and Virtual Appliances

CreatingavAppBuildProfile 89 WebConsoleTabReference 90 DescriptionTab 91 VMsTab 91 StartOrderTab 92 ResourcesTab 92 OutputTab 92 BuildingavAppBuildProfile 93 TestingtheGeneratedvApp 94 ImportingvAppProfiles 94

12 GuidelinesforCreatingVirtualAppliances 95
OutlineofVirtualApplianceBuildProcedure 95 VMwareRecommendations 95 VMwareReadyVirtualAppliances 96 ChoosingOVFVersion 96 ChoosingVirtualHardwareVersion 96 UserAccounts 96 IncludeUpdateAgent 96 PartitioningDiskforSystemandUserData 96 FootprintReduction 96 GuidelinesforAddingKernelExtensions 96

13 BuildingfromtheCommandLine 97
UsingtheCommandLine 97 ManagingBuilds 99 DiscoveryReports 99 OldBuilds 99 AddingSupportforaNewOS 99 Requirements 99 SupportFilesfortheNewOS 100 Fedora11AsanExample 101 SigningOVFFiles 101

14 BuildFromanExistingVM 103
ImportinganExistingVMUsingtheCLI 103 Prerequisites 103 HowItWorks 104 DiscoveringanExistingVM 104 TwoStepExistingVMDiscovery 104 ModifyingtheImportProfile 105 BuildingwiththeImportProfile 105 ExistingVMLimitations 106

Appendixes
A ManagementServicesWebAPI 109
RootObject 109 VAMIContainer 109 vami.container.navigate 109 vami.container.logout 109 vami.container.newHistoryItem 110 vami.container.isLogin 110

VMware, Inc.

Contents

vami.container.getUser 110 vami.container.getSessionID 110 VAMIContainerCallbacks 110 vami.container.registerOnShowCallback 110 vami.container.registerOnHideCallback 111 vami.container.registerOnNavigateCallback 111 VAMII/O 111 vami.io.httpGet 111 vami.io.httpPost 112 VAMILog 112 vami.log.info 112 vami.log.warn 112 vami.log.error 113

B SecuritywithSSHandSSL 115
InstallingSSHonWindows 115 VMwareWorkstationandVMwareServer1.0.x 115 VMwareServer2.0 116 CheckingVeracityofanSSLCertificateorSSHKey 116

C EditingXMLBuildProfiles 119
Introduction 119 StructureofVMXMLBuildProfiles 119 UsefulAttributesNotDisplayedintheVMwareStudioWebConsole CustomizingtheFooterintheWebConsole 129 CreatingVirtualDisks,Partitions,andVirtualDevices 129 UnmountingCDROMorISOAfteraBuild 131 ResourceAllocationSettingData 131 StructureofvAppXMLBuildProfiles 132 128

D Troubleshooting 135
ResolvingVMwareStudioIssues 135 ResolvingEclipsePluginIssues 139

Index 141

VMware, Inc.

Developers Guide to Building vApps and Virtual Appliances

VMware, Inc.

About This Book

VMwareStudioisanintegrateddevelopmenttoolthattakesexistingsoftwareapplications,packagesthem intovirtualmachinesandvApps,andbuildsvirtualappliancesreadytorunonVMwareplatformproducts. Thisbook,theDevelopersGuidetoBuildingvAppsandVirtualAppliances,providesinformationaboutcreating virtualmachinesandvAppsusingVMwareStudio2.1.

Revision History
Thisbookisrevisedwitheachreleaseoftheproductorwhennecessary.Arevisedversioncancontainminor ormajorchanges.Table 1summarizesthesignificantchangesineachversionofthisbook. Table 1. Revision History
Revision 20100713 20090828 20090629 20090205 20080905 Description MajorrevisionfortheVMwareStudio2.1release. FinalversionfortheVMwareStudio2.0release. RetitledDevelopersGuidetoBuildingvAppsandVirtualAppliancesforStudio2.0Beta. Correctionsmadetothefirstversion,butnonewmaterial. FirstversionoftheGuidetoBuildingandImplementingVirtualAppliancesforVMwareStudio1.0.

VMwareprovidesseveraldifferentSDKproducts,eachofwhichtargetsdifferentdevelopercommunitiesand targetplatforms.ToviewdocumentationforthevariousSDKproducts,andthecurrentversionofthisguide, gotohttp://www.vmware.com/support/pubs/sdk_pubs.html.

VMware Studio Forum


IfyouhavequestionsaboutVMwareStudioorwanttointeractwithotherusersanddevelopers,gotothe communityforumathttp://communities.vmware.com/community/vmtn/vam/studio?view=discussions. FornewsaboutOVFandvAppdevelopment,gototheVMwareblogathttp://blogs.vmware.com/vapp/.

Intended Audience
Thisdocumentisintendedfordevelopers,independentsoftwarevendors(ISV),systemintegrators(SI),value addedresellers(VAR),hardwareappliancevendors(HAV),ITprofessionals,anddatacenteradministrators whowanttocreatequickstartingvirtualmachines,vAppsandvirtualapplianceswithVMwareStudio.For informationaboutdeployingvAppsandvirtualappliancescreatedbyVMwareStudio,seethecompanion manual,UsersGuidetoDeployingvAppsandVirtualAppliances.

VMware Technical Publications Glossary


VMwareTechnicalPublicationsprovidesaglossaryoftermsthatmightbeunfamiliartoyou.Fordefinitions oftermsastheyareusedinVMwaretechnicaldocumentationgotohttp://www.vmware.com/support/pubs.
VMware, Inc. 9

Developers Guide to Building vApps and Virtual Appliances

Document Feedback
VMwarewelcomesyoursuggestionsforimprovingourdocumentation.Sendyourfeedbackto docfeedback@vmware.com.

Technical Support and Education Resources


Thefollowingsectionsdescribethetechnicalsupportresourcesavailabletoyou.Toaccessthecurrentversions ofotherVMwarebooks,gotohttp://www.vmware.com/support/pubs.

Online and Telephone Support


Touseonlinesupporttosubmittechnicalsupportrequests,viewyourproductandcontractinformation,and registeryourproducts,gotohttp://www.vmware.com/support.

Support Offerings
TofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,goto http://www.vmware.com/support/services.

VMware Professional Services


VMwareEducationServicescoursesofferextensivehandsonlabs,casestudyexamples,andcoursematerials designedtobeusedasonthejobreferencetools.Coursesareavailableonsite,intheclassroom,andlive online.Foronsitepilotprograms andimplementationbestpractices,VMwareConsultingServicesprovides offeringsto helpyouassess,plan,build,andmanageyourvirtualenvironment.Toaccessinformationabout educationclasses,certificationprograms,andconsultingservices,gotohttp://www.vmware.com/services.

10

VMware, Inc.

Getting Started with VMware Studio

VMware, Inc.

11

Developers Guide to Building vApps and Virtual Appliances

12

VMware, Inc.

Introduction to VMware Studio

Thischapterincludesthefollowingtopics:

Overviewonpage 13 ArchitectureofVMwareStudioonpage 16 RoadmapofThisManualonpage 18

Overview
VMwareStudioisanintegrateddevelopmenttoolthattakesexistingsoftwareapplicationsandpackagesthem intovirtualmachinesandvAppsthatarereadytorunandoptimizedforVMwareproductplatforms. VMware StudiocanbuildbothLinuxbasedVMsandWindowsbasedvirtualmachinesandvApps,running singletierormultitierapplications. LinuxbasedvirtualmachinesthatVMwareStudiogeneratescontainaninguestmanagementagentwitha WebconsolethatanISVcanbrandandshipaspartofacustomizedvirtualappliance.VMwareStudioserves asanextensiontotheISVsbuildsystem,generatingautomatedbuildsofvirtualmachinesandvApps containingthelatestsoftwarebinaries.VirtualmachinesandvAppsgeneratedbyVMwareStudioareinan industrystandardformat,enablingthemtorunonmanyvirtualizationplatforms.

What Is a vApp?
VMwarerecentlyintroducedthevApp,asoftwaresolutionoptimizedforcloudcomputing.Alogicalentity composedofoneormorevirtualmachines,thevAppcanbemovedandmanagedasaunit.AvAppspecifies andencapsulatescomponentsofamultitierapplicationaswellastheoperationalpoliciesandservicelevels associatedwithit.ThevAppgivesapplicationownersastandardwaytodescribepoliciesforanapplication, whichdifferentdatacenterscanconsistentlyinterpretandrun.ThevAppisacategoryofvirtualapplications thatcanbebuiltbyISVs,systemintegrators,valueaddedresellers,andonsiteITadministrators. TheOpenVirtualizationFormat(OVF)standard1.0isemployedtorepresentasinglevirtualmachineor combinationofmultiplevirtualmachines.Asimplemented,draftOVFstandard0.9cannotrepresentmore thanonevirtualmachine.YoucandeployavAppthroughvCenterServerwiththevSphereClient,orwith ovftool.VirtualCenter2.5andESX/ESXi3.5supportedOVF0.9only.YoucanrunallorpartofavAppon ESX/ESXi3.5ifyoudeploythevAppthroughvCenterServer4. Seehttp://www.vmware.com/appliances/learn/ovf.htmlfordetailsabouttheOVFstandard(DMTFDSP0243). Fromamanagementperspective,avAppactslikeavirtualmachineobject.Ithaspoweroperations,networks, datastores,anditsresourceusecanbeconfigured.SeetheOVFandvAppchaptersofvSphereVirtualMachine AdministrationGuideforvAppmanagementinformation. Fromanimplementationperspective,avAppcontainerisaspecializedresourcepoolthatisextendedwith computeresources,productinformation,andimportability.IntheVMwarevSphereAPIReference,VirtualApp (themanagedobjecttypeforvApp)containsvirtualmachines.

VMware, Inc.

13

Developers Guide to Building vApps and Virtual Appliances

What Is a Virtual Appliance?


Virtualappliancesareprebuiltsoftwaresolutions,comprisingoneormorevirtualmachinesandapplications, whicharepackaged,updated,maintained,andmanagedasaunit.Unliketraditionalhardwareappliances, softwareappliancesletcustomerseasilyacquireanddeploypreintegratedsolutionstacks. Virtualappliancesareusuallybuiltonastandardoperatingsystem(OS)andrunasavirtualmachine(VM). Withvirtualappliances,ISVscancreateasingleapplicationstack,reducingthecostandcomplexityof deploymentandmanagement.Itispossibletoshippreinstalled,preconfiguredsolutionsthatallowcustomers toplugsolutionsintotheircomputingenvironments.Forcustomers,deployingandmanagingsoftwareis easierwhentheapplicationsaredeliveredinavirtualappliance.Thefollowingitemssummarizethebenefits ofvirtualappliances:

AcceleratetimetomarketCustomerscanquicklydownloadandpoweronyourvirtualappliance. ReducedistributionoverheadThesamevirtualappliancerunsonmostVMwareproductplatforms. IncreasereliabilityVMwareStudiobuildsanoptionalupdaterepositoryforautomaticpatching. EnhancesecurityAppliancesarelessvulnerabletosecuritybreachesthanageneralpurposeOS. LowersupportcostsVirtualappliancesrequirelittleconfigurationandnomaintenance.

Audience for VMware Studio


IfyouareasoftwaredeveloperatanISV,VMwareStudiocanassistyouindeliveringyourapplicationsas virtualappliances,quicklyandeffectively.Ifyouareaninformationtechnologyprofessionalorsystem administrator,VMwareStudiocanhelpyoupackageexistingoperatingsystemsandapplicationsforyour virtualizeddatacenterforusewithintheenterprise.VMwareStudiocanbuildbothLinuxbasedVMsand WindowsbasedvirtualmachinesandvApps,runningsingletierormultitierapplications. Figure 11illustratestheworkflowtocreate,distribute,andupdateavirtualappliance.Asoftwarevendor packagesthesoftwarefordistributiontocorporatecustomersandendusers,whodeploythepackageona virtualizationplatform.VMwareStudiocanoptionallybuildanupdaterepository,andembedtheURLofthe updaterepositoryintothevirtualappliance,whichperiodicallychecksforupdatesafterdeployment. Figure 1-1. VMware Studio Workflow

Withintheenterprise,thesetwoboxesmightbejoinedtogether.Withinthesameorganization,ITdevelopers useVMwareStudiotopackagevirtualappliancesfordeliverytodatacentercustomers.Administratorscontrol operationalpoliciesandservicelevelsafterdeploymentandconfiguration.

14

VMware, Inc.

Chapter 1 Introduction to VMware Studio

Key Features
VMwareStudiohasinterestingcapabilitiesforISVsbuildingsingleormultipleVMappliancesandfor developerswhoplantocreateastandardizeddevelopmentenvironmentbypackagingtherightversionof applicationstackcomponentsandtoolsintoavirtualmachineorvApp.

Buildvirtualappliances. Ifyouhaveanexistingapplicationoryouarebuildinganewapplication,VMwareStudiocanhelpyou virtualizeit.FollowingthebestpracticesandguidelinessetbyVMware,youcancreateproductionready virtualappliancestoreachnewmarketsandreducethescopeofhardwareplatformtesting.

BuildvApps. Withmultitierapplications,packagingthemasseparatevirtualmachinesislessthanconvenient. VMwareStudioenablescreationofavAppcontainingoneormorevirtualmachines.VMwareStudio allowsyoutodefinethestartupandshutdownorder,therebyenablingoneclickdeploymentand poweronofthesevirtualmachines.Youcandefineresourcelimitsandpropertiesthatarevisibletoall thevirtualmachinescontainedinavApp.Forexample,avirtualmachinecontainingtheapplication servermustbeawareoftheIPaddressofavirtualmachinecontainingthedatabaseserver.

Extendtheinguestmanagementframework. VMwareStudio1.0embeddedaninguestmanagementframeworkintoLinuxbasedVMs,andprovided anetworkproxyservice,andanupdateservice,aspartofthisframework.Virtualapplianceauthorscould rebrandandcustomizethelookandfeeloftheWebinterface. InVMwareStudio2.0,themanagementframeworkandWebconsoleinterfacebecameextensible,andin VMwareStudio2.1,piecesbecomeoptional.Youcanaddacustommanagementservicewhenbuildinga virtualappliance,asrequiredbyyourapplication.IfaservicehasanassociatedWebinterface,youcan makethisinterfacevisibleintheWebconsole.VMwareStudioprovidesthisabilitysoappliancevendors canhaveasingleWebbasedconsoleforapplianceandapplicationconfigurationandmanagement.The Webinterfacecancontainalinktotheapplicationthatyoupackageinthevirtualappliance.

Automaticallyresolvepackagedependencies. VMwareStudiobuildsaVMstartingfromarelativelyminimalOSfootprint.VMwareStudiocaninspect applicationpackagesand,iftheyspecifythecorrectsetofOSpackagedependencies,Studioinstallsthose packagesintothevirtualmachinebeingbuilt.AdditionallyiftheseOSpackageshavemoredependencies onotherOSpackages,VMwareStudiomakessurethatallrequiredpackagesgetinstalled,providedthey areavailableintheISOimageoftheOS.

Packagecomplexapplicationsforvirtualenvironments. Complexmultitierapplicationscanspanvirtualmachines,justastheycanspanphysicalmachines. Componentscanrunondifferentoperatingsystems,communicatingoverthenetwork.VMwareStudio helpsyoupackagemultitierapplicationsintoavAppthatrunsefficientlyunderVMwarevSphere.

VMwareStudioPluginforEclipseIDE. EclipseandotherIDEsprovidevarioustoolsrequiredduringapplicationdevelopment,thelastphase beingcompilationofbinaries.Developerstraditionallycopythesebinariesbyhandintotheirtest environment.Intheexampleofmultitierapplicationserveranddatabase,thisinvolvescopyingtwice. Testingisaniterativeprocessduringdevelopment.Toaidtheseprocesses,VMwareStudioisnowalso availableasaplugintothepopularEclipseIDE.TheStudiopluginforEclipseenablesdevelopersto packagetheirapplicationbinariesanddeploythemquicklyintoavirtualmachineoravApp.The VMwareStudioPluginforEclipsehelpsdevelopersautomatethedeploymentprocess,movingforward towardintegrationofdevelopmentandtestenvironments.

ExistingLinuxVMasinput. VMwareStudioprovidestheuniqueabilityofnotrequiringdeveloperstobuildavirtualmachinefrom scratcheachtime.AfteryoubuildavirtualmachinewithVMwareStudio,orobtainaqualifyingLinux virtualmachinefromelsewhere,itcanserveasinputforasubsequentbuild.Thiscansavetimewhenyou arechangingonlythesoftwareversion,oronlytheapplicationmix,ofavirtualmachine.

VMware, Inc.

15

Developers Guide to Building vApps and Virtual Appliances

SupportforawiderangeofVMwareprovisioningengines. VMwareStudio1.0requiredVMwareServer1.0.xtobeinstalledforbuildingvirtualmachines.VMware Studio2.0andlatercanusemanyotherVMwareplatformproductstogenerateautomatedbuildsof virtualmachinesandvirtualappliances.SupportedplatformproductsincludeVMwareServer,VMware Workstation,ESX/ESXihosts,VMwareInfrastructure,andVMwarevSphere.

Architecture of VMware Studio


AsshowninFigure 12,VMwareStudiooffersachoiceofinterfacesforthedeveloper,includingWebbrowser, Eclipseplugin,andcommandlineinterface. Figure 1-2. VAMI Components

TheVMwareStudioWebconsoleisabrowserbasedinterfacethatsimplifiesthecreationandbuildingof virtualappliances.VMwarerecommendsthatyoustartwiththisinterface.VMwareStudioalsoincludesa buildserviceandVAMI,thevirtualappliancemanagementinfrastructure. AnEclipsepluginisprovidedsoyoucanusethesameEclipseintegrateddevelopmentenvironment(IDE)for developingyourapplicationasforpackagingitinavirtualmachine.Acommandlineinterfaceassistsyou withautomation.Forexample,youcanscheduleperiodicbuildsusingtheCLIratherthantheWebconsole.

Virtual Appliance Management Infrastructure (VAMI)


VAMIistheruntimemanagementcomponentthatVMwareStudioinstallsinaLinuxbasedvirtualappliance. VAMIisbasedonthecommoninformationmodel(CIM)withSFCBbeingtheCIMserverandlighttpdbeing theWebserver.VMwareStudio2.1offerstheseVAMIcomponents,alloptional:

WelcomescreenandthevirtualmachineconsoleTodisplaywelcomemessages,configurenetworking, setthetimezone,andlogin(theCLIscreeninTable 12showsaloginsession). FirstbootEULApromptonthevirtualmachinesconsoleRequestsacceptanceoftheenduserlicense agreement(EULA). ManagementservicesincludingCIMandVAMISeeVMwareStudioVAMIServiceonpage 55. ManagementWebconsoleWebconsoleinterfacetoVAMIservices(asinBrowserscreenofTable 12). AppliancebootscriptsTobeexecutedduringfirstorsubsequentbootsofthevirtualmachine. VMwareToolsfortheOSVMwareToolsimproveoperationsoftheguestoperatingsystemrunningin avirtualmachine.FormoreinformationseeVMwareToolsInstalledinaGeneratedVMonpage 47.
VMware, Inc.

16

Chapter 1 Introduction to VMware Studio

Youcancustomizeavirtualappliancebyaddingtabstotheuserinterface.SeeVMwareStudioVAMI Serviceonpage 55fordetailsaboutcustomservicetabsinaLinuxvirtualappliance. YoucanalsobuildavanillavirtualmachinecontainingnoVMwareStudioruntimecomponentsatall,ora virtualmachinewithsomecombinationofselectedcomponents.SeeCreatingaVanillaVMonpage 58.

Build System
TocreateaVMoravApp,youformulateabuildprofileusingtheVMwareStudioWebconsoleorEclipse interface.ThebuildprofilespecifiestheISOimageofaLinuxorWindowsoperatingsystemandthesoftware applicationstorunonthatoperatingsystem.ForaLinuxbasedVM,thebuildprofilealsospecifiesinguest services,inotherwordsVAMI.TheleftsideofFigure 13showsinputstothebuildsystem. Figure 1-3. VMware Studio Architecture

BeforeyoubuildaVMorvApp,VMwareStudiovalidatesthebuildprofile.ToprovisionaVM,thebuild systemusesaVMwareproductplatformtocreateavirtualmachinefromtheoperatingsystemISOandthe applicationsetyouspecify.AsuccessfulVMbuildisexportedtoanetworkaccessiblelocationontheVMware Studioappliance.ThisVMcontainstheOSandapplicationpackagesasdefinedinbuildprofile.TheVMalso hasbootscriptsconfigured,theinguestmanagementframeworkembedded,andiscustomizedaccordingto specificationsofyourbuildprofile. OnVMwareproductplatformsthatsupportthevSphereAPI(formerlytheVIMAPI),thebuildsystemuses theovftooltocreateandtransporttheVM.OnVMwareproductplatformsthatdonotsupportthevSphere API,thebuildsystemusestheVIXAPItocreateandtransporttheVM. TocreateavApp,thebuildsystemtakesasetofVMbuildprofilesorsuccessfullybuiltVMs,andpackages themtogetherwithanOVFdescriptor.AsthedeveloperofavApp,youcanspecifystartorderandresource allocationfortheconstituentVMsandapplications,butmanyaspectsofthevAppremainflexibleuntilthe administratordecidesatdeploymenttime,includingwherevariouspartsofthevApprunandhowtheir networkconnectionsaremade.

VMware Studio Plugin for Eclipse


VMwareStudioprovidesanoptionalpluginforEclipsethatcanbeusedwiththeEclipseIDE.Theplugin servesasabridgebetweentheEclipseIDEandVMwareStudiotocreateVMsandvAppsthatincludesoftware binariesthatyoucompileintheEclipseenvironment.TogetstartedusingtheEclipseinterface,seeChapter 8, UsingtheVMwareStudioPluginforEclipse,onpage 69.

VMware, Inc.

17

Developers Guide to Building vApps and Virtual Appliances

Integration with VMware vCenter Update Manager


VMwarevCenterUpdateManagerintegrateswithVMwareStudiosupdateservicetoenablecentralized managementofvirtualapplianceupdates.UpdateManager3.5andlaterprovidedefaultvirtualappliance upgradebaselinestoscanandupgradeavirtualappliancetothelatestreleasedorcriticalupdateversion. UpdateManageralsoletsyoucreatevirtualapplianceupgradebaselines.Similarstatementsaretrueforthe updatingofvApps.IntheUpdateManager4.0documentation,vAppsaretreatedascontainerobjectsof virtualmachinesorvirtualappliances. ForinformationaboutUpdateManager4.0,seehttp://www.vmware.com/support/pubs/vum_pubs.html.

Roadmap of This Manual


TodeployandconfigureVMwareStudio,readChapter 2,DeployingandUsingVMwareStudio,onpage 19. Togetanoverviewoftheinputstoandresultsofthebuildsystemandthebuildprocessingeneral,read Chapter 3,BuildingVMsandvAppswithVMwareStudio,onpage 27.

Linux and Eclipse Developers


LinuxdeveloperscancontinuewithChapter 4,CreatingaLinuxBasedVM,onpage 33.TocreateLinux packagesforinclusioninthisLinuxbasedVM,seeChapter 5,PackagingaLinuxApplication,onpage 49. DeveloperswhowanttocreatecustommanagementservicesforinclusionintheapplianceWebconsoleofthe LinuxbasedVMcanreadChapter 6,AddingaLinuxManagementService,onpage 55. DevelopersfamiliarwiththeEclipseIDEcanusetheVMwareStudioPluginforEclipsetoeasilypackage applicationsintheformofvirtualappliances.Development,testing,andpackagingcanbedonewiththe EclipseIDE.Tolearnmore,seeChapter 8,UsingtheVMwareStudioPluginforEclipse,onpage 69.

Windows Developers
WindowsdeveloperscancontinueinsteadwithChapter 9,CreatingaWindowsBasedVM,onpage 75. To createWindowsapplicationpackagesforinclusioninthisWindowsbasedVM,seeChapter 10,Packaging aWindowsApplication,onpage 83.

Developers Planning to Build vApps


DevelopersplanningtobuildmultipleVMvAppsshouldinadditionreadChapter 11,CreatingavAppfrom VMBuilds,onpage 89.

Automating Builds from the Command Line


DevelopersandISVswantingtogeneratenightlybuildsofvirtualmachines,vApps,andvirtualappliances withtheirlatestapplicationsoftwarebinariesshouldreadChapter 13,BuildingfromtheCommandLine, onpage 97.

ISVs Shipping Virtual Appliances


ISVsplanningtobuildvirtualappliancesshouldread,inadditiontootherrelevantchapters,Chapter 12, GuidelinesforCreatingVirtualAppliances,onpage 95.Whenshippingvirtualappliances,ISVsmightplan onestablishinganupdaterepositorytoremotelypublishpatchesforvirtualappliancesdeployedincustomer environments.Tocreatetheupdaterepositoryandlearndetailsabouttheupdateprocess,readChapter 7, ManagingtheLinuxUpdateRepository,onpage 61.

18

VMware, Inc.

Deploying and Using VMware Studio

ThischapterdescribeshowtodeployandconfigureVMwareStudio,andcontainsthefollowingtopics:

Prerequisitesonpage 19 DeployingVMwareStudioonpage 20 ModifyingtheNetworkandTimeZoneSettingsonpage 22 UsingVMwareStudioWebConsoleonpage 24

Prerequisites
TorunVMwareStudioandprovisionvirtualappliances,thefollowingarerequired:

YoucandownloadtheVMwareStudiosoftwarepackagefromtheVMwareWebsite,inyourchoiceof formats:OVF0.9,OVF1.0,OVA,orZIP.ItisbesttouseZIPforhostedproductslikeVMwareServerand Workstation6.5and7.0.Optionally,ifyouareusingEclipse,youcandownloadtheVMwareStudio PluginforEclipse.Seehttp://www.vmware.com/support/developer/studioforthedownloadlocation. VMwareStudiosupportsoneofthesevirtualizationproductplatformsforbuilding(provisioning)VMs. TheprovisioningplatformthatyouusetocreateaVMmustbecapableofrunningthefinishedVM.


VMwareESX/ESXi4.0or4.1 VMwareESX/ESXi3.5 ForESXi4.xandESXi3.5orlater,anevaluationorpaidlicenseisrequired.ThefreeESXilicensedoes notprovidethecapabilitiesthatStudioneedsforprovisioning.

vCenterServer4.0or4.1,whichmanagesprovisioningonESX/ESXihosts. VMwareWorkstation6.5.2,7.0.1,or7.1 VMwareServer2.0(deprecated) VMwareServer1.0.x(deprecated)

PrerequisitesifyouareprovisioningwithVMwareWorkstation:

AnSSHdaemon(SSHD)mustbeenabledonthehostofVMwareWorkstation.IfWorkstationis hostedonaWindowssystem,seeInstallingSSHonWindowsonpage 115. IfyourVMwareWorkstationisrunningonaWindowshost,starttheSSHDservice(ontheWindows host)withtheoptionAllowservicetointeractwithdesktop. Ports7and22mustbeopen.Port7isusedprimarilytovalidatetheupdaterepositoryserver. TheWorkstationuserinterfacemustberunning,andyoumustdesignatetheuserwhoiscurrently loggedintotheWorkstationhostastheprovisioninguserforVMwareStudio.

VMware, Inc.

19

Developers Guide to Building vApps and Virtual Appliances

PrerequisitesifyouareprovisioningwithVMwareServer1.0.x:

AnSSHdaemon(SSHD)mustbeenabledonthehostofVMwareServer.IftheVMwareServeris hostedonaWindowssystem,seeInstallingSSHonWindowsonpage 115. Ports7and22mustbeopen.Port7isusedprimarilytovalidatetheupdaterepositoryserver.

Approximately32GBofavailablestoragespacewhereyoudeployVMwareStudio. ThefollowingportsontheVMwareStudioapplianceareusedtoaccesstheWebconsoleandbuildVMs:

22sshtcp 80httptcp 5480httpstcp 5488http5489httpstcp(forinternalcommunicationbetweenlighttpdandSFCB)

VMwareStudiorequiresthefollowingportstobeopenonthehostrunningtheprovisioningproduct:

7echotcp,22sshtcp(forVMwareServer1.0.xandVMwareWorkstation).OnmostLinuxhostsport 22isopenbydefault,butport7isnot,butyoucanedit/etc/sysconfig/iptablestoopenport7. OnWindowsyoucanaddafirewallexceptionforechoonport7andsshonport22. 443httpstcp(forVMwareESX/ESXiandVirtualCenterorvCenterServer) 902vixtcp 8333httpstcp(forVMwareServer2.0)

Supportedbrowsers:

InternetExplorer7or8 MozillaFirefox3.x

Deploying VMware Studio


HowyoudeployVMwareStudiodependsontheprovisioningplatformyouuse.

Deployment Options
Forsimplicityofconfiguration,youcandeployVMwareStudioonthesamevirtualizationproductplatform thatyouplantouseforbuildingVMs.YoucanalsodeployVMwareStudioonadifferentvirtualization platformthantheoneusedforbuildingVMs.Forexample,ifyouarerunningVMwareStudioon32bit hardware,butyouarebuildinga64bitvirtualmachine,youcansettheprovisioningplatformtoaremote 64bitsystem.Asanotherexample,theremotesystemmightbelightlyloadedandcapableoffasterbuilds. Figure 21illustratesthesimplestsetupofVMwareStudio.Thevirtualizationplatformcouldbealmostany recentVMwareplatformproduct.Fordesktopproducts,onerequirementisanSSHserverontheplatforms hosttoallowSSHandSCPoperationsbyVMwareStudio.Forserverproducts,onerequirementisauserwith adequatepermissionsforprovisioning.SeeVMwarevSphereUserPrivilegesforProvisioningonpage 29. Figure 2-1. Single Host Setup of VMware Studio

20

VMware, Inc.

Chapter 2 Deploying and Using VMware Studio

Figure 22illustratesadualhostsetupofVMwareStudio.ThevirtualizationplatformsforhostsAandBcould beanyofthosepermittedforasinglehost,andthevirtualizationplatformdoesnothavetobethesame. The requirementsforprovisioningthroughhostBarethesameasforasinglehost,exceptbothhostsmustbe networkconnectedsoVMwareStudioonhostAcanreadilyaccessthevirtualizationplatformonhostB. Figure 2-2. Dual Host Setup of VMware Studio

Supported Distribution Formats


Selectingaformatdependsonthevirtualizationproductthatyouplantouse.VMwareStudioisavailablein thefollowingformats:

OVFAdescriptorthatreferencesVMDKformatvirtualdiskfiles OVAArchivecontainingOVF1.0descriptorandVMDKfiles ZIPArchivecontainingVMXandVMDKfiles

TodeployVMwareStudioon:

VMwarevSphere4UsethevSphereClienttoimportVMware_Studio-<version>_OVF10.ova,or VMware_Studio-<version>_OVF10.ovfanditsrelatedVMware_Studio-<version>.vmdkfile. VMwareInfrastructure3UsetheVIClienttoimportVMware_Studio-<version>_OVF09.ovfandits relatedVMware_Studio-<version>.vmdkfile. VMwareWorkstationUnzipVMware_Studio-<version>.zipandthenuseVMwareWorkstationto opentheextractedVMXfile. VMwareServer1.0.6or2.0(Deprecated.)UnzipVMware_Studio-<version>.zipandthenuse VMwareServertoopentheextractedVMXfile.

BothOVF0.9andOVF1.0oftheVMwareStudioappliancereferencethesameVMDKfile.

Deployment Procedure
TheprocedurefordeployingVMwareStudioisdifferentfortheOVForOVApackagethanfortheZIPfile. To deploy VMware Studio from OVF or OVA 1 TheOVForOVAformatofVMwareStudiocanbedeployeddirectlyfromtheVMwaredownloadWeb server.AlternativelytheVMwareStudioOVA,orOVFanditsassociatedVMDKfile,canbedownloaded toalocalWebserverorWindowsmachinewheretheVMwarevSphereorVMwareInfrastructureClient canaccessitfordeployingtheappliance.IfyoudecidetodownloadtheOVFformatofVMwareStudio appliancetoalocalmachine,placetheOVFanditsassociatedVMDKfileinthesamedirectory. ForVMwarevSphere4,runtheVMwarevSphereClientandselectmenuFile>DeployOVFTemplate. ForVMwareInfrastructure,runtheVMwareInfrastructureClientandselect File > Virtual Appliance > Import.Ineithercase,awizardguidesyouthroughdeployment. PowerontheVMwareStudiovirtualmachine.

VMware, Inc.

21

Developers Guide to Building vApps and Virtual Appliances

Asthevirtualmachinestarts,theVMwareStudioenduserlicenseagreement(EULA)appearsonthe virtualmachineconsole.Pressthespacebartocontinuedisplayingmorepages.Attheend,typeyesand pressEntertoaccepttheEULA. Whenitasksyoutoenteranewpasswordfortherootaccount,typeapassword.Retypethepasswordat thesecondprompt.VMwareStudiorequirestheroot(superuser)accounttobuildvirtualmachines. TheVMwareStudiowelcomescreenappears.BydefaultVMwareStudiotriestoacquireanIPaddress fromaDHCPserver.IfyoupreferastaticIPaddress,seeConfiguringStaticIPAddressesonpage 23.

WritedowntheIPaddressthatappearsthere,InterfacestoVMwareStudio:[Web]http://<IP.address>, becauseyouneedthisURLtoaccesstheVMwareStudioWebconsole.ThegivenhttpURLredirectsto httpsport5480. Youmightwanttosetanetworkproxy,changethetimezone,orconfigureastaticIPaddress.Fordetails, seeModifyingtheNetworkandTimeZoneSettingsonpage 22.

To deploy VMware Studio from ZIP 1 DownloadVMware_Studio-<version>.ziptothehostofVMwareServerorVMwareWorkstation, extracttheZIPfiletoadirectory,forexample /var/lib/vmware/VirtualMachines/VMware_Studio-2.0.0onaLinuxhostor C:\MyVirtualMachines\VMware_Studio-2.0.0onaWindowshost. InVMwareWorkstationortheVMwareServerConsoleapplication,selectmenuFile>Open. ClickBrowse,navigatetothedirectorywhereyouextractedtheVMwareStudiovirtualmachine,select VMware_Studio-<version>.vmxandclickOpen. PowerontheVMwareStudiovirtualmachine. ContinuewithStep 4oftheOVForOVAdeployment.

2 3 4 5

YouarenowreadytobegindevelopingwithVMwareStudio.

Security of Self-Signed SSL Certificate


TheVMwareStudioapplianceisdeliveredwithaselfsignedSSLcertificate.Ifyouaredevelopingonatrusted network,youcanchooseacceptthecertificatewithoutverification. ToverifytheauthenticityofthenetworkconnectionsyouaremakingwhendevelopingwithVMwareStudio, seeCheckingVeracityofanSSLCertificateorSSHKeyonpage 116.

Modifying the Network and Time Zone Settings


AfterdeployingtheVMwareStudioapplianceyoushouldconfigureseveraloptions.YoucanuseaVMware consolewindowforthis,asdescribedinthefollowingsections.ToreachtheVMwareconsolewindow,usethe vSphereClient(formerlytheVIClient),VMwareWorkstation,ortheVMwareServerConsoleapplication. TheVMwareStudiowelcomescreenonthecommandconsoleshowsthefollowingmenuselectionsatthe bottomofpage:
Login Configure Network Set Timezone (Current: UTC)

Choosing Between DHCP and Static Network Addresses


Whenitstarts,theVMwareStudioapplianceattemptstodiscoveraDHCPserveronthenetworktorequesta temporaryIPaddress.DHCPallowstheappliancetobeginrunningassoonaspossible.However,becausethe DHCPaddressistemporary,itmightbedifferenteachtimethevirtualappliancepowerson. VMwarerecommendsthatyourVMwareStudioappliancebeconfiguredtoastaticaddressthatremainsthe sameafterrestart.StaticIPallowsallusersoftheappliancetobecertainofitsnetworkaddress(andassociated hostname)sotheycanconnecttoitpredictably.
22 VMware, Inc.

Chapter 2 Deploying and Using VMware Studio

Configuring Static IP Addresses


Bydefault,VMwareStudioretrievesitsnetworkaddressfromaDHCPserver.Toconfigureastaticnetwork addressforthisvirtualappliance,dothefollowingsteps. To configure a static IP address 1 2 3 Fromthevirtualappliancewelcomescreen,selectConfigureNetworkandpressEnter. EnternototheUseaDHCPserverinsteadofastaticIPaddressprompt. EntertheaddressesforthefollowingandpressEnteraftereachentry:

IPAddress Netmask Gateway DNSServer1 DNSServer2

Configuring the Network Proxy


Bydefault,VMwareStudioassumesthatithasadirectconnectiontotheInternet.IfHTTPandotherprotocols gothroughanetworkproxy,dothefollowingsteps. To configure a network proxy 1 EnteryesornoattheIsaproxyservernecessarytoreachtheInternet?prompt. Ifyouansweredno,pressEnter. Ifyouansweredyes,pressEnter.TypetheIPaddressandportnumberoftheproxyserver.PressEnter. Areviewofyourentriesappears. 2 TypeyesandpressEnterifthevaluesarecorrect.

Ifthevaluesareincorrect,typenoandpressEntertodotheprocedureagain.

Configuring DHCP
IfyouconfiguredVMwareStudiotouseastaticIPaddress,butyoumustrestoretheconfigurationtoretrieve itsnetworkaddressfromaDHCPserver,dothefollowingsteps. To configure use of DHCP service 1 2 3 Fromthevirtualappliancewelcomescreen,selectConfigureNetworkandpressEnter. EnteryestotheUseaDHCPserverinsteadofastaticIPaddressprompt. EnteryesornoattheIsaproxyservernecessarytoreachtheInternet?prompt. Ifyouansweredno,pressEnter. Ifyouansweredyes,pressEnter.TypetheIPaddressandportnumberoftheproxyserver.PressEnter. Areviewofyourentriesappears. 4 TypeyesandpressEnterifthevaluesarecorrect.

Ifthevaluesareincorrect,typenoandpressEntertodotheprocedureagain.

VMware, Inc.

23

Developers Guide to Building vApps and Virtual Appliances

Setting the Time Zone


TochangethetimezoneforVMwareStudioappliance,dothefollowingsteps. To set the time zone 1 2 3 Fromthevirtualappliancewelcomescreen,selectSetTimezoneandpressEnter. IntheGeographicareascreen,selectyourcontinentorregionandpressEnter. IntheTimezonescreen,selectacityorareainyourtimezoneandpressEnter.

Thetimezoneissetandthewelcomescreenappears.

Using VMware Studio Web Console


Thissectionoutlinesprocedurestochangenetworksettings,shutdown,andreboottheVMwareStudio appliancefromtheWebconsole.TheseproceduresalsoworkgenerallyforLinuxbasedvirtualmachinesthat VMwareStudiocreated,becauseVAMIprovidesthetabsdescribedhere.

Accessing the VMware Studio Web Console


TheWebconsoleisthebestwaytobeginusingVMwareStudio. To access the VMware Studio Web console 1 2 InthesectionDeployingVMwareStudioonpage 20,theURLtoaccesstheVMwareStudioWebconsole isdisplayedinStep 6oftheprocess.WithoneofthesupportedWebbrowsers,gotothatlocation. TyperootastheUsername.TypethepasswordthatyouspecifiedinStep 5oftheprocessDeploying VMwareStudioonpage 20.PressEnterorclickLogin.

Shutting Down the VMware Studio Appliance


ClicktheSystemtabintheWebconsole. OntheInformationpageyouseethevirtualappliancevendor,appliancename,applianceversion,computer hostname,operatingsystemname,operatingsystemversion,andOVFenvironment(ifany). TheRebootandShutdownbuttonsareundertheActionsheadingontherightsideofthewindow.

Tostopthevirtualappliance,clicktheShutdownbutton. Torestartthevirtualappliance,clicktheRebootbutton.

Setting Time Zone in the Web Console


ClicktheSystemtabintheWebconsole. OntheTimeZonepageisadropdownmenutoselectamongtimezonesoftheworld,ifyoudidnotalready dosoontheServerConsole.ClicktheSaveSettingsbuttontomakeachange.Ifyoudonotexplicitlysetthe timezone,thedefaultisUTC,CoordinatedUniversalTime.

Network Configuration
ClicktheNetworktabintheWebconsole.Thistabofferspagesforthefollowingoperations:

StatusShowsnetworkstatusinformation,suchastheinterfacename,whetherDHCPwasused,the IP address,netmask,gatewayIPaddress,andDNSservers.YoucanclicktheRefreshbuttonunderthe Actionsheading(ontherightside)toobtainthecurrentinformation. AddressAllowsyoutospecifystaticIPinformationorretrievesettingsfromaDHCPserver.ClickSave SettingstoacceptchangesthatyoumaketotheIPsettings.ClickCancelChangestodiscardchanges.You canconfigureDHCPfromthisinterface,offromtheServerConsoleinConfiguringDHCPonpage 23.

24

VMware, Inc.

Chapter 2 Deploying and Using VMware Studio

IfyousetastaticIPaddressanddisabledDHCP,youmustentervaluesinallthefollowingfields:

IPAddressIPaddressoftheStudiovirtualappliance. NetmaskNetworkmaskforthevirtualappliance. GatewayIPaddressofthegateway(networkrouter). PreferredDNSServerIPaddressoftheprimaryDNSserver. AlternateDNSServerIPaddressofthesecondaryDNSserver.

ProxyAllowsyoutospecifyaproxyserverandportforaccessingexternalnetworks(forexample,the wideareaInternet).ClickSaveSettingstoacceptchangesthatyoumaketotheproxysettings.Click CancelChangestodiscardchanges.Youcanconfigureanetworkproxyfromthisinterface,asyoudid usingtheServerConsoleinConfiguringtheNetworkProxyonpage 23.Ifyoucheckthecheckboxnext toUseaProxyServer,youmustentervaluesinthefollowingfields:


ProxyServerHostnameorIPaddressfortheproxyserver. ProxyPortProxyservercommunicationsport. ProxyUsernameAvalidusername,iftheproxyserverrequiresauthentication. ProxyPasswordThevalidpassword,iftheproxyserverrequiresauthentication.

VMware, Inc.

25

Developers Guide to Building vApps and Virtual Appliances

26

VMware, Inc.

Building VMs and vApps with VMware Studio

ThischapterprovidesanoverviewofbuildingVMsandvAppswithVMwareStudio,andcontainsthe followingtopics:

OutlineofVMBuildProcedureonpage 27 OutlineofvAppBuildProcedureonpage 27 AcquiringtheOperatingSystemISOonpage 28 OutputFormatsonpage 28 SupportedProductstoRunGeneratedVMsandvAppsonpage 28

Outline of VM Build Procedure


YoubeginbuildingavirtualmachinebycreatingabuildprofilethatdefinesacontainerforthebaseOS configurationandtheincludedsoftwarepackages. To build a VM with VMware Studio 1 Defineabuildprofilewiththefeaturesyouwant.YouselectanoperatingsystemfortheVM,virtual hardware,andapplicationpackagestoinclude.ForLinuxbasedVMs,youcanalsoconfigurethe welcomescreen,firstbootscript,andsubsequentbootscripts. BuildtheVM.VMwareStudioreliesonaVMwarevirtualizationproductplatformtoassemblethe necessaryfilestobuild(provision)yourvirtualmachine. DeployyourVMtotheappropriatesystemsandtest.

2 3

AfteraLinuxbasedVMisdeployed,userscanmanageitfromthemanagementWebconsole,installedinthe virtualapplianceaspartofVAMI,orfromVMwarevCenter.Userscanalsocheckforandinstallupdateswith themanagementWebconsole,ifthedeveloperenabledupdateserviceandpopulatestheupdaterepository. AdministratorscancentrallymanagemultiplevirtualapplianceswithVMwarevCenter.

Outline of vApp Build Procedure


YoubeginbuildingavAppbycreatingabuildprofilethatdefinesacontaineranditsconstituentVMs. To build a vApp with VMware Studio 1 DefineabuildprofilecontainingoneormoreVMs.YoucanmixbothLinuxbasedandWindowsbased VMsinavApp.YoucanspecifythepoweronorderoftheVMs,theCPUandmemoryresourcesand reservationsallocatedforeach,IPassignmentpolicy,OVFproperties,anddistributionformat. BuildthevApp.ItisrequiredfortheVMsinavApptobepackagedinOVF1.0orOVAoutputformat. DeployyourvApptotheappropriatesupportedsystemsandtest.

2 3

VMware, Inc.

27

Developers Guide to Building vApps and Virtual Appliances

Acquiring the Operating System ISO


VMwarerecommendsthatyoudownloadtheOSISOimagetothelocaldiskoftheVMwareStudioappliance, in/opt/vmware/www/ISV/ISO.Forexample,youcandownloadtheUbuntu8.04.4releasebyrunningthe followingcommandsontheVMwareconsoleorsshcommandline:
cd /opt/vmware/www/ISV/ISO wget http://cdimage.ubuntu.com/releases/8.04.4/release/ubuntu-8.04.4-dvd-i386.iso

IfNFSisavailableonyourlocalareanetwork,agoodalternativeistoremotemountanetworkpartitionwhere youhavedownloadedacollectionofISOimagessuitableforbuildingVMs,asinthefollowingcommandrun fromtheVMwareStudioappliancecommandline:


mount nfs-server.example.com:/vol0/images/iso /opt/vmware/www/ISV/ISO

InVMwareStudio2.1,youcanstartwithanyqualifyingLinuxOSdistribution,orwithanexistingVM.See ISOofQualifyingCustomLinuxOSonpage 34,orChapter 14,BuildFromanExistingVM,onpage 103.

Requirements for Building 64-Bit VMs


Theresourcerequirementsofaguestoperatingsystemcannotexceedthehardwarecapacityofthehost system.Ifyoucreateavirtualmachinefroma64bitoperatingsystemimage,itcannotrunon32bithardware. SeetheKnowledgeBasearticle1003945HardwareandFirmwareRequirementsfor64BitGuestOperatingSystems athttp://kb.vmware.comfordetailedinformationabout64bitvirtualmachines.

Output Formats
Whenyouarefinishedtestingandpackaging,youcanmaketheVMandvAppbuildsaccessibletocustomers. YoucanprovideaVMorvAppinoneormoredistributionformats:

OVF1.0filescandescribeaVManddeployonESX/ESXi4.x,ortheycandescribeavAppanddeployonly throughvCenterServer4andlater. OVAfiles,OVF1.0archivesforeasierdistribution,deployinthesamemannerasabove. OVF0.9filesdeployonVMwareWorkstationforWindows,ESX/ESXi3.5,andthroughVirtualCenter2.5 andlater. Afterextraction,ZIPfilescreateVMXandVMDKfilesthatdeployonVMwareServer2.0or1.0.x, VMwareWorkstation,andVMwarePlayer.

Supported Products to Run Generated VMs and vApps


VMsandvAppsgeneratedbyVMwareStudiocanrunonfollowingVMwareproductplatforms: VMware vCenter Server VMwarevCenterServer4andlatersupportbothOVF0.9and1.0,VMandvApp, withvirtualhardwareversions4or7. VMware VirtualCenter 2.5 VMwareVirtualCenter2.5supportsOVF0.9,VMonly,withvirtualhardware version4. VMware ESX/ESXi 4.x VMwareESX/ESXi4.xhostssupportbothOVF0.9and1.0,VMonly(vAppswhen deployedthroughvCenterServer)withvirtualhardwareversions4or7. VMware ESX/ESXi 3.5 VMwareESX/ESXi3.5supportsOVF0.9,VMonly(vAppswhendeployedthrough vCenterServer)withvirtualhardwareversion4. VMware Server 2.0 VMwareServer2.0supportsvirtualhardwareversions4and7,VMonly. VMware Server 1.0.x Deprecated.VMwareServer1.0.xsupportsvirtualhardwareversion4,VMonly. VMware Workstation VMwareWorkstationforWindowssupportsOVF0.9,VMonly,withvirtualhardware versions4or7.WithWorkstation7.1youcanseparatelyinvokethebundledovftooltoconvertanOVF1.0 fileintothehostedVMXformatforWorkstationtoopen. VMware Player 2.5 and 3.x VMwarePlayer2.5and3.xsupportaVMwithvirtualhardwareversions4and7.
28 VMware, Inc.

Chapter 3 Building VMs and vApps with VMware Studio

VMware vSphere User Privileges for Provisioning


ForprovisioningonESX/ESXihostsorthroughvCenterServer,youcouldcreateaprovisioninguserwith fewerprivilegesthantherootloginortheAdministratorrole.YoumusthaveAdministratorpermissionto completethefollowingprocedures. To create a less-privileged user role in vCenter Server 1 2 3 StartthevSphereClientandconnecttothevCenterServer. ClickAdministration>Role>Add. Giveaname(forexamplevmstudio)tothenewroleandassigntoittherequiredprivilegeslistedbelow.

To assign a provisioning role to a user in vCenter Server 1 2 3 4 CreateanewuseronthesystemwherethevCenterServerisrunning. StartthevSphereClientandconnecttothevCenterServer. RightclickthevCenterobject(intheHostsandClusterstreeview)andselectAddPermission. IntheAssignPermissionsdialog,addthenewuseryoucreatedinStep 1totheUsersandGroupslist,and selectthenewrolecreated(forexamplevmstudio)asitsAssignedRole.

To create a less-privileged user role in ESX/ESXi 1 2 3 StartthevSphereClientandconnecttotheESX/ESXihost. ClickHome>Roles>AddRole. Giveaname(forexamplevmstudio)tothenewroleandassigntoittherequiredprivilegeslistedbelow.

To assign a provisioning role to a user in ESX/ESXi 1 2 3 CreateanewuserontheESX/ESXihost.YoucandothiswiththevSphereClient.Connecttothehost, navigatetotheUser&Groupstab,rightclickAdd,andtypetherequiredinformationintothedialogbox. RightclicktheESX/ESXihostobject(intheInventorytreeview)andselectAddPermission. IntheAssignPermissionsdialog,addthenewuseryoucreatedinStep 1totheUsersandGroupslist,and selectthenewrolecreated(forexamplevmstudio)asitsAssignedRole.

ObviouslythesestepsdonotapplyifyouarecontenttoprovisionwithauserwhohasthevCenterServer Administratorrole,orESX/ESXirootpermission.

ESX/ESXi and vCenter Server User Privileges


HerearetheuserprivilegesnecessaryforVMwareStudiotoprovisionaVMorvApponvCenterServeroron ESX/ESXi4.0(vSphere4):

Datastore

Allocatespace Browsedatastore Lowlevelfileoperations

HostLocaloperations

Createvirtualappliance Deletevirtualappliance Reconfigurevirtualappliance

HostprofileView NetworkAssignnetwork

VMware, Inc.

29

Developers Guide to Building vApps and Virtual Appliances

Resource

AssignvApptoresourcepool Assignvirtualmachinetoresourcepool Migrate QueryVMotion

vAppFullpermissions VirtualmachineFullpermissions

Setthesepermissionsonthetargetprovisioningplatform,notontheVMwareStudiohost.Forexample,if VMwareStudiorunsonESX/ESXi3.5butprovisionsonESX/ESXi4.0,setuserprivilegesforvSphere4onthe provisioningESX/ESXi4.0host.

ESX/ESXi and VirtualCenter User Privileges


HerearetheuserprivilegesnecessaryforVMwareStudiotoprovisionaVMonVirtualCenterserveroron ESX/ESXi3.5(VMwareInfrastructure3):

Datastore

Browsedatastore Filemanagement

HostLocaloperations

Createvirtualmachine Deletevirtualmachine

Resource

Assignvirtualmachinetoresourcepool Migrate QueryVMotion

VirtualmachineFullpermissions

30

VMware, Inc.

Developing a Linux-Based VM

VMware, Inc.

31

Developers Guide to Building vApps and Virtual Appliances

32

VMware, Inc.

Creating a Linux-Based VM

ThischapterdescribeshowtocreateaLinuxbasedvirtualmachineusingtheVMwareStudioWebconsole. EarlysectionsoutlinetheproceduresforcreatingaVM,middlesectionscoverthebuildprofileconfiguration fields,andlatersectionsdocumentadvancedtopics.


Overviewonpage 33 OperatingSystemISOImageonpage 34 ApplicationPackagesonpage 35 CreatingaVMBuildProfileonpage 35 WebConsoleTabReferenceonpage 37 BuildingaVMfromtheBuildProfileonpage 46 TestingtheGeneratedVMonpage 46 ReiteratingtheBuildProcessonpage 47 MigratingBuildProfilesfromStudio1.0or2.0onpage 47 VMwareToolsInstalledinaGeneratedVMonpage 47

Overview
VMwareStudiosupportsthecreationofvirtualmachinescontainingaLinuxbasedoperatingsystem, userprovidedapplications,andtheVirtualApplianceManagementInfrastructure(VAMI)agent.Italso allowscustomizationoftheVAMIWebinterfaceifyouareshippingthevirtualmachineasavirtualappliance andwanttorebrandtheWebconsoleforyourvirtualappliance.

Prerequisites OS and Application


ThischapterassumesthatyouhavedownloadedtheVMwareStudiosoftwareontoasupportedvirtualization productplatform,asdescribedinDeployingVMwareStudioonpage 20.Youalsoneed:

AnISOimagefromthelistofLinuxdistributionsinOperatingSystemISOImageonpage 34. YourapplicationpackagedforthechosenLinuxdistribution,asoutlinedinApplicationPackageson page 35.

Accessing the Web Console


ToaccesstheWebconsolewithyourbrowser,navigatetotheIPaddressoftheVMwareStudioappliance. The accessURLappearsatinstalltime,asdescribedinDeployingVMwareStudioonpage 20.

VMware, Inc.

33

Developers Guide to Building vApps and Virtual Appliances

Operating System ISO Image


Table 41liststheLinuxdistributionsthatVMwareStudiosupports.TheseLinuxdistributionsandversions aresupportedtoensurecompatibilitywheninstallingthemanagementagent. LinuxoperatingsystemimagesarewidelyavailableontheInternet.Whenpossible,Table 41providesURLs tohelpyoufindandacquireISOimages.Linuxreleasesanddownloadlocationschangefrequently,soitisbest touseasearchenginetofindtherequiredISOimage.MD5checksumsareprovidedtohelpensurevalidity. Table 4-1. Linux Operating System ISO Images
Operating System Name Arch ISO Image Name MD5 Checksum

http://cdimage.ubuntu.com/releases/ Ubuntu8.04.4 Ubuntu8.04.3 Ubuntu8.04.1 Ubuntu8.04 Ubuntu7.10 Ubuntu7.04 http://download.novell.com SLES11.0 32bit 64bit SLES10.2 32bit 64bit http://www.redhat.com RHEL5.4 32bit 64bit RHEL5.3 32bit 64bit RHEL5.2 RHEL5.1 http://centos.org CentOS5.4 32bit 64bit CentOS5.3 32bit 64bit CentOS5.2 32bit 64bit CentOS5.0 32bit CentOS5.4i386binDVD.iso CentOS5.4x86_64binDVD.iso CentOS5.3i386binDVD.iso CentOS5.3x86_64binDVD.iso CentOS5.2i386binDVD.iso CentOS5.2x86_64binDVD.iso CentOS5.0i386binDVD.iso 071e18754c2fb066c526672f9aea0515 92cab2977a58ce422130e5c655dc8513 997638cd72a559e38f9fd1955a368231 6d4fd59688ed8644514010316d6a5698 1539bad48e984ae1441052dc074c0995 644f9f63f208ebee36ae5e2cdcc58721 b5633ee6ee3b2e10d92672c74e594d75 32bit 64bit 32bit rhelserver5.4i386dvd.iso rhelserver5.4x86_64dvd.iso rhel5.3serveri386dvd.iso rhel5.3serverx86_64dvd.iso rhel5.2serveri386dvd.iso rhel5.2serverx86_64dvd.iso rhel5.1serveri386dvd.iso 7a12ec6599527e4f3d1790b51eadbfed 04fe3c10202402d7b389528d2bad0210 371c62851611fd32ead440df6f24a296 c5ed6b284410f4d8212cafc78fd7a8c5 b5af5c38856a331f95ac6ad40c085f9c 5390f9f703e083cf1470fb438ea49082 4380325824d389e2c202477c9d5b2855 SLES11DVDi586GMDVD1.iso SLES11DVDx86_64GMDVD1.iso SLES10SP2DVDi386GMDVD1.iso SLES10SP2DVDx86_64GMDVD1.iso 4958d4dde2575666355c8a1c5858bab0 50a2bd45cd12c3808c3ee48208e2586b 2b91efeb8a62e2824302bf9269080252 dab2c4b8fc9939b33535ab2d321f3f2e 32bit 32bit 32bit 32bit 32bit 32bit ubuntu8.04.4serveri386.iso ubuntu8.04.3serveri386.iso ubuntu8.04.1dvdi386.iso ef478e539e991dfa09c3b5b7c589aba6 f97b4abf0a91a6b260a0261a019c0e5e 5fddb647c1945b20055d751576dea8fc deprecated deprecated deprecated

ISO of Qualifying Custom Linux OS


YoucanadddoityourselfguestOSsupportwiththe--newosoptionofstudiocli,andbyeditingtheXSL descriptionsandinstallationscripts.Formoreinformation,seeAddingSupportforaNewOSonpage 99 andAppendix C,EditingXMLBuildProfiles,onpage 119. ThisfeatureallowsyoutobuildanXMLprofileforanyqualifyingcustomLinuxOS,possiblyevenoneswith problems,andespeciallyLinuxdistributionsthatVMwareStudiodoesnotofficiallysupport.

34

VMware, Inc.

Chapter 4 Creating a Linux-Based VM

Footprint Reduction
YoucanreducethesizeofmostoperatingsystemsbyrunningtheVMwareStudiofootprintreductionscripts. SeeOperatingSystemFootprintReductiononpage 54fordetails.

Application Packages
VMwareStudiousesthenativepackagingmechanismforeachsupportedoperatingsystemtoinstalland updatesoftwareinthevirtualmachine.RHEL,CentOS,andSUSEuseRPMpackaging,whereasUbuntuuses DEBpackaging.VMwareStudioincludesthemkpkgcommandlinetoolforcreatingpackagesofeithertype, RPMorDEB.SeeChapter 5,PackagingaLinuxApplication,onpage 49forinformationaboutusingmkpkg. VMwareStudiosupportstheautomaticconversionofcompressedTAR(tar.gz,tgz)filesintoRPMorDEB files.YoucanusetheVMwareStudioPluginforEclipsetopackageyourapplicationinacompressedTARfile. SeeChapter 8,UsingtheVMwareStudioPluginforEclipse,onpage 69formoreinformation. AbuildprofilecontainsalistofApplicationPackageRepositorieswithpackagestobedownloadedfroman HTTPserverandinstalledinthevirtualmachine.YoucanincludeexternalHTTPservers,atsomepenaltyin reliabilityandperformance.Toincludeadditionalpackages,addeithertheURLofadirectorycontainingone ormorepackages(VMwareStudioresolvesinstallationorder),theURLofaRPMorDEBpackage,orthename ofacompressedTARfile. BeforecreatingaVM,makecertainthatyouhavealloftheappropriateoperatingsystemandthirdparty packagesthatyourapplicationrequires.Youcaninstallmultipleapplicationpackages,andyoucancontrol theinstallationordertodefinepriorityincaseofconflictingpackagefiles.Considerthesepointswhenyou assemblepackagesanddeterminedependencies:

VMwareStudioinstallspackagesintheorderyougiveintheApplicationPackageRepositorieslist (see Table 45)whileresolvingandinstallinganydependentpackages. IfyouincludepackagesintheApplicationPackageRepositorieslistthatdependonotherpackages, VMwareStudioresolvesdependenciesbetweenthemandpackagesincludedintheOSISO. IfyourapplicationdependsuponpackagesthatarenotavailableontheOSISO,identifythem beforehand.Dependentpackagesincludesystemsecurityupdatesandthirdpartypackages.Ifyour applicationdependsuponaspecificversionofapackagethatisnotpresentintheISO,obtainitseparately. Forexample,yourapplicationmightdependonthelatestversionofApache,buttheOSdistributionyou selectcontainsanolderversionofApache.Placethelatestversionintheapplicationpackagesdirectory beforestartingthebuildprocess.

BydefaulttheApplicationPackageRepositorieslistcontainsoneURLthatreferstoalocaldirectoryonthe VMwareStudioappliance.ThisURLcontainsthestring[VADK.localIP]torepresenttheIPaddressofthe localVMwareStudioappliance.ThefollowingURLanddirectorypathrefertothesamelocation:


URLoftheapplicationpackagerepositoryhttp://[VADK.localIP]/ISV/appliancePackages LocaldirectoryonVMwareStudioappliance/opt/vmware/www/ISV/appliancePackages

YoucanplaceyourapplicationpackagesinadifferentlocaldirectoryontheVMwareStudioappliance,oron anotherHTTPserver.IfyousupplytheURLofadirectoryorpackageonanotherHTTPserver,itmustbe networkaccessible.CheckthatdirectoryindexingisenabledintheHTTPserver(forexample,Options+Index specifiedintheApacheconfigurationfile)becauseVMwareStudiorequiresdirectoryindexingforfilediscovery. IfyourURLpointstoanHTTPserverdirectory,any.tgzortar.gzfileinthatdirectoryisconsidereda packageandwillbeinstalled.

Creating a VM Build Profile


ThebuildprofilecontainsalltherequiredinformationtoautomatethebuildingofaVM.Thebuildprofile containsinformationaboutthecontentsoftheVM,virtualhardwareconfigurationoftheVM,locationwhere toobtaintheOSISO,andtheVAMImanagementservicestobeincludedintheVM.Thissectionexplainssteps tocreateaVMbuildprofilewiththeWebconsole.Subsequentsectionsprovidereferenceinformationabout theoptionsineachconfigurationtab.

VMware, Inc.

35

Developers Guide to Building vApps and Virtual Appliances

To create a VM build profile 1 ObtaintheOSISOforoneofthesupportedoperatingsystems.SeeOperatingSystemISOImageon page 34forinformationaboutsupporteddistributions. YoucanuseapreviouslybuiltLinuxvirtualmachineasastartingpoint.TheOSISOimagestillmustbe present.SeeBuildingwiththeImportProfileonpage 105. 2 3 IntheVMstaboftheWebconsole,clickCreateProfile. IntheCreateaNewVMProfiledialogbox,specifyanameforyourVMbuildprofile,selectaLinuxprofile fromtheOStemplates,andclickCreateProfile. VMwareStudiosuppliespreconfiguredtemplatesforthesupportedoperatingsystems.Afteryoucreate yourownvirtualmachine,italsobecomesavailableasatemplatetocreatederivedvirtualmachines. 4 TheEditingpageappears,whereyoucreatethebuildprofileofyourVM.TheEditingpageorganizesthe buildprofileintothefollowingtabs:

DescriptionSpecifiesgeneralinformationaboutthevirtualmachineorvirtualappliance,including licenseagreement.SeeDescriptionTabonpage 37fordetails. HardwareSpecifiesvirtualhardwareconfigurationforthevirtualmachine,includingCPU, memory,networkadapters,CD/DVD,andvirtualdisks.SeeHardwareTabonpage 38fordetails. OSSpecifieslocationoftheOSISOimage,rootpassword,additionalusers,andbootscript customization.SeeOSTabonpage 39fordetails. ApplicationSpecifiestheapplicationpackagerepositoryandoperatingsystempackagestoinstall intothevirtualmachine.SeeApplicationTabonpage 40fordetails. ManagementSpecifiesVAMImanagementservicestoincludeinthevirtualmachine,anddetails abouttheoptionalupdateservicerepository.SeeManagementTabonpage 41. OutputSpecifiesthetypeofdistributionformat(OVF,OVA,orZIP)forthevirtualmachine. See OutputTabonpage 43fordetails. BuildSettingsSpecifiessetupofthebuildenvironment,suchasconnectioninformationtooneof manypossibleprovisioningplatforms.SeeBuildSettingsTabonpage 44fordetails.

UsetheNextandBackbuttonstonavigatebetweenthetabsuntilyouhavespecifiedallrequiredfields. Ifyoutrytonavigatetothenextpagewithoutspecifyingarequiredfield,anerrormessageappearsinred nexttothefieldshowingwhereyoumustfixaproblembeforecontinuing. Eachfieldinthebuildprofilehasahelpicon(iinacircle)ontherightside.Clickingthehelpicontoggles betweendisplayofcontextualhelpandalistoffrequentlyaskedquestions(FAQ). Attemptingtonavigateofftheeditingpageproducesaconfirmationdialogboxaskingifyouwantto discardyouredits. 5 Afteryoucompleteeditingabuildprofile,youcantakeoneofthefollowingactionsbyclickingabutton ontherightsideofthewindow:

ValidateAftercompletionofabuildprofile,checkstheconfigurationtohelpyouavoidbuilderrors. Awindowappearstoshowthevalidationsthatitperforms. SaveandBuildSavesyourbuildprofileanddisplaystheBuildSummarydialogboxforreview. To buildtheVMandbeginprovisioning,clickBuildVM.Aprogressiconappearswithabuildlog thatshowsstatusasthebuildprogresses. SaveandCloseSavesyourbuildprofileandclosestheeditingpage.Youcansaveanincomplete profile.ThebuildprofileappearsintheVMList,soyoucanchoosetoeditorbuilditlater. CloseWithoutSavingClosestheeditingpageanddiscardschanges.Awarningappearsaskingif youaresureyouwanttodiscardchangesmadeduringthecurrentsession.

AftercreatingaVMprofile,youarereadytobuildtheVM.ProceedtoBuildingaVMfromtheBuildProfile onpage 46.


36 VMware, Inc.

Chapter 4 Creating a Linux-Based VM

WithVMwareStudio2.1,youcanrunconcurrentbuildsfromdifferentVMprofiles,ormultiplebuildsfrom thesameVMprofile.VMwareStudio2.0handledonlyonebuildatatime.The/opt/vmware/etc/studio filegovernshowmanybuildscanrunconcurrentlybeforetheystarttoqueue.Settingconcurrent_limit higherthantwocouldadverselyaffectperformanceontheprovisioningsystem. WithVMwareStudio2.1,youcanproducesignedOVFdistributionfilesbymodifyingthesigningscriptinthe XMLbuildprofileandspecifyingaprivatekeyfileorprivatekeypassword. NOTEIfyouhaveanexistingbuildprofilethatyoucreatedwithVMwareStudio1.0,youcanuseitwith VMwareStudio2.0or2.1.SeeMigratingBuildProfilesfromStudio1.0or2.0onpage 47.

Web Console Tab Reference


ThesesectionsdocumentallfieldsindifferenttabsoftheWebConsole.

DescriptionTabonpage 37 HardwareTabonpage 38 OSTabonpage 39 ApplicationTabonpage 40 ManagementTabonpage 41 OutputTabonpage 43 BuildSettingsTabonpage 44

Description Tab
Table 42describestheconfigurationpropertiesavailableontheDescriptiontab. Table 4-2. Description Tab Configuration Properties
Field Information ProductName Version Nameforthisvirtualapplianceorvirtualmachine.Theproductnameappearsinthe WebconsolefortheVMandonthewelcomescreen.RequiredforVMwareReady. Versionnumberforthisrelease.Thisfieldisimportantifyouareshippingthevirtual machineasavirtualappliance.Theversionnumberisusedtotrackupdatesand mustbeintheformatofmajor.minor.build.revision.Numberscanbeintherangeof 065535.Forexample,1.0.0.0forthefirstrelease.RequiredforVMwareReady. Thisfieldallowsyoutoentermoredescriptivetextforversion.Forexample,ifthe virtualapplianceisinthealphareleasestate,youmightenter1.0.0.0alphaversion. URLonyourcompanysWebsitethatprovidesinformationabouttheproduct. Enteryourcompanyname.Thisfieldisimportantifyouareshippingthevirtual machineasavirtualappliance. Descriptivetextaboutthevirtualmachine.forexample,thefeaturesprovidedorthe contentsofthevirtualmachine,andsoforth.PlacedintheOVFannotationelement. VendorURLtoyourcompanysWebsite.Thisfieldisimportantifyouareshipping thevirtualmachineasavirtualappliance. URLtoyourmainapplicationcontainedinthisvirtualmachine.Thisfieldis importantifyouareshippingthevirtualmachineasavirtualappliance.ThisURLin usedbothasatargetfortheApplicationURLLabel,andinthevSpheresummarytab toprovidealinktotheapplication.The${app.ip}keywordintheURLresolvesto theVMsIPaddress,afterdeployment,atruntime. Description

FullVersion ProductURL VendorName Description VendorURL ApplicationURL

VMware, Inc.

37

Developers Guide to Building vApps and Virtual Appliances

Table 4-2. Description Tab Configuration Properties (Continued)


Field Description

Web Console Visual Customization LogoPath LocationoftheimagefileontheVMwareStudioappliancefortheiconthatdisplays intheWebconsoleforthisvirtualmachine.Thisfieldisimportantifyouareshipping thevirtualmachineasavirtualappliance. TheURLtousewhenthelogoisclickedintheWebconsole.Youcanspecifyyour companysWebsiteorasitethatcontainsinformationaboutthevirtualappliance. ThelinkshouldbeanhttporhttpsURL,forexample,http://www.example.com. ThelabelfortheURLintheApplicationLinkURLfield.Thisisthelabelthatappears intheWebconsoleforyourapplication.Forexample,ifyourapplicationisnamed Acme,youcanusethelabelAcmeHometopointtothehomeaddressofthe Acmeapplication. Tocustomizetheleftsidefooterandthemiddlefootertext,youcanedittheXML buildprofile.SeeCustomizingtheFooterintheWebConsoleonpage 129.

LogoLinkURL

ApplicationURLLabel

FooterText(nofield) EULA and Login Screen EndUserLicenseAgreements

Youcanaddanenduserlicenseagreement(EULA)byclickingtheAddEULA button,andmorethanoneEULAbyclickingitagain.TodeleteaEULA,clickthe RemoveEULAlinkassociatedwiththeEULAyouwanttoremove. YoucanAddEULAmultipletimesindifferentlanguages,thenedittheXMLprofile in/opt/vmware/var/lib/build/profilestodesignatethelanguageofeach EULA.Intheovf:EulaSection_Typesection,changexml:lang="en"tothe languageslocale,sovCenterServercandisplaytheEULAintheprevailinglocale whenimportingthevirtualapplianceasOVF.

EULA

Thefulltextofyourenduserlicenseagreement.Theuserseesthiswhenrunningthe VMforthefirsttimeandmustacceptthislicenseagreement.Thisisimportantifyou areshippingtheVMasavirtualappliance.IfnoEULAisdefined,thentheVMboots withoutuseracceptance.IfaEULAisdefined,butyoudisablethecheckboxShow EULAonfirstboot,theappliancedoesnotpromptforEULAacceptanceduringits firstboot. IftheEnableLoginScreencheckboxisenabled,thevirtualappliancedisplaysthe WelcomeTextontheloginscreenafterthevirtualmachinebootsup. EnterinformationthatprovidesanintroductiontoyourVM.Youcansupply instructionsfortheuseronhowtoaccessyourapplicationontheVM,whichhelps improvetheuserexperienceiftheVMisshippedasanappliance.Youcanenterup to16linesoftextwithamaximumof79charactersineachline.Charactersoverthe maximumlinelengthorlinesafterthe16tharenotdisplayed.Variablesubstitutions areacceptedfor${app.name},${app.version},and${vami.url}.

LoginScreen WelcomeTextonLoginScreen

Hardware Tab
Table 43describestheconfigurationpropertiesavailableontheHardwaretab. Table 4-3. Hardware Tab Configuration Properties
Field VMware Hardware Version HardwareVersion SetsthevirtualhardwareversionfortheVM.Forinformationaboutvirtualhardware version,seetheKnowledgeBasearticle1003746athttp://kb.vmware.com.

Description

Virtualhardwareversion4isforESX3orlater,andWorkstation5orlater. Virtualhardwareversion7isforVMwareServer2.0,Workstation6.5orlater, Player2.5orlater,Fusion2orlater,andESX4.0orlater.

Compatibility Virtual CPU and Memory VirtualProcessors CPUReservation(Mhz)

ShowsVMwareproductplatformscompatiblewiththehardwareversionselected.

SelectthenumberofvirtualCPUs.Thenumbermustbelessthanorequaltothe numberofCPUsintheprovisioningplatformusedtocreatethevirtualmachine. GuaranteedlowerboundontheamountofCPUthatthehostreservesforthisVM.

38

VMware, Inc.

Chapter 4 Creating a Linux-Based VM

Table 4-3. Hardware Tab Configuration Properties (Continued)


Field Memory(MB) Description Theamountofvirtualmemory(inmegabytes)allocatedtothisvirtualmachine. Enteravaluein4MBincrements(4,16,256,512andsoon).Thedefaultformost Linuxvirtualmachinesis256MB.Thedefaultis512MBforRHEL5.3(32bitor 64bit).Thisamountofmemorymustbelessthanorequaltothememoryofthe provisioningplatform. GuaranteedlowerboundonthememoryamountthatthehostreservesforthisVM.

MemoryReservation(MB) Virtual Devices NetworkAdapters

NumberofvirtualnetworkadapterstobeconfiguredforthisVM.TheVAMIagent providesconsoleandWebconsoleinterfacestomanageonlythefirstnetwork adapter(eth0)ifmorethanoneadapterisdefined. NumberofopticaldiscdrivestobeconfiguredforthisVM.

CD/DVDDrives Virtual Hard Disks Name Size(GB)

Nameofthevirtualdisk,usedwhennamingVMDKfiles. Sizeingigabytesofthevirtualdisk,asafloatingpointnumberwithtwooptional decimalplaces,forexample2.33,4.6,or5. Ifyourequireonlyoneharddisk,youmaychangethedisksize,butyoushouldnot altervaluesinthePartitionssection.OnLinuxthe/bootpartitionmustcomefirst. Addingorremovingpartitionsinthefirstharddiskisnotrecommended.Clickthe ModifyDiskLayoutlinktoalterthePartitionspecifications. Ifyourequiremorethanoneharddisk,clicktheAddDiskbutton. Toremoveanadditionalvirtualdisk,clicktheRemoveDisklink.

Partitions MountPoint MaximumSize Size(MB) Filesystem Mountpointforthepartition. Checktheboxtospecifythatthispartitionautomaticallyusesthemaximumsize available.OnlythelastpartitionofadiskshouldbemarkedasMaximumSize. Sizeinmegabytesofthepartition. Filesystemformat,eitherext3orswap. Onlyext3issupportedatthistime.Theswappartitionmustbeonthefirstdisk,for compatibilitywithunattendedinstallers. Bootable Checkthisboxifyouwanttobeabletobootfromthepartition.

OS Tab
Table 44describestheconfigurationpropertiesavailableontheoperatingsystemOStab. Table 4-4. Operating System Tab Configuration Properties
Field Operating System OSDistribution ISOURL Areadonlyfieldspecifyingtheoperatingsystemcorrespondingtothetemplateyou chosewhenyoucreatedthisvirtualmachine. ThelocationoftheOSISOimage.TheURLcanbeeitherafile://orhttp:// location.It isrecommendedtousefile://toalocalOSISOfile. IfVMwareStudiowarnsyouthattheISOLocationCannotbeVerified,download therequiredOSISOimageorNFSmounttheOSISOdirectory,thenclickthe Check NowbuttontoreverifytheISOimageatthisURL. ISOMD5 TheMD5checksumfortheOSISOimage.VMwareStudiocomparesthevalueinthis fieldwiththechecksumfortheISOimagetoensurethattheimageiscorrect. InVMwareStudio2.1youcaneditthisfieldtocorrectthechecksumafterupdating oralteringtheISOimage.Also,removingthechecksumentirelyskipsthechecksum validationstep.Thisisnotgenerallyrecommended,butcanbehelpfulifyouhavea customizedISOimage. Description

VMware, Inc.

39

Developers Guide to Building vApps and Virtual Appliances

Table 4-4. Operating System Tab Configuration Properties (Continued)


Field User Accounts RootPassword Enterthepasswordoftheadministrativeuseraccountforthevirtualmachineand thenconfirmthepasswordbyenteringitagainintheConfirmPasswordfield.Ifyou areshippingtheVMasvirtualappliance,youmightwanttocreateafirstbootscript topromptusersforanewrootpassword. Ifyouneedtoaddauseraccount,clicktheAddUserbutton.TheVAMIagentis usingtheoperatingsystemsdatabasetoauthenticateaccesstotheWebconsoleand thesmallfootprintCIMbroker(SFCB). Enterthenameforthisuseraccount.Forvirtualappliances,youmaywanttocreate nonrootuseraccountsforlimitedaccess. Enterthepasswordfortheuserandthenenteritagaintoconfirmthepassword. Enterthefullnameforthisuseraccount. EnterUserIDofthisuseraccount.Generally,notspecifyingtheUIDandallowing theOStodeterminetheUIDisrecommended.Ifspecified,makesuretogiveavalid (existing)UIDnumbervaluethatisuniquewithintheVM. Todeleteauseryouhaveadded,clicktheRemoveUserlink. Description

AddUser

Username Password FullName(optional) UID(optional)

RemoveUser Boot Customization EnableBootScripts FirstBootScript

Ifthecheckboxisenabled,thefirstscriptrunsatinitialbootandtheotherscriptruns atsubsequentboots. Ascriptthatcontainsanyapplicationrelatedconfigurationthatshouldoccurwhen thevirtualmachineisfirstbootedup.Importantforvirtualapplianceswhere enduserconfigurationisrequiredaccordingtothedeploymentenvironment.For example,populatingadatabase,configuringsystemdatathattheapplicationneeds, orstartingvariousapplicationcomponents.Thisscriptisexecutedonlyonthefirst bootupofthevirtualmachine.Thisscriptcanbefoundinthevirtualmachineat /opt/vmware/etc/isv/firstboot. Ascripttorunonthesecondandsubsequentrebootsofthevirtualmachine.Youcan entercommandsforapplicationstartupinthisfield.Youcanlocatethisscriptinthe VMat/opt/vmware/etc/isv/subsequentboot.Importantforvirtualappliances.

SubsequentBootScript

Application Tab
Table 45describestheconfigurationpropertiesavailableontheApplicationtab. Table 4-5. Application Tab Configuration Properties
Field Application Packages ApplicationPackageRepositories AlistofApplicationPackageRepositories. Ifyouplacepackagesintothisdirectory,youneedtospecifyonlythedirectory, noteachpackageexplicitly. UsetheMoveUpandMoveDownbuttonstospecifytheinstallationorder. AddURL|Edit|Remove Toaddanapplicationpackageordirectoryofapplicationpackagestoyour VM,clickAddURL,entertheURLofthepackageordirectory,andclickOK. TochangetheURLofanapplicationpackageordirectory,clickEdit,modify theURL,andclickOK.Todeleteanentry,clickRemove. SeeApplicationPackagesonpage 35fordetailsaboutapplication repositories. VMware Tools Installbasepackages InstallpackagesforX Ifthischeckboxisenabled,theVMwareToolsatthelistedpackagelocation willbeinstalled. Ifthischeckboxisenabled,theVMwareToolsforX11windowsatthelisted packageslocationwillbeinstalled. Description

40

VMware, Inc.

Chapter 4 Creating a Linux-Based VM

Table 4-5. Application Tab Configuration Properties (Continued)


Field List of packages from OS install media Package,Version,Arch,Description Add|Remove AlistofpackagesfromtheOSinstallationmediatoincludeinthevirtualmachine. Whenyouselectapackageinthelist,adescriptionofitappearsontheright. TheOSISOimagecontainsadditionalpackagesthatcanbeinstalledintothe virtualmachine.VMwareStudioprovidesaselectiondialogboxtohelpyou findapplicationpackagesintheOSISOimage. Toaddpackagestothelist,clickAdd,searchforapackagebytypingpartof itsnameintheSearchwindoworselectingacategory,clickAddonpackages toadd,andwhenyouarereadyclickOK. Toremoveapackagefromthelist,selectitandclickRemove.Youcannot removeanyVAMIrequiredpackagesfromthelist. Application Installation Customization ApplicationPreInstallScript ApplicationPostInstallScript ScriptthatrunsafterinstallationofpackagesfromtheOSmedia,butbeforethe installationofapplicationpackagesduringvirtualmachineprovisioning. Scriptthatrunsaftertheinstallationofapplicationpackagesduringthevirtual machineprovisioningphase. Description

Management Tab
Table 46describestheconfigurationpropertiesavailableontheManagementtab. VAMImanagementservicesexposemanagementfunctionalityastabsinthegeneratedappliancesVAMIWeb console.TheCoreserviceprovidestheVAMIuserinterfaceandserverframework.TheSystemandNetwork servicesprovidesbasicsysteminformation,timezonesettings,andnetworksettings.TheUpdateserviceis optionalandenablesupdatingoftheOSandapplicationpackagesfromaremoteupdaterepository. Table 4-6. Management Tab Configuration Properties
Field Management Services EnableManagementCIMOM Server core,network,system Ifyouenablethischeckbox,thesmallfootprintCIMbroker(SFCB)thatsupports VAMIisinstalled.SFCBisatypeofCIMOM(CIMobjectmanager). Ifthischeckboxisdisabled,asasideeffectthemanagementGUIisnotinstalled. Name,versionnumber,anddescriptionofincludedmanagementservices.Services appearastabsintheWebconsoleofaVMbuiltbyVMwareStudio,ifyouenablethe GUI.Youcandeleteservicesthatyoucreate,butbuiltinservicesaremandatory. Servicesaredefinedinthe/opt/vmware/var/lib/build/serviceshierarchy. LinuxManagementServicesarealsodisplayedundertheLibrary>Linuxtab,where youcanimportanewservice Add|Remove Toaddaservice,clicktheAddbutton,selectitscheckbox,andclickOK. Inparticular,youcanselecttheVAMIupdateservicehere. Toremoveaservice,selectitscheckboxandclicktheRemovebutton. Toreplaceaservicewithanewerversionoftheservice,firstremovetheoldversion, thenaddthenewversion. Someofthemanagementservicesarerequiredandcanbereplacedonlybya differentversionoftheservice. Management Web Server Settings EnableManagementServer (GUI) WebServerHTTPSPort CustomizeGUITabOrder Ifthischeckboxisenabled,managementservicesappearastabsintheVAMIconsole ofaVMbuiltbyVMwareStudio,availablewithHTTPS. ConfigurableHTTPSportnumberfortheVAMIWebconsole.Changethisnumberif theapplicationyouarebuildingrequiresthisportnumber.Defaultportis5480. YoucanmovethetabpositioninageneratedVAMIWebconsole. Description

VMware, Inc.

41

Developers Guide to Building vApps and Virtual Appliances

Table 4-6. Management Tab Configuration Properties (Continued)


Field SSL Certificate Information CommonName ThisinformationisusedtocreateaselfsignedSSLcertificateforthevirtualmachine WebconsoleandthesmallfootprintCIMbroker(SFCB)duringthefirstboot. Servercertificatesareissuedtoacommonname.Inmostcases,thisisthefullDNS name(fullyqualifieddomainname)usedtonavigatetoaWebsite. Organization Unit CountryCode Thefulllegalnameofyourcompany.Thisnameisusedtosignthecertificate. Thegroupordepartmentwithinyourcompanyrequestingthecertificate. Enterthetwodigitcodeforthecountrywhereyourcompanyislocated. For example,USfortheUnitedStates. Description

Update Service Repository Settings (Optional) Toenableupdateservice TheUpdateserviceenablesremoteupdatingofaVM.Itisdisabledbydefault,but recommendedwhendistributingvirtualappliancestoendusers.ToenableUpdate serviceandestablishanupdaterepository,followthisprocedure. UnderManagementServices,clickAdd,selecttheupdatecheckbox,clickAddagain, andfilloutallfieldsfortheupdaterepositoryservice. SeeChapter 7,ManagingtheLinuxUpdateRepository,onpage 61formore informationaboutupdaterepositories. CDROMupdates IfyouwanttocreateaCDROMcontainingupdatesforappliancesthatlackexternal networkaccess,clickthisbutton.YouwillbeabletodelivertheISOArchiveburned ontotheCDROM,andyourappliancewillbeabletoupdatefromtheCDROM. IftheSpecifyrepositoryoptionisselectedinsteadoftheCDROMupdatesoption, RepositoryURLspecifieslocationoftheupdaterepository.TheRepositoryURLgoes intothebuildprofileandgetsembeddedinthevirtualappliance,whichperiodically checkstheURLforupdates.Ifyouplantoprovideupdatesforavirtualappliance, theRepositoryURLmustpointtoanInternetaccessiblelocation,andyoushouldnot changetheURLafterabuild. Youmightplantouseastagingserverforinternaltestingandcopythecontentsof yourupdaterepositorymanuallytoanInternetaccessibleandexternallyvisiblesite whenthevirtualapplianceisreadytobeshipped. Username(optional) ThisusernameisusedtoauthenticatetoaWebserverattheURLfortheupdate repository.Tocomplywithlicensingrestrictions,thisfieldisrequiredforupdating anyvirtualappliancebasedontheRedHadEnterpriseLinux(RHEL)operating system.Allcustomersusethesameusernametodownloadupdates. Passwordforthespecifiedusername.Enterthesamepasswordtwicetoconfirm. ThispasswordisusedtoauthenticatetoaWebserverattheURLfortheupdate repository.Tocomplywithlicensingrestrictions,thesefieldsarerequiredfor updatinganyvirtualappliancebasedontheRedHadEnterpriseLinux(RHEL) operatingsystem.Allcustomersusethesamepasswordtodownloadupdates. VendorUUID AuniqueidentifierthatVMwarevCenterUpdateManagerusestoidentifyavendor. AllVMscreatedbyaparticularvendorshouldhavethesameVendorUUID.VMware recommendsthatthisbea128bitslongUUID(16bytes). AuniqueidentifierthatVMwarevCenterUpdateManagerusestoidentifya particularproduct.EachProductshouldhaveadifferentProductRID.VMware recommendsthatthisbea128bitslongUUID(16bytes). Descriptionforthisupdate.Forexample,aversionnumber,issuesfixed,orthe enhancementsprovidedbytheupdate.Updateinformationpresentedhereappears intheWebconsoleofthevirtualappliancewhentheupdateismadeavailable.

RepositoryURL

Password(optional)

ProductRID

UpdateDescription

Repository Server Settings FileTransferProtocol FileTransferHostname AreadonlyfieldindicatinguseofSCPfiletransferprotocol. ThehostnameorIPaddresswheretheupdaterepositoryislocated.VMwareStudio musthaveSSH/SCPaccesstothehostthatservesastheupdaterepository.Thisis neededtopublishthevirtualappliancefiletotheupdaterepository.

42

VMware, Inc.

Chapter 4 Creating a Linux-Based VM

Table 4-6. Management Tab Configuration Properties (Continued)


Field FileTransferUsername Description Usernameontheupdaterepositoryhost.UsedbyVMwareStudiotocopyfilesusing theSCPprotocoltotheupdaterepositorystagingserver.Thisusernamecanbe differentfromtheusernamethatthevirtualappliancesusestodownloadupdates. Passwordforuserontheupdaterepositoryhost.Typeittwicetoconfirm. Pathusedforpublishingvirtualapplianceupdatestotheupdaterepository.Forthe virtualappliancetofindanyupdates,thispathshouldtranslatetotheURLofthe updaterepository.

FileTransferPassword FileTransferPath

Repository Export Settings UpdateArchive EnablethisoptiontoexportanupdatearchiveasaZIPfile,andspecifyZIPFilename. Theexportedarchiveisplacedinthebuildinstancesdirectory.Youcanlatercopythis ZIParchivetoaWebserver. EnablethisoptiontoexportanupdatearchiveasaISOfile,andspecifyISOFilename. TheexportedISOimageisplacedinthebuildinstancesdirectory.Youcanlatercopy thisarchivetoaWebserver,ormorelikely,burnitontoCDROM.

ISOArchive

Output Tab
Table 47describestheconfigurationpropertiesavailableontheOutputtab. Table 4-7. Output Tab Configuration Properties
Field Distribution Format OutputFileName OutputFormat Thenameforthedistributionfileofyourvirtualmachine.Thisnameisusedwhen creatingthevirtualmachineOVF,OVA,orZIPpackage. Selectthetypeofdistributionfileforthevirtualmachine.ThedefaultformatisOVF. Youcanchoosemorethanoneoutputformat.

Description

OVFUsethisformatifthevirtualmachinewillbedeployedonvirtualization platformsthatsupporttheOpenVirtualizationFormat. OVAArchiveofOVF1.0descriptorandVMDKvirtualdiskfiles.Requires VMwarevSphere4fordeployment. ZIPUsethisformatifyourvirtualmachinewillbedeployedonvirtualization platformsthatdonotsupportOVF.

DirectoryinZIPArchive OVF IP Assignment Settings DHCP

Thedirectoryunderwhichfilesrelatedtoyourvirtualmachineshouldappearwithin thegeneratedZIPoutputfile.

IfthedistributionformatisOVF1.0orOVA,duringdeploymenttheuserisgiventhe optiontouseaDHCPserverforconfiguringthisVMsnetworking,whichwillbe automaticallyconfiguredbytheVAMIagent.VMwarerecommendsthatanIPpool beconfiguredonthevCenterServertoavoidawarningmessage,butanIPpoolis notrequiredforDHCP. IfthedistributionformatisOVF1.0orOVAanddeployingonvCenterServer,during deploymenttheuserisgiventheoptiontouseafixedortransientIPaddressforthis VM.TheVMsnetworkingwillbeautomaticallyconfiguredbytheVAMIagent. This requiresthatanIPpoolbeconfiguredonthevCenterServer.

OVFEnvironment

OVF Properties Add|Edit|Remove Key Label Description ClickAddtoaddanOVFproperty.ClickEdittochangeanexistingOVFproperty. ClickRemovetodeleteanOVFproperty. KeytoOVFProperty. LabelforOVFProperty. DescriptionofOVFProperty.

VMware, Inc.

43

Developers Guide to Building vApps and Virtual Appliances

Table 4-7. Output Tab Configuration Properties (Continued)


Field Type Description ListofOVFpropertytypessupportedforediting.Thesetypesareenforcedby VMwarevSphereduringdeployment.IfyouselectCustomType,ovf:typeappears withvalueandqualifiers. String,unsignedinteger,stringchoice,Booleanvalue,orIPaddressofthisproperty. Maximumlengththatcanbespecifiedforastringproperty. Lowandhighvaluesthatcanbespecifiedforanintegerproperty. Listofpossiblevaluesforastringchoiceproperty. Whethertopromptusertoallowchangingofproperty. EachPropertyelementinaProductSectionmustbeassignedanovf:typeattribute. ValidtypeslooklikeCdatatypesandarelistedintheOVFspecification. Optionalattributeovf:valueprovidesadefaultvalueforaPropertyelement. Optionalattributeovf:qualifersspecifiesCIMtypequalifiersforaProperty,with multiplequalifiersseparatedbycommas. Optionalattributevmw:qualifersgivesVMwarespecificqualifiersforaProperty.

DefaultValue MaximumLength Range ValueMap UserConfigurable ovf:type ovf:value ovf:qualifiers vmw:qualifiers

Build Settings Tab


Table 48describestheconfigurationpropertiesavailableontheBuildSettingstab. BuildsettingsareusedonlyforprovisioningaVM.Theyarenotthedeploymentconfigurationsoftheoutput VM.TheoutputVM(exceptOVFandOVA,whichcanoverridenetworksettings)willbeconfiguredtorunat firstinDHCPnetworkmode. Table 4-8. Build Settings Tab Configuration Properties
Field Build Environment VirtualizationPlatform TheVMwarevirtualizationplatformforprovisioningyourvirtualmachine.A dropdownmenudisplaysachoiceofvirtualizationplatform.Asyouselectdifferent platforms,buildenvironmentsettingsmaychange.Allsettingsaredocumented below,althoughnotallappearatanygiventime. ClicktheConnectionWizardbuttonforhelpconfiguringthispage.Youcanuseitto configurethebuildenvironmentsettings.Itallowsyoutobrowseahostandselect thenecessarysettings.TheconnectionwizardisavailableforESX/ESXihosts, VMwareVirtualCenter,VMwarevCenterServer,andVMwareServer2. Description

ConnectionWizard

Build Environment Settings <Platform>Host ThehostnameorIPaddressofthevirtualizationplatformyouuseforprovisioning. Notallinformationitemsarerequiredfordifferentplatforms.Forexample,only VMwareWorkstationneedsthevmruncommand,andthebuilddirectorypathis neededonlyforhostedproducts. Port Theportforcommunicatingwiththeremotehostthatperformsprovisioning.For manyvirtualizationplatformsthisistheHTTPSport443.VMwareServer1.0.xoften usestheauthdorautomationport,usually902,sometimes904.VMwareServer2.0 hostedonWindowsprobablyusesport8333.VMwareWorkstationusesSSHonport 22forremoteprovisioning,soitdoesnotaskforaportnumber. Ausernameontheremotehostforauthenticationofvirtualmachineprovisioning. Passwordforthespecifiedusername.Youmusttypethepasswordtwicetoconfirm. (vCenteronly)DatacenternameasdesignatedintheVMwarevSphereinventory. ThisnameappearsintheleftsidebaroftheVMwarevSphereclientwhenconnected throughvCenterServer. Specifythedatastorewhereyouwanttostorethevirtualmachinefiles.Datastore namesappeartheVMwarevSphereclientSummarypage.

Username Password DatacenterName

DatastoreName

44

VMware, Inc.

Chapter 4 Creating a Linux-Based VM

Table 4-8. Build Settings Tab Configuration Properties (Continued)


Field ResourcePool(Optional) Description IfyoucreatedaresourcepoolandyouwanttheVMtobebuildinthisresourcepool whilebeingprovisioned,youcanspecifytheresourcepoolname. ESX/ESXihostsandvCenterServerhaveabuiltindefaultresourcepool,Resources. ThisresourcepoolisvisibleintheManagedObjectBrowser(MOB)interfaceat http://<esx-or-vc>/mob,butthevSphereClient,VMwareStudio,andovftool donotsupportit.Ifyouwanttosetaresourcepool,useonethatwascreated,not Resources. ManagedESXHost NetworkLabel PathtovmrunCommand (vCenteronly)HostnameorIPaddressoftheESX/ESXihostmanagedbyvCenter. Specifythenetworkconnectionlabel.NetworknameappearsintheVMware vSphereclientSummarypage.BydefaultthisnameisVMNetwork. (Workstationonly)VMwareWorkstationusesthevmruncommandforprovisioning. Donotincludethevmruncommanditself,onlythepathtoit.

OnWindowsthiscouldbeC:\ProgramFiles\VMware\VMwareWorkstation. OnLinuxthiscouldbe/usr/bin.

BuildDirectoryPath

(WorkstationandServer1.0.xonly)Thetemporarypathusedbytheprovisioning platformtoregisterandcontrolprovisioningofthevirtualmachine.Thislocationis usedtostorethevirtualmachineduringtheprovisioningphase. Forexample,ifaLinuxsystemisthehostoftheVMwareServerand/tmpisthe provisioningdirectory,thenenter/tmpintheHostPathfield. Asanalternateexample,ifaWindowssystemisthehostoftheVMwareServerand c:\tmpistheprovisioningdirectory,SCPusestheOpenSSHserverinCygwin,sothe HostPathisc:\tmpbuttheFileTransferPathbelowshouldbe/cygdrive/c/tmp.

HostEnvironment

(WorkstationandServer1.0.xonly)Specifiesthehostoperatingsystemwhereyour provisioningplatformruns.IfyouselectWindowsorLinuxCustomSettings,then youmustfillinthefollowingitemsforFileTransfer.Seethedescriptionsofthese itemsundertheOutputtab.


FileTransferProtocol FileTransferUsername FileTransferPassword FileTransferPathUsedbyVMwareStudioforuploadingthevirtualmachine beingbuilttotheHostPath.Touploadthevirtualmachineduringthe provisioningphasefromVMwareStudiotothehostrunningtheprovisioning platform,youmightneedtospecifytheFileTransferPathandHostPath differentlyforthescputility,althoughtheymustrefertothesamedirectoryon thehostrunningtheprovisioningplatform.Forexample,ifVMwareServerruns onWindows,SCPusestheOpenSSHserverinCygwin,sotheHostPathis c:\tmpbuttheFileTransferPathshouldbe/cygdrive/c/tmp.

Network Settings NetworkType SpecifyeitherDHCPtoretrieveIPaddressesfromaDHCPserver,orStatictoseta fixedIPaddress.IfyouspecifyStatic,thefollowingfieldsappearforyoutofillin:


IPAddress Netmask Gateway PreferredDNSServer AlternateDNSServer Bridgedmodeisthedefaultforcommunicatingwiththevirtualmachinebeing built.BridgedmodeisrequiredwhentheVMwareStudiovirtualapplianceand theprovisioningplatformarerunningondifferentcomputers. HostOnlymodeapplieswhenVMwareStudioisrunningonalocalinstallation oftheprovisioningplatform.ForHostOnlyprovisioningavirtualappliance mustbeconfiguredtouseHostOnlynetworkingbypoweringofftheVMware Studiovirtualapplianceandeditingitsvirtualnetworkadaptersettings.

NetworkConnection

ForVMwareWorkstationandServer1.0.x,specifyoneofthefollowingoptions:

Build Agent Removeagentafterprovisioning Ifthischeckboxisenabled,themanagementagentisremovedafterprovisioning.

VMware, Inc.

45

Developers Guide to Building vApps and Virtual Appliances

Building a VM from the Build Profile


Afteryouhavecompletedabuildprofile,youcanbuildyourVM.FirstclickValidatetoverifythecontentsof thebuildprofile.IftheVMprofilevalidates,clickSaveandBuild.ThenintheBuildSummarydialogbox,click BuildVM.ThisstartsbuildingatransientVMontheprovisioningplatform. ToretainthetransientVMwithoutcleaningupafterthebuild,intheBuildSummarydialogbox,click AdvancedBuildSettings.ThismakesvisibleacheckboxsayingRetaintransientVMonthevirtualization platformandskipprovisioningcleanup.ClickingthecheckboxallowsyoutotesttheVMontheprovisioning platformbeforedeployingitelsewhere. Whenthebuildstarts,astatusiconappearstoindicatethatthebuildisinprogress.Asprovisioningcontinues, abuildlogappearstoinformyouofeachcompletedstepinVMprovisioning.Tocancelabuildinprogress, clickCancelunderthestatusicon. InVMwareStudio2.1youcanlaunchmultiplebuildsconcurrently.Navigatetoanotherbuildprofileandclick SaveandBuild.Youcanalsobuildthesameprofileagainbeforetheearlierbuildcompletes. IMPORTANTYoucanmonitortheinstallationoftheLinuxOSandyourapplicationsontheconsoleofthe provisioningserver.Todothis,starteithertheVMwarevSphereClient,theVMwareInfrastructureClient,or theVMwareServerConsoleapplication.Workstationmustbestartedalready.SelecttheVMthatyouspecified intheprofileyoucreated,whichshouldpoweron,andclickConsole(ifnotalreadydisplayed). WatchingtheVMprovisioningcanhelpgreatlyifsomethinggoeswrong. TheLinuxVMalwaysrebootsbeforeapplicationinstall.Ifyouencounterproblemsduringthebuildprocess, seeTroubleshootingVMBuildsonpage 135fordiagnosticinformation. Afterabuild,youcanviewvariouslogstoseewhathappenedduringthebuild.InthelistofVMprofiles,select aVMandclickBuildLogtoseearecapofbuildprogress. Toseethebuildsummary,variouslogs,anddiscoveryreports:intheVMList,clicktheVMname>Finished (orFailed,orCanceled).TheDetailsdialogboxappears,withthefollowingtabs:

BuildSummaryprovidesdetailsofthebuildprofileconfiguration. VerboseLogprovidesadetailedlogofeachcompletedphaseofthebuildprocess. DebugLogprovidesdetailsofeachcompletedbuildphase,includingdebugginginformation. ApplicationInstallLogprovidesalogoftheinstallationmessagesastheoperatingsystemandeach applicationpackagegetsinstalledintothevirtualmachine.Reviewingtheinstalllogcanhelpwhen troubleshootingpackagedependencyerrorsifmorepackagesarerequired. DiscoveryReportsprovidesinformationaboutpackages,hardwaresettings,andoperatingsystem.

EachbuildisstoredintheVMwareStudioappliancesfilesystem.Youcandeleteolderbuildswhentheyare nolongerneeded.SeeReiteratingtheBuildProcessonpage 47formoreinformation.

Testing the Generated VM


AfteryouhavesuccessfullybuiltaVM,youcanobtainthevirtualmachinedistributionfilebyclickingonthe ZIPorOVFlink(dependinguponwhichtypeofoutputfileyouspecified)intheDownloadcolumnofthe VMsPreviousBuildlist. YoushouldclickonyourvirtualmachinedistributionfileandtestthecompletedVMbydeployingitintothe intendedenvironmenttoensurethattheVMandanyapplicationsthatitcontainsworkproperly.Youcan downloadaZIPfilefortesting.DonotdownloadanOVFfortesting,becauseifyoudo,yougetonlytheOVF andnottheassociatedVMDKfiles.Instead,testtheOVFbyrightclickingontheURL,copyingit,andpasting itintotheImportApplianceorDeployOVFTemplatedialogboxesofESX3.5or4.0,respectively. Verifythatallapplicationpackagesareinstalledcorrectlyandthatyourbootscriptsruncorrectly.Checkthat yourapplicationstartscorrectly.

46

VMware, Inc.

Chapter 4 Creating a Linux-Based VM

Ifyouplantodistributethisvirtualmachineasavirtualappliancetoyourcustomers,seetheUsersGuideto DeployingvAppsandVirtualAppliancesforinformationaboutdeployingyourvirtualappliancefortesting.

Reiterating the Build Process


ManydevelopersfindthataneasywaytoacreateaLinuxVMistobuilditinitiallycontainingonlythe operatingsystem,andaddapplicationpackagesanddependenciesinsuccessivebuilds.Eachsuccessfulbuild occupiesspace,butyoucandeletethem. TodeleteabuildusingtheVMwareStudioconsole,selectaVMfromtheVMList,locatethebuildinstance youwanttoremove,andclickDelete.Youcanalsodeleteabuildusingthestudiocli-dcommand.

Migrating Build Profiles from Studio 1.0 or 2.0


YoucanimportbuildprofilesintoVMwareStudiointhefollowingcircumstances:

WhenyouupgradetoanewerversionofVMwareStudio. Whenyoumanuallycreateabuildprofile. WhenusingabuildprofilecreatedbyanotheruseronanotherVMwareStudioappliance.

IfyouhaveanexistingbuildprofilethatyouwanttobringintoVMwareStudioyoucanimporttheprofile. Howeveryoucannotuse,norsuccessfullyimport,aStudio2.0BetaprofileintoStudio2.0or2.1GA.Instead, youmuststartfromapreexisting2.0template,orimportaVMwareStudio1.0profile. To import an existing build profile 1 2 3 4 PlacethebuildprofileonthehostwheretheWebbrowserruns. OpentheVMwareStudioWebconsoletotheVMspageandclickImportProfile. Adialogboxappearswhereyouenteranamefortheprofileandlocationofthebuildprofiletoimport. ClicktheBrowsebuttontohelpfindthebuildprofileonyourcomputer. ClickImportProfile.VMwareStudiocreatesanewbuildprofilebasedontheimportedone,andaddsit totheVMList.YoucanselectthenewlyimportedVMandbuildit,oredititsprofile.

VMware Tools Installed in a Generated VM


TheVMwareToolssoftwarepackages(vmware-open-vm-toolsDEBorRPMpackages)thatVMwareStudio installsinLinuxbasedVMsareoftheVMwareOperatingSystemSpecificPackages(OSP)packagingformat, versionedESX4.0.Theyarecurrentlyavailableathttp://packages.vmware.com/tools/esx/4.0/index.html. NewlyreleasedoperatingsystemsmightnotyetbesupportedbyanavailableOSPVMwareToolsdownload. Also,OSPsarenotavailablefordiscontinuedoperatingsystemssuchasUbuntu7.04and7.10.Inthesecases, youralternativeistoobtainandcompiletheopensourcetoolsathttp://openvmtools.sourceforge.net. Despitethesimilarnames,theOSPvmware-open-vm-toolspackagesarenotexactlythesameasthe opensourceVMwareToolsproducedfromSourceForgecode. InVMwareStudio2.1,VMwareToolswereseparatedintothecorepackageandtheXwindowspackage. AfterdeployingaVMwiththistypeofVMwareToolsinstalled,usersshouldnotrunInstallVMwareTools ontheirvirtualizationplatform,becausedoingsooverwritestheexistingVMwareToolsintheVM,andthe differencesinformatcouldcauseinstallationfailureorruntimeerrors. IfuserschoosetoupgradetheVMwareToolsinaVM,theycanusethedpkgorrpmcommandtomanually uninstallthevmware-open-vm-tools*DEBorRPMpackage,theneitherrunInstallVMwareToolsontheir virtualizationplatform,orinstallanewerversionofthevmware-open-vm-tools*DEBorRPMpackage. Unfortunately,anyenduserchangestosoftwarepackagesintheVM,includingVMwareTools,couldthwart theapplianceupdatefacilityofVMwareStudio.

VMware, Inc.

47

Developers Guide to Building vApps and Virtual Appliances

48

VMware, Inc.

Packaging a Linux Application

Thischaptercontainsthefollowingsections:

VMwareStudioMakePackage(mkpkg)Toolonpage 49. OperatingSystemNativeToolsonpage 52. TARArchiveasInputFormatonpage 53

VMware Studio Make Package (mkpkg) Tool


Youcanprovideapplicationbitsinvariousformatstobeinstalledonthevirtualmachine.Ifyouhaveabinary imageofyoursoftware,youcanspecifycopycommandsaspartofyourpreinstallorpostinstallscripts. You canalsospecifytheapplicationbitsinTARformat. Forbetterlifecyclemanagementofthevirtualmachinecontents,VMwarerecommendsthatyourapplication bepackagedinthenativepackagingformatoftheoperatingsystem(RPMorDEB).Ifthevirtualmachineis deliveredasavirtualappliance,nativepackagingguaranteesthattheISVcanupdatetheapplicationina consistentfashionafteracustomerdeploysthevirtualappliance.Automaticupdates,versiontracking, dependencyresolution,andcompletevirtualappliancemanifestsarethebenefitsofrequiringthat applicationsbedeliveredinthenativeoperatingsystempackagingformat. VMwareStudioprovidesacommandlinetool,mkpkg,toassistinthecreationofapplicationpackages.Using themkpkgtoolyoucancreateeitherDEBorRPMapplicationpackages.Inaddition,theVMwareStudioPlugin forEclipseiscapableofcreatingpackages,inawayequivalenttomkpkg.Formoreinformation,seeChapter 8, UsingtheVMwareStudioPluginforEclipse,onpage 69.

Options of the Make Package Tool


ThefollowinglistshowstheLinuxoperatingsystemsthatVMwareStudiosupports,andthepackageformat foreachoperatingsystem:

CentOSRPM RedhatRPM SLESRPM UbuntuDEB

ForDEBpackages,youcreateandspecifythepreinstallandpostinstallscriptswhenyoubuildthepackage. ThesescriptsremainseparatefileswithDEBpackages. ForRPMpackages,thepreinstallandpostinstallscriptsareembeddedintothecontrol.specfile.Because thepreinstallandpostinstallscriptsareinsertedintothegeneratedtemplatecontrol.spec,youmust specifythescriptswhenyourunmkpkg-trpm-T.

VMware, Inc.

49

Developers Guide to Building vApps and Virtual Appliances

Themkpkgcommandsyntax,withoptionsdescribedinTable 51,isasfollows:
mkpkg -t {rpm|deb} [-T] [-c ctrl] [-C file] [-P preinst] [-p postinst] [-R prerem] [-r postrem] <dir>

Thisisthesameasrunningmkpkgfromthestudioclifrontend.
studiocli --mkpkg -t {rpm|deb} [-T] [-c ctrl] [-P preinst] [-p postinst] [-R prerem] [-r postrem] <dir>

Table 5-1. mkpkg Options


Option -h -H -t -T -c -C -P -p -R -r <dir> Description Displayhelpinshortformat. Displayhelpinverboseformat. Typeofpackagetocreate(rpmordeb).Mandatoryargument. Createsasamplecontrolfiletobeusedasatemplateforthepackagetype. Packagecontrolfile.Youcancreateasamplecontrolfiletouseasatemplatewiththe-Toption. Filecontainingalistofuserconfigurationfilesthatarenotoverwrittenwhenapackageisupgraded. Preinstallscripttoberunbeforeinstallingthepackage. Postinstallscripttoberunafterinstallingthepackage. Preremovalscripttoberunbeforeremovingthepackage. Postremovalscripttoberunafterremovingthepackage. Thedirectorytobepackaged.Programsandfilesinthisdirectoryshouldbeintheirproperplacewhen installed,relativetothisdirectory.Forexample,afilethatshouldbeinstalledintothe/etcdirectoryshould beputintoasubdirectorycalledetcinthisdirectory.

Example of Creating a DEB Package


BeforeyoucreateaDEBpackage,youmustorganizeyourapplicationpackagesintotheproperdirectory structure.Forexample,executablefilesin/binmustbeunderasubdirectorynamedbinandfilesthatbelong in/etcshouldbeunderasubdirectorynamedetc. Hadoop,anopensourcedistributedfilesystemforlargedatasetswritteninJava,isourexamplehere. To create a DEB package for Hadoop 1 OntheVMwareStudioappliance,chooseorcreateadirectoryandextractHadoopintoit.
cd /<your_dir> tar zxpf hadoop-0.20.0.tar.gz

CreateaControlfilebyrunningthiscommand,whichproducesthemessagethatfollows.
mkpkg t deb T deb control file template has been created as control

Youcannowmodifythecontrolfileasneeded.
Package: hadoop-dfs Version: 1.00 Essential: yes Priority: extra Section: utils Maintainer: yourname@example.com Architecture: i386 Description: Hadoop is a distributed file system based on map-reduce.

NOTEThecontrolfilealsocontainsaDependssection.Ifyoudonothaveanypackagedependencies, makesureyouremovetheDependssection.

50

VMware, Inc.

Chapter 5 Packaging a Linux Application

Youcancreatepreinstall,postinstall,preremoval,andpostremovalscriptsforyourapplication. These scriptscancontaincommandsthatyouwouldrunwhileinstallingyourapplication.Inthis examplewenameourpreinstallandpostinstallscriptspreinstandpostinst.Similarnamingcould befollowedforthepreremovalandpostremovalscripts.Runthefollowingcommand:


mkpkg t deb c control P preinst.sh p postinst.sh hadoop-0.20.0

Ifyourcommandsyntaxiscorrect,yougetamessagesimilartothefollowing:
109737 blocks dpkg-deb: building package hadoop-dfs in /<your_home>/hadoop-dfs-1.00_i386.deb

CopythegeneratedDEBfileto/opt/vmware/www/ISV/appliancePackageswiththecpcommand:
cp hadoop-dfs_1.00_i386.deb /opt/vmware/www/ISV/appliancePackages

Example of Creating an RPM Package


BeforeyoucreateanRPMpackage,youmustorganizeyourapplicationpackagesintotheproperdirectory structure.Forexample,executablefilesin/binmustbeunderasubdirectorynamedbinandfilesthatbelong in/etcshouldbeunderasubdirectorynamedetc. SugarCRM,anopensourcesoftwaresolutionforcustomerrelationshipmanagement,isourexamplehere. To create an RPM package for SugarCRM 1 OntheVMwareStudioappliance,chooseorcreateadirectoryandextractSugarCRMintoit.
cd /<your_dir> unzip SugarCD-5.1.0c.zip

CreateaControlfilebyrunningthiscommand,whichproducesthemessagethatfollows
mkpkg t rpm T -p postinst.sh rpm control file template has been created as control.spec

UnlikeforDEB,mkpkgforRPMplacesthepreinstallandpostinstallscriptswithinthecontrolfile. 3 Youcannowmodifythecontrol.specfileasneeded.
Summary: Sample SugarCRM package Name: SugarCRM Version: 5.1.0c Release: 11 License: Commercial Vendor: SugarCRM Group: System Environment/Daemons URL: http://www.sugarcrm.com BuildArchitectures: noarch #Requires: %description

ThefollowingisanexampleofaSugarCRMpackage:
%post #!/bin/bash chown -R wwwrun /opt/SugarCE-Full-5.1.0c/ # # Do not put anything below the %defattr line; the list of files # in this package is automatically written there. # %files %config /opt/SugarCE-Full-5.1.0c/config.php %defattr(-,root,root)

The%configsectionlistsconfigurationfilesthatyoudonotwantoverwrittenduringanupdate.

VMware, Inc.

51

Developers Guide to Building vApps and Virtual Appliances

Runmkpkgwiththecontrol.specfileyoujustedited.
mkpkg -t rpm -c control.spec SugarCE-Full-5.1.0c

Ifyourcommandsyntaxanddependenciesarecorrect,youseemessagessimilartothefollowingbefore yourRPMisgenerated:
109737 blocks Processing files: SugarCE-Full-5.1.0c Checking for unpackaged file(s): /usr/lib/rpm/check-files Wrote: /<your_home>/ sugarcrm_5.1.0c.0-11_i386.rpm

CopythegeneratedRPMfileto/opt/vmware/www/ISV/appliancePackageswiththecpcommand:
cp sugarcrm_5.1.0c.0-11_i386.rpm /opt/vmware/www/ISV/appliancePackages

Operating System Native Tools


Ifyouchoosetousenativetoolsoftheoperatingsysteminsteadofmkpkg,thefollowingsectionsprovidea briefoverviewofhowtopackageanapplicationinDEBorRPMformats.

DEB Native Packaging


DEBpackagesareconstructedbywritingasmallcontrolfileandpointingthepackagingtoolatadirectory hierarchythatcontainsonlytheapplicationfilesinstalledintheirproperorder. Acontrolfilecanbesimple,forexample:
Package: change-this-package-name Version: 99.99 Essential: no Priority: extra Section: utils Maintainer: yourname@example.com Architecture: i386 Description: This describes the package, and contains a summary if what it provides.

Thecommandtogeneratethepackageisdpkg-deb.Becauseoffilepermissionissues,youusuallycallitfrom acommandcalledfakeroot,asinthisexample:
fakeroot dpkg-deb -b <directory-hierarchy>

RPM Native Packaging


RPMpackagesareconstructedsimilarlytoDEBbasedpackages,butinadditiontopointingthepackaging toolatadirectorycontainingtheapplicationsfiles,eachfileintheapplicationmustbereferencedinthe packagecontrolfile,asinthisexample:
Summary: This is the short description of the package. Name: change-this-package-name Version: 99.99 Release: 99.99 License: Commercial Vendor: Your Company Name Group: System Environment/Daemons URL: http://YourCompanyURL BuildArchitectures: noarch %description This is the longer description of the package, and should contain more detailed informaton about what the package provides. %files %defattr(-,root,root) /bin/ls

ThecommandtogenerateRPMpackagesisrpmbuild,whichyourunasinthisexample:
rpmbuild -bb <controlfile> --buildroot <directory-hierarchy>
52 VMware, Inc.

Chapter 5 Packaging a Linux Application

TAR Archive as Input Format


AsanalternativetoRPMandDEBpackages,applicationscanbeinstalledusingTARfilesasinput.Tousethis feature,addtheTARfiletoanapplicationpackagerepository.VMwareStudioconvertstheTARfiletoanRPM orDEB(dependingontheOSnativepackageformat)duringinstallationoftheOS,andinstallsasanormal RPMorDEBfile.Ifenabled,theupdaterepositoryisalsopopulatedwiththeRPMorDEBfile. TheTARfileshouldfollowoneofthefollowingformatspecifications. 1 Simplepackagewithnoversion,nometadata,andnoupdates: a b c d 2 NametheTARfile<packageName>.tar.gzor<packageName>.tgz TheRPMandDEBpackagewillbeversion1.0.0,andcanbeinstalledonaLinuxOS. VMupdateswillnotinstallnewversionsofthepackage. ContentsoftheTARfilewillbeinstalledintotherootdirectoryoftheresultingVM.

Packagewithversion,butnoothermetadata,updatesifversionincrements: a b c d NametheTARfile<packageName>_<version>.tar.gzor<packageName>_<version>.tgz TheRPMandDEBpackagewillhavea<version>number,andcanbeinstalledonaLinuxOS. VMupdateswillinstallanewversionofthepackage,iftheversionisincrementedfornewbuilds. ContentsoftheTARfilewillbeinstalledintotherootdirectoryoftheresultingVM.

Packagewithcompletemetadata: a b NametheTARfile<anyname>.tar.gzor<anyname>.tgz Afilenamedmanifest.xmlmustbecontainedintheTAR,accordingtothefollowingspecification.

Themanifest.xmlfilemustconformtothefollowingexample:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <package format="1.0" type="linux"> <name>packagename</name> <version>1.0.0.0-build1</version> <vendor>special apps</vendor> <depends>package1, package2, package3</depends> <arch>i386</arch> <short-description>Best special app</short-description> <description>A sample package the best app!</description> <preinstall>#!/bin/sh echo "Hello from the preinstall" </preinstall> <postinstall>#!/bin/sh echo "Hello from the postinstall" </postinstall> <preremove>#!/bin/sh echo "Hello from the preremove" </preremove> <postremove>#!/bin/sh echo "Hello from the postremove" </postremove> <configuration-files> <file>/opt/myapp/config.xml</file> </configuration-files> </package>

IncludealltheXMLattributesshownabove,althoughvaluesmaybeemptyexceptfor<name>,<version>, <vendor>,and<arch>.Thevalueof<arch>canbenone,i386,oramd64. OSinstallationfailsifapackagemarkedasi386isinstalledona64bitOS,orifapackagemarkedamd64 isinstalledona32bitOS.Packagesmarkedasnoneinstallonanyarchitecture. The<short-description>isaonelinedescription,while<description>isamultilinedescription.

VMware, Inc.

53

Developers Guide to Building vApps and Virtual Appliances

Section<configuration-files>maycontainanynumberofconfigurationfilesin<file>elements.These filesmustalreadyexistintheTAR,andwillbemarkedasConfigfilesintheRPMandDEBpackage.Ifafile issolisted,itisnotreplacedwhenthepackageisupgraded. FilepermissionsandownersarepreservedfromthecontentsoftheTAR,howeverallusersandgroupsmust existontheVMwareStudioappliance,otherwisefileownershipdefaultstoroot,grouproot.

Operating System Footprint Reduction


YoucanreducethesizeofmostvirtualappliancesbyrunningtheVMwareStudiofootprintreductionscripts. Althoughthesescriptsdonotaffectapplicationpackagesspecifically,theyrunbeforeandafterapplication installation.Onescripteliminatesunusedpackages,whiletheotherremovesunnecessaryfiles. To reduce the size of a virtual appliance 1 2 IntheVMs>Applicationtab,scrolldowntoApplicationInstallationCustomization. ClickApplicationPreInstallScripttodisplaythescripttext,readthecomment,anduncommentlines (erase#)startingwithcut_pkgs_wrapper=run_cut_pkgs.sh. Thisscriptrunsbeforeapplicationinstallationtodetectandeliminateunusedpackages. 3 ClickApplicationPostInstallScripttodisplaythescripttext,readthecomment,anduncommentlines startingwithcut_files_wrapper=run_cut_files.sh. Thisscriptrunsafterapplicationinstallationtoremoveunnecessaryfiles. 4 ClickSaveandBuildtopreserveyouruncommentingandrebuild. Outputdiagnosticsaresavedin/opt/vmware/www/build/<buildID>/statusinthecutpkgs.logand cutfiles.logfiles. 5 Youcancustomizethescripttemplatesin/opt/vmware/etc/footprintifneeded.

54

VMware, Inc.

Adding a Linux Management Service

Thischapterexplainsthefollowingtopics:

VMwareStudioVAMIServiceonpage 55 DefaultManagementServicesonpage 56 CreatingaManagementServiceonpage 57 ImportingaManagementServiceonpage 58 CustomizingtheInitializationScriptonpage 59

VMwareStudiocontainsseveraldefaultmanagementservices,anditallowsyoutocreatenewones.

VMware Studio VAMI Service


Figure 61showstheimplementationframeworkofVirtualApplianceManagementInfrastructure(VAMI) servicesontopofCIMproviders. Figure 6-1. VAMI Services

VMwareStudiobuiltvirtualmachinescarryaninguestmanagementcomponent,theVirtualAppliance ManagementInfrastructure(VAMI).AllmanagementservicesprovidedbyVAMIareimplementedas commoninformationmodel(CIM)providers.VAMIservicesusethesmallfootprintCIMbroker(SFCB)asa CIMobjectmanager(CIMOM).CIMisastandardfromDistributedManagementTaskForce(DMTF).The VAMIservicescanbeunderpinnedastabsintheWebconsole.


VMware, Inc. 55

Developers Guide to Building vApps and Virtual Appliances

VAMIhasthefollowingcomponents:

HTTPServerAlightweightWebserverusingLIGHTTPDtohostthemanagementWebconsole. CIMBrokerThesmallfootprintCIMbroker(SFCB)actsasthemanagementagentfortheVM.CIMis astandardfromtheDistributedManagementTaskForce(DMTF);seehttp://www.dmtf.orgfordetails. VAMIUIFrameworkProvidesacontainerfortheVAMIserviceWebinterface,whichisshownasatab intheWebconsole. VAMIServicesVAMIservicesareusedtoexposeaWebinterfacetomanagetheVM.AVAMIservice cancontainaWebinterface,theCIMprovider,additionalfiles,andWebserverconfiguration.TheWeb interfacecanoptionallyuseaJavaScriptAPIforbetterintegrationwiththeVAMIUIframework. AuthenticationThepluggableauthenticationmodule(PAM)isusedtoauthenticateaccesstothe managementWebconsoleandCIMAPIs.Theauthenticationmodulecreatesasessionfileforeachuser, whichisstoredat/opt/vmware/var/lib/vami/core/sessionasafile.Thetimeoutforsessionsis controlledbytheenvironmentvariableVAMI_AUTHENTICATION_TIMEOUTandspecifiedinnumberof minutes.Thedefaultsettingisoneday(1440minutes).

AsstatedinVirtualApplianceManagementInfrastructure(VAMI)onpage 16,VMwareStudio2.1offers manyoptionalmanagementcomponents.Thevadk:VAMISection_TypefieldsintheXMLprofilecontrols whichcomponentsgetinjectedintotheprovisionedvirtualappliance.


vadk:LoginTTYThebluescreenserverconsole. vadk:ShowEULAEULAappearingonthevirtualmachineconsole. vadk:ManagementSrvWebservicesbackend(CIMobjectmanager). vadk:ManagementGuiWebuserinterfaceandHTTPserver,whichdependsonthebackend. vadk:RunBootScriptsBootscripts. vadk:VMToolsCoreandvadk:VMToolsXVMwareTools,usuallytheOSspecificpackage(OSP). vadk:UpdateSection_TypeTheupdateservice. vadk:InitScriptCustomizableserviceinitializationscriptruneachtimethevirtualapplianceboots. SeeCustomizingtheInitializationScriptonpage 59.

Default Management Services


VMwareStudiocomeswithadefaultsetofmanagementservicesthatcanbeincludedwithanyLinuxbased virtualmachine.WhenyoulogintotheVMwareStudioWebconsoleandclicktheLibrary>Linuxtabs,this listappearsshowingthedefaultmanagementservices:

coreTheVAMIframeworkandWebcontainertoholdotherservices. systemDisplaysbasicsysteminformation,andhasaninterfacetoshutdownorreboottheVM. networkAllowsenduserstoconfiguretheirnetworkandproxysettings. updateIfyouareplanningtoshipavirtualappliance,VMwarehighlyrecommendsthatyouinclude thisserviceaspartofyourbuildprofile.Updateservicesimplifiesthemaintenanceofvirtualappliances byautomaticallyormanuallyapplyingupdatesfromaISVmanagedupdaterepository.Theupdate serviceintegrateswithVMwarevCenterUpdateManagertoallowcentralizedmanagementofupdates throughVMwarevSphere.Fordetails,seehttp://www.vmware.com/support/pubs/vum_pubs.html.

VAMIpackagesmayalsoincludeapplianceconfig,init,andservicebase.

Management Services with Eclipse


VMwareStudioprovidesanEclipsepluginforpackagingyourmanagementservice.Formoreinformation, seeChapter 8,UsingtheVMwareStudioPluginforEclipse,onpage 69,especiallyCreatingManagement Servicesonpage 71.

56

VMware, Inc.

Chapter 6 Adding a Linux Management Service

Creating a Management Service


VMwareStudioletsyouaddyourownmanagementservicesinthevirtualmachine,withtheirWebinterface appearingastabsintheWebconsoleofthegeneratedvirtualmachine.Thesemanagementservicesare packagedinatarortar.gz fileandimportedintoVMwareStudio. YoucanpackagemanagementservicesusingtheVMwareStudioPluginforEclipse(seeManagement ServiceswithEclipseonpage 56)orcreatethemmanuallyasdescribedinthissection.Managementservices canbemadepartofyourLinuxbasedvirtualmachinebyspecifyingtheminthebuildprofile. Whenyoucreateamanagementservice,theservicemustbeencapsulatedinatarortar.gzfilewiththe followingdirectorystructure:

service.xmlContainsservicename,versionnumber,anddescriptionofthemanagementservice. Installedinthe/opt/vmware/var/lib/vami/${servicename}/directory. conf/lighttpd.confLIGHTTPDconfigurationsettingsforthisservice.Settingsareappendedtothe originallighttpd.conffileandinstalledin/opt/vmware/var/lib/vami/${servicename}/conf. provider/*.regCIMproviderregistrationfiles.Atbuildtime,VMwareStudioinstallsthisfileintothe /opt/vmware/var/lib/sfcb/stage/regs/directory. provider/*.mofCIMprovidermanagedobjectformat(MOF)files.Installedintothe /opt/vmware/var/lib/sfcb/stage/mofs/root/cimv2directory. provider/*.soCIMprovidersharedlibraries.Installedinto/opt/vmware/lib. system-root/*Contentoftheservicethatmustresidein(getcopiedto)thesystemrootdirectoryof theVMsoperatingsystem. view/view.xmlDescribesthetabtitletoshowintheWebconsole,containsinformationaboutthetabs content.Installedinthe/opt/vmware/share/htdocs/service/${servicename}/directory. view/*Allviewspecificfilesforthisservice.ContainsHTML,JavaScript,andimages.Installedinthe /opt/vmware/share/htdocs/service/${servicename}/directory. web-root/*TheviewdirectorycontainsservicespecificWebuserinterfacefiles.Additionalfilesthat mustbeplacedattheWebrootlevelofLIGHTTPD.Installedin/opt/vmware/share/htdocs.

Oftheabovefiles,onlyservice.xmlismandatory,andview.xmlisneededforitsassociateduserinterface.

service.xml
Thisfiledescribestheidentityanddependenciesoftheservice.Thefollowingcodeblockdescribesthe service.xmlformat:
<service> <name>ServiceName</name> <version>1.0.0.0</version> <description>This provides the build service to create new appliance</description> <requires> <packages>rpm_or_dep_package_dependencies separated by commas</packages> <services>other_service_dependencies separated by commas</services> </requires> </service>

view.xml
ThisfiledescribestheWebinterfaceproperties,includingthetabtitleandcontentsofthetab.Contentcanbe oftwotypes,urlorhtml.Whencontenttypeisurl,itisthelocationofthefilethatappearsintheUItab. Thefollowingcodeblockdescribestheview.xmlformatwhencontenttypeisurl:
<service> <title>ServiceTitle</title> <content type="url" url="index.html"/> </service>

VMware, Inc.

57

Developers Guide to Building vApps and Virtual Appliances

IftheURLisprefixedwithaslash(forexample/index.html),theURLlocationisrelativetothedocument rootoftheWebserver,/opt/vmware/share/htdocs.OtherwisetheURLlocationisrelativetowherethe serviceviewsareinstalled,/opt/vmware/share/htdocs/service/${servicename}. Thefollowingcodeblockdescribestheview.xmlformatwhencontenttypeishtml:


<service> <title>ServiceTitle</title> <Content type="html"> <![CDATA[ Hello world or other important html content ]]> </Content> </service>

SeeManagementServicesWebAPIonpage 109,forextendedJavaScriptAPIsupportwithbasicnavigation, communication,authenticationandlogging.

Creating a Vanilla VM
TodisablealltheoptionalVAMIservices,orasubsetofmanagementservices,changetheseelementsinthe XMLprofilesvadk:VAMISection_Typetofalse:
<vadk:ShowEULA>false</vadk:ShowEULA> <vadk:SetHostname>false</vadk:SetHostname> <vadk:SetNetwork>false</vadk:SetNetwork> <vadk:CreateSSHKeys>false</vadk:CreateSSHKeys> <vadk:RunBootScripts>false</vadk:RunBootScripts> <vadk:LoginTTY>false</vadk:LoginTTY> <vadk:ManagementSrv>false</vadk:ManagementSrv> <vadk:ManagementGUI>false</vadk:ManagementGUI> <vadk:VMToolsCore vadk:install="false" /> <vadk:VMToolsX vadk:install="false" />

TheWebconsoleinterfaceisabletochangesome,butnotall,ofthesesettings.Formoreinformationonthese settings,seeStructureofvAppXMLBuildProfilesonpage 132.

Underlying CLI
Youcanrunthevamimanagercommandtoinstall,uninstall,extract,register,andunregisterservices.Theuser interfaceusesthevamimanagercommandtoimplementactions. Typevamimanageratthecommandlineforinformationaboutitsoptions.

Importing a Management Service


YoucanincludeanyoftheexistingVAMIservicesintoyourbuildprofile.Youcanalsoincludeamanagement servicethatyouhavecreatedinanewlybuiltVM. To import a management service 1 2 3 4 5 6 7
58

LogintotheVMwareStudioWebconsoleandclicktheLibrary>Linuxtabs. ClicktheImportServicebutton.Browsetothelocationofthetarortar.gz filethatyoucreatedforyour managementservice.ClickImportService. Ifcorrectlycreated,yournewserviceappearsinthelist,withitsversionanddescription.VMwareStudio maintainsthemanagementservicesrepositoryunder/opt/vmware/var/lib/build/services. FollowinstructionsforcreatinganewVM,orforeditinganexistingVM. OntheManagementpageunderManagementServices,clicktheAddbutton,selectthenewservicefrom alist,andclickAdd. Optionally,clickCustomizeGUITabOrder,whichallowsyoutoadjusttheorderofthetabs. SaveandbuildtheVM.
VMware, Inc.

Chapter 6 Adding a Linux Management Service

ThisserviceisinstalledasRPMorDEBpackageintheresultingVMandappearsasatab(ifitcontainsaUI component)intheVMmanagementWebconsole.

Customizing the Initialization Script


TheVMwareStudioinitializationscriptvaos_init.shintegratesintotheLinux/etc/init.dmechanismof serviceinitializationscripts.Itrunseachtimethevirtualappliancereboots. Youcancustomizetheinitializationscript,thenameofwhichisspecifiedinthevadk:InitScriptfieldofthe XMLprofilesvadk:VAMISection_Type.Themainreasonforcustomizingthescriptistoavoidcriticalerrors duringandaftervirtualappliancereboot. To customize the vaos_init.sh script 1 2 3 Findtheinitializationscriptin/opt/vmware/etc/vaos/vaos_init.shandcopyittoanewfile,for examplevaos_myinit.shinthesamedirectory. Editthenewscriptyoujustcreatedwithyourchanges. FindtheXMLprofilein/opt/vmware/var/lib/build/profilesandchangethefollowinglinetosay forexamplevaos_myinit.shinsteadofvaos_init.sh.
<vadk:InitScript vadk:template="/opt/vmware/etc/vaos/vaos_init.sh"/>

Launchanewbuildandtestyourchanges.

Thevaosservicestartsin19thpositionatrunlevelstwoandzero,asyoucanseein/etc/rc2.d.

VMware, Inc.

59

Developers Guide to Building vApps and Virtual Appliances

60

VMware, Inc.

Managing the Linux Update Repository

IfyouareanISVshippingavirtualappliance,VMwarehighlyrecommendscreatinganUpdateRepositoryfor yourvirtualappliance.Thisenablesyoutoremotelyupdatevirtualappliancesdeployedatcustomersites. Thischapterdescribeshowtopublishupdatestoyourvirtualapplianceandincludesthefollowingtopics:


OverviewofUpdatesonpage 61 GeneratinganUpdateonpage 62 PublishinganUpdateonpage 64 TestingAgainstaStagingUpdateRepositoryonpage 66 DiagnosingFailedUpdatesonpage 66 UpdateRepositoryXMLonpage 67 SupportingCentralUpdateswithVMwarevCenterUpdateManageronpage 67

Overview of Updates
Afteravirtualapplianceisbuiltandreleased,youmightneedtopublishanupdateforit.VMwareStudio definesanupdateasasetofRPMorDEBpackages.TheVMwareStudioupdaterepositorycontainsthese packagesandamanifestfilethatdescribesthecontentsofaparticularversionofthevirtualappliance.Inthe virtualappliancemodel,theISVcreatesandpublishesupdatestotherepository. Avirtualappliancedeployedatacustomersitecanphonehometoanupdaterepositorytoretrieveupdates, whichmightinclude:

OperatingSystemupdatesYoucandownloadOSupdatesfromtheOSprovidersWebsite. ApplicationupdatesYoucanprovideyourownapplicationupdates.

To update a virtual appliance 1 BuildyourfirstvirtualappliancesoitcanreceiveupdatesfromanupdaterepositoryhostedatanISVsite. InVMwareStudio(seeManagementTabonpage 41)enabletheupdateservicebeforeabuild.When youenableupdatesforaVM,VMwareStudiocreatesanupdaterepositoryaftertheVMbuild. Aftertheapplianceisshipped,monitorupdatesforitsOSinadditiontotheapplicationstackcomponents thatarepresentinyourvirtualappliance. Analyzethechangesandselectapplicableupdatesforyourvirtualappliance. Generatetheupdateintheformthatyourvirtualapplianceunderstands.Forgeneratingupdatesusing VMwareStudio,seeGeneratinganUpdateonpage 62. Testtheupdatestomakesurethatyourapplicationcontinuestoworkasbeforeinthevirtualappliance. Publishtheupdate.SeePublishinganUpdateonpage 64.Youhaveachoiceofseveralpublication methods,assummarizedinTestingAgainstaStagingUpdateRepositoryonpage 66.

2 3 4 5 6

VMware, Inc.

61

Developers Guide to Building vApps and Virtual Appliances

Figure 71showsVMwareStudiocreatinganupdaterepositoryforavirtualapplianceVMonastagingserver. TheISValsohastheoptionofexportingtheupdaterepositoryasaZIPfileorasanISOimagefordistribution. Figure 7-1. VMware Studio Update Repository

Figure 72showsthedifferentchannelswhereavirtualapplianceVMcanretrieveupdates.BoththeZIPfile andISOimagecontainthecompleteupdaterepositorythattheISVbuilds.TheZIPcanbedeployedtoalocal Webserverwithinthecustomerslocalareanetwork,whereastheISOcanprovideoffnetworkupdatesifthe VMisconfiguredwithaCDdrive. Figure 7-2. Virtual Appliance Update Retrieval

Generating an Update
Figureshowstheflowofcreatingavirtualapplianceanditsupdaterepository.Whentheupdatemanagement serviceforaVMisenabled,anupdaterepositoryiscreatedattheendoftheVMbuild.Anupdaterepository cannotbecreatedwithoutbuildingtheVM. Figure 7-3. Update Flow During VM Builds

Start

Build VM or vApp

Create Update?

End no

yes

Build Update Repository

DuringaVMwareStudioupdatebuild,theport7openrequirement(Prerequisitesonpage 19)appliesto thehostoftheUpdateRepository,inotherwordstherepositoryserverorstagingserver.

62

VMware, Inc.

Chapter 7 Managing the Linux Update Repository

To generate an update from the VMware Studio Web console 1 2 3 4 LogintotheVMwareStudioWebconsole. IntheVMList,selectthevirtualapplianceforwhichyouwanttogenerateanupdate. UnderActions,clickEditProfile. IntheDescriptiontab,changetheversionnumberintheprofilefortheVM.Thisisthekeyindicatorthat anupdatewasgeneratedforanexistingvirtualappliance.TheVersionisanumberinN.N.N.Nformat, whereNmustbeanumberbetween0and65535. IntheManagementtab,clickAddandenabletheupdateservice.AnewUpdateServicesectionappears onthepage,withasectionforUpdateServiceRepositorySettings. ChooseandtypeaRepositoryURLtoestablishanupdatesiteforyourvirtualappliancesinthefield. The RepositoryURLshouldbeonapubliclyaccessibleWebsite. OntheVMs>ManagementpageunderUpdateServicesettings,youcanchangetheRepositoryURL. Whenavirtualapplianceupdates,itgetsthechangedRepositoryURL,sothefollowingtimeitchecksfor anupdate,itwilllookinthenewlocation.Rebootisnotrequired.Toenablethisfeature,theoldrepository mustcontainafinalupdatewiththenewrepositorylocation,andthenewrepositorymustcontainan initialupdate.Thefinalupdateandtheinitialupdatemaybethesameapplianceversion,ordifferent. NOTEChangingthevirtualappliancename,VendorUUID,orProductRIDinthebuildprofilewhile generatingupdatesmightaffectintegrationwithVMwarevCenterUpdateManager.SeeSupporting CentralUpdateswithVMwarevCenterUpdateManageronpage 67formoreinformation. 7 8 ProvideanUpdateDescriptionsotheenduserknowswhatthisupdatecontains.TheVendorUUIDand ProductRIDaremandatoryforusewithVMwarevCenterUpdateManager. CompletethedetailsforRepositoryServerSettings,wheretheupdatearchivegetscopiedafterabuild. Ifyouplantocopytheupdatefromastagingservertotheupdaterepositoryonanexternalproduction Website,makesuretheRepositoryURLpointstothatexternalproductionWebsite,nottotheinternal stagingserver.Afterthebuildcompletes,copytheentirestagingserverupdatetotheexternalproduction Website.Toeasethetaskofcopyingalltheupdatefiles,underRepositoryExportSettingsyoucanclick UpdateArchiveandspecifyaZIPFilename. VMwareStudiocreatesanewmanifestwiththenewversionnumberspecifiedinthebuildprofile,and updatestherepository.VMwareStudiomarksthenewversionofthevirtualapplianceasthelatestversion andcopiesthenewandchangedpackagestotheupdaterepository.Ifyouremoveapackagefromthebuild profile,thenewlygeneratedmanifestreflectsthisremoval.TheVAMIagentdoesnotdeletepackageswhen updatinganappliance,butyoucanaddapreupdateorpostupdatescripttoremovepackages.

5 6

Updates on CDROM
Ifyouarebuildinganappliancethatlacksexternalnetworkaccess,orifyourcustomersprefer,youcandeliver updatesonCDROM. To generate an update from the VMware Studio Web console 1 2 FollowthegeneralprocedureforGeneratinganUpdateonpage 62. InStep 6,selectCDROMupdatesinsteadofSpecifyrepository. FieldsforRepositoryURL,Username,andPasswordbecomedimmedout. 3 4 5 UnderRepositoryExportSettings,clickISOArchiveandspecifytheISOFilenametocreate. Afterthebuildsucceeds,theupdateiscopiedtotheFileTransferPathontheFileTransferHostname. BurntheISOFilenametoCDROMfordeliverytoyourcustomers. Alternately,youcanmaketheISOimageavailableatalocationonyourproductionrepositoryWebserver, andletcustomersdownloaditandburntheCDROMthemselves.
VMware, Inc. 63

Developers Guide to Building vApps and Virtual Appliances

Updates Requiring Reboot


Yourapplicationmightrequireasystemrebootafterapplyinganupdate.Ifanupdatecausestheapplianceto reboot,youshouldwarnendusersaboutthistheUpdateDescriptionfield.Ifyouwantyourvirtualappliance torebootafteranupdate,youcanrunthefollowingcommandaspartoftheupdate:
/usr/share/update-notifier/notify-reboot-required

Thiscreatesthefile/var/run/reboot-required,whichisdeletedafterreboot.Thiscommandshouldgoin theupdatemanifestspostInstallShellScript(notthesameastheApplicationPostInstallScript).Toput itthere,edittheVMprofilein/opt/vmware/var/lib/build/profiles,findvadk:UpdateSection_Type, andaddthenotify-reboot-requiredlinebeforefinalstatuschecking.

Digitally Signing an Update


Whenyousignanupdate,theenduserisabletoauthenticateitasbeingfromavalidsource. WithStudio2.1youcansignupdatesbyusingonepublickey,ineffectforthelifetimeofavirtualappliance. Signingisdonebyascript,encapsulatedintheXMLprofile,thatrunsafteryougeneratetheupdatemanifest. Youcanfindactivevirtualapplianceprofilesinthe/opt/vmware/var/lib/build/profilesdirectory.In yourXMLprofile,lookinthevadk:UpdateSection_Typeundervadk:DigitalSignatureforthepubkey script,whichcreatesadigitalsignaturefromaPEMkey,placingtheresultsinthespecifiedsignaturefile. Beforeupdatebegins,anotherscriptvalidatesthesignaturefileandpublickey.Lookforthevalidatescript underneaththepubkeyscript.Updateproceedsonlyifthesignaturevalidates.Intheupdaterepository,the filemanifest-latest.xml.sigcontainsthedigitalsignature. Toproperlysupportdigitalsigning,youcanmodifythesescriptstouseyourexistingsigninginfrastructure, ratherthanopenssl. Digitalsigninginvolvestwostages.Thesign_manifestscripttakesafileasinput,andoutputsasignature. Inofficialmode,thescriptusesofficialsigninginfrastructuretoperformthesigning,whichisusefulfor production.Intestingmode,thescriptcallsopensslwithaprivatekeystoredinpubliclyavailablelocation todothesigning.Thatisusefulfordevelopmentbuilds. Thesecondstageistheget_public_keyscript,whichoutputsthepublickey.Similarlyithasanofficialmode andatestingmode.Theproducedpublickeyisembeddedintoavirtualappliance,whichislaterusedto validatetheupgrademanifestfile.Thevalidationprocessisalwaysdoneusingopenssl.

Adding Your EULA to an Update


WithStudio2.1youcanincludeaneworrevisedEULAwithanupdate.Thevamiclicommand,whenrun withthe--acceptulaoption,createsanupdatethatautoacceptsanyEULAthatexists,insteadofexplicitly askingtheusertoaccepttheEULA.
vamicli update --install <version> --accepteula

ByeditingtheXMLprofile,youcansettheEULAdisplaypolicytoalways,checkversion,ornever.The checkversionpolicyshowstheEULAonlyiftheupdateversionisnewerthantheintroducedVersion. UnliketheEULAmechanismforinitialvirtualapplianceinstall,theupdateEULAdoesnotcurrentlysupport multiplelocales.

Publishing an Update
Afterthefieldsaremodifiedinthebuildprofile,clickSaveandBuildtobuildyourvirtualappliancewiththe updates.Aspartofthebuildprocess,theupdaterepositoryisupdatedwithanewmanifest.Youcanseethat manifest-latest.xmlisupdatedtoreflecttheupdate,andadditionalpackagesarecopiedtotherepository. NOTEItisnotpossibletopublishupdatesforavAppinasingleunit.TheISVmustcreateaseparateupdate repositoryforeachconstituentVMinthevApp.

64

VMware, Inc.

Chapter 7 Managing the Linux Update Repository

Testthegeneratedvirtualappliancetoensureitworksasexpectedwiththeupdates.Onceyouarereadyto maketheupdatesvisibletoendusers,youcancopytheentirecontentstoyourexternalWebserverthathosts theupdaterepository.BecausedeployedvirtualappliancesatcustomersiteshavetheURLofthisWebserver embedded,thefollowingactionscanoccur:


Virtualappliancesflaganupdateavailable,ifautomaticcheckforupdateisenabled. Theendusercanmanuallycheckforupdatestoviewavailableupdates. TheendusercanseetheUpdateDescriptionandreacttoanycriticalinformationitcontains.Forexample, youcanincludethisadvisorymessage:Thisvirtualappliancewillrebootafterapplyingthisupdate.

CAUTIONDuringthetimewhenyouarepublishinganupdateintoapreviouslyexistingupdatesdirectory, usersdownloadingtheupdatemightencounterdatacorruption.AbestpracticeforWebsitesistopublishyour updatefirstonastagingserver,andlatersyncittotheproductionserverduringoffhours.Anothersolution istocopythenewupdaterepositorytoanewdirectory,andrenamethedirectorywhentheuploadiscomplete.

Publishing an Update Repository from ZIP


TherepositoryinformationthatyouconfigureintheWebconsolepersistsinthebuildprofile.Additionally, VMwareStudiocancreateaZIParchiveofeachupdatewhenyouenableUpdateArchiveExport. YoucanuseUpdateArchiveExporttocontrolpublishingofupdatesbymanuallycopyingthearchiveand extractingtheupdatefilestoaremoteWebserver.Duringthebuild,VMwareStudiocreatesthefollowing updateZIPfile:
/opt/vmware/www/build/<buildNumber>/exports/zip/<exportFile>.zip

TopublishanupdatefromtheZIParchivecreatedusingRepositoryExport,extractthecontentsofthefilein thedocumentrootoftheURLthatwasspecifiedastheupdateURL.Forexample,ifyousettheupdateURL tohttp://<your-server>/updates/andsetthedocumentrootintheWebserverto/var/www/htdocs/, thenyouwouldextractthecontentsoftheZIPfileinto/var/www/htdocs/updates/on<your-server>. VirtualapplianceenduserscouldnowretrieveandinstalltheupdatefromyourWebserver. ThefollowingexampleisforLinuxbasedWebservers. To publish an update from the ZIP archive 1 ConnectwithSSHtoyourproductionupdateserver,inthisexamplesupport.example.com:
ssh support.example.com

RunscptosecurecopyfromtheVMwareStudiovirtualappliance<vmwStudio>into/tmp:
scp root@<vmwStudio>:/opt/vmware/www/build/<buildNumber>/exports/zip/<exportFile>.zip /tmp

IftheproductionupdateserverhasHTTPaccesstoyourvirtualappliance,youcouldinsteadrun:
cd /tmp; wget --no-proxy http://<vmwStudio>/build/<buildNumber>/exports/zip/<exportFile>.zip

Ifyournetworkdoeshaveaproxy,wgettakesitfromthehttp_proxyenvironmentvariable. 3 CreateadirectoryforupdatesonyourWebserver:
mkdir -p /var/www/htdocs/updates/productXYZ cd /var/www/htdocs/updates/productXYZ

ThepathyouspecifymustbeintheWebserverdocumentroot(inthisexample,/var/www/htdocs)and mustcorrespondtotherepositoryURLspecifiedfortheapplianceduringthebuild. 4 Ifthisdirectorycontainsfilesfromapreviousupdatearchive,thepreviousupdatemanifestXMLfile, manifest-latest.xml,shouldberenamedasabackupfile.Thenameofthisbackupfileisarbitrary.For example,youcanembeditscreationdateintheformatyyyymmddforyear,month,anddate.Tomakeyour backupoftheoldupdatemanifestfile,runacommandlikethefollowing.Ifyoueverneedtorevertyour updateservertoanolderupdateversion,youcanoverwritethemanifest-latest.xmlfilewiththe contentsofapreviousmanifestbackupfile.


mv ./manifest/manifest-latest.xml ./manifest/manifest-<yyyymmdd>.xml

VMware, Inc.

65

Developers Guide to Building vApps and Virtual Appliances

RunthefollowingcommandstoextracttheupdatearchivecontentsintotheproductXYZdirectory:
unzip /tmp/<exportFile>.zip

Testing Against a Staging Update Repository


Whenbuildingavirtualappliance,itisnotarequirementtopublishupdatesfromaZIParchive.Thatisonly onemechanism.Inthisexample,theUpdateRepositoryURLinthebuildprofilepointstoaHTTPorHTTPS locationontheproductionserver,whiletheupdateFileTransferHostnameandFileTransferPathpointtoa directoryonthestagingserver.ThissetupisshowninFigure 71. AsanISVyouhavethreewaystodeliverupdates:

FromaWebserveronthepublicInternet,calledProductionServerintheFigure 71diagram.IntheVM buildprofile,UpdateRepositoryURLreferstotheupdatelocationonthisWebserver. BydeliveringaZIPfiletoyourcustomers,whounziptherevisedsoftwareintotheupdaterepositoryon theirlocalWebserver,andsettheirvirtualappliancetoupdatefromtheURLoftheupdaterepositoryon thislocalWebserver.ThemiddleofFigure 72showsthisdeliverymechanism. BydeliveringaCDROMtoyourcustomers,whoplacethediscinaCDdriveaccessibletotheappliance andenableupdatefromCDROM.ThebottomofFigure 72showsthisdeliverymechanism.

Withthestagingserversetup,hereishowyoucantestupdatesagainstthestaging(notproduction)repository fromyourvirtualappliances.DoingsoavoidsmanualinstallationofanyRPMorDEBupdatepackages. Openaterminaltotheapplianceofinterestandfollowthesesteps: 1 Edit/opt/vmware/var/lib/vami/update/provider/provider-deploy.xmlandchange repositoryAddress,replacingtheURLpointingtotheupdaterepositoryontheproductionserverwith theURLofupdaterepositoryonthestagingserver.Obviouslythisisonlyforinternaltesting. RunthiscommandtorestarttheCIMbroker:


/etc/init.d/vami-sfcb restart

Runthiscommandtocheckforupdateavailability:
/opt/vmware/bin/vamicli update --check

Runthiscommandtoinstalltheupdate.
/opt/vmware/bin/vamicli update --install latest

Runthedesiredteststoverifythattheexpectedupdatesoccurredintheappliance.

CheckingforupdatesrequirestheHTTP1.1protocolonyourupdaterepositoryWebserver.

Diagnosing Failed Updates


Studio2.1providesthevamisupportscript,whichbundlesuplogfilesintoatarfile(tarball)fordiagnosis. Youcanfindthisscriptat/opt/vmware/bin/vamisupportonallVMwareStudiogeneratedappliances.Itis usefulforgeneraltroubleshooting,becauseitcapturesmorethanjustupdaterelatedinformation. Afteravirtualapplianceupdateerror,supportpersonnelcanaskthecustomertorunthevamisupportscript. Thescriptreportswhereithaswrittenthecollectedlogfiles.Thecustomercanthenscptheresultingtarball toacomputerwithemailservice,andtransmitittosupportpersonnelfordiagnosis.Inadditiontootherdata, thevamisupportscriptsavesthesefiles,whichmightbeusefultodiagnosevirtualapplianceupdateerrors:

/opt/vmware/var/log/vami/vami.log /opt/vmware/var/log/vami/updatecli.log /opt/vmware/var/lib/vami/update/data/job/<job-id>/*

Thejob/<job-id>directorycontainsacopyofthemanifestfiles,preinstallscripts,postinstallscripts,and otherscriptsthatarerelatedtoaparticularupdatejob.Ifyouseemultiple<job-id>directories,checktheir modificationtimesforthemostrecent.

66

VMware, Inc.

Chapter 7 Managing the Linux Update Repository

Update Repository XML


Theupdaterepositoryhasaspecificformat.Eachtimeyoupublishanupdatetotheupdaterepository,new packages(andnewversionsofexistingpackages)areaddedtotherepository.Theoldmanifestismovedto manifest-<version>.xml,thenewmanifest-latest.xmlreplacestheoldone.Alsomanifestrepo.xml isupdatedtoreflectanynewpackagesintherepository.Examinethemanifest-latest.xmlfiletoverifythat yourupdatewaspublishedtotherepository.Themanifest-latest.xmlstructureisthefollowing:
<update> <version> ... <description> ... <vendorUUID> ... <productRID> ... <product> ... <vendorURL> ... <fullVersion> ... <postInstallScript> ... <preInstallScript> ... <vendor> ... <UpdateInfoList> ... <productURL> ... <supportURL> ... <releaseDate> ... <PackageGroups> <group installOrder=0> ... <package name= ... > </package> ... </group> </PackageGroups> </update>

TheXMLcontainsupdatemetadataincludingintroduced-versionforVMwarevCenterUpdateManager (VUM)tomatch.LookfortheUpdateInfosection,whichyoucanedittosupportUpdateManager.
<vadk:UpdateInfoList> <vadk:UpdateInfo vadk:introduced-version="1.0" vadk:category="feature" vadk:severity="important" vadk:affected-versions="" vadk:description="" vadk:reference-type="vendor" vadk:reference-id="" vadk:reference-url=""/> </vadk:UpdateInfoList>

YoucanedittheXMLsectionExtendedConfigList,whichgetsplacedintothemanifestfile.
<vadk:ExtendedConfigList> < [edit this section] /> </vadk:ExtendedConfigList>

TheXMLprofilecanenableanddisabledigitalsignatures.SeeDigitallySigninganUpdateonpage 64.

Supporting Central Updates with VMware vCenter Update Manager


TheupdatesthatarepublishedforanappliancecanbeappliedbytheendusereitherusingtheWebconsole ofthevirtualapplianceorusingthecentralizedupdatemanagementprovidedbyUpdateManager. VMwarevCenterUpdateManagerallowssystemadministratorstocreateabaselinethatcontrolsupdatesto allvirtualappliances,orabaselineforaparticularappliance,orabaselineforappliancesfromagivenvendor, andsoforth. Anybaselinesspecifiedusingthevendornameorproductnamesareinternallyreferencedwiththe VendorUUIDandtheProductRIDfields.UpdateManagercanretrievetheVendorUUIDandProductRID fromvirtualappliances.

VendorUUIDThegloballyuniqueidentifierforyourcompanyororganization.TheUUIDcanbea WindowsGUID(GloballyUniqueIdentifier). ProductRIDUniqueproductidentifier,whichshouldbeuniqueacrossallappliancesfromavendor.

VMware, Inc.

67

Developers Guide to Building vApps and Virtual Appliances

TheVendorUUIDandProductRIDfieldsaremandatoryinbuildprofileswiththeupdaterepositoryenabled. UpdateManagerrequirestheVendorUUIDandProductRIDwhilereferencingtheappliancesinthebaselines. Ifthevendornameorappliancenameweretochangeforafutureversionofavirtualappliance,thenany baselinescreatedbytheuserwouldbecomeinvalid. Toavoidinvalidbaselines,VMwarerequiresthatdevelopersentertheirVendorUUIDandProductRIDwhen creatingupdaterepositoryinformation.

68

VMware, Inc.

Using the VMware Studio Plugin for Eclipse

TheVMwareStudioPluginforEclipsecanhelpyoupackageapplicationsanddevelopLinuxbasedvirtual appliancesandvApps.Thischaptercontainsthefollowingsections:

RequirementsofVMwareStudioPluginforEclipseonpage 69 GettingStartedwithVMwareStudioPluginforEclipseonpage 69 PackagingApplicationstoRunInaVirtualMachineonpage 70 CreatingManagementServicesonpage 71 AdditionalEclipseFeaturesonpage 71

UsingtheVMwareStudioPluginforEclipse,youcancontroltheuserinterfaceportionsofVMwareStudio likeanapplicationunderdevelopment.TheVMwareStudioPluginforEclipseisalsousefulforpackaging Linuxbasedapplications.TheVMwareStudioPluginforEclipseisalsousefulformakingyourown managementservices,whichcreatenewtabsintheStudioWebconsole.SeeChapter 6,AddingaLinux ManagementService,onpage 55formoreinformationaboutmanagementservices.

Requirements of VMware Studio Plugin for Eclipse


TheVMwareStudioPluginforEclipsehasthefollowingprerequisites.

VMwareStudio2.0or2.1alreadyinstalled. Eclipse3.4(Ganymede),3.5(Galileo),or3.6(Helios).Visitthehttp://www.eclipse.org/downloadsWebsite todownloadandinstall.TheJavaIDEandApacheAnt1.7areincludedinEclipsereleases. OnallEclipseplatforms(Linux,Mac,Windows)checkforeitherofthefollowing:


AccesstotheVMwareStudioforEclipseupdatesite,http://<StudioIPaddr>/eclipse/update/ TheVMwareStudioForEclipse-2.1.0.*.zippackagedownloadedfromVMware.com

Getting Started with VMware Studio Plugin for Eclipse


TheVMwareStudioPluginforEclipsemustbeinstalledintotheEclipseframework. To get started with VMware Studio Plugin for Eclipse 1 IfyouarerunningEclipsebehindafirewall,settheproxyinEclipse.ThisisbecauseEclipseusestheHTTP proxywhenlookingatdependenciesfortheVMwareStudiopluginduringinstallation. a b SelectWindow>Preferences>General>NetworkConnections>Manualproxyconfiguration,or usethesystemproxyconfigurationifavailable. SettheHTTPproxyforEclipseandpossiblytheSSLproxy.

VMware, Inc.

69

Developers Guide to Building vApps and Virtual Appliances

InstallthepluginfromtheVMwareStudioIPaddressorZIPpackage. a b InEclipse3.4,selectHelp>SoftwareUpdates>AvailableSoftware>AddSite. InEclipse3.5,selectHelp>InstallSoftware>Add. ForLocation,dooneofthefollowing:

TypetheVMwareStudioforEclipseupdatesiteURL, http://<StudioIPaddr>/eclipse/update/. ClickArchiveandselectthedownloadedVMwareStudioForEclipse-2.1.0.*.zippackage.

c d 3 4

SelecttheVMwareStudioPluginforEclipsecheckbox. InEclipse3.4,clickInstall. InEclipse3.5,clickNext.

RestartEclipsewhenprompted. SelectWindow>ShowView>Other>VMwareStudio>VMwareStudioExplorer. ThisaddsaviewofVMwareStudiointoanexistingperspective.

5 6 7

IntheVMwareStudioExplorertab,doubleclickthebarwhereitsaystoconfigureVMwareStudio. IntheVMwareStudioConnectiondialogbox,specifythehostnameorIPaddressoftheVMwareStudio appliance,port5480,usernameroot,andthepasswordyouset.ClickFinish. UndertheVMwareStudioExplorertab,doubleclickVMwareStudioWebConsole.TheWebConsole viewappears.YoucanaddprofilesandresourcesusingtheExplorerview.TheVMwareStudioExplorer viewincludes:

VMwareStudioWebconsoleYoudoubleclickthislinetoopentheVMwareStudiouserinterface inanembeddedWebbrowser.Youprobablywillbeaskedtoignoreoracceptasecuritycertificate. VMProfilesShowstheVMsyouhavecreated,withprofileandsequenceofbuilds. vAppProfilesShowsthevAppsyouhavecreated,withprofileandsequenceofbuilds. ResourcesIncludesoperatingsystemimagesandpackagerepositories.

Packaging Applications to Run In a Virtual Machine


YoucanuseVMwareStudioPluginforEclipsetopackagesoftwareforinclusioninaLinuxbasedVM. To create a new Linux package 1 FromtheFilemenu,selectNew>Other>VMwareStudio>VMwareStudioLinuxPackage,clickNext, possiblychangetheAddtoProjectsetting,andclickFinish. ThenewLinuxpackageappearsasaVMwareStudioPackage(VSP)fileinundertheprojectyouchose. 2 Addfilestoyourpackagebyimportingthemasfilesorimportinganentiredirectory.Youcansetthe metadatasuchaspackagename,version,andsoforth.Youcanalsomodifythepreinstall,postinstall, preremove,andpostremovescripts. WhenyouopenaVSPfileinEclipse,aneditingwindowappearswithPackageconfigurationdatatitle. Atthetoprightofthiseditor,clicktheBuildPackagebutton.Inthedialogthatappears,selectapackage Repositoryname,aoutputfilename,andoptionallyaVMprofiletowhichthispackageshouldbeadded. IfyouselectaVMprofile,youcanclickthecheckboxtoautomaticallystartaVMbuildwhenthepackage uploadfinishes. Whenyoucreateapackage,thefilestab(bottomofwindow)allowsyoutoimportfilesandselectthe destinationintheappliancetoinstalleachofthemindividually.Youcanmarkafileasaconfigurationfile byrightclickingonafileandselectingMarkasConfig.Youcanalsoimportadirectory.Whenadirectory hasitssourcelocationspecified,duringthepackageexport,thatsourcelocationisaddedintothepackage recursively,usingdefaultfileattributes.Ifadirectoryhasnosourcelocationspecified,thenthedirectory iscreatedontheappliancebutnofilesarecopied.
70 VMware, Inc.

Chapter 8 Using the VMware Studio Plugin for Eclipse

Creating Management Services


YoucanaddyourownmanagementservicesandcreatenewtabsintheWebconsoleofyourvirtualappliance. SeeChapter 6,AddingaLinuxManagementService,onpage 55formoreinformationaboutthestructureof managementservices. TheVMwareStudioPluginforEclipseprovidestheconceptofaprojecttohelpyoudevelopandbuild managementservices. Thenormaldevelopmentcycleistodevelopyourapplication,addnewfilesintothe structureofaserviceproject,thenusethebuild.xmlscripttocreateatar.gzfilefortheservice. To create a new Service with Eclipse 1 FromtheFilemenu,selectNew>Project>VMwareStudio>VMwareStudioServiceProject,clickNext, typeaprojectname,possiblychangetheservicenameandotherattributes,andclickFinish. Anewservice.xmltabappearswiththeattributesyoujustset.Forfulldetailsabouttheservicedirectory hierarchy,seeCreatingaManagementServiceonpage 57. 2 Topackagetheserviceasatar.gzfile,runbuild.xmlasanAntscript.Youcandothisbyrightclicking build.xmlunderyourprojectandselectingRunAs>AntBuild. TheAntbuildlogappearsintheConsole,showingthenameofthetar.gzfileifsuccessful. Youcanpredefinethebuild.xmlAntscripttobuildyourservice,andwheretoputthetar.gzfile. ToimportyournewlycreatedserviceintoVMwareStudio,seeImportingaManagementServiceonpage 58.

Additional Eclipse Features


YoucanuploadaCDimagebyrightclickingintheVMwareStudioExplorertab,selectingUploadISOImage, andopeninganISOfile.YoucanalsodeleteorrenameISOfiles. Youcanmanagepackagerepositories(bycreating,deleting,andrenamingthem).Youmustcreateapackage repositorybeforeyoucanexportaLinuxApplicationPackage. Withinpackagerepositories,youcandeleteandrenameVSPpackagefiles. YoucanaddpackagerepositoriestoaVMprofile.IntheVMwareStudioExplorertab,expandVMProfiles, expandaVM,rightclickitsprofile,andselectAddpackagerepository.Thisdownloadstheprofilefromthe VM,addsapackagerepositoryintotheapplicationpackagesoftheVM,andsavestheprofilebacktotheVM. Becareful:ifsomeoneelseiseditingthesameprofileatthesametime,yourprofilechangesmightbe overwritten,oroverwritetheotherpersonschanges. YoucanstartandmonitorbuildsofaVMorvAppbyrightclickingonaspecificProfileSummaryand selectingStartNewBuild.Allthebuildsarelistedwiththeirstatus.Youcancancelabuildthatiscurrently runningbyrightclickingonitandselectingCancelBuild,ordeleteabuildbyrightclickingonitand selecting Delete. YoucanaccesstheLogsandExportsofeachbuildbydoubleclickingontheminsidetheVMwareStudio Explorertab.YoucanopentheEclipseXMLeditorandreadtheprofile.xmlthatwasusedforeachbuildby doubleclickingontheprofile.TheEclipseXMLeditorisreadonly. YoucanopenaVMorvAppProfilesintheVMwareStudioWebconsolebydoubleclickingonit. ALinuxapplicationpackageisuploaded(exported)totheVMwareStudioapplianceasacompressedTAR file,convertedtoaRPMorDEBpackageduringtheVMbuild,installedintothevirtualappliance,andthen installedintotheupdaterepository. Youmustmanuallyincrementtheversionofanapplicationpackageifyouwantittoreplacetheoldpackage duringanapplianceupdate.

VMware, Inc.

71

Developers Guide to Building vApps and Virtual Appliances

Uninstalling the Eclipse Plugin


YoucanuninstalltheVMwareStudioEclipseplugin. To uninstall the Eclipse plugin 1 Dooneofthefollowing:

InEclipse3.4,selectHelp>SoftwareUpdates>InstalledSoftware. InEclipse3.5,selectHelp>AboutEclipse>InstallationDetails>InstalledSoftware.

2 3

SelectVMwareStudioPluginforEclipseandclickUninstall. RestartEclipsewhenprompted.

New Features in Studio 2.1


WelcomepagedescribeshowtogetstartedwiththeVMwareStudiopluginforEclipse. Livebuildlogsprovidemessageupdatesinrealtime,withoutyouhavingtoreopenthelogfile. YoucanrightclickthePropertiesmenuforexportableURLsofOVF,OVA,andZIPdistributionfiles. Usabilityimprovements:


TheVMtreerepresentationbecomesgrayedoutwhentheconnectiontoitfails. Inthetreeview,multipleselectissupportedfordeleting. AlsoyoucandeletebypressingkeyboardDeletekey.

SupportforanttargetsoutsidetheEclipseframework. AfteryoucreateaVMandapplicationasaVMwareStudioPackage(VSP),thedevelopmentenvironment remainsintactsothenextbuildcanfollowthesamepatternwithlessdeveloperintervention.

72

VMware, Inc.

Developing a Windows-Based VM

VMware, Inc.

73

Developers Guide to Building vApps and Virtual Appliances

74

VMware, Inc.

Creating a Windows-Based VM

ThischapterdescribeshowtocreateaWindowsbasedVMusingtheVMwareStudioWebconsole.

Overviewonpage 75 OperatingSystemISOImageonpage 76 WindowsApplicationPackagesonpage 76 CreatingaVMBuildProfileonpage 76 AdditionalFieldsforWindowsReferenceonpage 77 BuildingaVMfromtheBuildProfileonpage 80 TestingtheGeneratedVMonpage 80 ReiteratingtheBuildProcessonpage 81

Overview
VMwareStudiosupportsthecreationofvirtualmachinescontainingaWindowsbasedServeroperating systemanduserprovidedapplications. WindowsbasedVMsbuiltbyVMwareStudiodonothavetheVirtualApplianceManagement Infrastructure (VAMI)agent.

Prerequisites OS and Application


ThischapterassumesthatyouhavedownloadedtheVMwareStudiosoftwareontoasupportedvirtualization productplatform,asdescribedinDeployingVMwareStudioonpage 20.Youalsoneed:

AnISOimagefromthelistofWindowsoperatingsystemsinOperatingSystemISOImageonpage 76. AvalidlicensekeyfortheWindowsoperatingsystemyouselect. YourapplicationsharedonaMicrosoftNetworkFolder,orpackagedasaVMwareStudioPackage(VSP) forWindows,asoutlinedinWindowsApplicationPackagesonpage 76.

Accessing the Web Console


ToaccesstheWebconsolewithyourbrowser,navigatetotheIPaddressoftheVMwareStudioappliance.The accessURLappearsatinstalltime,asdescribedinDeployingVMwareStudioonpage 20.

VMware, Inc.

75

Developers Guide to Building vApps and Virtual Appliances

Operating System ISO Image


Table 91liststheWindowsdistributionsthatVMwareStudiosupports. Table 9-1. Operating System ISO Images
Operating System Name WindowsServer2008withoutHyperV Architecture 32bit 64bit WindowsServer2003 32bit 64bit Possible Variations Enterprise,Datacenter,Standard Enterprise,Datacenter,Standard Enterprise,Datacenter,Standard,Web,SMB Enterprise,Datacenter,Standard

Windows Application Packages


VMwareStudiocaninstallanapplicationintoaWindowsbasedVMbyexecutingtheapplicationinstaller duringtheVMbuild.Toautomaticallyinstalltheapplication,itisrequiredtoruntheinstallerinsilentmode whileusingtheappropriateinstallercommandline. VMwareStudioofferstwowaystoinstallyourapplication:

YoucaninstallanapplicationlocatedinaMicrosoftNetworkFolder,byspecifyingthesetupcommand linefromtheApplicationpreinstallscript,whichisoneoftheitemsyoudefineintheVMbuildprofile. Forexampletoinstallanapplicationfromanetworkdrive:


\\installserver\crm\setup.exe /s

YoucandefineaVMwareStudioPackage(VSP)forWindowstoencapsulateyourapplicationsetup,and hosttheapplicationsetupfilesintheVMwareStudioappliance.VSPforWindowsisafileformatthat describestheprocessofinstallingaWindowsapplicationintoaWindowsbasedVM. YoucanusetheVMwareStudioWebconsoletopackageanapplicationasaVSPforWindows. See CreatingaWindowsApplicationPackageonpage 84.

AVMbuildprofilecontainsalistofApplicationPackageRepositoryURLs,designatingVSPforWindowsfiles locatedonaMicrosoftNetworkFolder,forinstallinginthevirtualmachine.EachVSPforWindowsfileis loadedandexecutedintheorderlisted. Toincludeapackage,eitheraddtheURLofadirectorycontainingoneormoreVSPforWindowsfiles,oradd theURLofaVSPforWindowsfile.UsetheSMBprotocoltoindicateaMicrosoftNetworkFolderintheURL. Forexample,thisistheURLofaVSPforWindowsfile:


smb://installserver/crm/default.vsp

Creating a VM Build Profile


ThebuildprofilecontainsinformationaboutthecontentsoftheVM,virtualhardwareconfigurationofthe VM,andthelocationwheretoobtaintheOSISO.Thebuildprofilecontainsalltherequiredinformationto automatethebuildingofaVM.ThissectionexplainsstepstocreateaVMbuildprofilewiththeWebconsole. Subsequentsectionsprovidereferenceinformationabouttheoptionsineachconfigurationtab. YoucanusetheVMwareStudioWebconsoletocreateabuildprofileforaWindowsbasedvirtualmachine. To create a Windows VM 1 2 3 ObtaintheOSISOimageforasupportedversionofWindows. IntheVMstaboftheWebconsole,clickCreateProfile. IntheCreateaNewVMProfiledialog,specifyanameforyourvirtualmachine,selectaWindowsprofile fromthetemplates,andclickCreateProfile. VMwareStudiosuppliespreconfiguredtemplatesforthesupportedoperatingsystems.Afteryoucreate yourownvirtualmachine,italsobecomesavailableasatemplatetocreatederivedvirtualmachines.

76

VMware, Inc.

Chapter 9 Creating a Windows-Based VM

TheEditingpageappears,whereyoueditthebuildprofileofyourvirtualmachine.VMwareStudio showsdifferentitemstoeditforaWindowsvirtualmachinethanforaLinuxvirtualmachine,asnoted. TheVMeditingpageorganizesthebuildprofileintothefollowingtabs:

DescriptionSpecifiesgeneralinformationaboutthevirtualmachine.SeeDescriptionTabon page 37fordetails.WebConsoleVisualCustomizationandWelcomeTextfieldsarenotsupportedin WindowsbasedVM.Theenduserlicenseagreement(EULA)issupportedonlywhenpackagingthe WindowsbasedvirtualmachineasOVForOVA,andisdisplayedatdeploymenttime. HardwareSpecifieshardwareconfiguration,suchasCPU,memory,anddisks,forthevirtual machine.SeeHardwareTabonpage 38fordetails.Usethedrivefieldtoassignadrivelettertoa diskpartition. OSSpecifiesinformationabouttheoperatingsystemforthevirtualmachine.SeeOSTabon page 39fordetails.(OperatingSystemConfigurationincluded,seeOSTabonpage 77.) ApplicationSpecifiesthelistofVSPforWindowsfilestoinstallintothevirtualmachine.See ApplicationTabonpage 79fordetails. OutputSpecifiesthetypeofdistributionformat(OVF,OVA,orZIP)forthevirtualmachine.ZIPis fordeploymentonolderVMwareproductplatforms.OVFisfordeploymentonESX/ESXihostsor VMwarevSphere,andOVAforVMwarevSphere.SeeOutputTabonpage 43fordetails. BuildSettingsSpecifiessetupofthebuildenvironment,suchasconnectioninformationtomany possibleprovisioningplatforms.SeeBuildSettingsTabonpage 44fordetails.

UsetheNextandBackbuttonstonavigatebetweenthetabs,fillingintherequiredandoptionalfields. If youattempttonavigatetothenextpagewithoutspecifyingarequiredfield,anerrormessageappears inrednexttothefieldshowingwhereyoumustfixaproblembeforecontinuing. Eachfieldinthebuildprofilehasahelpicon(iinacircle)ontherightside.Clickingthehelpicontoggles betweendisplayofcontextualhelpandalistoffrequentlyaskedquestions(FAQ). TabsbelowthepurpleVMwareStudiologo(topleft)navigatetootherinterfacesintheWebconsole. Attemptingtonavigateofftheeditingpageproducesadialogaskingifyouwanttodiscardyouredits. 5 Afteryouconfigureabuildprofile,youcantakeoneofthefollowingactionsbyclickingabuttononthe rightsideofthewindow:

ValidateAftercompletingabuildprofile,youcanvalidateitsconfigurationbeforebuildingthe virtualmachine.ClicktheValidatebuttonontherightsideofthewindowtocheckthebuildprofile. SaveandBuildValidatesandsavesyourbuildprofileanddisplaysthebuildsummarydialogbox. Tobeginthebuildprovisioningprocess,clickBuildVMinthisdialogbox.Aprogressiconappears andabuildlogisavailabletoviewthestatusofthebuildasitprogresses. SaveandCloseSavesyourbuildprofileandclosestheeditingpage.Youcansaveanincomplete profile.ThebuildprofileappearsintheVMList,soyoucanchoosetoeditorbuilditlater. CloseWithoutSavingClosestheeditingpageanddiscardschanges.Awarningappearsaskingif youaresureyouwanttodiscardchangesmadeduringthecurrentsession.

Additional Fields for Windows Reference


ThissectiondescribesthenewitemsthatarerequiredforaWindowsbuildprofile.

OS Tab
TheOSTabcontainsthebasicsettingstoinstallWindowsinunattendedmode.VMwareStudiocreatesan unattendedsetupfilewithsettingsfromtheOperatingSystemInstallationConfigurationsection,and providesittotheWindows. Table 92describesthenewconfigurationpropertiesintheoperatingsystemOStab.

VMware, Inc.

77

Developers Guide to Building vApps and Virtual Appliances

Table 9-2. Operating System Tab New Properties


Field Operating System OSEdition SpecifiestheWindowsOSeditiontoinstall. MakesuretousethecorrectOSISOtomatchtheselectedOSEdition. Windows2003providesaseparateCDforeachedition,whileWindows2008 providesaDVDthatincludesalltheeditions. Operating System Installation Configuration ProductKey TheproductkeycodetoactivatetheMicrosoftlicenseforWindowsServer,in theformXXXXXXXXXXXXXXXXXXXXXXXXX. Windows2008canbeactivatedafterinstallationbykeepingthisfieldempty. OwnerName OrganizationName ComputerName LicenseMode ConcurrentConnections TimeZone JoinNetwork Ownersfullname. Ownersorganizationname. Specifiesthecomputernameinthenetwork.Use*togeneratearandom computername. (Windows2003)Whetherthelicenseisperserver,perdevice,orperuser. (Windows2003)Networkconnectionsallowedsimultaneously.Theminimum valueis5. SpecifiesthelocaltimezonefortheWindowsvirtualmachine. Specifiesnetworkmembershipsettingsforthisvirtualmachine.

Description

WorkgroupNameoftheworkgroupinwhichthecomputerparticipates. DomainNameofWindowsdomaininwhichthecomputerparticipates. UsernameForadomain,nameoftheuseraccountthathaspermissionto createacomputeraccountinthatdomain. PasswordForadomain,passwordofthatuseraccountthathas permissiontocreateacomputeraccountinthatdomain.

ItisnotrecommendedtojoinadomainduringtheVMprovisioning,iftheVM isgoingtobedeployedmorethanonce.Itispreferredtojointhedomainduring theVMdeployment,whileusingtheSyspreptool. AdditionalUnattendedConfiguration VMwareStudioautomatestheOSinstallationbycreatingaWindows unattendedfilewithsettingsbasedontheVMbuildprofile. Additionalunattendedconfigurationcanbeprovidedtomergewiththe unattendedfilecreatedbyVMwareStudio.Thisisanadvancedfeaturetoallow additionalcustomizationoftheWindowsOSinstallation,suchasperforming installationorremovalofOScomponents Windows2003usestheunattend.txtformat.Foradditionalinformationsee http://support.microsoft.com/kb/155197 Windows2008usestheunattend.xmlformat.Foradditionalinformationsee http://technet.microsoft.com/enus/library/cc730695(WS.10).aspx#BKMK_2 Operating System Sysprep Configuration PerformSysprep Ifchecked,runSyspreptoolattheendofinstallation. TheSystemPreparationtool(Sysprep)isatechnologyprovidedbyMicrosoft toautomatethecloninganddeploymentofWindowsoperatingsystem.Using SysprepisrecommendedwhenaVMwillbedeployedmorethanonce,to preparethesystemforcloning. Foradditionalinformationseehttp://support.microsoft.com/kb/302577 ForWindows2003basedVMs,theSyspreptooliscopiedfromtheWindows 2003CD(deploy.cab)intotheVMlocalfilesystemundertheC:\Sysprep folder.TheSyspreptoolisalreadyinstalledaspartofWindows2008. GeneratenewSID SysprepCommand (Windows2003)Ifchecked,generateanewSecurityID(SID).Windows2008 alwaysgenerateanewSIDwhenusingSysprep. Sysprepcommandtoexecute.

78

VMware, Inc.

Chapter 9 Creating a Windows-Based VM

Table 9-2. Operating System Tab New Properties (Continued)


Field SysprepConfigurationFile Description ContentsoftheSysprepanswerfile.SpecifyanyrequiredSysprepsettings whenrunningtheVMforthefirsttime.Thedefaultcontentprovidedby VMwareStudioisusingaspecialvariableconventiontosetsomeSysprep settingsfromtheOSinstallationsettings.Forexample,theProductKeycanbe retrievedbyusing$(ProductKey)intheSysprepconfigurationfilecontent. Windows2003usesthesysprep.infformat.TocreateaSysprep.infanswer fileforusebySysprep,youcanusetheSetupManagertoolthatisincludedon theWindows2003CDandalsointheMicrosoftWindows2003ResourceKit. Windows2008usesthesysprep.xmlformat.Tocreateasysprep.xmlanswer fileforusebySysprep,youcanusetheSetupManagertoolthatisincludedin theWindowsAutomatedInstallationKit(AIK).TolocatetheAIK,searchfor AIKdownloadontheMicrosoftWebsite. User Accounts AdministratorPassword AddUser PasswordoftheAdministratoruseraccountfortheWindowsVM. ClicktheAddUserbuttontoaddanewusertothisWindowsVM.Yousupply username,password,confirmpassword,fullname(optional),andgroup membershipforthenewuser. Todeleteauser,clicktheRemoveUserlinkintheupperrightcorner. Ifneeded,usetheApplicationpreinstallscripttoenableandsetthepassword oftheGuestuseraccount.

Application Tab
Table 93describestheconfigurationpropertiesavailableontheApplicationtab. Table 9-3. Application Tab Configuration Properties
Field Application Packages ApplicationPackageRepositories Add|AddURL|Edit|Remove AlistofApplicationPackageRepositorieswithVSPforWindowsfiles. UsetheMoveUpandMoveDownbuttonstospecifytheinstallationorder. YoucanincludeaVMwareStudioWindowsPackageforWindowseitherfrom theVMwareStudioapplianceWindowspackagesrepositoryorfromany MicrosoftNetworkFolder. ToaddanapplicationpackagefromtheVMwareStudioappliancepackages repository,clickAdd,AdialogboxshowsalistofpackagesintheVMware StudioapplianceWindowspackages(underthe/opt/vmware/depot/winrepo directory).SelecttheWindowspackageorpackagestobeincludedaspartof theVM,andclickAddinthedialog. VMwareStudiopackagescanbeinstalledfromanyMicrosoftNetwork Foldersbyspecifyingthesmbprotocol,asinthisexample: smb://appstorage/windows/sharepoint/sharepoint.vsp ToaddanapplicationpackageordirectoryofpackagestoyourVM,clickAdd URL,entertheURLofthepackageordirectoryonaMicrosoftNetwork Folder,andclickOK. TochangetheURLofanapplicationpackageordirectory,clickEdit,modify theURL,andclickOK.Todeleteanentry,clickRemove. SeeWindowsApplicationPackagesonpage 76fordetailsaboutapplication repositories. Application Installation Customization ApplicationPreInstallScript ApplicationPostInstallScript Scriptthatrunsafterinstallationoftheoperatingsystem,butbeforethe installationofapplicationpackagesduringvirtualmachineprovisioning. Scriptthatrunsaftertheinstallationofapplicationpackagesduringthevirtual machineprovisioningphase. Description

VMware, Inc.

79

Developers Guide to Building vApps and Virtual Appliances

Building a VM from the Build Profile


Afteryouhavecompletedabuildprofile,youcanbuildyourVM.FirstclickValidatetoverifythecontentsof thebuildprofile.IftheVMprofilevalidates,clickSaveandBuild.ThenintheBuildSummarydialogbox,click BuildVM.ThisstartsbuildingatransientVMontheprovisioningplatform. ToretainthetransientVMwithoutcleaningupafterthebuild,intheBuildSummarydialogbox,click AdvancedBuildSettings.ThismakesvisibleacheckboxsayingRetaintransientVMonthevirtualization platformandskipprovisioningcleanup.ClickingthecheckboxallowsyoutotesttheVMontheprovisioning platformbeforedeployingitelsewhere. Whenthebuildstarts,astatusiconappearstoindicatethatthebuildisinprogress.Asprovisioningcontinues, abuildlogappearstoinformyouofeachcompletedstepinVMprovisioning.Tocancelabuildinprogress, clickCancelunderthestatusicon. IMPORTANTYoucanmonitortheinstallationofWindowsandyourapplicationsontheconsoleofthe provisioningserver.Todothis,starteithertheVMwarevSphereClient,theVMwareInfrastructureClient,or theVMwareServerConsoleapplication.Workstationmustbestartedalready.SelecttheVMthatyouspecified intheprofileyoujustcreated,whichshouldpoweron,andclickConsole(ifnotalreadydisplayed). WatchingtheVMprovisioningcanhelpgreatlyifsomethinggoeswrong. Whenthebuildcompletesorfails,VMwareStudioinformsyouwhetherthisbuildwassuccessfulornot.If you encounterproblemswhenbuildingavirtualmachine,seeTroubleshootingVMBuildsonpage 135for diagnosticinformation. Afterabuild,youcanviewvariouslogstoseewhathappenedduringthebuild.InthelistofVMprofiles,select aVMandclickBuildLogtoseearecapofbuildprogress. Toseethebuildsummary,variouslogs,anddiscoveryreports:intheVMList,clicktheVMname>Finished (orFailed,orCanceled).TheDetailsdialogboxappears,withthefollowingtabs:

BuildSummaryprovidesdetailsofthebuildprofileconfiguration. VerboseLogprovidesadetailedlogofeachcompletedphaseofthebuildprocess. DebugLogprovidesdetailsofeachcompletedbuildphase,includingdebugginginformation. ApplicationInstallLogprovidesalogoftheinstallationmessagesastheoperatingsystemandeach applicationpackagegetsinstalledintothevirtualmachine.Reviewingtheinstalllogcanhelpwhen troubleshootingpackagedependencyerrorsifmorepackagesarerequired. DiscoveryReportsprovidesinformationaboutpackages,hardwaresettings,andoperatingsystem.

EachbuildisstoredintheVMwareStudioappliancesfilesystem.Youcandeleteolderbuildswhentheyare nolongerneeded.SeeReiteratingtheBuildProcessonpage 81formoreinformation.

Testing the Generated VM


AfteryouhavesuccessfullybuiltaVM,youcanobtainthevirtualmachinedistributionfilebyclickingonthe ZIPorOVFlink(dependinguponwhichtypeofoutputfileyouspecified)intheDownloadcolumnofthe VMsPreviousBuildlist. YoushouldclickonyourvirtualmachinedistributionfileandtestthecompletedVMbydeployingitintothe intendedenvironmenttoensurethattheVMandanyapplicationsthatitcontainsworkproperly.Youcan downloadaZIPfilefortesting.DonotdownloadanOVFfortesting,becauseifyoudo,yougetonlytheOVF andnottheassociatedVMDKfiles.Instead,testtheOVFbyrightclickingontheURL,copyingit,andpasting itintotheImportApplianceorDeployOVFTemplatedialogboxesofESX3.5or4.0,respectively. Verifythatallapplicationpackagesareinstalledcorrectlyandthatyourbootscriptsruncorrectly.Checkthat yourapplicationstartscorrectly. Ifyouplantodistributethisvirtualmachineasavirtualappliancetoyourcustomers,seetheUsersGuideto DeployingvAppsandVirtualAppliancesforinformationaboutdeployingyourvirtualappliancefortesting.

80

VMware, Inc.

Chapter 9 Creating a Windows-Based VM

Reiterating the Build Process


ManydevelopersfindthataneasywaytoacreateaWindowsVMistobuilditinitiallyjustcontainingthe operatingsystem,thenaddapplicationpackagesanddependenciesinsuccessivebuilds.Eachsuccessfulbuild occupiesspace,butyoucandeletethem. TodeleteabuildusingtheVMwareStudioconsole,selectaVMfromtheVMList,locatethebuildinstance youwanttoremove,andclickDelete.Youcanalsodeleteabuildusingthestudiocli-dcommand.

VMware, Inc.

81

Developers Guide to Building vApps and Virtual Appliances

82

VMware, Inc.

10

Packaging a Windows Application

10

Thischaptercontainsthefollowingsections:

AboutVMwareStudioPackageforWindowsonpage 83. RepositoryofWindowsApplicationPackagesonpage 83 CreatingaWindowsApplicationPackageonpage 84.

About VMware Studio Package for Windows


VMwareStudioPackage(VSP)forWindowsisafileformatthatdescribestheprocessofinstallingaWindows applicationintoaWindowsbasedVM.VSPforWindowsworkstogetherwithexistingapplicationinstallers, anddefinesthecommandlineandscriptstoruntheinstallerinsilentmode.UsingaVSPforWindowshasthe followingkeyfeatures:

Supportsallsilentapplicationinstallers(MSI,InstallShield,andothers). Providesacontainerforapplicationsetupfiles. Allowsmultiplecommandlinesandscripts(Shell,JScript,VBScript). Handlesexecutionerrors. Rebootstheoperatingsystemasneeded. PermitsreuseofthepackagedefinitionwithmultipleVMbuildprofiles.

VSPforWindowscanalsobeusedtoperformsimpleapplicationinstallationtasks,suchascopyingfilesand updatingtheregistry.Forexample,youcanprovideashellscripttocopyfilesfromthepackagefoldertothe VMslocalfilesystem.Usuallytheinstaller(suchasMSI)updatestheregistry.VSPforWindowsshouldnot beusedasareplacementforexistingapplicationinstallationtechnologies. TheVSPforWindowsfileformatissimilarbutnotidenticaltotheVSPforLinuxproducedbyVMwareStudio PluginforEclipse.

Repository of Windows Application Packages


TheVMwareStudioappliancecontainsaWindowspackagerepositorythathostsuserdefinedVSPfor Windows,forinstallinginWindowsbasedVMs.EachWindowspackageisassignedadirectory,which containstheVSPfileformatandadditionalfilesusedtoinstalltheapplication.Suchasexecutables,scripts, MSIfiles,andsoforth. AVSPforWindowsisplacedontheVMwareStudioapplianceunderthefolder:
/opt/vmware/depot/winrepo

VMwareStudiocontainsaSambaservertoallowremoteaccesstotheWindowspackagesrepository.Using rootusercredentials,youcanaccessitforuploadingsetupfilesinthefollowingMicrosoftNetworkFolder:
\\<studio-address>\depot\winrepo

VMware, Inc.

83

Developers Guide to Building vApps and Virtual Appliances

Creating a Windows Application Package


UsetheLibrarytabtocreateaVSPforWindows. To package a Windows application 1 2 3 Identifytheapplicationsetupfilesandtherequiredcommandtorunthesilentinstaller. IntheVMwareWebconsole,clickLibrary>Windows>CreatePackage. IntheCreateaNewWindowsPackagedialogbox,specifyanameforyourpackage.Spacesarenot allowed.Selectatemplatefromthelist,usetheOthertemplateforacleanpackagedefinition. Click Create.AfteryoucreateaWindowspackage,itbecomesavailableasanothertemplateinthislist. OntheEditingpage,optionallyprovideadescriptionofthepackage. Uploadallfilesrequiredtoinstallyourapplicationintothepackagefolder,whichcanbereachedeither locallyontheVMwareStudioappliance,orremotelyasaMicrosoftNetworkFolderbyauthenticatingas theVMwareStudiorootuser.
VMware Studio Appliance Folder: /opt/vmware/depot/winrepo/<package-name> Microsoft Network Folder: \\<studio-address>\depot\winrepo\<package-name>

4 5

WithintheCommand1section,definetheappropriateexecutableorscripttoinstalltheapplicationin silentmode.Severalcommandtypesaresupported.

ProgramExecutetheprogramdefinedinthecommandfield. ShellRuntheshellscriptdefinedinthescriptfieldusingtheCommandInterpreter(CMD). VBScriptRuntheVBScriptdefinedinthescriptfieldusingWindowsScriptEngine. JScriptRuntheJScriptdefinedinthescriptfieldusingWindowsScriptEngine.

Forexample,thefollowingcommandexecutestheFirefoxinstallerfromthepackagedirectory:
Firefox Setup 3.0.6.exe -ms

Asanotherexample,thefollowingcommandskicksoffanMSIbasedinstallation:
msiexec /i crm.msi ADDLOCAL=ALL /NoRestart /Passive

Duringpackageinstallation,thepackageMicrosoftNetworkFolderismappedasanetworkdriveand usedastheworkingdirectoryoftheexecutedcommandsandscripts.Userelativepathsinthecommands andscriptstoaccessfilesinthepackagedirectory. 7 Forvariouscommandexitcodes,addtheactiontoperforminthatcase.Defineanyadditionalexitcode handlingthatyourapplicationrequiresbyclickingtheAddResultbutton.Usetheasterisk(*)exitcode todefineadefaultactionforexitcodesthatarenotlisted.Whendefiningactions,youcanchoosefromthe followinglistofavailableactions.


OKsuccessfulexecution. Rebootimmediatelyrebootnowbeforecontinuingtothenextcommandorpackage. Rebootoninstallationendrebootafterinstallingallpackages. Rebootonpackageinstallationendrebootafterallcommandsinthecurrentpackageareexecuted. Rebootimmediatelyandrepeatcommandrebootnowandreexecutethecurrentcommand. Failexecutionfailed.

Toaddexitcodes,andforalistofregisteredexitcodes,seeRegisteredExitCodesonpage 85. 8 9 Ifinstallationofyourapplicationrequiresanothercommand,clickAddCommandandtypeitunder Command2(andup).Repeatthisstepforasmanycommandsasyouneed. ClickSaveandClosetoretainyourchanges.YourapplicationappearsinthelistofWindowsPackages.

84

VMware, Inc.

Chapter 10 Packaging a Windows Application

Registered Exit Codes


Thesearetheregisteredexitcodesthatdefinethedefaultbehavior.ClickAddResulttoregisternewexitcodes tooverridethedefaultbehavior.

0OKsuccessfulexecution. 1641Rebootimmediatelyrebootnowbeforecontinuingtothenextcommandorpackage. 3010Rebootoninstallationendrebootafterinstallingallpackages. *(Other)Failexecutionfailed.

Environment Variables when installing Packages


VMwareStudiosupportsthefollowingenvironmentvariablesincommandsandscripts:

PACKAGEDIRLocationofcurrentpackagefolder. ThisexampleshowsusinganabsolutepathtotheMSIfile:
msiexec /i %PACKAGEDIR%\application.MSI /Passive

REPOSITORYDIRLocationoftheVMwareStudioWindowspackagesrepository. ThisexampleshowsusingMSIfilefromanotherpackage:
msiexec /i %REPOSITORYDIR%\crm\application.MSI /Passive

LOGDIRLocationoftheloggingdirectory.Logfilescreatedunderthisdirectoryarecopiedtothestatus directoryoftheVMbuildinstanceintheVMwareStudioappliance. ThisexampleenablesthelogfileduringMSI:


msiexec /i CRM.msi /Lime "%LOGDIR%\crm.log" ADDLOCAL=ALL /NoRestart /Passive

VMware, Inc.

85

Developers Guide to Building vApps and Virtual Appliances

86

VMware, Inc.

Developing a vApp for vSphere

VMware, Inc.

87

Developers Guide to Building vApps and Virtual Appliances

88

VMware, Inc.

11

Creating a vApp from VM Builds

11

ThischapterdocumentsuseoftheVMwareStudioWebconsoleforbuildingavApp.

IntroductiontoBuildingavApponpage 89 ApplicationsinavApponpage 90 ImportingvAppProfilesonpage 94 WebConsoleTabReferenceonpage 90 BuildingavAppBuildProfileonpage 93 TestingtheGeneratedvApponpage 94

AvAppisaprebuiltsoftwaresolution,consistingofoneormorevirtualmachines(VMs)andapplications, whicharepotentiallyoperated,maintained,monitored,andupdatedasaunit.TheOVF1.0standardis requiredtorepresentthecombinationofmultiplevirtualmachinesandapplications.

Introduction to Building a vApp


ThevAppunifiesasetofVMsandapplications,definingtheirdependenciesandinterfunctionality,including packaging,startorder,andresourceallocation. YoucanmixLinuxbasedVMsandWindowsbasedVMstogetherinavApp.

Prerequisites
TobuildavAppyoumusthaveoneormorevirtualmachinebuildprofiles.Ifavirtualmachineisnotbuilt, thevAppbuildprocessattemptstobuildit.FordetailsaboutVMbuildprocedures,seeChapter 4,Creating aLinuxBasedVM,onpage 33orChapter 9,CreatingaWindowsBasedVM,onpage 75. TorunavApp,youneedavirtualizationproductplatformthatsupportsOVF1.0,suchasVMwarevSphere.

Creating a vApp Build Profile


JustasyoucreatedandbuiltvirtualmachinesusingtheVMstaboftheVMwareStudioWebconsole,you createandbuildvAppsusingthevAppstab. To create a vApp 1 InthevAppstaboftheWebconsole,clickCreateProfile.IntheCreateaNewvAppProfiledialogbox, chooseanameforyourvApp,selectatemplatefromthelist,evenifonlyoneappears,andclick Create Profile. AfteryousuccessfullysaveavAppprofile,itbecomesavailableinthislistandcanbeusedasastarting pointtodefineanothervAppbuildprofile.

VMware, Inc.

89

Developers Guide to Building vApps and Virtual Appliances

ThevAppwizardappears,whereyoucaneditthebuildprofileofyourvApp.Thiswizardorganizesthe buildprofileintothefollowingtabs:

DescriptionGeneralinformationaboutthevApp.SeeDescriptionTabonpage 91fordetails. VMsThevirtualmachinestoincludeinthevApp.SeeVMsTabonpage 91fordetails. StartOrderStartorderofvirtualmachinesinthisvApp.SeeStartOrderTabonpage 92for details. ResourcesControlsvSphereresourcesforvirtualmachinesinthisvApp.SeeResourcesTabon page 92fordetails. OutputSelectsoutputformat,virtualmachinewhichholdstheApplicationURL,andOVFsettings. SeeOutputTabonpage 92fordetails.

3 4

IntheDescriptiontab,specifytheproductnameandversion,atminimum. IntheVMstab,clickAddVMs,selectatleastoneVMbuildprofile,andclickAdd. Dothisatleastonce.MostvAppscontainmorethanoneVM.

5 6

IntheStartOrdertab,youcancontrolpoweronandpoweroffsequenceoftheVMsbyplacingvirtual machinesintodifferentbootgroupsandspecifyingstart/stopdelay. IntheResourcestab,youcancontroltheCPUandmemorysharesthatvSphereallocatesforeachVM. Forinformationaboutbootgroups,CPUshares,andmemoryshares,seethevSpheredocumentation.

7 8 9

IntheOutputtab,youmustspecifyaFileNamefortheresultingvApp.YoucanalsoenableOVAarchive inadditiontoOVF,controlthemethodofIPassignment,andaddnewOVFproperties. (Optional)ClickValidatetocheckyoursettings. TobuildthevApp,clickSaveandBuildandintheBuildSummarydialogbox,clickBuildvApp. TheSaveandClosebuttonwritestodiskthesettingsyoucreated.TheCloseWithoutSavingbutton discardsyoursettings.

Ifthebuildissuccessful,yournewvAppappearsinthelistofvAppprofilesunderthevAppstab.Ifthebuild fails,diagnosticmessagesappearintheBuildSummarydialogbox. NOTEAnyvAppmustberepresentedaccordingtotheOVF1.0standard.TheOVF0.9specificationdidnot allowmultiplevirtualmachinestoberepresentedinacollection. Applications in a vApp AvAppisaprebuiltsoftwaresolutionconsistingofoneormorevirtualmachines(VMs). YouincludeLinuxapplicationsbyspecifyingthemintheApplicationPackageRepositorieslistforoneofthe childLinuxVMsofthisvApp,asdescribedinApplicationPackagesonpage 35. YouincludeWindowsapplicationsbyusingtheLibrary>Windowstabtocreatepackagesforapplications, ortoimportexistingpackagesforoneofthechildWindowsVMsofthisvApp,asdescribedinCreatinga WindowsApplicationPackageonpage 84.

Web Console Tab Reference


ThesesectionsdocumentallfieldsindifferenttabsoftheWebConsole.

DescriptionTabonpage 91 VMsTabonpage 91 StartOrderTabonpage 92 ResourcesTabonpage 92 OutputTabonpage 92

90

VMware, Inc.

Chapter 11 Creating a vApp from VM Builds

Description Tab
Table 111describestheconfigurationpropertiesavailableontheDescriptiontab. Table 11-1. Description Tab Configuration Properties
Field Information ProductName Version FullVersion ProductURL Vendor Description NameofthevAppthatyouarebuilding.ThisnameisusedtoshowthisvAppinthe vSphereinventoryandintheSummarytabofvSphere. VersionofthevApp.ThisisshownintheSummarytabforthisvAppinthevSphere client. ArbitrarytextstringusedtodisplayversioninformationofthevApp,oftensimilar toVersion.ThisisshownintheSummarytabforthisvAppinthevSphereclient. URLonthecompanysWebsitewherecustomerscanfindinformationaboutthis vAppThisisshownintheSummarytabforthisvAppinthevSphereclient. CompanynameofthevAppvendor.ThisisshownintheSummarytabforthisvApp inthevSphereclient. DescriptionofthefunctionalitythatthisvAppprovides.Thedescriptiondisplays whenthevAppisimportedintoESXasanOVFandintheSummarytabforthis vAppinthevSphereclient. VendorURLtoyourcompanysWebsite.ThisisshownintheSummarytabforthis vAppinthevSphereclient. URLtotheWebconsolefortheapplicationprovidedinthisvApp.The${app.ip} keywordintheURLresolvestotheVMsIPaddress,afterdeployment,atruntime. IntheOutputpageforvApps,theApplicationURLConfigurationfieldcontainsa menuwhereyoucanspecifywhichVMyouwantrepresentedin${app.ip}. Description

VendorURL ApplicationURL

End-User License Agreements AddEULA EULA ClicktheAddEULAbuttontoaddanenduserlicenseagreement(EULA). ThefulltextofyourEULA.Theuserispresentedwiththislicensewhenrunningthe vAppforthefirsttimeandmustacceptthislicenseagreement.IfnoEULAisdefined, thenthevAppbootswithoutuserintervention. YoucanaddmorethanoneEULAbyclickingtheAddEULAbuttonagain.Youcan deleteaEULAbyclickingtheRemoveEULAlinkontherightaboveitsEULA.

VMs Tab
Table 112describestheconfigurationpropertiesavailableontheVMstab. Table 11-2. VMs Tab Configuration Properties
Field VM List ProfileName Location Build Nameofthevirtualmachineprofile. LocationoftheOVForOVAfilefromwhichthisvAppisbuilt. Thedropdownboxallowyoutoselectanexistingbuild,orrebuildfromitsprofile. TheBuildfromprofilechoicemeansthatVMwareStudiorebuildstheVMfromits profileeachtimeyoubuildthevApp. ClicktheRemovebuttontodeleteaVMfromthevApp. ClicktheAddVMsbuttontoaddaVMtothisvApp. Description

Remove AddVMs

VMware, Inc.

91

Developers Guide to Building vApps and Virtual Appliances

Start Order Tab


Table 113describestheconfigurationpropertiesavailableontheStartOrdertab. Table 11-3. Start Order Tab Configuration Properties
Field VM List BootGroup StartAction StartDelay(sec) Orwhentoolsisready StopAction StopDelay(sec) Allvirtualmachineswhicharepartofthesamebootgroupstartoneafteranotherbasedon thestartactionspecified. Atstarttime,whethertopoweronthevirtualmachine,ordonothing. Thenumberofsecondstowaitforpoweron,ifnotwaitingfortools.Thestartsequence continuesafterthisdelay. Ifselected,waituntilVMwareToolsisrunningbeforeinitiatingapplications. Atstoptime,whethertopoweroff,suspendthevirtualmachine,orshutdowntheguestOS. Thenumberofsecondstowaitforpoweroff. Description

Resources Tab
Table 114describestheconfigurationpropertiesavailableontheResourcestab. Table 11-4. Resources Tab Configuration Properties
Field VM List CPUShares MemoryShares ThepriorityforthisvirtualmachinerelativetootherswhennonreservedCPUisavailable. Thepriorityforthisvirtualmachinerelativetootherswhennonreservedmemoryisavailable. Description

Output Tab
Table 115describestheconfigurationpropertiesavailableontheOutputtab. Table 11-5. Output Tab Configuration Properties
Field Distribution Format FileName OutputFormat NameofthevAppfile.ThisnameisvisibletouserswhentheydownloadtheOVForOVA package. UseOVFformatfordeployingthisvApponanyVMwarePlatform. UseOVA(archive)formatforfasterdeploymentbystreamingthevApp. Application URL Configuration ApplicationURLVM WhenyouspecifiedtheApplicationURLforthisvApp,theVMsIPaddressissubstituted intothe${app.ip}variableintheURL.BecauseavAppcanhaveseveralVMs,youmust specifywhichoftheVMscomprisingthevAppwillhaveitsIPaddresssubstitutedintothe ${app.ip}variable.SelecttheVMtowhichthevAppsApplicationURLshouldpoint. Description

OVF IP Assignment Settings DHCP DuringdeploymenttheuserisgiventheoptiontouseaDHCPserverforconfiguring networkingofallVMswithinthisvApp.ThenetworkingforallVMsisautomatically configuredbyStudiosinguestagent.IfanIPpoolisnotconfiguredonthevCenterServer, yougetawarningifyouhaveassociatedaVMorvAppwithanetworkthatfailsto designateaDHCPserverintheIPpool,butyoucandisregardthewarning.

92

VMware, Inc.

Chapter 11 Creating a vApp from VM Builds

Table 11-5. Output Tab Configuration Properties (Continued)


Field OVFEnvironment Description DuringdeploymenttheuserisgiventheoptiontouseafixedortransientIPaddressforall VMswithinthisvApp.ThenetworkingforallVMsisautomaticallyconfiguredbyStudios inguestagent.ThisrequiresanIPpooltobeconfiguredonthevCenterServer.

OVF Properties Key Label Description Type DefaultValue MaximumLength Range ValueMap UserConfigurable ovf:type ovf:value ovf:qualifiers vmw:qualifiers KeytoOVFProperty. LabelforOVFProperty. DescriptionofOVFProperty. ListofOVFpropertytypessupportedbyStudio.ThesetypesareenforcedbyVMware vSphereduringdeployment. String,unsignedinteger,stringchoice,Booleanvalue,orIPaddressofthisproperty. Maximumlengththatcanbespecifiedforastringproperty. Lowandhighvaluesthatcanbespecifiedforanintegerproperty. Listofpossiblevaluesforastringchoiceproperty. Whethertopromptusertoallowchangingofproperty. EachPropertyelementinaProductSectionmustbeassignedanovf:typeattribute.Valid typeslooklikeCIMdatatypesandarelistedintheOVFspecification. Optionalattributeovf:valueprovidesadefaultvalueforaPropertyelement. Optionalattributeovf:qualifersspecifiesCIMtypequalifiersforaProperty,with multiplequalifiersseparatedbycommas. Optionalattributevmw:qualifersgivesVMwarespecificqualifiersforaProperty.

Building a vApp Build Profile


Afteryouhavecompletedabuildprofile,youcanbuildyourvApp.FirstclickValidatetocheckforminor errors.IfthevAppprofilevalidates,clickSaveandBuild. Whenthebuildstarts,astatusiconappearstoindicatethatthebuildisinprogress.Asprovisioningcontinues, abuildlogappearstoinformyouofeachcompletedstepinvAppprovisioning.Tocancelabuildinprogress, clickCancelunderthestatusicon. Whenthebuildcompletesorfails,VMwareStudioinformsyouwhetherthisbuildwassuccessfulornot.If youencounterproblemswhenbuildingavirtualmachine,seeTroubleshootingVMBuildsonpage 135for diagnosticinformation. Afterabuild,youcanviewvariouslogstoseewhathappenedduringthebuild.InthelistofvAppprofiles, selectavAppandclickBuildLogtoseearecapofbuildprogress. ClickContentstoshowtheVMsthatarecontainedinthevApp. ToseethevAppbuildsummaryandverboselog,clickPreviousBuilds>BuildStatus>Finished(orFailed). TheDetailsdialogboxappears,withthefollowingtabs:

BuildSummaryprovidesdetailsofthebuildprofileconfigurationandEULAs. VerboseLogprovidesadetailedlogofthevAppvalidationbuild.

EachvAppbuildisstoredinthefilesystem.YoumightwanttodeleteoldervAppprofileswhentheyareno longerneeded.Todoso,selectanoldbuildinthePreviousBuildslistandclicktheDeletebutton.

VMware, Inc.

93

Developers Guide to Building vApps and Virtual Appliances

Testing the Generated vApp


AfteryouhavesuccessfullybuiltavApp,youcanobtainthevAppdistributionbyclickingintheDownload columnofthevApplistontheOVF1.0orOVAlink(dependinguponwhichtypeofoutputfileyouspecified forbuildoutput).Likewise,youcanobtaintheOVForOVAfilesforoldbuildsinthePreviousBuildslist. YoucantestthecompletedvAppbydeployingitintheintendedenvironmentandverifyingthatthevApp andanyapplicationsthatitcontainsworkproperly.Checkthatyourapplicationstartscorrectly.Ensurethat allpackagesaredeployedproperlyandthatbootscriptsruncorrectly. NOTEItisnotpossibletopublishvAppupdatesasaunit.YoumustseparatelyupdatetheconstituentVMs ofavApp.

Importing vApp Profiles


YoucanimportvAppbuildprofiles/templatesintoVMwareStudiointhefollowingcircumstances:

WhenyouupgradetoanewerversionofVMwareStudio. WhenyoumanuallycreateavAppbuildprofile. UsingaprofilecreatedbyanotheruseronanotherVMwareStudioappliance.

To import an existing vApp profile into VMware Studio 1 2 3 4 5 PlacethevAppbuildprofileonthehostwheretheWebbrowserruns. IntheVMwareStudioWebconsole,clickthevAppstabandclicktheImportProfilebutton. AdialogboxappearswhereyoumustenterthenameofthevApp.YoucanclicktheBrowsebuttonto findtheprofileonyourcomputer. ClickImportProfile.VMwareStudiocreatesanewvAppprofilebasedontheimportedbuildprofile,and addsittothelistofvApps. VMbuildprofilesthatarereferencedbythisvAppbuildprofilemustbeimportedintoVMwareStudio beforeyoucanbuildthisvApp.

94

VMware, Inc.

12

Guidelines for Creating Virtual Appliances

12

VMwareStudioallowsdeveloperstocreateVMsandvAppsthatyoucanshipasvirtualappliances. This chapterdescribesthebestpracticesforcreatingvirtualappliances.


OutlineofVirtualApplianceBuildProcedureonpage 95 VMwareRecommendationsonpage 95

Outline of Virtual Appliance Build Procedure


YoubeginbuildingavirtualappliancethesamewaythatyoucreateaVMoravApp:bycreatingaprofilethat definesacontaineranditsincludedsoftwarepackages. To manage the virtual appliance life cycle 1 Defineabuildprofilewiththefeaturesyouwant.SelectanoperatingsystemfortheVM,thevirtual hardware,andapplicationpackagestoinclude.Youcanconfigurethewelcomescreen,firstbootscript, andsubsequentbootscripts. VMwarerecommendsthatyouselectvirtualhardwareversion4.Version4virtualmachinesare compatibleacrossallVMwarevirtualizationproducts,whichisanimportantcriteriaforacceptanceof virtualappliances.Howevertherearegoodreasonsforselectingvirtualhardwareversion7. VMwarerecommendsthatyouincludetheupdateagentwhencreatingvirtualappliance.Followthe stepsforestablishinganupdaterepositoryusingtheManagementTabonpage 41. BuildtheVM.VMwareStudioreliesonavirtualizationproductplatformtoassemblethefilesrequired tobuild(orprovision)yourvirtualappliance. IfyouarebuildingamultipleVMappliance,calledavApp,repeatthestepsabovetocreateotherVMs. WhenyouhavethesetofVMsthatyouneed,packagethemintoavAppcontainerbydefiningavApp buildprofileandbuildingthevApp. DistributetheoutputasOVAorOVF. Onanongoingbasis,youmightberequiredtoreleasepatchesforyourvirtualappliancesandvAppsthat aredeployedatcustomersites.

3 4 5

6 7

Aftervirtualappliancesaredeployed,enduserscanmanagethemindividuallyfromtheVMwareStudioWeb console.AdministratorscanmanageavApporcollectionofvirtualappliancesfromVMwarevCenterServer. EnduserscancheckforandinstallapplianceupdatesusingtheWebconsole,ifyouenabledtheupdateservice forthevirtualapplianceandestablishedanupdaterepository.

VMware Recommendations
Theremainingsectionsinthischaptergivesuggestionsorrecommendationsforchoicesyoumakeduringthe creationofavirtualapplianceorvApp.Somechoicesareatradeoffofportabilityfornewfunctionality.

VMware, Inc.

95

Developers Guide to Building vApps and Virtual Appliances

VMware Ready Virtual Appliances


ThevirtualappliancesthatVMwareStudiocreatesarealmostVMwareReady.Theonlygapisthatdatainthe productsectionmustbefilledin.Productnameandversionarerequired,butotherfieldscanbeempty.Inthe currentrelease,ProductNameisfilledinfromtheVMprofilename,and1.0.0.0isthedefaultversionnumber. FordetailsabouttheVMwareReadyprogram,seehttp://www.vmware.com/partners/vmwareready.

Choosing OVF Version


VMwaresuggestsdeliveringOVF0.9outputfilessoyourvirtualappliancecanrunonolderVMwareproduct platformssuchasESX/ESXi3.5andVirtualCenter.IfyoucreateavAppwithmultipleVMs,youmustdeliver OVF1.0orOVAoutputfiles,andthevAppcanrunonlyonVMwarevSphere. ThedownsideofOVF0.9isthatitlosesanyOVFpropertiesyouhavedefined,andyourvirtualappliance cannotbenefitfromautomaticnetworkconfigurationthatOVF1.0deploymentintoVMwarevSphere provides.FortunatelyVMwareStudiogeneratesbothOVF0.9andOVF1.0descriptorswhenyouselectOVF output,soyoucaneasilydeliverbothformatstocustomers.

Choosing Virtual Hardware Version


VMwarerecommendsspecifyingvirtualhardwareversion4(vmx-4)intheVMs>Hardwaretab.Thisvirtual hardwareversioncanrunonallcurrentandmostrecentVMwareplatforms.Ifyourvirtualappliancerequires morethanfourprocessorsormorethan64GBmemoryandisdesignedtorunonESX/ESXi4.0,youshould selectvirtualhardwareversion7.VMwareWorkstationandVMwareServer2arelimitedto8GBmemory evenwithvirtualhardwareversion7.

User Accounts
VMwarerecommendsthatyounotgiveawaytherootoradministratorpasswordforyourappliance.Youcan modifythefirstbootscripttorequestthattheendusersupplyacustomrootpasswordatdeploymenttime. Alternatively,youcancreateadditionaluseraccountsthathavenonrootprivileges,andinformcustomers aboutthoseaccountstoenforcelimitedaccesstothevirtualappliance.

Include Update Agent


WhenbuildingLinuxbasedVMs,VMwarestronglyrecommendsenablingtheupdaterepository.Youdothis ontheVMs>Managementtabbyaddingtheupdateservicetothelistofmanagementservices.Thenfollow proceduresinChapter 7,ManagingtheLinuxUpdateRepository,onpage 61.WindowsbasedVMsdonot allowtheoptionofanupdaterepository.

Partitioning Disk for System and User Data


VMwarerecommendsthatyoukeepuserandconfigurationdataonseparatedisks.Thisaidsinupgradingthe appliancetoanewerversion.Youcandecommissionthevirtualapplianceafterunmountingthedatadisks andmountingthemonthenewvirtualappliance.

Footprint Reduction
VMwarerecommendsbothmethodsofreducingthesizeofgeneratedVMs:redundantpackageelimination andunnecessaryfileremoval.SeeOperatingSystemFootprintReductiononpage 54

Guidelines for Adding Kernel Extensions


Toinsertacustomkernelmodule,youcanrunthemodprobecommandfromtheFirstBootScripttoloadyour kernelmodule.Themodprobe(8)pagesaysthatmodprobeexpectsanuptodatemodules.depdependencies file,asgeneratedbythedepmodcommand;seedepmod(8).TomakealterationstotheLinuxkernel,youcanuse anewVMwareStudio2.1featuretoaddsupportforaneworcustomLinuxoperatingsystem.Thisinvolves creatinganISOimageoftheoperatingsystemwithalteredkernel,thenaddingittothelistofOStemplates thatVMwareStudiosupports.Formoreinformation,seeAddingSupportforaNewOSonpage 99.
96 VMware, Inc.

13

Building from the Command Line

13

YoucanusetheVMwareStudioWebconsoletocreateandbuildvirtualmachinesandvApps.Youcanalso usetheVMwareStudiocommandlineinterfacetointegratewithanexistingapplicationbuildsystem, automatethebuildprocess,andintegratewithyoursourcecontrolsystem.Thisisespeciallyrequiredwhen shippingavirtualmachineorvAppasavirtualappliance. ThischapterdescribestheVMwareStudiocommandlineinterfaceandincludesthefollowingtopics:


UsingtheCommandLineonpage 97 ManagingBuildsonpage 99 AddingSupportforaNewOSonpage 99 SigningOVFFilesonpage 101

Forinformationaboutbuildprofilefiles,seeAppendix C,EditingXMLBuildProfiles,onpage 119.

Using the Command Line


VMwareStudioprovidesacommandlineinterfacetobuild,query,andcleanupvirtualmachinesandvApps. Tousethecommandlineinterface,logintotheVMwareStudioconsolebyaccessingtheVMwareStudio welcomescreenandselectingtheLoginoption.Alternatively,youcanuseaterminalemulatortomakeanSSH connectiontotheVMwareStudioappliance.Afteryouloginasroot,runthefollowingcommand:
studiocli

Table 131describestheoptionsavailableforthestudioclicommand. Table 13-1. Options to the studiocli Command


Option -b Alternate --buildstatus Description Displaysthestatusandlogmessagesforaspecifiedbuildinstanceorallinstances perbuildprofile.Forexample,tolistallbuildinstances: studiocli --buildstatus TolistthestatusofbuildinstancemyVA/myvAppwithextraverbosity,run: studiocli --buildstatus --verbose --instance myVA/myvApp TolistthestatusofallbuildinstancesforbuildprofilemyBuildProfile.xml,run: studiocli --buildstatus --verbose --profile myBuildProfile.xml Thissubcommandtakesthe--key,--value,and--nomapoptions. -c --createbuild Createsthevirtualmachine/vAppbasedonagivenbuildprofile.Alsogeneratesa updaterepositoryifarepositoryisspecifiedinthebuildprofile.Forexample,to buildavirtualmachine,enterthefollowingcommand: studiocli --createbuild --verbose --profile /<path>/<mybuildprofile.xml> -C --convertprofile ConvertaStudio1.0or2.0profileintoaStudio2.1profile.Profilescreatedinearlier versionsofStudiomustbeconvertedbeforetheycanbeused.Simplyopeningthem intheWebUIconvertsthemautomatically.

VMware, Inc.

97

Developers Guide to Building vApps and Virtual Appliances

Table 13-1. Options to the studiocli Command (Continued)


Option -d Alternate --deletebuild Description Deletesabuildinstanceforaspecifiedbuildprofileincludingitsvirtualmachine, vApp,logandupdatefiles.Forexample,todeleteallfilesassociatedwiththebuild instancemyVA/myvApp,run: studiocli --deletebuild --instance myVA/myvApp -D --debug Enablesdebugmode.Normally,afterabuild,thetransientvirtualmachineorvApp isdeletedfromtheprovisioningengine.Forhelpdebugging,thisoptionprevents thetransientvirtualmachinefrombeingdeleted,leaveshelpfullogfilesinplace, anddoesnotdeletetemporaryfilesusedinthebuildprocess.Logfilestocheckare /var/log/vmware-studio-agent.logand/root/postinstall.log.This optionalsoenablesverbosedebuggingmessages(-vvoptiondescribedbelow). Showsubcommandofstudiocli,andpossibleoptionstoeachsubcommand. Auniquetagforeachbuild.Thevaluemustbelessthan16characterslongandcan becomposedofthelettersaz,AZ,thenumbers09,andthecharactersand_.By default,abuildinstancewillbegeneratedbyVMwareStudio. Importavirtualmachine.TheimportedVMcanbeusedasinputVMforexisting VMprovisioning.InadditiontotheVM,VMwareStudioalsoneedsabuildprofile forexistingVMprovisioning.Ifpossible,specifytheoriginalbuildprofilethat matchestheimportedVMwiththeprofileoption:p http://.../example.xml Beforeprovisioning,youcanchangethisbaseprofile,forexamplebyaddingnew packagesorcreatingnewusers.Ifyoudonotprovidetheoriginalprofile,VMware Studiotriestogenerateoneforyou. studiocli --importvm <http://vmurl./ovf/ova/zip> --profile /<path>/<mybuildprofile.xml> -k -k -v --cancelbuild -key --value Cancelsthebuildcurrentlyinprogress.Ifthevirtualmachineiscurrentlybeing provisionedontheserver,itisdeletedfromtheserver. Onlyvalidafter-bor--buildstatus.Searchesforallthebuildinstancesmatching the<key>and<value>.<key>areonesonthelefthandsideofthebuildstatus outputand<value>areontherighthandside. Helpsinthecreationofapplicationpackages.Usingthistoolyoucancreateeither DEBorRPMapplicationpackages.Fordetails,seeChapter 5,PackagingaLinux Application,onpage 49 Disablesthemappingof[VADK.localIP]totheIPaddressofVMwareStudio. UsedbytheManagementUI.Onlyvalidafter-bor--buildstatus. SpecifiesanewOS,usuallyonethatisnotontheofficiallysupportedlist,forsystem andpackagediscovery.VMwareStudiogeneratesabuildprofileinthisprocess. Mustbefollowedbythe-por--profileoption. After-Cor--convertprofile,specifiesoutputfilenameforconversion. Specifiesthequalifiedfilenameofabuildprofile.Generictemplatebuildprofiles canbefoundunder/opt/vmware/etc/build/templates.VMwareStudio generatedVMprofilesarelocatedat/opt/vmware/var/lib/build/profiles, andvAppprofilesarelocatedat/opt/vmware/var/lib/build/vapp_profiles. ShowsthetypeofaprofilewhetheraVMorvApp.Aprofilenamemustbe specified Validatesagivenbuildprofilebytestingresourceauthentication,availability,and connectivity.Forexample,tovalidateyourbuildprofilebeforebuildingyour virtualmachine/vApp,runthefollowingcommand: studiocli --validateprofile --profile /<path>/<mybuildprofile.xml> -v --verbose Increasesdescriptiveoutputwiththefirstinvocation.Enablesdebugoutputwith subsequentinvocations(-vv).

-h -i

--help --instance

-I

--importvm

-m

--mkpkg

--nomap -n --newos

-o -p

--output --profile

-P -t

--profiletype --validateprofile

98

VMware, Inc.

Chapter 13 Building from the Command Line

Managing Builds
Foreverybuildofavirtualmachine,VMwareStudiomaintainsabuildinstancenumberandthelogsforthat build.Forexample,buildinstance1storeslogsinthefollowingdirectory:
/opt/vmware/www/build/1/status/

Thisdirectorycontainsthreeimportantlogfilesforeachbuild:

verbose.logHighlevelinformationofthebuildprocess. postinstall.logInformationaboutthebuildofthevirtualmachineincludingpackageinstallation. debug.logDetailedinformationaboutthebuildincludingISOmanagement,networkcommunications, andprovisioninginformation.

BuildlogsareaccessibleusingtheStudioWebconsoletotroubleshootbuildfailures.

Discovery Reports
ThestudioclicommandgeneratesseveralreportfilesduringVMdiscovery,whichareavailableinthe followingdirectory:
/opt/vmware/www/build/<VM-name>.<instance>/discover

Old Builds
VMwareStudiostoresandlogsallthevirtualmachinesthatitbuilds.Unneededbuildinstancesshouldbe removedandolderbuildinstancesshouldbearchivedawaytorecoverfreediskspaceforVMwareStudio. Youcanobtainalistofallbuildsbyrunningthiscommand:
studiocli --buildstatus

Youcanobtaininformationaboutaspecificbuildbyspecifyingitsprofileorinstancenumber:
studiocli --buildstatus --profile myVirtualMachine studiocli --buildstatus --instance profileABC.7

Todeletejustoneinstanceofabuild,runthefollowingcommand:
studiocli --deletebuild --instance profileABC.7 --verbose

Adding Support for a New OS


TocreateavirtualappliancefromanOSthatVMwareStudio2.1doesnotofficiallysupport,usethe--newos optiontogenerateaprofile.Thenimportthegeneratedprofileandcontinuewiththeusualbuildprocedure.
studiocli --newos --osdesc <osdesc> --profile <baseprofile>

Forexampleinthefollowingcommand,SLES11SP1isastringtodescribetheguestOS,andthepathtofile build_profile.xmlidentifiestheprofileonwhichthenewguestOSisbased.
studiocli --newos --osdesc "SLES 11 SP1" --profile /opt/vmware/etc/build/templates/suse/11/0_x86_64/build_profile.xml

AmessageappearssayingnewOSsupporthasbeenadded,andgivingthelocationofTODO_new_oswhere instructionsarelocated.Forbestpractices,seeGuidelinesforAddingKernelExtensionsonpage 96. IfyouthengototheVMwareStudioWebconsoleandclicktheCreateProfilebutton,SLES11SP1appears asoneoftheavailabletemplatesforcreatingavirtualapplianceprofile.

Requirements
VMwareStudiocurrentlysupportsonlyRPMbasedandDEBbasedoperatingsystems.Thesesystemscanuse anunattendedinstallerthatmaybeinvokedremotelythroughthenetwork,suchasAnacondaforRHELand CentOS,PreseedforUbuntu,orAutoyastforSLES.

VMware, Inc.

99

Developers Guide to Building vApps and Virtual Appliances

Support Files for the New OS


Table 132showsthefilesthatarecreatedtosupportanewguestoperatingsystem.Atminimumintheprofile, youmustupdatetheISOpath,MD5checksum,vendor,majorversion,andminorversion. Table 13-2. Support Files in OS Profile
build_profile.xml <new_OS>.xsl preinstall.xsl post.xsl commontask.xsl commonfunc.xsl Templatebuildprofile. OSunattendedinstallerconfigurationfile. ScriptexecutedbyStudiobeforestartingtheOSinstallation.Itspurposeistocreaterepositories forpackagingutilities. ScriptexecutedbyStudioinsidetheVMaftertheOSinstallationcompletes. Supplementaltopreinstall.xslandpost.xslscripts. Supplementaltopreinstall.xslandpost.xslscripts.

Inbuild_profile.xml,herearesomeimportantfieldstoverifyorupdate:

<Section xsi:type="vadk:JEOSSection_Type">

<vadk:BootArgs>KernelbootparameterswithstaticIP. <vadk:BootArgsDHCP>KernelbootparameterswithDHCPIP. <vadk:BootFiles>Kernelbinaryandpathtoinitrdbootscript. <vadk:ISO>OperatingsystemISO,MD5checksum,andpackagesrepository. <vadk:Distribution>Operatingsystemdistributiondetails. <vadk:OSPackages>Operatingsystempackagemetagroupsandpackages.

<Section ovf:id="" ovf:version="" xsi:type="ovf:OperatingSystemSection_Type">

ovf:idThisvalueisdefinedbyanextendedversionoftheDMTFCIMStandard, CIM_OperatingSystem.OsType. Ifthedefaultovf:idvaluedoesnotcorrectlyreflecttheguestOS,consider105for32bitor106for 64bitoperatingsystems.

<Section xsi:type="vadk:ApplicationSection_Type">

<vadk:OSPackages>Operatingsystempackages. <vadk:ApplicationPackages>Applicationsoftwarepackages.

<Section xsi:type="vadk:VAMISection_Type">

<vadk:VMToolsCore>VMwareToolsbasepackages.SeetheWebsitehttp://packages.vmware.com forcompatibilityquestions. <vadk:VMToolsX>VMwareToolspackagestosupportXwindows.

For<new_os>.xsl,verifythatthegivenunattendedinstallerconfigurationfileworksforthenewguestOS. Forpost.xsl,verifythattheLinuxcommandstobeexecutedinthisscriptworkforthenewguestOS. ThenewOStemplatenowappearsintheVMwareStudioWebinterfacesCreateaNewVMProfiledialog. MountthecorrespondingISOimageunder/opt/vmware/www/ISV/ISOandstartcreatingprofilesand buildingvirtualapplianceswiththenewOS. TodeletetheOStemplatefromVMwareStudio,goto/opt/vmware/etc/build/templates/<OSname>and removetherelatedsubdirectoryhierarchy.

100

VMware, Inc.

Chapter 13 Building from the Command Line

Fedora 11 As an Example
AftercreatingFedora11basedonRHEL5.4template,sometouchupisnecessary.
studiocli --newos --osdesc Fedora 11 --profile /opt/vmware/etc/build/templates/redhat/5/4/build_profile.xml

ThekickstartXSLfile,inthiscase/opt/vmware/etc/build/templates/Fedora11/Fedora11.xsl,must havean%endtagtoclosethesections%pre,%post,and%packages.RedHatdoesnotrequirethe%endtag. Youalsomustupdatethevadk:ISOsectionoftheFedora11profilewiththepropervadk:pathtotheISOfile, andrelatedattributesinthissection.

Signing OVF Files


Studio2.1buildprofilescontainanewpostoutputcreationscriptmechanism.TheDistributionFormat elementhasbeenextendedtoallowusersuppliedscriptstorunafterthegenerationofagivenoutputformat, whetherOVF,OVA,orZIP.Scriptsallowunattendedmanipulationoftheresultingoutput.Youcansignthe OVFusingthismechanism.Anexamplescriptthatcallsthesignovfsamplecommandisincludedinnewly generatedStudioprofiles. TheeffectofsigninganOVFcanbeseenonlywhendeployingtoESX/ESXi4.1orthroughvCenterServer4.1. TheOVFbasedcertificateisignoredinearlierversionsofVMwarevSphere. TheXMLprofilescontainasamplesigningprogramthatacceptsanOVFstyleprivacyenhancedmail(PEM) file,orintheabsenceofaPEMfile,generatesaselfsignedkey,withwhichtosigntheOVF.
signovf -p <PEM_file> [-s subject] <OVF_file>

Youcanspecifythe-soptionwithanX500likeparameterforsigning,soopenssldoesnothavetoaskfor thatinformationinteractively.Forexample:
signovf -p mail.pem -s '/C=US/ST=Some-State/O=AnyCompany/CN=Self-Signed' appliance.ovf

VMware, Inc.

101

Developers Guide to Building vApps and Virtual Appliances

102

VMware, Inc.

14

Build From an Existing VM

14

Thischapterexplainsthefollowingtopics:

ImportinganExistingVMUsingtheCLIonpage 103 DiscoveringanExistingVMonpage 104 BuildingwiththeImportProfileonpage 105 ExistingVMLimitationsonpage 106

YoucanuseanysuccessfulLinuxVMbuildtocreateanewLinuxVM.TheexistingVMfeaturecansavetime whenchangingtheapplicationmixofanappliance,orwhendevelopingabaseapplianceforuseasapattern.

Importing an Existing VM Using the CLI


UsethestudioclicommandtodiscoverthepropertiesofanexistingVM.Afterdiscovery,studioclicreates animportprofilethatyoucaneditintoabuildprofileusingtheWebconsole.ForbackgroundontheCLI,see UsingtheCommandLineonpage 97.

Prerequisites
Beforeyoubegin,notethefollowingrequirements:

YoumusthaveeitheraLinuxbasedvirtualappliancepackagedasZIP,OVF,orOVAonthelocalhost,or apoweredoffLinuxVMonaremoteprovisioningengine,eitherESX/ESXiorvCenterServer. AfterexistingVMimport,youneedtheISOfileofacorrespondingLinuxOStobuildthenewVM. TheVMwareStudioprovisioningagentmustbeinstalledintheinputVMfordiscovery. IftheinputVMwasbuiltusingVMwareStudio2.1withthevadk:removeAgentPackageattributesetto false(itsdefaultvalue),thentheVMcontainstheprovisioningagent.TheWebconsolehasthissetting. OntheBuildSettingspagetheRemoveagentafterprovisioningcheckboxisnormallyunchecked,so leaveituncheckedwhenbuildinganinputVM. IftheinputVMwasnotbuiltwithVMwareStudio2.1,youmustinstalltheprovisioningagentmanually. Thepackagesvmware-studio-provagent_*_i386.rpmandvmware-studio-provagent_*_all.deb areavailablein/opt/vmware/www/provagentontheVMwareStudioappliance.Installthesepackages ontheinputVMbeforestartingthediscoveryandimportphases.

ItisbestiftheinputVMdoesnothaveanexistingEULA.Ifitdoes,youmustacceptitontheconsoleof theprovisioningserverwhentheVMbootsup.AlternativelyyoucouldprovisionwithvCenterServer, whichusesadifferentEULAmechanismanddoesnotrequestEULAacceptanceontheconsole. Ifbothoftheseworkaroundsareproblematic,youcanedittheXMLprofileoftheinputVM,changingthe valueofvadk:ShowEULAtofalse.YoumightwanttosetotherattributesinVAMI_Section_Typetofalse, especiallyRunBootScripts.ThissolutionworksonlyforinputVMsbuiltwithVMwareStudio2.1.

TheinputVMmustbepoweredoff,ifitresidesonaprovisioningengine,asstatedabove.
103

VMware, Inc.

Developers Guide to Building vApps and Virtual Appliances

How It Works
Withtheimportoption,studioclicommandcallstheimport.plscript,andwiththenameoption,itcalls theimport_helper.plscript.Bothimportscriptsareinthe/opt/vmware/share/builddirectoryonthe VMwareStudioappliance.

Discovering an Existing VM
DuringthediscoveryphaseyoutellVMwareStudiowheretofindanexistingVM.Animportprofileresults. To discover an existing VM and create an import profile 1 Loginasrootandrunstudiocliwiththeimport,name(newVMinthisexample),andverboseoptions.
studiocli --importvm --name newVM -v

WhenaskedforthesourceVMlocation,typealocalfilepathname,orviforremoteVI(vSphere)locator. Localpathnamemaybe/opt/vmware/www/build/<VM>/exports/ovf/VM_OVF10.ovf,forexample.

3 4 5 6 7

Whenaskedfortheremoteenginetype,youcantypeeitheresxorvcenter.Forremoteengineversion, youcanacceptthedefault4forvSphere4.x. Whenaskedforhost,typetheIPaddressorDNSnameoftheremoteprovisioningengine.Forport,accept thedefault443unlessitwaschanged. Givetheusername.ForESX/ESXi,acceptthedefaultroot.ForvCenterServer,typeAdministrator. Thentypetheuserloginpassword,twice. WhentheCLIdisplaysresourcepool,youcanacceptthedefault. IfyouselectedVI(vSphere)locator,thescriptsaystochooseanexistingVM.PressTabtwicetoshowthe VMlist.TypethenameofanexistingVMfromthelist. Theimportscriptreadsthesnapshotlistandallowsyoutochooseanoldsnapshot,ifpresent.Thenitasks fortheLinuxOSvendor,majorversion,andminorversion.Afterthis,youcanchangetheresourcepool, datastorename,andnetworkname.

WhenaskedforthetransientVMname,youcanusetheexistingVM,whichprobablyappearsinthe prompt,toavoidaleftovertransientVM. YoucanalsochooseadifferentnameforthetransientVM,whichyoumightwanttodeletelater.

Typeanoutputfilenamefortheimportprofile,suchas/root/importp,wheretheimportscriptwrites theprofileafterdiscovery(/rootisyourhomedirectory). Theimportscriptsconnecttotheprovisioninghost,configurethetransientVMforprovisioning,discover theexistingVM,andproduceanimportprofile. Afterwards,theVMwareStudioWebconsoleshowsanimportprofileforthenewlydiscoveredVM. ContinuewiththestepsinBuildingwiththeImportProfileonpage 105.

Two-Step Existing VM Discovery


Ifyouwantmorecontroloverthediscoveryandimportphases,youcanrunthescriptsintwosteps. To discover an existing VM then create an import profile 1 Runtheimporthelperscripttocreateanimportprofile,/root/importp2forexample.
/opt/vmware/share/build/import_helper.pl

RunstudioclitoconverttheimportprofileintoabuildprofilethatappearsintheWebconsoleVMList.
studiocli --importvm --name newVM2 --profile /root/importp2.xml -v

104

VMware, Inc.

Chapter 14 Build From an Existing VM

Modifying the Import Profile


Youcansavetheimportprofile,/root/importp.xmlinthisexample,formodificationandlateruse. GoodXMLeditorsexist,butimportprofilesyntaxisnotdifficulttounderstand,soitisbesttouseatexteditor thatyoufeelcomfortablewith.

Building with the Import Profile


EditingadiscoveredVMprofilediffersfromregularprofileediting.Regulareditingcreatesafreshprofilein whichyouhavetospecifyeverything.TheVMprofilefromanexistingVMalreadyhasmanyitemsdefined. YouneedtosupplyanISOURLandrootpassword,butlittleelse. To create a new VM from an existing VM 1 ClicktheVMstab. ThenewlyimportedprofileshouldappearintheVMProfilelist. 2 3 Selecttheprofilethatyoujustimported,newVMforexample. ClicktheEditProfilebutton.ProceedasusualbyspecifyingfieldsinpagesundertheVMstab. YoucanmodifymostitemsontheDescriptionpage,includingProductNameandVersion. TheHardwarepageimposesrestrictionsaslistedinExistingVMLimitationsonpage 106. 4 OntheOStab,providetheISOURLofacorrespondingLinuxdistribution,andsettherootpassword. TheISOURLusuallylookslikefile:///opt/vmware/www/ISV/ISO/<distribution>.isoandthe ISOMD5isoptional. 5 OntheApplicationtab,youcanremovepackagesontheListofpackagesfromOSinstallmediaifyou donotwanttheminthenewVM. ThebuildprofilescreatedfromanexistingVMimportprofiledonotincludeVMwareTools(coreorX) foryoutoselectandenable.ThisisbecausethegenericVMwareToolsintheVMwareStudioappliance donotupgradecleanly,andbecauseOSspecificpackagesmightnotworkonanunsupportedOS. IfyouwanttoincludeVMwareToolsinsubsequentVMbuilds,youcanobtainanoperatingsystem specificpackage(OSP)fromthepackagerepositoryathttp://packages.vmware.comoryoucancompile sourcecodeavailableathttp://openvmtools.sourceforge.net.SeetheVMwareToolsInstallationGuide OperatingSystemSpecificPackagesmanualforpackageinstallationorder.Packagestoinstallare:
vmware-open-vm-tools-kmod-<kernel.version>* vmware-open-vm-tools-common_*

PackagesforX11are:
vmware-open-vm-tools-xorg-drv-display_* vmware-open-vm-tools-xorg-drv-mouse_* vmware-open-vm-tools-xorg-utilities_*

6 7 8 9

OntheManagementtab,clickEnableManagementCIMOMServerifyouwantVAMIservicestoappear inthenewVM.AlsoclickEnableManagementServer(GUI)ifyouwanttheWebconsoletoappear. TheOutputandBuildSettingstabsshouldbefilledinalreadyfromthediscoveryphase. (Optional)ClicktheValidatebuttontoverifyyourbuildprofile. Whenyouarefinishedediting,clicktheSaveandBuildbutton.

YoucanchoosetoremovetheprovisioningagentafterabuildbycheckingRemoveagentafterprovisioning ontheBuildSettingspage.Thissetsthevadk:removeAgentPackageattributetotrue.Fordevelopmentand debugging,andexistingVMtransformation,VMwarerecommendsthatyouretaintheprovisioningagent (vmware-studio-provagent*)intheVM.Foraproductionvirtualappliance,VMwarestronglyrecommends thatyouremovetheagent.

VMware, Inc.

105

Developers Guide to Building vApps and Virtual Appliances

Existing VM Limitations
WhenyoubeginwithanexistingVMoranyqualifyingLinuxOSinsteadofwithasupportedOSdistribution, VMwareStudio2.1offersbenefitsandimposeslimitationsasfollows:

YoushouldnotattemptconcurrentbuildsofanexistingVM,althoughVMwareStudiodoesnotprevent youfromdoingso. ItisbestfortheexistingVMtobeasupportedLinuxdistribution.VMwareStudiomakesitsbesteffort withanyrelatedLinuxdistributionusingDEBorRPMpackaging. YoucanaddandremoveOSpackages,applicationpackages,andmanagementpackages. Youcanaddnewvirtualdiskbutneitherresizenorremovedisks. YoucanaddandremovevirtualCPUs,withaminimumofone.Youcanresizevirtualmemory. Youcanupgrade(butnotdowngrade)thevirtualhardwareversion. Youcanupdatethevirtualapplianceloginpassword(rootuser,forexample).

106

VMware, Inc.

Appendixes

VMware, Inc.

107

Developers Guide to Building vApps and Virtual Appliances

108

VMware, Inc.

Management Services Web API

ThisappendixdocumentsthemanagementservicesJavaScriptAPI,whichyoucanusetocreateacustomuser interfaceasatabintheLinuxvirtualmachineWebconsole.Thistabistheonscreenrepresentationofa managementservice.


RootObjectonpage 109 VAMIContaineronpage 109 VAMIContainerCallbacksonpage 110 VAMII/Oonpage 111 VAMILogonpage 112

AsshowninCreatingaManagementServiceonpage 57,aUIcanbespecifiedintheview.xmlbothasa <Contenttype="html">andas<Contenttype=url>.ThisJavaScriptAPIcanbeusedinbothcases.

Root Object
TherootobjectvamihasoveradozenmethodstonavigatewithinaWebcontainer,communicatewiththe LIGHTTPDWebserver,andloginformationfordebuggingpurposes.Toobtainthevamirootobjectwithin JavaScript,calltheparent:
var vami = parent.vami;

VAMI Container
Thefollowingfunctionscanbecalledontherootvamiobject.

vami.container.navigate
Requeststhatthecontainernavigatetoapage.Returnstrueifthecontainerisabletonavigate.
boolean navigate(String token)

Parameter: tokenAstringrepresentingthedestinationpage,intheformServiceName.PageNamewherePageNameis optional.IfPageNameisnotpresent,itgoestothefirstpageintheService. Example:


vami.container.navigate('network.Status');

vami.container.logout
Logsoutthecurrentuser.
void logout()

VMware, Inc.

109

Developers Guide to Building vApps and Virtual Appliances

vami.container.newHistoryItem
Addsanewbrowserhistoryitem.
void newHistoryItem(String historyToken)

Parameter: historyTokenThetokenassoicatedwiththehistoryitem. Exampletorecordahistorychange:


vami.container.newHistoryItem('myservice.InternalPage');

vami.container.isLogin
Checkstoseeiftheuserisloggedin.Returnstrueiftheuserisstillloggedin.
public boolean isLogin()

vami.container.getUser
Getsthenameofuserwhoiscurrentlyloggedin.Returnstheusernameofthecurrentlogin.
public String getUser()

vami.container.getSessionID
ReturnsthecurrentsessionID,whichisusedforauthenticationwithPAMortocommunicatewithsfcbd.
public String getSessionID()

ExampletoauthenticateauserontheserversideusingPython:
# import required libraries import sys sys.path.append('/opt/vmware/lib/python/site-packages/') import pywbem # returns true if we are able to authenticate def authenticate(user, sessionid): try: # connect to cimom with username and sessionid, make CIM call cliconn = pywbem.WBEMConnection('http://localhost:5488', (user, sessionid)) cliconn.EnumerateInstanceNames('VAMI_ComputerSystem') return True except Exception, e: return False

VAMI Container Callbacks


VAMIWebcontainerprovidescallbacksforservicestoregisterandgetnotifiedofvariousnavigationalevents.

vami.container.registerOnShowCallback
RegistersacallbackfunctionwiththecontainerforexecutionwhentheServiceisdisplayed.Thecallback functionyoupasswillthenreceivethetokenforthecurrentpage.
public void registerOnShowCallback(JavaScriptObject callback)

Parameter: callbackFunctionthatgetsexecutedwhentheServiceisdisplayed.Thisfunctionwillreceivethetokenfor thecurrentpage. Exampletoregisteracallbackfunction:


function myOnShow(token){ alert(token); vami.container.registerOnShowCallback(myOnShow);

110

VMware, Inc.

Appendix A Management Services Web API

vami.container.registerOnHideCallback
RegistersacallbackfunctionwiththecontainerforexecutionwhentheServiceishiddenandtheusermoves toanotherService.Thecallbackfunctionyoupasswillthenreceivethetokenforthepagetobenavigated.
public void registerOnHideCallback(JavaScriptObject callback)

Parameter: callbackFunctionthatgetsexecutedwhentheServiceishidden.Thisfunctionwillreceivethetokenfor thependingpagetowheretheuserisnavigating. Exampletoregisteracallbackfunction:


function myOnHide(pendingToken){ return confirm(pendingToken); } vami.container.registerOnHideCallback(myOnHide);

vami.container.registerOnNavigateCallback
Registersacallbackfunctionwiththecontainerforexecutionwhenthecontainernavigatestothecurrent Service.Thecallbackfunctionyoupasswillthenreceivethetokentoindicatenavigation.
public void registerOnNavigateCallback(JavaScriptObject callback)

Parameter: callbackFunctionthatgetsexecutedwhentheServiceishidden.Thisfunctionwillreceivethetokenfor thecurrentpage.Callbackfunctionshouldbeinthisformat:


functionName(token);

Exampletoregisteracallbackfunction:
function myOnNavigate(pendingToken){ alert(token); } vami.container.registerOnNavigateCallback(myOnNavigate);

VAMI I/O
TheVAMIWebcontainerprovidesavami.ioobjecttocommunicatewiththeLIGHTTPDWebserver.

vami.io.httpGet
MakeanHTTPGETrequestfortheprovidedURL,andfeedtheresulttothecallbackfunction.Becauseof SameOriginPolicy(SOP)restrictions,thisAPIcannotmakecallstoanyotherserverotherthantheserverfrom whichthispageisloaded.
public void httpGet(boolean authenticate, boolean blocking, String description, String url, JavaScriptObject callback)

Parameters:

authenticateTrueifyouwanttouseHTTPbasicaccessauthenticationonthecurrentlyloggedin usernameandpassword.SeetheWikipediaarticleaboutBasicAccessAuthentication. blockingTruetoindicatetothecontainerthatthisisablockingrequest. descriptionDescriptionoftherequest,tobeshownintheuserinterface. urlRelativeorfullHTTPURLforthisrequest. callbackJavaScriptcallbackfunctionthattakesastringasitsargument.Thereturnedcontentfromthe requestispassedtothiscallbackfunction.

Exampletorequestafile:
vami.io.httpGet(false, false, 'Get XML file', '/VAMI.xml', alert);

VMware, Inc.

111

Developers Guide to Building vApps and Virtual Appliances

ExampletorequestaJavaScriptObjectNotation(JSON)objectandparsethatobject:
function evaluateJSON(json){ eval(json); } vami.io.httpGet(false,false,'Get JSON Object','/RESTInterface',evaluateJSON);

vami.io.httpPost
MakeanHTTPPOSTrequestfortheprovidedURL,andfeedtheresulttothecallbackfunction.Becauseof SameOriginPolicy(SOP)restrictions,thisAPIcannotmakecallstoanyotherserverotherthantheserverfrom whichthispageisloaded.
httpPost public void httpPost(boolean authenticate, boolean blocking, String description, String url, String content, JavaScriptObject callback)

Parameters:

authenticateTrueifyouwanttouseHTTPbasicaccessauthenticationonthecurrentlyloggedin usernameandpassword.SeetheWikipediaarticleaboutBasicAccessAuthentication. blockingTruetoindicatetothecontainerthatthisisablockingrequest. descriptionDescriptionoftherequest,tobeshownintheuserinterface. urlRelativeorfullHTTPURLforthisrequest. contentContenttopostfortheURL,usuallyforHTTPGETrequestthisispartoftherequestURL. callbackJavaScriptcallbackfunctionthattakesastringasitsargument.Thereturnedcontentfromthe requestispassedtothiscallbackfunction.

Exampletorequestacalltothesfcb:
var cimXML; //fill cimXML with the CIM XML that you want to post to CIMOM vami.io.httpPost(true,false,'Making CIMOM Call','/cimom', cimXML, evaluateJSON);

VAMI Log
ToenableloggingforavirtualmachineWebconsole,use<webconsoleurl>?log=info&logwindow=true. Thisshowsasmallvisiblewindowthatdisplaysallmessagesthatareloggedusingvami.logobject.Other optionsforthelogparameterarewarnanderror.

vami.log.info
Logsaninformationalmessage.
public void info(String message, JavaScriptException exception)

Parameters:

messageMessagestringtolog. exceptionJavaScriptexception.Optional.

vami.log.warn
Logsawarningmessage.
public void warn(String message, JavaScriptException exception)

Parameters:

messageMessagestringtolog. exceptionJavaScriptexception.Optional.

112

VMware, Inc.

Appendix A Management Services Web API

vami.log.error
Logsanerrormessage.
public void error(String message, JavaScriptException exception)

Parameters:

messageMessagestringtolog. exceptionJavaScriptexception.Optional.

VMware, Inc.

113

Developers Guide to Building vApps and Virtual Appliances

114

VMware, Inc.

Security with SSH and SSL

Thisappendixcontainsthefollowingsections:

InstallingSSHonWindowsonpage 115. CheckingVeracityofanSSLCertificateorSSHKeyonpage 116

Installing SSH on Windows


VMwareStudiorequiresthesecureshell(SSH)protocoltocommunicatewithsomeprovisioningplatforms, includingVMwareWorkstationandVMwareServer1.0.x.Withmostotherprovisioningplatforms,VMware StudiousesHTTPSinstead.WhenWorkstationandServer1.0.xrunonLinux,theSSHprotocolisavailableby default.WhentheyrunonWindows,youmustinstallSSH.

VMware Workstation and VMware Server 1.0.x


BecauseWindowssystemsdonotordinarilyincludesupportforthisprotocol,whenVMwareWorkstationor VMwareServer1.0.xishostedonWindows,installOpenSSHasfollows. To install the SSH daemon on a Windows system 1 DownloadtheOpenSSH4.2p11forWindowsBinaryInstallerfromhttp://sshwindows.webheat.co.uk/. NOTEThisparticularversionofOpenSSHworksbestonWindowsXP.Ifyouhaveadifferentversionof Windows,youshouldconsiderinstallingarecentversionofCygwinanditsOpenSSHoption. 2 3 Runtheinstaller,setupssh.exe. Afterinstallation,createaworkingdirectoryforprovisioningvirtualmachines,forexample:
mkdir C:\vmware_studio-tmp

NOTEc:\vmware_studio-tmp translatesto /cygdrive/c/vmware_studio-tmpwhenyousetthe VMwareServerFileTransferPath. 4 5 Selectausernameandpasswordtouseinthescriptbelow. Thefollowingscriptusesthenetusercommandtocreateausernamedvmware_studiouserwith passwordVMware.LateritusesthecaclscommandtocontrolACLsfortheC:\vmware_studio-tmp directoryyoujustcreated.Eithercreateabatchscriptcontainingthefollowingcommands,orrunthese commandssequentiallyinacommandpromptwindow:


net user vmware_studiouser VMware /add C: cd \"Documents and Settings" mkdir vmware_studiouser\.ssh cacls vmware_studiouser /T /P everyone:F cd \ cacls vmware_studio-tmp /G everyone:F
VMware, Inc. 115

Developers Guide to Building vApps and Virtual Appliances

cd \Program Files\OpenSSH\bin mkgroup -l > ..\etc\group mkpasswd -l > ..\etc\passwd

LaunchtheOpenSSHdaemonbyrunningthenetstartcommand:
net start opensshd

Disableanyfirewall,orpreferably,createanexceptionintheWindowssystemfirewalltoavoidblocking theSSHconnectionwithVMwareStudio(bothTCPandUDPprotocolsonport22).

VMware Server 2.0


VMwareServer2.0usesthesametransportmechanismasESX/ESXi,soyoudonotneedtoinstallSSHon WindowshostedServer2.0.

Checking Veracity of an SSL Certificate or SSH Key


Thisprocedurehelpsyouverifythatthehosttowhichyouareconnectingisindeedthehostyouintended. To display and validate SSL and SSH fingerprints 1 2 3 FromthemainVAMIscreenonlocalconsole,makeanoteoftheURLdisplayedonthe[Web]line,and selectLogin. LoginasrootusingthepasswordyouselectedduringfirstbootoftheVMwareStudioappliance. RunthefollowingcommandtodisplaytheSHA1fingerprintofthex.509v3(SSL)certificateforthe VMwareStudioHTTPserver:
/usr/bin/openssl x509 -fingerprint -sha1 -noout -in /opt/vmware/etc/lighttpd/server.pem

Summaryofoptions:

x509Usex.509certificatemode(noleadingdash). -fingerprintDisplayfingerprint. -sha1DisplaySHA1hashvalueforfingerprint. -nooutDonotoutputtheentirecertificate. in <infile>Usethespecifiedfileasthesourcefile.

RunthefollowingcommandtodisplaythefingerprintoftheSSH2orRSAkeyfortheSSHserver:
/usr/bin/ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub

Summaryofoptions:

-lList(show)fingerprint. -f <infile>Usethespecifiedfileasthesourcefile.

UsingyourchoiceofsupportedWebbrowser,gototheURLyounoteddowninStep 1. TheHTTPlisteneronport80/tcpredirectstoanHTTPS(HTTPwithSSL)listeneronport5480/tcp. A warningappears,explainingthattheSSLCertificatecouldnotbevalidatedusingexistinginformation.

6 7

Fetchthecertificate,viewthecertificatesummary,locatetheSHA1fingerprint,andcompareittothe SHA1fingerprintyougeneratedinStep 3. IftheSHA1fingerprintsmatch,confirmthesecurityexception.Youcanchoosetostoreitpermanently. IftheSHA1fingerprintsdonotmatch,youmightbeexperiencingamaninthemiddlesecurityattack. Ifyouconfirmthesecurityexception,yourWebbrowserproceedstotheVMwareStudiologinscreen.

ToverifythefingerprintoftheSSH2orRSAkeyfortheSSHserver,chooseeitherToconfirmwith InteractiveSSHonpage 117,orToconfirmwithSCPorSFTPonpage 117.

116

VMware, Inc.

Appendix B Security with SSH and SSL

To confirm with Interactive SSH 1 UsingyourchoiceofSSHclient(forexamplePuTTY0.60),orthesshcommandonLinux,connecttothe IPaddresswithintheURLthatyounoteddowninStep 1.TheSSHclientpromptsyoutoacceptorreject thekeypresented(inthecaseofPuTTY,a2048bitRSAkeyoverSSHv2). ComparethisfingerprinttotheSSH2orRSAfingerprintyougeneratedinStep 4. Ifthefingerprintsmatch,acceptatrustrelationship.Youcanchoosetocacheyourdecisionpermanently, ratherthanforthisSSHsessiononly. TheSSHclientproceedswithsessioninitiation.AftertheVMwareStudiomessage,arootshellappears.

2 3 4

To confirm with SCP or SFTP 1 UsingyourchoiceofSCPclient(forexampleWinSCP4.x),orthescpcommandonLinux,connecttothe IPaddresswithintheURLthatyounoteddowninStep 1.TheSCPclientpromptsyoutoacceptorreject thekeypresented(inthecaseofWinSCP,a2048bitRSAkeyoverSSHv2). ComparethisfingerprinttotheSSH2orRSAfingerprintyougeneratedinStep 4. Ifthefingerprintsmatch,acceptatrustrelationship.Youcanchoosetocacheyourdecisionpermanently, ratherthanforthisSCPsessiononly. TheSCPclientproceedswithsessioninitiation.

2 3 4

VMware, Inc.

117

Developers Guide to Building vApps and Virtual Appliances

118

VMware, Inc.

Editing XML Build Profiles

ThisappendixcanhelpyoueditXMLbuildprofiles.Itcontainsthefollowingsections:

Introductiononpage 119 StructureofVMXMLBuildProfilesonpage 119 UsefulAttributesNotDisplayedintheVMwareStudioWebConsoleonpage 128 CustomizingtheFooterintheWebConsoleonpage 129 CreatingVirtualDisks,Partitions,andVirtualDevicesonpage 129 UnmountingCDROMorISOAfteraBuildonpage 131 ResourceAllocationSettingDataonpage 131 StructureofvAppXMLBuildProfilesonpage 132

Introduction
VMwareStudiocreatesabuildprofilethatdefinesavirtualmachine. TheXMLschemasforthebuildprofilesarelocatedinthe/opt/vmware/etc/build/schemasdirectory insideVMwareStudio.Itisnevernecessaryorrequiredtolookattheseschemasfortheconstructionofbuild profiles.VMwarerecommendsthatyouusetheVMwareStudioWebconsoletocreatebuildprofiles.Once created,youcaneditthebuildprofileandbuildorrebuildtheVMorvApp. TheVMwareStudioWebconsolesavesbuildprofilesinthefollowinglocationsforaVMandavApp:
/opt/vmware/var/lib/build/profiles/<VMprofileName>.xml /opt/vmware/var/lib/build/vapp_profiles/<vAppProfileName>.xml

VMwareStudioincludespreconfiguredbuildprofiletemplates,locatedinthefollowingdirectories:
/opt/vmware/etc/build/templates/<OS>/<release>/<version>/build_profile.xml /opt/vmware/etc/build/vapp_template/vapp_template.xml

BuildprofilesconformtoanearlyversionoftheOVF0.9draftspecifications.FormoreinformationaboutOVF, seehttp://www.vmware.com/appliances/learn/ovf.html.

Structure of VM XML Build Profiles


ThesectionsofthebuildprofilecorrespondtosectionsintheVMwareStudiobuildinterface. Table C1,VMBuildProfileXMLConfigurationProperties,onpage 120describestheconfiguration propertiesinthebuildprofileXMLfile.

VMware, Inc.

119

Developers Guide to Building vApps and Virtual Appliances

Table C-1. VM Build Profile XML Configuration Properties


Property Information ProductName Description TheProductSectioncontainsISVbrandinginformationfortheVM. ThisnameisvisibletousersonthetextwelcomescreenandontheWebconsoleafterdeploymentof theVM. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/Product VendorName Version Nameofthevendor.Importantwhenshippingavirtualappliance. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/Vendor VMwareStudiousestheversionofthevirtualmachinetotrackupdates.Itmaybeinn.n.n.nformat, wherenisanumberbetween0and65535. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/Version FullVersion ProductURL VendorURL ApplicationURL Freeformattextstringusedtodisplaytheversioninformationofthevirtualmachine. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/FullVersion URLtothecompanysWebsitewhichprovidesinformationabouttheproduct. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/ProductUrl URLtotheyourcompanysWebsite. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/VendorUrl URLtothemainapplicationWebpage.InsteadofahostnameinthehttpURL,youcanusethe variablestring${app.ip},whichresolvestotheIPaddressoftheVM. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/AppUrl Category Description UsuallyApplication. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/Category Descriptionofthefunctionalitythevirtualmachineprovides.Itisdisplayedwhenthevirtualmachine isimportedintoESXasanOVF. //ovf:Envelope/Section[@xsi:type='ovf:AnnotationSection_Type']/Annotation EULAText EnduserlicensingagreementsfortheVM.TheusermustacceptallEULAsbeforeusingtheVM.When deployingonvSphere,thevSphereClienthandlesovf:EulaSection_Typeacceptance. //ovf:Envelope/Section[@xsi:type='ovf:EulaSection_Type']/License YoucanaddmultipleEULAtextsbycopyingthe<Section>elementcontainingEulaSection_Type andplacingadditionalEULAtextsinrepeated<Section>elements.YoucanalsospecifyEULAsin differentlanguagesbychangingthexml:lang=setting,whichselectsEULAbyprevailinglocale. <Section xsi:type="ovf:EulaSection_Type" xml:lang="en"> <Info>End User License Agreement</Info> <License>English EULA text here</License> </Section> <Section xsi:type="ovf:EulaSection_Type" xml:lang="fr"> <Info>Accord de licence d'utilisateur</Info> <License>French EULA text here</License> </Section> InVMwareStudio2.1youcanalsospecifyafilenameorfilenamescontainingtheEULAtext,possibly indifferentlanguages,tobeselectedaccordingtotheprevailinglocale(seeEULALocationbelow). EULALocation SpecifiesthelocationofaEULAfile.MayberepeatedformultipleEULAfiles.Althoughdiscussed here,thisappearsinBuildSection_Type.YoucanspecifyEULAsindifferentlanguagesbychanging thexml:lang=setting,whichselectsEULAbyprevailinglocale. <vadk:EULAlocation xml:lang="en">/opt/eula_en.txt</vadk:EULAlocation> <vadk:EULAlocation xml:lang="fr">/opt/eula_fr.txt</vadk:EULAlocation> IfyoudefinetheEULAtextinEulaSection_Type(above)andalsoinaEULAlocationfile,allEULAs arepromptedforduringdeploymentandfirstboot,exceptwhenthevSphereClienthandlesEULA acceptance.ThedisplayorderofEULAlocationandEulaSection_Typetextsisindeterminate. More Information VendorUUID TheExtendedProductSectioncontainsadditionalISVbrandingitems. UniversallyUniqueIdentifierfortheISV.MandatoryforVMwarevCenterUpdateManager.For details,seeSupportingCentralUpdateswithVMwarevCenterUpdateManageronpage 67. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/ vadk:VendorUUID

120

VMware, Inc.

Appendix C Editing XML Build Profiles

Table C-1. VM Build Profile XML Configuration Properties (Continued)


Property ProductRID Description RepositoryIdentifierforthevirtualappliance.MandatoryforVMwarevCenterUpdateManager.For details,seeSupportingCentralUpdateswithVMwarevCenterUpdateManageronpage 67. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/ vadk:ProductRID ApplicationLinkLabel LabelprovidedinthisfieldisshownintheWebconsoleforthisvirtualmachine.Thislabelpointsto theURLprovidedinApplicationLinkURLfield. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/ vadk:AppUrlName LogoPath IcondisplayedintheWebconsoleforthevirtualmachine.Specifythelocationofanimagefilethatyou havecopiedintoadirectoryinVMwareStudio. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/vadk:Logo LogoURL URLtoyourcompanysWebsite. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/ vadk:LogoUrl WelcomeText Welcometextforthevirtualmachineshowninthewelcomescreen.Thewelcometextmustbe16lines orless,withamaximumof79charactersineachline.Anylinesorcharactersgreaterthantheselimits willnotdisplayinthevirtualmachineconsole. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/ vadk:WelcomeText SSL Certificate CommonName TheSSLCertificateSectionprovidesdetailsabouttheappliancesSSLcertificate. Servercertificatesareissuedtoacommonname.Inmostcases,thisisthefullDNSnameusedwhen navigatingaWebsite. //ovf:Envelope/Section[@xsi:type='vadk: SSLCertificateSection_Type']/vadk:CommonName Organization Legalnameofyourorganization.Itisusedtosignthecertificate. //ovf:Envelope/Section[@xsi:type='vadk: SSLCertificateSection_Type']/vadk:OrganizationName OrganizationalUnit Departmentorsectionofyourorganization.Thisinformationisusedinthecreationofthecertificate. //ovf:Envelope/Section[@xsi:type='vadk: SSLCertificateSection_Type']/vadk:OrganizationalUnitName CountryCode Twolettercountrycoderepresentingthecountryinwhichtheorganizationorunitisbased.This informationisusedinthecreationofthecertificate. //ovf:Envelope/Section[@xsi:type='vadk: SSLCertificateSection_Type']/vadk:CountryName Management InitializationScript ShowEULA SetHostname SetNetwork CreateSSHKeys RunBootScripts EnableConsoleLogin TheVAMISectiondescribesthemanagementservicesinthisVM. LocationofthevirtualapplianceOSinitializationscript,vaos_init.shbydefault. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:InitScript WhetherornottodisplaytheEULAatfirstboot,trueorfalse. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:ShowEULA Whetherornottosetthehostname,trueorfalse. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:SetHostname Whetherornottosetthenetwork,trueorfalse. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:SetNetwork WhetherornottocreateSSHkeys,trueorfalse. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:CreateSSHKeys Whetherornottorunbootscripts,trueorfalse. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:RunBootScripts Whetherornottoenableconsole(TTY)login,trueorfalse. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:LoginTTY

VMware, Inc.

121

Developers Guide to Building vApps and Virtual Appliances

Table C-1. VM Build Profile XML Configuration Properties (Continued)


Property EnableVAMIServices EnableManagementGUI ServiceName Description Whetherornottoenablemanagementservices,trueorfalse. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:ManagementSrv WhetherornottoenabletheWebconsoleGUI,trueorfalse. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/vadk:ManagementGUI Nameoftheservice.TheseareeitherVAMIservicesorservicescreatedandaddedbytheuser. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/ vadk:Service/@vadk:name ServiceVersion Specifiestheversionoftheaddedservices. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/ vadk:Service/@vadk:version ServiceTabOrder OrderinwhichtheaddedservicesappearinthegeneratedVM. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/ vadk:Service/@vadk:tabOrder WebServerPort ConfigurableportnumberforthelighthttpdWebserver.ThisistheportnumbertoaccessyourVM fromtheWebbrowser. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/ vadk:WebServer/@vadk:httpsPort FooterandCopyright Leftsidefooter(FooterLeft)andcopyrightinthemiddlesectionofthefooter(FooterCopyright). //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/ vadk:Service/@vadk:ViewCustomization InstallVMwareTools WhethertoinstallVMwareToolscorepackageandX11windowsystempackage. //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/ vadk:VMToolsCore/@vadk:pkgsDir //ovf:Envelope/Section[@xsi:type='vadk:VAMISection_Type']/ vadk:VMToolsX/@vadk:pkgsDir Application VMName TheApplicationSectiondescribespackagecontentandoutputformat. Nameofthevirtualmachinefile.Thisnameisvisibletouserswhentheydownloadthevirtualmachine ZIPorOVFpackage. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:VMXFilename DistributionFormat UseOVFformattodeployonVMwarevSphere.UseZIPtodeployonVMwarehostedproducts. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:DistributionFormat/@vadk:format OVFFilename NameofthevAppOVForOVAoutputfile. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:DistributionFormat/@vadk:filename ZIPArchiveDirectory DirectoryunderwhichallfilesrelatedtotheVMshouldappearinthegeneratedarchive.ZIPonly. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:DistributionFormat/@vadk:directory PostOutputCreation SigningScript Ifenabled,thisscriptgeneratesaselfsignedcertificateorcouldinstallanSSLcertificateifavailable. Thescriptappliestothedistributionformatofitscontainingsection. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:PostOutputCreation/@vadk:script ApplicationPackages ListofrepositoryURLswhereapplicationpackagesareavailable.Youcancopyapplicationpackages ontotheVMwareStudioappliance(/optdirectoryonthefirstline),whichismadeavailableatthe followingURL(secondline): /opt/vmware/www/ISV/appliancePackages http://[VADK.localIP]/ISV/appliancePackages //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:ApplicationPackages

122

VMware, Inc.

Appendix C Editing XML Build Profiles

Table C-1. VM Build Profile XML Configuration Properties (Continued)


Property OSPackageList Description ThepackagesaddedbytheuserthroughtheGUIareaddedintheApplicationSection.Thesearethe additionalOSpackagesrequiredbytheISVsapplication. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/vadk:OSPackages PackagestoRemove Forfootprintreduction,thepackagestoberemovedfromthestandardOSdistribution. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:PackagesToRemove FirstBootScript Shellscriptthatrunswhenthevirtualmachinebootsupforthefirsttime. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:BootActions/vadk:FirstBoot SubsequentBootScript Shellscriptthatrunswhenthevirtualmachinebootsupeachtimeexceptforthefirsttime. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:BootActions/vadk:SubsequentBoot RootPassword Passwordfortheadministrativeuseraccountforthevirtualmachine. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:Users/vadk:User[@vadk:username='root']/@vadk:password OVF IP Assignment DHCP TheIpAssignmentSectiondescribeshowOVFcontrolsIPassignment. EnabletheoptionofusingtheDHCPserverforconfiguringnetworkingoftheVM. //ovf:Envelope/Section[@xsi:type='vadk:IpAssignmentSection_Type']/ vmw:IpAssignmentSection[@vmw:schemes=dhcp] OVFEnvironment EnabletheoptionofusingafixedoratransientIPaddressfortheVM. //ovf:Envelope/Section[@xsi:type='vadk:IpAssignmentSection_Type']/ vmw:IpAssignmentSection[@vmw:schemes=ovfenv] OVF Property Key Label Description ThePropertySectionsetsOVFproperties. KeytotheOVFProperty. //ovf:Envelope/Section[@xsi:type='vadk:PropertySection_Type']/Property/@ovf:key LabelfortheOVFproperty. //ovf:Envelope/Section[@xsi:type='vadk:PropertySection_Type']/Property/Label DescriptionfortheOVFproperty. //ovf:Envelope/Section[@xsi:type='vadk:PropertySection_Type']/Property/ Description Type DefaultValue TypeoftheOVFproperty //ovf:Envelope/Section[@xsi:type='vadk:PropertySection_Type']/Property/ovf:type ValueoftheOVFpropertyaccordingtothetype. //ovf:Envelope/Section[@xsi:type='vadk:PropertySection_Type']/Property/ @ovf:value UserConfigurable Whethertopromptusertoallowchangingproperty. //ovf:Envelope/Section[@xsi:type='vadk:PropertySection_Type']/Property/ @ovf:userConfigurable OVFQualifiers OVFstandardtypequalifiers. //ovf:Envelope/Section[@xsi:type='vadk:PropertySection_Type']/Property/ @ovf:qualifiers VMWQualifiers VMwarespecifictypequalifiers. //ovf:Envelope/Section[@xsi:type='vadk:PropertySection_Type']/Property/ @vmw:qualifiers Update Repository UpdateRepositoryURL Iftheupdateserviceisenabled,UpdateSectiondescribessetupoftheupdaterepository. URLtotheupdaterepository.ThisURLisembeddedinthegeneratedvirtualmachineandiftheVM isshippedasvirtualappliance,itisusedtocheckforandinstallavailableupdates.IftheURLis changedinasubsequentversion,theISVshouldinformendusers,intheupdatedescription,toreboot thevirtualappliancesothatSFCBcanprocessthenewURL. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:Repository/@vadk:url

VMware, Inc.

123

Developers Guide to Building vApps and Virtual Appliances

Table C-1. VM Build Profile XML Configuration Properties (Continued)


Property Username(optional) Description UsernameusedtoauthenticatetheWebserverattheURLfortheupdaterepository. Tocomplywithlicensingrestrictions,thisfieldisrequiredforupdatinganyvirtualappliancebasedon theRedHatEnterpriseLinux(RHEL)operatingsystem. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:Repository/@vadk:username Password(optional) PasswordusedtoauthenticatetheWebserverattheURLfortheupdaterepository.Inordertocomply withlicensingrestrictions,thisfieldisrequiredtoupdateanyvirtualappliancebasedontheRedHat EnterpriseLinux(RHEL)operatingsystem.Passwordformatfollows. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:Repository/@vadk:password FileTransferProtocol ProtocolusedtopublishsoftwareupdatestotheWebserverwhichservesasanupdaterepository. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:RepositoryStagingServer/@vadk:fileProto FileTransferHostname HostnameofthehostrunningtheWebserverwhichservesasanupdaterepository. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:RepositoryStagingServer/@vadk:hostname FileTransferUsername ThisistheusernameusedbyVMwareStudiotocopyfilesusingscpprotocoltotherepositorystaging server.Itcanbedifferentfromwhatthevirtualmachinesusetodownloadupdatesviahttp. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:RepositoryStagingServer/@vadk:fileLogin FileTransferPassword ThisisthepasswordusedbyVMwareStudiotocopyfilesusingscpprotocoltotherepositorystaging server.Itcanbedifferentfromwhatthevirtualmachinesusetodownloadupdatesviahttp. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:RepositoryStagingServer/@vadk:filePassword FileTransferPath Pathusedforpublishingvirtualapplianceupdatestotheupdaterepository.Ifthevirtualappliancehas tofindanyupdates,thispathshouldtranslatetotheupdaterepositoryURL. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:RepositoryStagingServer/@vadk:filePath UpdateDescription UpdateinformationpresentedhereisdisplayedintheWebconsoleofthevirtualmachinewhenthe updatebecomesavailable. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/vadk:Info UpdateArchive ExportFile PreInstallShellScript FilenameoftheupdatearchiveZIPfilethatwillbeexportedtothebuildinstancesdirectory. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:RepositoryExport/@vadk:filename Scripttobeexecutedbeforetheupdate. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:PreInstallShellScript PreInstallShellScript Scripttobeexecutedaftertheupdate. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:PostInstallShellScript DigitallySignedUpdate Thissectioncontainsthreescripts.Thefirstsignstheupdatewithatemporaryorpermanentcertificate. Thesecondgetsthepublickeyforsigningandverification.Thethirdvalidatestheupdatecertificate. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:DigitalSignature/vadk:Script/@vadk:name=sign //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:DigitalSignature/vadk:Script/@vadk:name=pubkey //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:DigitalSignature/vadk:Script/@vadk:name=validate UpdateInformation Thissectiontracksupdates,includingtheversionwhenintroduced,toavoidunnecessaryupdating. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/vadk:UpdateInfoList/ (fieldsincludeintroduced-version,category,severity,affected-versions,description, reference-type,reference-id,reference-url)

124

VMware, Inc.

Appendix C Editing XML Build Profiles

Table C-1. VM Build Profile XML Configuration Properties (Continued)


Property CIM Operating System OperatingSystem Description TheOperatingSystemSectionshowstheguestoperatingsystemasdefinedbyCIM. Nameoftheoperatingsystem. //ovf:Envelope/Section[@xsi:type='vadk:OperatingSystemSection_Type']/ vadk:RepositoryExport/@vadk:description OSInformation Informationabouttheoperatingsystem. //ovf:Envelope/Section[@xsi:type='vadk:OperatingSystemSection_Type']/ vadk:RepositoryExport/@vadk:info Virtual Hardware TheVirtualHardwareSectiondescribesvirtualhardwareconfiguration. CAUTIONVMwarestronglyrecommendsthatyouusetheVMwareStudioWebconsoletoeditthe virtualhardwaresettings,becauseinvalidconfigurationscancausebuildfailure.SeeCreatingVirtual Disks,Partitions,andVirtualDevicesonpage 129. InthefollowingXMLitems,<rasd:InstanceId>shouldbesequentialstartingwithnumberone(1) anduniqueforeverynewresource. CPUs Thenumberofvirtualprocessorstobeconfiguredforthisvirtualmachine. IMPORTANTThisnumbermustbelessthanorequaltothenumberofCPUsintheprovisioning platformusedtocreatethevirtualmachine.Ifthemachineonwhichtheprovisioningplatformrunsis incapableofbootingavirtualmachinewithmorethanoneCPU,thenyoucanspecifyonlyoneCPU inthebuildprofile. //ovf:Envelope/Section[@xsi:type='ovf:VirtualHardwareSection_Type']/ Item[rasd:ResourceType = 3] -definestheCPUs Item/rasd:VirtualQuantity -definesthenumberofCPUs Memory(MB) Amountofmemory(RAM)inmegabytes(MB)allocatedtothisvirtualmachinein4MBincrements. //ovf:Envelope/Section[@xsi:type='ovf:VirtualHardwareSection_Type']/ Item[rasd:ResourceType = 4] -definesthememory(RAM) Item/rasd:VirtualQuantity -definestheamountofmemory NetworkandSCSI Adapters ThedefinitionofanetworkorSCSIcard.EachcardthatyoudefinerequiresaseparateItemelement. //ovf:Envelope/Section[@xsi:type='ovf:VirtualHardwareSection_Type'] /Item[rasd:ResourceType = 10] /Item[rasd:ResourceType = 6] InVMwareStudio2.1youcanchangethenetworkorSCSIadaptertypebyeditingtheXMLprofile. Thesupported10networkadaptertypesarePCNet32andE1000.Thesupported6SCSIadapter typesarelsilogicandbuslogic. VirtualHardDisk Therecanbeamaximumof4partitionsoneachnonrootvirtualdisk.However,inmostcases,onefull sizepartitionshouldbesufficient,sincethereisamaximumof60diskssupportedforCentOS5.0and RHEL5.1.ForUbuntu7.04,Ubuntu7.10,andUbuntu8.04,15disksaresupported. ItisrecommendedthatyouusetheVMwareStudioWebconsoletoadddisksandpartitions.This sectioniscomplicatedandhasmanyinterdependencieswithinthebuildprofileXML.Formore information,seeCreatingVirtualDisks,Partitions,andVirtualDevicesonpage 129. Operating System OSDistribution BootParameters TheJEOSSectiondescribesthejustenoughoperatingsystemfortheVM. IndicatesthenameoftheOSforyourvirtualmachine. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:Distribution BootArgsarepassedtotheOSatboottime. BootArgsDHCParepassedtothenetworkatboottime. BootFilesdescribeOSbootlocation. UnattendedInstallTemplateisanXSLfiledescribinginstallation. PreInstallScript PointstoascriptthatrunsontheStudioapplianceduringVMprovisioning,beforeOSinstallation begins.ThisscriptturnsthepackagesdirectoryintoasuitablerepositoryfortheOSinstaller. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:PreInstallScript PostInstallScript PointstoascriptthatrunsontheprovisionedVMafterOSinstallation.Itsaddsusers,makesdisks, andmayinstallapplicationpackages. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:PreInstallScript

VMware, Inc.

125

Developers Guide to Building vApps and Virtual Appliances

Table C-1. VM Build Profile XML Configuration Properties (Continued)


Property PostScriptRepository andPackageLists Description Repositorylistandpackagelistforinternaluse. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/ vadk:PostScriptRepoList vadk:PostScriptPackageList URLandpathsofpackagerepository,sourcedirectory,andtargetdirectory. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:VADKPackages ISOPath URLfromwheretheISOisdownloadedoraccessed.Bothfile://andhttp://protocolsaresupported, butifthehttp://protocolisused,itmaytakeaverylongtimeforthefirstbuildtodownloadtheISO image.Forthatreason,thedefaultbuildprofiletemplatesspecifyafile://locationonVMwareStudio inwhichyouplaceapredownloadedISOimage.MakesurethattheISOURLisvalidandreachable. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:ISO/@vadk:path ISOMD5 Distribution OSPackageList AnISOdownloadedfromtheISOURLshouldhavethesameMD5checksumshownhere. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:ISO/@vadk:md5sum Vendor,releasenumber,architecture,packageformat,packagemanager,andpackagerepository. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:Distribution ListofpackagesfromtheOSinstallmediatobeincludedinthevirtualmachine.Nopackagescanbe removedfromtherequiredlistofpackages. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:OSPackages Build Settings VMNetworkConnection TheBuildSectioncontrolsprovisioningoftheVM. NetworkConnectionallowsyoutospecifyeitherBridgedorHostonlyoption.Thenetworkmodeis alwaysresettobridgedpriortoZIPandOVFpackaging.TheNetworkConnectioncanalsospecifythe networklabelforVMwarevSphere,VMNetworkforexample. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:NetworkConnection VMNetworkType VMwareStudioprovidestwooptionsforobtainingIPaddressesforthevirtualmachinebeingbuilt duringprovisioning,usingDHCPorbyspecifyingastaticIPaddress.Specifyoneofthefollowing:

VADKPackages

DHCP Static,whichnecessitatestheitemsbelow.

//ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:NetworkType IPAddressthestaticIPaddresstobeusedforthevirtualmachineduringprovisioning. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:IP NetmaskThenetmasktobeusedforthevirtualmachineduringprovisioning.Anetmaskenables therecipientofIPpacketstodistinguishthenetworkIDandhostIDportionsoftheIPaddress. Netmasksnormallyareoftheformat255.x.x.x. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:Netmask GatewayTheIPAddressofthedesignatedgatewayforthisnetwork. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:Gateway PreferredDNSServer(Optional)TheprimaryDNSservertobeusedforthevirtualmachineduring provisioning.AnameserverisresponsibleformappingIPaddressestonames. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:DNS1 AlternateDNSServer(Optional)ThealternateDNSservertobeusedforthevirtualmachineduring provisioning.AnameserverisresponsibleformappingIPaddressestonames. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:DNS2 HostName (provisioningplatform) ThehostnameorIPaddressofthevirtualizationplatformyouuseforprovisioning. Notallinformationitemsarerequiredfordifferentplatforms.Forexample,onlyVMwareWorkstation needsthevmruncommand,andthebuilddirectorypathisneededonlyforhostedproducts. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:hostname

126

VMware, Inc.

Appendix C Editing XML Build Profiles

Table C-1. VM Build Profile XML Configuration Properties (Continued)


Property Port Description Theportforcommunicatingwiththeremotehostthatperformsprovisioning.Formanyvirtualization platformsthisistheHTTPSport443.VMwareServer1.0.xoftenusestheauthdorautomationport, usually902,sometimes904.VMwareServer2.0hostedonWindowsprobablyusesport8333.VMware WorkstationusesSSHonport22forremoteprovisioning,soitdoesnotaskforaportnumber. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:port HostOS Theoperatingsystemoftheprovisioningplatform. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:hostOS Username Ausernameontheremotehostforauthenticationofvirtualmachineprovisioning. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:login Password Passwordforthespecifiedusername.Youmusttypethepasswordtwicetoconfirm. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:password BuildDirectoryPath (WorkstationandServer1.0.xonly)Thetemporarypathusedbytheprovisioningplatformtoregister andcontrolprovisioningofthevirtualmachine.Thislocationisusedtostorethevirtualmachine duringtheprovisioningphase.Forexample,ifaLinuxsystemisthehostoftheVMwareServerand /tmpistheprovisioningdirectory,thenenter/tmpintheHostPathfield. Asanalternateexample,ifaWindowssystemisthehostoftheVMwareServerandc:\tmpisthe provisioningdirectory,SCPusestheOpenSSHserverinCygwin,sotheHostPathisc:\tmpbutthe FileTransferPathbelowshouldbe/cygdrive/c/tmp. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:path. DatastoreName DatastorenameasshownintheVMwarevSphereclientSummarypage.Thisnamecouldbe datastore1,storage1,orsomeotherdesignation. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:datastore DatacenterName (vCenteronly)DatacenternameasdesignatedintheVMwarevSphereinventory.Thisnameappears intheleftsidebarofthevSphereclientwhenconnectedthroughvCenterServer. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:datacenter ManagedESXHost (vCenteronly)HostnameorIPaddressoftheESX/ESXihostmanagedbyvCenter. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:managedESX ResourcePool(Optional) IfyoucreatedaResourcePoolandyouwantVMwareStudiotobepartofit,youcanspecifythename oftheresourcepool.Optional.ESX/ESXihostsandvCenterServerhaveabuiltindefaultresource pool,Resources.ThisresourcepoolisvisibleintheManagedObjectBrowser(MOB)interfaceat http://<esxorvc>/mob,butthevSphereClient,VMwareStudio,andovftooldonotsupportit.Ifyou wanttosetaresourcepool,useonethatwascreated,notResources. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:resourcePool FileTransferUsername UsernameusedtotransferprovisioningVMfilestoandfromtheprovisioningplatformhost. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:fileLogin FileTransferPassword Passwordusedtoauthenticatethefiletransferstoandfromtheprovisioningplatformhost. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:filePassword FileTransferProtocol ProtocolusedtocommunicatebetweentheprovisioningplatformhostandtheVMwareStudio appliance.EnsurethatcommunicationusingthespecifiedprotocolworksbetweentheVMwareStudio applianceandthehostwheretheprovisioningplatformruns. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:fileProto

VMware, Inc.

127

Developers Guide to Building vApps and Virtual Appliances

Table C-1. VM Build Profile XML Configuration Properties (Continued)


Property FileTransferPath Description ApathusedbyVMwareStudioforuploadingtheprovisioningvirtualmachinetothehostpath.The FileTransferPathandtheBuildDirectoryPathmustrefertosamephysicaldirectory.Forexample,say aLinuxboxisthehostoftheVMwareServerand/tmpistheprovisioningdirectory.Inthiscase,both FileTransferPathandBuildDirectoryPathwouldhave/tmpastheirentries.Asanotherexample,say aWindowsboxisthehostoftheVMwareServerandc:\tmpistheprovisioningdirectory.Inthiscase BuildDirectoryPathmightbec:\tmpwhileFileTransferPathmightbe/cygdrive/c/tmp,because thatisthenameofthesamelocationwhenOpenSSHforWindowsisinstalledfortheSSHservice. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:filePath PathtovmrunCommand (Workstationonly)VMwareWorkstationusesthevmruncommandforprovisioning.

OnWindowsthiscouldbeC:\ProgramFiles\VMware\VMwareWorkstation. OnLinuxthiscouldbe/usr/bin.

//ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:vmrunPath VirtualizationPlatform TheVMwarevirtualizationplatformforprovisioningyourvirtualmachine.Adropdownmenu displaysachoiceofplatforms.Asyouselectdifferentplatforms,buildenvironmentsettingschange. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostProduct vadk:name=""> PreInstallShellScript Shellscriptthatyoucanmodify,whichrunsontheprovisionedVMbeforeinstallationofapplication packages.ItmayremoveunneededOSorapplicationpackages. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:PreInstallShellScript PostInstallShellScript Shellscriptthatyoucanmodify,whichrunsontheprovisionedVMafterinstallationofapplication packages.Itmaydeleteunnecessaryfiles. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:PostInstallShellScript EVMScripts ForinstallationofanexistingVM,andforpreinstallationofthenewVMbasedonit. //ovf:Envelope/Section[@xsi:type='vadk:ExistingVMSection_Type']/ vadk:EVMInstallScript //ovf:Envelope/Section[@xsi:type='vadk:ExistingVMSection_Type']/ vadk:PreInstallScript

Useful Attributes Not Displayed in the VMware Studio Web Console


/ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/vadk:ProvisioningTimeoutsfollow: @vadk:boot="600"Newnameforvadk:pxe.Maximumwaittime(inseconds)todiscoverthenetwork addressofthetransientVMduringprovisioning. @vadk:hang="7200"Maximumtime(inseconds)forprovisioningtocomplete. @vadk:remoteDeviceBootDelay="25"TransientVMbootdelay(inseconds)thatallowsitsCDROMand floppydevicestobeconnected. @vadk:remoteDevice="15"Maximumtime(inseconds)forCDROMorfloppydevicestoconnect. @vadk:scpOperationTime="300"Maximumtime(inseconds)forthescpcommandstocomplete. @vadk:sshWaitTime="120"Time(inseconds)forStudiossshcommandstocomplete.Ifyouseeany failuresrelatedtossh,increasethissetting,althoughdoingsomayprolongoverallbuildtimes. @vadk:systemCmdWaitTime="30"Maximumtime(inseconds)forVMwareStudiosovftooland remoteDeviceConnectcommandstoreporttheirinitialresponses. @vadk:systemCmdMaxTime="7200"Maximumtime(inseconds)forVMwareStudiosovftooland remoteDeviceConnectcommandstocomplete. /ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/vadk:ProvisioningEngine/vadk :VmhostLan/@vadk:wsXDisplay=0.0X11displayconfigurationtodisplaytheVMwareWorkstation consoleonaLinuxhost.VMwareWorkstationprovisioningfailsifthisattributeisnotsetaccordingly.
128 VMware, Inc.

Appendix C Editing XML Build Profiles

Customizing the Footer in the Web Console


YoucancustomizetheleftsidefooterandthemiddlefootertextforaVMWebconsole.Todothis,edittheVM profileandaddHTMLtagsasinthisexampletotheViewCustomizationXMLsection:
<Section xsi:type="vadk:VAMISection_Type"> <vadk:ViewCustomization> <vadk:FooterLeft>&lt;a href=&quot;http://www.vmware.com/&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;padding-top: 3px;&quot; src=&quot;service/core/vmware-footer-logo.gif&quot; alt=&quot;VMware logo&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</vadk:FooterLeft> <vadk:FooterCopyright>Copyright &amp;copy; 1998-2009 VMware, Inc. All rights reserved.</vadk:FooterCopyright> </vadk:ViewCustomization> </Section>

Asshownintheexample,thefooterHTMLmustbeXMLencoded.Ifitcontainsanyimages,makesurethat theimagesareaccessibletotheWebconsoleofyourvirtualappliance.

Creating Virtual Disks, Partitions, and Virtual Devices


Thefollowingsectionsprovideinformationaboutthevirtualhardwarethatisdefinedinthebuildprofilefor avirtualmachine.IntheVMwareStudioGUI,theHardwaretabiswherethisinformationisdefined. Hardware ThissectiondefinesthevirtualharddrivesandSCSIcontrollersthatappearinthevirtualmachine. Anexamplecontrollerspecificationlookslikethis:
/ovf:Envelope/Section[@xsi:type='ovf:VirtualHardwareSection_Type'] ... <Item> <rasd:BusNumber>0</rasd:BusNumber> <rasd:Caption>SCSI Controller 0 - LSI Logic</rasd:Caption> <rasd:InstanceId>4</rasd:InstanceId> <rasd:ResourceSubType>lsilogic</rasd:ResourceSubType> <rasd:ResourceType>6</rasd:ResourceType> </Item>

rasd:BusNumberThecontrollernumber.Controller0,harddrive0isdefinedtobethebootdevice.Four controllersaresupported(03). rasd:CaptionAtextdescriptionofthecontroller. rasd:InstanceIdTheorderofthisIteminthehardwaresection. rasd:ResourceSubTypeTypeofthecontroller.SupportedtypesarelsilogicandbuslogicforSCSI adapter,orPCNet32andE1000fornetworkadapter.SeeResourceAllocationSettingDataonpage 131. rasd:ResourceTypeThetypeofcontroller.Resourcetype6indicatesSCSI.Type10indicatesnetwork.

Anexampleofaharddrivelookslikethis:
<Item> <rasd:AddressOnParent>1</rasd:AddressOnParent> <rasd:Caption>Harddisk 1</rasd:Caption> <rasd:HostResource>/disk/newdisk</rasd:HostResource> <rasd:InstanceId>5</rasd:InstanceId> <rasd:Parent>4</rasd:Parent> <rasd:ResourceType>17</rasd:ResourceType> </Item>

rasd:AddressOnParentTheharddriveaddressonthecontroller.Fifteenharddrivespercontrollerare supported,numbered015,withaddress7beingreserved. rasd:CaptionAtextdescriptionoftheharddrive. rasd:HostResourceAstringthatassociatedthisharddrivewithanassociatedentryintheDiskSection. Thisentryalwaysbeginswith/disk/ followedbytheIDfromtheentryintheDiskSection.

VMware, Inc.

129

Developers Guide to Building vApps and Virtual Appliances

rasd:InstanceIdTheorderofthisIteminthehardwaresection. rasd:ParentThecontrolleronwhichtheharddriveistoreside.ThisnumberistheInstanceIdofthe controller,notthecontrollernumber. rasd:ResourceTypeThetypeofhardwaredevice.17isaharddrive.

Disk Thissectiondefinesthename,size,andformatofthevirtualharddrivesthatappearinthevirtualmachine. Thefollowingisanexampleofadiskspecification:


/ovf:Envelope/Section[@xsi:type='ovf:DiskSection_Type'] ... <Disk ovf:diskId="newdisk" ovf:capacity="2048" ovf:capacityAllocationUnits="MegaBytes" ovf:format="http://www.vmware.com/specifications/vmdk.html#sparse" ovf:fileRef="newdisk.vmdk" />

ovf:diskIdIDofthisdisk.TheIDmatchesthisdiskwithaharddrivedefinedintheHardwaresection. ovf:capacityThesizeofthedisk,inovf:capacityAllocationUnits. ovf:capacityAllocationUnitsThesizeunits.MegaBytesarethesupportedvalue. ovf:formatTheformatofthevmdkfile.Thisvalueshouldalwaysbe: http://www.vmware.com/specifications/vmdk.html#sparse. ovf:fileRefThenameofthegeneratedfileforthisdisk.

Partition ThissectiondefinesthepartitionsonthedisksspecifiedintheDisksection.Forexample:
/ovf:Envelope/Section[@xsi:type='vadk:DiskPartitionSection_Type'] ... <vadk:Partition vadk:mount="/newdisk" vadk:fs="ext3" vadk:bootable="0" vadk:diskId="newdisk" vadk:size="grow"/>

vadk:mountTheplacewherethediskappearsonthevirtualmachinesfilesystem.Thisfieldisignored forpartitionsmarkedswap. vadk:fsThetypeofpartitiontomake.Astandardfilesystemwillhavethevalueext3;theothervalid valueisswaptodefineaswappartitiontoextendthevirtualmemoryofthevirtualmachine. vadk:bootableWhetherthispartitionisbootableornot.Thisflagissetonlyintherootpartition (controller0,disk0)andonlyonthebootpartition. vadk:diskIdTheovf:diskIdintheDisksectiontowhichthispartitionrefers. vadk:sizeSizeofthepartition.Normally,eachnewdiskhasonlyonepartition,specifyingtheentire disk.Thisisspecifiedwiththewordgrowinthisattribute.Otherwise,avaluemaybeenteredherethat specifiesthesizeofthepartitioninMB.Agrowpartitionshouldbethelastpartitionspecifiedinthedisk.

Virtual Sound Card Toaddavirtualsoundcardtothevirtualmachine,insertthefollowingintothebuildprofilesection, <Section xsi:type="ovf:VirtualHardwareSection_Type">,replacingtheinstancenumberwiththe nextnumberinsequenceinyourhardwaresection.


<Item> <rasd:Caption>es1371 sound controller</rasd:Caption> <rasd:InstanceId>7</rasd:InstanceId> <rasd:ResourceSubType>es1371</rasd:ResourceSubType> <rasd:ResourceType>35</rasd:ResourceType> </Item>

130

VMware, Inc.

Appendix C Editing XML Build Profiles

Virtual USB Controller ToaddavirtualUSBcontrollertothevirtualmachine,insertthefollowingintothebuildprofilesection, <Section xsi:type="ovf:VirtualHardwareSection_Type">,replacingtheinstancenumberwiththe nextnumberinsequenceinyourhardwaresection.


<Item> <rasd:Caption>USB controller</rasd:Caption> <rasd:InstanceId>8</rasd:InstanceId> <rasd:ResourceType>23</rasd:ResourceType> </Item>

Unmounting CDROM or ISO After a Build


InStudio2.1youcanchangetheISOelementvadk:unmountAfterUseinthebuildprofile.Thedefaultisfalse. Whensettotrue,theISOisunmountedafterabuild.ThisisusefulforunmountingtheCDROMpostbuild. ItisalsousefulwhenyouwanttomountadifferentISOforthenextbuild.

Resource Allocation Setting Data


Table C2shows<Item>elementsintheDMTFstandard.Table C3showsinstanceIDsforvarioushardware. Table C-2. DMTF RASD Standard
ElementName Description InstanceID ResourceType ResourceSubType VirtualQuantity AllocationUnits Reservation Limit Weight Address Parent AddressOnParent AutomaticAllocation Connection HostResource RequiredfieldthatcontainsadisplayfriendlymessageaboutthecontentoftheRASD Humanreadabledescription RequiredfieldthatcontainsuniqueIDwithinthis<VirtualHardwareSection> Requiredfieldthatindicatesthekindofresource Avendorspecificidentifierforspecificdevices Specifiestheamount(usedformemoryandCPU) Specifiestheunitofresource(usedformemoryandCPU) Specifiesresourceallocationpolicy(CPUandmemory) Specifiesresourceallocationpolicy(CPUandmemory) Specifiesresourceallocationpolicy(CPUandmemory) Typicallyusedastheunitnumberofacontroller InstanceIDofparentcontroller(fordevicesonacontroller) Usedtospecifytheorderfordevicesonacontroller Usedtospecifywhetheradeviceshouldbeconnectedonpoweron(e.g.,foraCDROM) Referencetoanetworkforanethernetadaptor Referencetoavirtualdiskforadiskdrive

Table C-3. Resource Type Numbering


Processor Memory IDEController SCSIController EthernetAdapter FloppyDrive CD/DVDDrive DiskDrive USBController 3 4 5 6 10 14 15/16 17 23

VMware, Inc.

131

Developers Guide to Building vApps and Virtual Appliances

Structure of vApp XML Build Profiles


AfteryoubuildavApp,youcanfinditsXMLprofileinthislocationontheVMwareStudioappliance:
/opt/vmware/var/lib/build/vapp_profiles/<vAppProfileName>.xml

Table C4describestheconfigurationpropertiesinthevAppbuildprofileXMLfile. Table C-4. vApp Build XML Configuration Properties


Property vApp Information vAppName Version FullVersion ProductURL Vendor Description VendorURL ApplicationURL Description ItemsintheProductSectionfortheISV. NameofthevApp.ThisnameisdisplayedasvAppinvSphere. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Product VersionofthevApp.ThisversionisdisplayedintheSummarytabinvSphereclient. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Version FreetextusedtodisplaythefullversionofthevApp. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:FullVersion ProductURLtothecompanysWebsitewhichprovidesinformationaboutthisvApp. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:ProductUrl NameofthevAppvendor. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Vendor DescriptionofthefunctionalitythisvAppprovides.ItisdisplayedinthesummarytabinvSphereclient. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:AnnotationSection/ovf:Annotation VendorURLtothecompanysWebsite. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:VendorUrl URLtothemainapplicationWebpage.The{$app.ip}keywordintheURLisresolvedtotheIPaddress oftheVM. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:AppUrl EULAText enduserlicensingagreementforthevApp.TheusermustacceptthisagreementbeforeusingthevApp. YoucanaddmorethanoneEULAinthebuildprofilebycopyingthe<EulaSection>. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:EulaSection/ovf:License VM Information ProfileName Location YoucanspecifymorethanonevirtualmachineinVMCollection. SpecifiestheprofilenameoftheVM. //vadk:MultiVM/vadk:VMCollection/vadk:VM/@vadk:profile Ifspecified,itisusedtoselectanexistingbuildofaVM.Ifvadk:locationisspecified,thentheVMatthat locationisused.Otherwise,theVMisbuiltfromtheprofilespecifiedinthevadk:profile. //vadk:MultiVM/vadk:VMCollection/vadk:VM/@vadk:location Id ThisistheidentificationoftheVM,usedintheStartupSection.ThisidisautogeneratedbytheUI. //vadk:MultiVM/vadk:VMCollection/vadk:VM/@vadk:ovfid Start Order Id BootGroup StartAction TheStartupSectiondescribespoweronorderforthevApp. SpecifytheidoftheVM.Thismatchesthevadk:ovfidintheVMCollectionSection. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/@ovf:id SpecifythebootgrouptoorderthestartupandshutdownoftheVMs. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/@ovf:order ActiontoperformontheVMwhilestartingthevApp.ItcaneitherbespecifiedaspowerOnorignored. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/ @ovf:startAction StopAction ActiontobeperformedontheVMwhileshuttingdownthevApp. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/ @ovf:stopAction

132

VMware, Inc.

Appendix C Editing XML Build Profiles

Table C-4. vApp Build XML Configuration Properties (Continued)


Property StartDelay Description NumberofsecondstowaitfortheVMtopoweronbeforecontinuingwiththestartsequence. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/ @ovf:startDelay StopDelay NumberofsecondstowaitfortheVMtopoweroffbeforecontinuingwiththestopsequence. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/ @ovf:stopDelay Tools IfselectedintheUI(settotrueintheprofile),waituntilVMwareToolsisrunningbeforecontinuingwith thestartsequence. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/ @ovf:waitingForGuest Resources OVFID CPUShares CPUReservation (Mhz) MemoryShares MemoryReservation (MB) Output FileName OutputFormat ApplicationURLVM SpecifiesvSphereResourcesallocatedforthevApp. SpecifytheIDoftheVM.Thismatchesthevadk:ovfidintheVMCollectionSection. //vadk:MultiVM/vadk:Resources/vadk:Resource/@vadk:ovfid ThepriorityofthisVMrelativetootherswhennonreservedCPUisavailable. //vadk:MultiVM/vadk:Resources/vadk:Resource/vadk:cpu/@vadk:weight GuaranteedlowerboundontheamountofCPUthatthehostreservesforthisVM. //vadk:MultiVM/vadk:Resources/vadk:Resource/vadk:cpu/@vadk:reservation ThepriorityofthisVMrelativetootherswhennonreservedmemoryisavailable. //vadk:MultiVM/vadk:Resources/vadk:Resource/vadk:memory/@vadk:weight GuaranteedlowerboundontheamountofCPUthatthehostreservesforthisVM. //vadk:MultiVM/vadk:Resources/vadk:Resource/vadk:memory/@vadk:reservation SpecifiestheDistributionFormatforoutput. NameofthevAppOVFandOVAoutputfiles. //vadk:MultiVM/vadk:DistributionFormat/@vadk:filename OVForanOVAformatcanbeusedtodeploythevAppintovCenterServerusingvSphereClient. //vadk:MultiVM/vadk:DistributionFormat/@vadk:format SelectstheVMtowhichtheapplicationURLshouldpoint.ItisusedinconfiguringtheApplicationURL specifiedintheDescriptiontab.vadk:appurlissettothewordtrueifthisVMistobeselected. //vadk:MultiVM/vadk:VMCollection/vadk:VM/@vadk:appurl OVF IP Assignment DHCP OVFEnvironment TheIpAssignmentSectionspecifieshowtohandleOVFnetworkspecifications. EnabletheoptionofusingtheDHCPserverforconfiguringnetworkingoftheVM. //vadk:MultiVM/vmw:IpAssignmentSection[@vmw:schemes=dhcp] EnabletheoptionofusingafixedoratransientIPaddressfortheVM. //vadk:MultiVM/vmw:IpAssignmentSection[@vmw:schemes=ovfenv] OVF Property Key Label ThePropertysectionsetsOVFpropertiesforthevApp. KeytotheOVFProperty. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Property/@ovf:key LabelfortheOVFproperty. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Property/ @ovf:Label Description DescriptionfortheOVFproperty. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Property/ @ovf:Description Type TypeoftheOVFproperty //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Property/ @ovf:type

VMware, Inc.

133

Developers Guide to Building vApps and Virtual Appliances

Table C-4. vApp Build XML Configuration Properties (Continued)


Property DefaultValue Description ValueoftheOVFpropertyaccordingtothetype. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Property/ @ovf:value UserConfigurable Whethertopromptusertoallowchangingproperty. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Property/ @ovf:userConfigurable OVFQualifiers OVFstandardtypequalifiers. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Property/ @ovf:qualifiers VMWQualifiers VMwarespecifictypequalifiers. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Property/ @vmw:qualifiers

134

VMware, Inc.

Troubleshooting

Thisappendixcontainstwosections:

ResolvingVMwareStudioIssuesonpage 135 ResolvingEclipsePluginIssuesonpage 139

Resolving VMware Studio Issues


Table D1listsproblemsthatyoumightencounterwhenusingVMwareStudio,andprovidespossible resolutionsfortheseproblems.
O

Table D-1. Troubleshooting Information for VMware Studio


Problem Troubleshooting VM Builds Windowsbuildfailswithanaccountalreadyexists error. ThebuildofaVMorvApphangsortimesout withoutanyspecificerror. WindowsServeralreadyhasaguestuseraccount.Ifyoutryto createone,itcausesbuildstofail. Checktheprovisioningengineconsoletoseeifuserinputis neededorifthereisaspecificfailure.Thiscanhappenbecause youspecifiedanOSpackageinthebuildprofilethatdoesnot existaspartoftheISO;inthatcase,removetheOSpackage. Thisproblemhasseveralpossiblecauses: 1 YourDHCPservermightbehavingtroubleissuinganIP address.ThealternativeistouseastaticIPaddressduring provisioning.ObtainanIPaddressinyournetwork,and updatethevirtualmachineNetworkType. Ifyoutrytoprovisiona64bitOSona32bitESXihost, VMwareStudiotimesoutwaitingforIPinformationfrom theVM,whichcannotpoweron.Themessageontheconsole oftheprovisioningmachinewouldbeYourCPUdoesnot supportlongmode.Usea32bitdistribution. WhenanESX/ESXihostismanagedbyvCenterServer,and youprovisiondirectlyontheESX/ESXihost,notthrough vCenterServer,theprovisioningmightfail.Thisisnota supportedconfiguration:nexttimeprovisionthrough vCenterServer. Resolution

VMwareStudiotimesoutwaitingforIPinformation fromtheprovisioningVMduringbuild.

Abuildfailsandprintsmanymessagesincluding: Error: unable to open NFC target disk.

Thiscouldbeapermissionsproblem.Whennetworkshares servefilesanddirectoriesownedbydifferentusers,remotebuild transfercanfail.Trybuildingtolocaldiskinsteadofbuildingto anetwork.share. Youmustuse64bithardwaretoprovisionavirtualmachine with64bitguestoperatingsystem.IftheCPUisanIntelorAMD processor,itmustbecapableofexecuting64bitinstructions. IntelprocessorsmusthaveVT(virtualizationtechnology,which IntelcpuiddocumentationalsocallstheVMXbit)enabled. SometimesthissettingisintheBIOS.

Provisioninga64bitOSfailswhenusing32bit hardwaretorunavirtualizationproductplatform. Theverboselogcontainsthiserrormessage:THE CHOSENPROVISIONINGENGINEDOESNOT APPEARTOBECAPABLEOFRUNNING64BIT GUESTS;THEBUILDMAYNOTBESUCCESSFUL.

VMware, Inc.

135

Developers Guide to Building vApps and Virtual Appliances

Table D-1. Troubleshooting Information for VMware Studio (Continued)


Problem DuringoperatingsysteminstallationinaVMbuild, the/bootpartitionsizecausesthebuildtofail. Instancenameswhichbeginswithperiod(.)or hyphen()resultinGUIunresponsiveness. Resolution Checkthe /var/log/syslogandseeiftherearediskfullerrors. Ifso,youcanincreasethesizeofyour/boot partitioninthe Hardwaretabofthebuildprofile. Thiscanhappeniftheprofilenamestartswithaperiodor hyphen,orifyouenteraninstancenamewiththecreatebuild command.Thesolutionistodeleteallinstancesthatstartwitha periodorhyphenusingthestudioclicommand. Thecausecouldbethatrpmbuildsearchedfordependencies andfoundsomefilesmissing,eventhoughtheyarenotreally required.Theworkaroundistocreateapackageinsteadofusing thepostinstallscripttocopythefilesinvolved. Youcanignorethesewarningmessages. Youdonotneedtorunapt-getupdatetocorrectthisproblem.

AStudiobuildfailswiththismessage: Provisioning Agent: failed to run script .post.sh WhilebuildinganUbuntuVMyoumayseeoneof thesetwopostinstall.logerrormessages: W: Conflicting distribution: http://10.20.30.123 stable Release. WARNING: The following packages cannot be authenticated! UnabletobuildUbuntuvirtualmachinesthat containmorethan15virtualdisks.

TheUbuntuinstallerlimitsyoutocreatingnomorethan15disks duringOSinstallationprocess,andVMwareStudiofollowsthis restriction.Toaddmorethan15disks,addthemaftertheVMis builtbyVMwareStudio. UsethenumericIPaddresstoconnecttotheprovisioningengine orupdaterepositoryserver. Ensurethatifyouassignapartitionwithsize=growthatitisthe lastpartitiononthedisk. Thisproblemcanbecausedbynotchangingtheversionnumber fortheupdatepackage.Thepackagehasnewcontent,butthe versionnumberisthesameasapreviouspackage.Whenyou createanupdatepackage,changetheversionnumber. Theproblemcanalsooccuriftheapplicationpackagesareofthe sameversion,butdifferentchecksum

TheStudioWebconsoledoesnotaccepthostnames, forexamplehostnamescontainingunderscore(_). Diskpartitioningforyourvirtualmachinehas partitionsassignedtothewrongmounts. Updatepackagebuildfails,butaZIPorOVFfileis created.

WhenbuildingRHEL,CentOS,orSLES,themessage Error:RPMfailed:...vmware.drv.so...conflict appearswhileinstallingVMwareTools. Whenprovisioningavirtualmachineonan ESX/ESXihostthatismanagedbyvCenterServer,the buildissuccessful,butanorphanedinstanceofthe machineremainsintheinventoryafterwards. Thebuildfailswiththefollowingfaultstring: fault.RestrictedVersion.summary

Youcanignorethiserrormessage.VMwareStudiooverwrites theOSpackagevmware.drv.sowithavalidvmware.drv.so duringthebuildprocess. Theworkaroundistodeletetheorphanedvirtualmachinefrom theinventoryusingthevSphereClientconnectedtovCenter. Nexttime,provisionthroughtheESX/ESXihostsmanaging vCenterServertoavoidthisproblem. ProvisioningthroughESXiwiththefreeESXilicenseproduces thiserrorbecausetherequiredESXcapabilitiesforprovisioning arenotavailable.TheESXievaluationlicense(whichexpiresina givenperiod)orapaidlicensewillsolvethisissue. Checkthattherearenonetworkingrelatedproblembyrunning sshfromtheStudioappliancetotheWorkstationhost. MakesureyouenteredavalidPathtovmruncommand.For instance,enter/usr/binnot/usr/bin/vmrunforLinux,or enterC:\ProgramFiles\VMware\VMwareWorkstationnot C:\ProgramFiles\VMware\VMwareWorkstation\vmrun.exe forWindows. IfthesymptomwasthatthetransientVMcouldnotbepowered on,orthattheVMwasnotseenontheWorkstationconsole, verifythattheuserenteredintheBuildSettings(forWorkstation provisioning)matchestheuserwhoiscurrentlyrunningthe Workstationconsoleonitshost.IfthehostisrunningaLinuxOS, alsoverifythatthevadk:wsXDisplayinthebuildprofile (default":0.0")matchesthecorrectXwindowsDISPLAY environmentvariable.

WorkstationfailstobuildaVMwiththewarning: Failed to detect a powered-up transient VM.

136

VMware, Inc.

Appendix D Troubleshooting

Table D-1. Troubleshooting Information for VMware Studio (Continued)


Problem WhenvalidatingfiletransfertoVMwareServer1.0.x orWorkstation,thiserrorappearsinthelogfile: <build/update host> could not be reached! VMwareServer1.0.xgivesthiserrorduringabuild: Login error: Insufficient permissions in host operating system VMwareServer1.0.xrunningonWindowsreports: VMware Server unrecoverable error: (vmx) duringtheVMbuild.Thiserroriscausedbyauser withoutlocaladministrativeprivilegesdoingabuild. VMwareServer1.0.xgivesthisunrecoverableerror: Cannotgettemporarydirectoryforlogfile. Acorefileisavailable.Pleaserequestsupport. Resolution Thiscouldbeduetoport7orport22beingclosed.Seethe prerequisitessectionforPrerequisitesonpage 19. Port7butalsobeopenonthehostoftheUpdateRepository. EnsurethatyouhavethecorrectcredentialsforVMwareServer intheBuildSettings. SelectauserwithWindowsadministrativeprivilegesforthe VMwareServersectioninthebuildprofile.

MakesuretogiveAdministrativeprivilegestotheuseronthe hostrunningVMwareServer.Thisisthesameuserthatyou specifiedintheSetupTabinVMwareServerSectionduring buildprofilecreation,forauthenticatingtoVMwareServerand remotelycontrollingVMprovisioningusingtheVIXprotocol. Onecauseisthatduringdiscovery,disksizeswerecalculatedtoo small.Becauseofroundingerrorswhenconvertingfromdisk cylinderstoMB,virtualdisksizeissometimescalculatedoneor twoMBsmallerthanneeded.Thesolutionistoincreasethesize ofthedisksinthegeneratedbuildprofiletobematchwhatis required.ThesizeisrepresentedinMBintheovf:capacity attributeofDiskelementsintheDiskSection_Typesection. //ovf:Envelope/Section[@xsi:type="ovf:DiskSection_ Type"]/Disk/@ovf:capacity

AfterexistingVMdiscoveryandimport,theVM builtfromitcannotdeploy,returninganI/Oerror orError500code.InvCenterServerandESX/ESXi 4.1,theerrorisproperlyreportedascapacityofdisk islargerthanrequested.

Thebuildfailswithamessagelikethis: STUDIOABORT:Error:Unabletoinstallpackage pkg-name Troubleshooting VM Power-On VMwareStudioappliancedoesnotgetanIPAddress assigned. Duringthefirstbootofavirtualmachine,thevirtual machinestopsrunningbeforereachingthelogin prompt.Restartingthevirtualmachineresultsinthe FirstBootScriptbeingskipped. ALinuxVMcreatedbyVMwareStudioinOVF format,whenimportedintoVMwareWorkstation withtheWorkstationConversionWizard,failsto bootwithakernelpanicerror.Alogfilemightsay thattheBuslogicSCSIadapterisnotsupported. WhenyouprovisiononWorkstationorServer1.0.x andchecktheRetainTransientVMoption,which callsthedebugCLIflag,thetransientVMleftafter thebuilddoesnotbootupmanually.TheVMstarts, andtheprovisioningagentshowssignsofexecuting, buttheVMsoonpowersdownsoyoueffectively cannotdoanythingwithit. AfterprovisioningthetransientVMgoesoffline, looksforthepostOSinstallationlogfile,butdoesnot findit,sothebuildfails. AfteryousetanappliancetouseastaticIPaddress, itsIPaddressmightreverttotheDHCPsettingthat itusedpreviously.

Thismighthappenwhentheconfigurationfilesinaprevious buildgetoutofsyncwiththoseinanupdatedpackage. Thesolutionistomodifythepreinstallscripttoremoveand purgetheoldpackage.

GotoVMwareStudioconsole,andusetheConfigureNetwork optiononVMwareStudiowelcomescreen. Discardthevirtualmachineandstartoverwiththevirtual machineOVForZIPfile.

ToworkaroundthisknownissueintheVMwareConverter versionthatsupportstheWorkstationConversionWizard,edit the.vmxfileoftheVMthattheConversionWizardcreated. Replacebuslogicwithlsilogiconthescsi0.virtualDev line,andpowerontheVM. Thecauseisthattheprovstart.isoimageisrequestedbutnot availabletothetransientVM,sotheprovisioningagentcannot executescriptsintheprovstart.isoimageatboottime.A workaroundistoreconfiguretheVMsoitsCDROMconnectsto thephysicaldriveinsteadofprovstart.iso,rebuildandreboot theVM.Iftheprovisioningagentdoesnotseeprovstart.iso, theVMwillbootandfunctionasyouexpect. Thecausecouldbeatemporarylossofnetworkconnectivity,or slowserverresponse.Runthebuildagain. Onecauseispersistenceofthedhclientprocess,whichcould changethenetworksettingswhenitsDHCPleaseexpires. Thesolutionistologintotheapplianceasroot,killthedhclient process,andrunthe/etc/rc.d/networkrestartcommandto resetnetworking.

VMware, Inc.

137

Developers Guide to Building vApps and Virtual Appliances

Table D-1. Troubleshooting Information for VMware Studio (Continued)


Problem Troubleshooting After Deployment Networkingparameterscouldreverttotheir deploytimesettingsafterareboot.Thisoccurswith VMsdeployedundervCenterServer,whenyou changenetworksettingswiththebluescreenlogin insteadofwiththeWebconsoleUI. WhenyoudeployaVMundervCenterServer,you aregivenachoiceofnetworkingconfiguration (DHCP,Fixed,orTransient)andyoumayassignan IPaddresstotheVM.OncetheVMisrunning,VAMI allowstheUItodonetworkreconfigurationofthe VM.HowevervCenterServerdoesnotknowifthe networkwasreconfigured.ThereisaflagintheVM thattellstheVAMIcoderunatboottimethat networkingwasreconfiguredintheVM,soignore thenetworkparametersfromvCenterServer. ThisworksfineifyouusetheWebconsoleUIto reconfigurethenetwork.However,thebluescreen networkconfigurationdoesnotsetthisflag,sothe nexttimetheVMisbooted,networkingparameters aresettotheirstatewhentheVMwasfirstdeployed. Theworkaroundistoeditthenetworkflagmanually.Todothis, changethevalueoftheovfattributeinthenetworkelementof /opt/vmware/etc/vami/vami_ovf_info.xmlfromtrueto false.Inotherwords,findthissection: <?xml version="1.0"?> <ovf-info> <eula ovf="true"/> <network ovf="true"/> </ovf-info> Changeittothis: <?xml version="1.0"?> <ovf-info> <eula ovf="true"/> <network ovf="false"/> </ovf-info> Resolution

VMwareStudio2.1providesthevamisupportscript,whichbundlesuplogfilesintoatarfile(tarball)for troubleshooting.Thisscriptisat/opt/vmware/bin/vamisupportonVMwareStudiogeneratedappliances. Whenreportingaproblem,thecustomercanrunthevamisupportscript,andnotewhereitwritesoutput. Thecustomercanscptheresultingtarballtoacomputerwithemailservice,thensenditwiththeirreport.

138

VMware, Inc.

Appendix D Troubleshooting

Resolving Eclipse Plugin Issues


Table D2listsproblemsthatyoumightencounterwhenusingtheVMwareStudioPluginforEclipse. Table D-2. Troubleshooting Information for the Eclipse Plugin
Problem Troubleshooting the Studio Plugin for Eclipse WhyisittakingsolongtoinstalltheVMwareStudio PluginforEclipse? WhydoesEclipsehangatstartuptime? TheEclipseinstallerisprobablysearchingtheexternalWebfor dependencies.SettheHTTPproxyinEclipseasinGetting StartedwithVMwareStudioPluginforEclipseonpage 69. ItispossiblethatEclipseistryingtoupdateorinstallplugins fromanobsoleteornonexistentsoftwaresite.Youcanremove oldlocationsfromthelistofavailablesoftwaresitesasfollows. InEclipse3.4:Help>SoftwareUpdates>ManageSites>[click boxtodim]>Remove. InEclipse3.5:Window>Preferences>Install/Update> AvailableSoftwareSites>[clicksite]>Remove WhatcanIdoaboutaninvalidsecuritycertificate, witherrorcodesec_error_ca_cert_invalid sayingthecertificateisnottrustedbecauseitis selfsigned? TheVMwareStudioPluginforEclipseusesthedefaultWeb browserthatisconfiguredinEclipse.Youshouldsetthis configurationtouseasupportedbrowser. IftheconfigurationissettoanembeddedMozilla,suchas FirefoxonLinux,andisusingxulrunner>=1.9(Geckolayout), certificatevalidationmightfailwithoutaneasywaytobypassit. Typicallyyouseeamessagesuchasthefollowinginapopup:
x.x.x.x:5480 uses an invalid security certificate. The certificate is not trusted because it is self signed. The certificate is only valid for <a id="cert_domain_link" title="Self-Signed by VMware, Inc."> Self-Signed by VMware, Inc.</a>

Resolution

Youhaveachoiceoftwoworkarounds:

ConfigureEclipsetoopenanexternalbrowser.Todothis, clickWindow>Preferences>General>WebBrowser>Use ExternalWebBrowser. OpentheVMwareStudioWebconsoleinaregularbrowser windowandseparatelyestablishthecertificateoverride:

InFirefox3forexample,clickOryoucanaddan exception>AddException>GetCertificate>Confirm SecurityException. CopythecertificateoverridefilefromyourWebbrowser profiletotheEclipseprofile:


cd $HOME/.mozilla cp firefox/*default/cert_override.txt eclipse/

RestartEclipse.

VMware, Inc.

139

Developers Guide to Building vApps and Virtual Appliances

140

VMware, Inc.

Index

Numerics
32-bit operating systems 34, 76 64-bit requirements 20, 28, 135

A
application install on Windows 76, 84 application package repositories 49 DEB or RPM format 49 location of appliancePackages 35 mkpkg command 49, 53 specification order 35 winrepo package depot for Windows 84 audience 9, 18 developers building vApps 18, 89 ISVs shipping virtual appliances 18, 95 Linux and Eclipse developers 18, 33, 69 release build automation 18, 97 Windows developers 18, 75

digital signatures for updates 64 digital signing of OVF files 101 discovering and importing a VM 104 discovery reports for a VM 99 disk partitioning for system and user 96 disk size and partitioning, virtual 39

E
Eclipse plugin 17, 69 download and install 69 management services 71 packaging applications 70 proxy for network access 69 requirements for 69 troubleshooting 139 uninstalling 72 ESX/ESXi platform support 19, 28 EULA localization and customization 38, 64, 120 existing VM as input 103

B
build profile building a Linux VM 35, 46 building a Windows VM 76, 80 debugging build summary and logs 46, 80 migrating from earlier versions 47 procedure to build a vApp 27, 89, 93 XML structure and syntax 119 build system in VMware Studio 17

F
field updates, See updates to virtual appliances footprint reduction, packages and files 54

G
guest operating system support 34, 76

I
ISO image of operating system 28 for Linux 34 for Windows 76 network access with NFS 28

C
CIMOM (CIM object manager) 41, 55 command-line options reference 97 Common Information Model (CIM) 16, 55, 105 CPU and memory, virtual 38 creating DEB or RPM packages 50

L
Linux kernel extensions, adding 96

D
DEB package creation 50, 52 debugging by watching build provisioning 46, 80 with build summary and logs 46, 80, 99 with vamisupport script 66, 138 deploying VMware Studio from OVF or OVA 21 from ZIP 22 multiple hosts and single host 21

M
management service, creating and importing 57 migrating build profiles from earlier versions 47 mkpkg command options 50

N
network settings proxy through firewall 23, 25 static IP or DHCP 22, 23, 25 new OS support with studiocli command 99 NFS mount on VMware Studio appliance 28

VMware, Inc.

141

Developers Guide to Building vApps and Virtual Appliances

O
old builds, removing 99 open-source VMware Tools 47 operating system image, See ISO image of OS OSP file format for VMware Tools 47 OVF and OVA distribution formats 21, 28, 96 OVF standard (DMTF DSP0243) 13

P
ports to open for VMware Studio 20 prerequisites for running VMware Studio 19 privileges for provisioning on vCenter Server and ESX/ESXi 29 on VirtualCenter and ESX/ESXi 30 product key for Microsoft Windows 78 ProductRID 42, 63, 67 provisioning agent for existing VM 105

generating (building) an update 62 publishing updates 64 reboot requirement 64 retrieving an update 62 staging server and production server 62 testing your updates 66 VMware vCenter Update Manager 67 web delivery of updates 63 XML description of repository 67 ZIP archive for updates 65 user privileges, See privileges for provisioning

V
vamisupport script 66, 138 vanilla (VAMI reduced) VM 58 vaos_init.sh initialization script 58 vApp build and deliver workflow 14 definition 13 requirements and components 89 VendorUUID 42, 63, 67 virtual appliance best practices for development 95 definition 14 updates from update repository 61 Virtual Appliance Management Infrastructure (VAMI) 16, 55 APIs for container, I/O, and log 109 components including CIM 56 creating a management service 57 importing a management service 58 service.xml description 57 services for system, network, update 56 view.xml description 57 virtual hardware version, choosing 96 VirtualApp, vApp managed object 13 VMware Ready program 37, 96 VMware Studio features and architecture 15 ports to open 20 requirements to run 19 storage needed 20 troubleshooting 135 VMware Tools in generated appliances 47 VMware vCenter Update Manager 18, 67 VMware virtualization platforms 21 ESX/ESXi 28 Player 28 VMware Infrastructure 3 21, 28 VMware Server 21, 28 VMware vSphere 4 21, 28 Workstation 21, 28

Q
qualifying Linux distributions 34

R
reboot the VMware Studio appliance 24 removing old builds 99 requirements for running VMware Studio 19 roadmap for reading this manual 18 RPM package creation 51, 52

S
security of root account on Linux 96 security of self-signed SSL certificate 22, 116 shut down the VMware Studio appliance 24 signovf for digital signature of OVF 101 size (footprint) reduction scripts 35 SSH, installing on Windows hosts 115 storage needed for VMware Studio 20 studiocli command options 97

T
technical support resources 10 testing a generated appliance 46, 80 time zone 22 changing to local 24 for a generated Windows VM 78 troubleshooting the Eclipse plugin 139 troubleshooting VMware Studio 135

U
unmounting CDROM after a build 131 Update Manager, VMware vCenter 18, 67 updates to virtual appliances 61 CDROM delivery of updates 63 creating updates 61

142

VMware, Inc.

Index

W
Web API for management services, VAMI 109 Web console for VMware Studio 16, 24, 33, 75 Application tab 40, 79 Build Settings tab 44 Description tab 37 Hardware tab 38 Management tab 41 OS tab 39, 77 Output tab 43 Windows application packaging 76 error and exit codes 84, 85 InstallShield 83 JScript support 84 library create package 84 LOGDIR environment variable 85 Microsoft installer (MSI) 83, 84 PACKAGEDIR environment variable 85 REPOSITORY environment variable 85 VMware Studio package (VSP) 83 winrepo package depot 84 workflow to build and deliver vApps 14

X
XML build profile, structure and syntax 119 XML format for update repository 67

Z
ZIP distribution format 21, 28, 43, 65

VMware, Inc.

143

Developers Guide to Building vApps and Virtual Appliances

144

VMware, Inc.

Vous aimerez peut-être aussi