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 [Link]
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: [Link] The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: docfeedback@[Link]
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 [Link] 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 [Link]
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 [Link] 57 [Link] 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 [Link] 109 [Link] 109 [Link] 110 [Link] 110
VMware, Inc.
Contents
[Link] 110 [Link] 110 VAMIContainerCallbacks 110 [Link] 110 [Link] 111 [Link] 111 VAMII/O 111 [Link] 111 [Link] 112 VAMILog 112 [Link] 112 [Link] 112 [Link] 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
[Link] [Link] 1summarizesthesignificantchangesineachversionofthisbook. Table 1. Revision History
Revision 20100713 20090828 20090629 20090205 20080905 Description MajorrevisionfortheVMwareStudio2.1release. FinalversionfortheVMwareStudio2.0release. RetitledDevelopersGuidetoBuildingvAppsandVirtualAppliancesforStudio2.0Beta. Correctionsmadetothefirstversion,butnonewmaterial. FirstversionoftheGuidetoBuildingandImplementingVirtualAppliancesforVMwareStudio1.0.
VMwareprovidesseveraldifferentSDKproducts,eachofwhichtargetsdifferentdevelopercommunitiesand [Link],andthecurrentversionofthisguide, goto[Link]
VMware Studio Forum
IfyouhavequestionsaboutVMwareStudioorwanttointeractwithotherusersanddevelopers,gotothe communityforumat[Link] FornewsaboutOVFandvAppdevelopment,gototheVMwareblogat[Link]
Intended Audience
Thisdocumentisintendedfordevelopers,independentsoftwarevendors(ISV),systemintegrators(SI),value addedresellers(VAR),hardwareappliancevendors(HAV),ITprofessionals,anddatacenteradministrators whowanttocreatequickstartingvirtualmachines,[Link] informationaboutdeployingvAppsandvirtualappliancescreatedbyVMwareStudio,seethecompanion manual,UsersGuidetoDeployingvAppsandVirtualAppliances.
VMware Technical Publications Glossary
[Link] oftermsastheyareusedinVMwaretechnicaldocumentationgoto[Link]
VMware, Inc. 9
Developers Guide to Building vApps and Virtual Appliances
Document Feedback
[Link] docfeedback@[Link].
Technical Support and Education Resources
[Link] ofotherVMwarebooks,goto[Link]
Online and Telephone Support
Touseonlinesupporttosubmittechnicalsupportrequests,viewyourproductandcontractinformation,and registeryourproducts,goto[Link]
Support Offerings
TofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,goto [Link]
VMware Professional Services
VMwareEducationServicescoursesofferextensivehandsonlabs,casestudyexamples,andcoursematerials [Link],intheclassroom,andlive [Link] andimplementationbestpractices,VMwareConsultingServicesprovides offeringsto helpyouassess,plan,build,[Link] educationclasses,certificationprograms,andconsultingservices,goto[Link]
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 [Link] asanextensiontotheISVsbuildsystem,generatingautomatedbuildsofvirtualmachinesandvApps [Link] industrystandardformat,enablingthemtorunonmanyvirtualizationplatforms.
What Is a vApp?
VMwarerecentlyintroducedthevApp,[Link] composedofoneormorevirtualmachines,[Link] andencapsulatescomponentsofamultitierapplicationaswellastheoperationalpoliciesandservicelevels [Link], [Link] thatcanbebuiltbyISVs,systemintegrators,valueaddedresellers,andonsiteITadministrators. TheOpenVirtualizationFormat(OVF)standard1.0isemployedtorepresentasinglevirtualmachineor [Link],draftOVFstandard0.9cannotrepresentmore [Link],orwith ovftool.VirtualCenter2.5andESX/[Link] ESX/ESXi3.5ifyoudeploythevAppthroughvCenterServer4. See[Link] Fromamanagementperspective,[Link],networks, datastores,[Link] AdministrationGuideforvAppmanagementinformation. Fromanimplementationperspective,avAppcontainerisaspecializedresourcepoolthatisextendedwith computeresources,productinformation,[Link],VirtualApp (themanagedobjecttypeforvApp)containsvirtualmachines.
VMware, Inc.
13
Developers Guide to Building vApps and Virtual Appliances
What Is a Virtual Appliance?
Virtualappliancesareprebuiltsoftwaresolutions,comprisingoneormorevirtualmachinesandapplications, whicharepackaged,updated,maintained,[Link], softwareappliancesletcustomerseasilyacquireanddeploypreintegratedsolutionstacks. Virtualappliancesareusuallybuiltonastandardoperatingsystem(OS)andrunasavirtualmachine(VM). Withvirtualappliances,ISVscancreateasingleapplicationstack,reducingthecostandcomplexityof [Link],preconfiguredsolutionsthatallowcustomers [Link],deployingandmanagingsoftwareis [Link] ofvirtualappliances:
AcceleratetimetomarketCustomerscanquicklydownloadandpoweronyourvirtualappliance. ReducedistributionoverheadThesamevirtualappliancerunsonmostVMwareproductplatforms. IncreasereliabilityVMwareStudiobuildsanoptionalupdaterepositoryforautomaticpatching. EnhancesecurityAppliancesarelessvulnerabletosecuritybreachesthanageneralpurposeOS. LowersupportcostsVirtualappliancesrequirelittleconfigurationandnomaintenance.
Audience for VMware Studio
IfyouareasoftwaredeveloperatanISV,VMwareStudiocanassistyouindeliveringyourapplicationsas virtualappliances,[Link] administrator,VMwareStudiocanhelpyoupackageexistingoperatingsystemsandapplicationsforyour [Link] WindowsbasedvirtualmachinesandvApps,runningsingletierormultitierapplications. Figure 11illustratestheworkflowtocreate,distribute,[Link] packagesthesoftwarefordistributiontocorporatecustomersandendusers,whodeploythepackageona [Link],andembedtheURLofthe updaterepositoryintothevirtualappliance,whichperiodicallychecksforupdatesafterdeployment. Figure 1-1. VMware Studio Workflow
Withintheenterprise,[Link],ITdevelopers [Link] operationalpoliciesandservicelevelsafterdeploymentandconfiguration.
14
VMware, Inc.
Chapter 1 Introduction to VMware Studio
Key Features
VMwareStudiohasinterestingcapabilitiesforISVsbuildingsingleormultipleVMappliancesandfor developerswhoplantocreateastandardizeddevelopmentenvironmentbypackagingtherightversionof applicationstackcomponentsandtoolsintoavirtualmachineorvApp.
Buildvirtualappliances. Ifyouhaveanexistingapplicationoryouarebuildinganewapplication,VMwareStudiocanhelpyou [Link],youcancreateproductionready virtualappliancestoreachnewmarketsandreducethescopeofhardwareplatformtesting.
BuildvApps. Withmultitierapplications,packagingthemasseparatevirtualmachinesislessthanconvenient. [Link] allowsyoutodefinethestartupandshutdownorder,therebyenablingoneclickdeploymentand [Link] [Link],avirtualmachinecontainingtheapplication servermustbeawareoftheIPaddressofavirtualmachinecontainingthedatabaseserver.
Extendtheinguestmanagementframework. VMwareStudio1.0embeddedaninguestmanagementframeworkintoLinuxbasedVMs,andprovided anetworkproxyservice,andanupdateservice,[Link] rebrandandcustomizethelookandfeeloftheWebinterface. InVMwareStudio2.0,themanagementframeworkandWebconsoleinterfacebecameextensible,andin VMwareStudio2.1,[Link] virtualappliance,[Link],youcan [Link] [Link] Webinterfacecancontainalinktotheapplicationthatyoupackageinthevirtualappliance.
Automaticallyresolvepackagedependencies. [Link] applicationpackagesand,iftheyspecifythecorrectsetofOSpackagedependencies,Studioinstallsthose [Link] onotherOSpackages,VMwareStudiomakessurethatallrequiredpackagesgetinstalled,providedthey areavailableintheISOimageoftheOS.
Packagecomplexapplicationsforvirtualenvironments. Complexmultitierapplicationscanspanvirtualmachines,justastheycanspanphysicalmachines. Componentscanrunondifferentoperatingsystems,[Link] helpsyoupackagemultitierapplicationsintoavAppthatrunsefficientlyunderVMwarevSphere.
VMwareStudioPluginforEclipseIDE. EclipseandotherIDEsprovidevarioustoolsrequiredduringapplicationdevelopment,thelastphase [Link] [Link],thisinvolvescopyingtwice. [Link],VMwareStudioisnowalso [Link] [Link] VMwareStudioPluginforEclipsehelpsdevelopersautomatethedeploymentprocess,movingforward towardintegrationofdevelopmentandtestenvironments.
ExistingLinuxVMasinput. VMwareStudioprovidestheuniqueabilityofnotrequiringdeveloperstobuildavirtualmachinefrom [Link],orobtainaqualifyingLinux virtualmachinefromelsewhere,[Link] arechangingonlythesoftwareversion,oronlytheapplicationmix,ofavirtualmachine.
VMware, Inc.
15
Developers Guide to Building vApps and Virtual Appliances
SupportforawiderangeofVMwareprovisioningengines. [Link] Studio2.0andlatercanusemanyotherVMwareplatformproductstogenerateautomatedbuildsof [Link],VMware Workstation,ESX/ESXihosts,VMwareInfrastructure,andVMwarevSphere.
Architecture of VMware Studio
AsshowninFigure 12,VMwareStudiooffersachoiceofinterfacesforthedeveloper,includingWebbrowser, Eclipseplugin,andcommandlineinterface. Figure 1-2. VAMI Components
TheVMwareStudioWebconsoleisabrowserbasedinterfacethatsimplifiesthecreationandbuildingof [Link] buildserviceandVAMI,thevirtualappliancemanagementinfrastructure. AnEclipsepluginisprovidedsoyoucanusethesameEclipseintegrateddevelopmentenvironment(IDE)for [Link] [Link],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 [Link] 47.
VMware, Inc.
16
Chapter 1 Introduction to VMware Studio
[Link] Serviceonpage 55fordetailsaboutcustomservicetabsinaLinuxvirtualappliance. YoucanalsobuildavanillavirtualmachinecontainingnoVMwareStudioruntimecomponentsatall,ora [Link] 58.
Build System
TocreateaVMoravApp,youformulateabuildprofileusingtheVMwareStudioWebconsoleorEclipse [Link] [Link],thebuildprofilealsospecifiesinguest services,[Link] 13showsinputstothebuildsystem. Figure 1-3. VMware Studio Architecture
BeforeyoubuildaVMorvApp,[Link],thebuild systemusesaVMwareproductplatformtocreateavirtualmachinefromtheoperatingsystemISOandthe [Link] [Link] hasbootscriptsconfigured,theinguestmanagementframeworkembedded,andiscustomizedaccordingto specificationsofyourbuildprofile. OnVMwareproductplatformsthatsupportthevSphereAPI(formerlytheVIMAPI),thebuildsystemuses [Link] API,thebuildsystemusestheVIXAPItocreateandtransporttheVM. TocreateavApp,thebuildsystemtakesasetofVMbuildprofilesorsuccessfullybuiltVMs,andpackages [Link],youcanspecifystartorderandresource allocationfortheconstituentVMsandapplications,butmanyaspectsofthevAppremainflexibleuntilthe administratordecidesatdeploymenttime,includingwherevariouspartsofthevApprunandhowtheir networkconnectionsaremade.
VMware Studio Plugin for Eclipse
[Link] servesasabridgebetweentheEclipseIDEandVMwareStudiotocreateVMsandvAppsthatincludesoftware [Link],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. [Link] updatingofvApps.IntheUpdateManager4.0documentation,vAppsaretreatedascontainerobjectsof virtualmachinesorvirtualappliances. ForinformationaboutUpdateManager4.0,see[Link]
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 [Link] packagesforinclusioninthisLinuxbasedVM,seeChapter 5,PackagingaLinuxApplication,onpage 49. DeveloperswhowanttocreatecustommanagementservicesforinclusionintheapplianceWebconsoleofthe LinuxbasedVMcanreadChapter 6,AddingaLinuxManagementService,onpage 55. DevelopersfamiliarwiththeEclipseIDEcanusetheVMwareStudioPluginforEclipsetoeasilypackage [Link],testing,andpackagingcanbedonewiththe [Link],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 [Link],ISVsmightplan onestablishinganupdaterepositorytoremotelypublishpatchesforvirtualappliancesdeployedincustomer [Link],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,[Link] [Link],ifyouareusingEclipse,youcandownloadtheVMwareStudio [Link][Link] VMwareStudiosupportsoneofthesevirtualizationproductplatformsforbuilding(provisioning)VMs. TheprovisioningplatformthatyouusetocreateaVMmustbecapableofrunningthefinishedVM.
VMwareESX/ESXi4.0or4.1 VMwareESX/ESXi3.5 ForESXi4.xandESXi3.5orlater,[Link] notprovidethecapabilitiesthatStudioneedsforprovisioning.
vCenterServer4.0or4.1,whichmanagesprovisioningonESX/ESXihosts. VMwareWorkstation6.5.2,7.0.1,or7.1 VMwareServer2.0(deprecated) VMwareServer1.0.x(deprecated)
PrerequisitesifyouareprovisioningwithVMwareWorkstation:
AnSSHdaemon(SSHD)[Link] 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)[Link] hostedonaWindowssystem,seeInstallingSSHonWindowsonpage 115. Ports7and22mustbeopen.Port7isusedprimarilytovalidatetheupdaterepositoryserver.
Approximately32GBofavailablestoragespacewhereyoudeployVMwareStudio. ThefollowingportsontheVMwareStudioapplianceareusedtoaccesstheWebconsoleandbuildVMs:
22sshtcp 80httptcp 5480httpstcp 5488http5489httpstcp(forinternalcommunicationbetweenlighttpdandSFCB)
VMwareStudiorequiresthefollowingportstobeopenonthehostrunningtheprovisioningproduct:
7echotcp,22sshtcp([Link]).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 [Link] [Link],ifyouarerunningVMwareStudioon32bit hardware,butyouarebuildinga64bitvirtualmachine,youcansettheprovisioningplatformtoaremote [Link],theremotesystemmightbelightlyloadedandcapableoffasterbuilds. Figure [Link] [Link],onerequirementisanSSHserverontheplatforms [Link],onerequirementisauserwith [Link] 29. Figure 2-1. Single Host Setup of VMware Studio
20
VMware, Inc.
Chapter 2 Deploying and Using VMware Studio
Figure [Link] beanyofthosepermittedforasinglehost,andthevirtualizationplatformdoesnothavetobethesame. The requirementsforprovisioningthroughhostBarethesameasforasinglehost,exceptbothhostsmustbe networkconnectedsoVMwareStudioonhostAcanreadilyaccessthevirtualizationplatformonhostB. Figure 2-2. Dual Host Setup of VMware Studio
Supported Distribution Formats
[Link] 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 [Link],orOVFanditsassociatedVMDKfile,canbedownloaded toalocalWebserverorWindowsmachinewheretheVMwarevSphereorVMwareInfrastructureClient [Link] appliancetoalocalmachine,placetheOVFanditsassociatedVMDKfileinthesamedirectory. ForVMwarevSphere4,runtheVMwarevSphereClientandselectmenuFile>DeployOVFTemplate. ForVMwareInfrastructure,runtheVMwareInfrastructureClientandselect File > Virtual Appliance > [Link],awizardguidesyouthroughdeployment. PowerontheVMwareStudiovirtualmachine.
VMware, Inc.
21
Developers Guide to Building vApps and Virtual Appliances
Asthevirtualmachinestarts,theVMwareStudioenduserlicenseagreement(EULA)appearsonthe [Link],typeyesand pressEntertoaccepttheEULA. Whenitasksyoutoenteranewpasswordfortherootaccount,[Link] [Link](superuser)accounttobuildvirtualmachines. [Link] [Link],seeConfiguringStaticIPAddressesonpage 23.
WritedowntheIPaddressthatappearsthere,InterfacestoVMwareStudio:[Web][Link] [Link] httpsport5480. Youmightwanttosetanetworkproxy,changethetimezone,[Link], 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
[Link] network,youcanchooseacceptthecertificatewithoutverification. ToverifytheauthenticityofthenetworkconnectionsyouaremakingwhendevelopingwithVMwareStudio, seeCheckingVeracityofanSSLCertificateorSSHKeyonpage 116.
Modifying the Network and Time Zone Settings
[Link] consolewindowforthis,[Link],usethe vSphereClient(formerlytheVIClient),VMwareWorkstation,ortheVMwareServerConsoleapplication. TheVMwareStudiowelcomescreenonthecommandconsoleshowsthefollowingmenuselectionsatthe bottomofpage:
Login Configure Network Set Timezone (Current: UTC)
Choosing Between DHCP and Static Network Addresses
Whenitstarts,theVMwareStudioapplianceattemptstodiscoveraDHCPserveronthenetworktorequesta [Link],becausethe DHCPaddressistemporary,itmightbedifferenteachtimethevirtualappliancepowerson. VMwarerecommendsthatyourVMwareStudioappliancebeconfiguredtoastaticaddressthatremainsthe [Link](andassociated hostname)sotheycanconnecttoitpredictably.
22 VMware, Inc.
Chapter 2 Deploying and Using VMware Studio
Configuring Static IP Addresses
Bydefault,[Link] 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,[Link] gothroughanetworkproxy,dothefollowingsteps. To configure a network proxy 1 EnteryesornoattheIsaproxyservernecessarytoreachtheInternet?prompt. Ifyouansweredno,pressEnter. Ifyouansweredyes,[Link]. 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,[Link]. 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 [Link] VMwareStudiocreated,becauseVAMIprovidesthetabsdescribedhere.
Accessing the VMware Studio Web Console
TheWebconsoleisthebestwaytobeginusingVMwareStudio. To access the VMware Studio Web console 1 2 InthesectionDeployingVMwareStudioonpage 20,theURLtoaccesstheVMwareStudioWebconsole isdisplayedinStep [Link],gotothatlocation. [Link] 5oftheprocessDeploying VMwareStudioonpage [Link].
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 [Link] timezone,thedefaultisUTC,CoordinatedUniversalTime.
Network Configuration
[Link]:
StatusShowsnetworkstatusinformation,suchastheinterfacename,whetherDHCPwasused,the IP address,netmask,gatewayIPaddress,[Link] Actionsheading(ontherightside)toobtainthecurrentinformation. [Link] [Link] 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).[Link] [Link],asyoudid usingtheServerConsoleinConfiguringtheNetworkProxyonpage [Link] 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 [Link],virtual hardware,[Link],youcanalsoconfigurethe welcomescreen,firstbootscript,andsubsequentbootscripts. [Link] necessaryfilestobuild(provision)yourvirtualmachine. DeployyourVMtotheappropriatesystemsandtest.
2 3
AfteraLinuxbasedVMisdeployed,userscanmanageitfromthemanagementWebconsole,installedinthe virtualapplianceaspartofVAMI,[Link] themanagementWebconsole,ifthedeveloperenabledupdateserviceandpopulatestheupdaterepository. AdministratorscancentrallymanagemultiplevirtualapplianceswithVMwarevCenter.
Outline of vApp Build Procedure
YoubeginbuildingavAppbycreatingabuildprofilethatdefinesacontaineranditsconstituentVMs. To build a vApp with VMware Studio 1 [Link] [Link],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/[Link],youcandownloadtheUbuntu8.04.4releasebyrunningthe followingcommandsontheVMwareconsoleorsshcommandline:
cd /opt/vmware/www/ISV/ISO wget [Link]
IfNFSisavailableonyourlocalareanetwork,agoodalternativeistoremotemountanetworkpartitionwhere youhavedownloadedacollectionofISOimagessuitableforbuildingVMs,asinthefollowingcommandrun fromtheVMwareStudioappliancecommandline:
mount [Link]:/vol0/images/iso /opt/vmware/www/ISV/ISO
InVMwareStudio2.1,youcanstartwithanyqualifyingLinuxOSdistribution,[Link] ISOofQualifyingCustomLinuxOSonpage 34,orChapter 14,BuildFromanExistingVM,onpage 103.
Requirements for Building 64-Bit VMs
Theresourcerequirementsofaguestoperatingsystemcannotexceedthehardwarecapacityofthehost system.Ifyoucreateavirtualmachinefroma64bitoperatingsystemimage,itcannotrunon32bithardware. SeetheKnowledgeBasearticle1003945HardwareandFirmwareRequirementsfor64BitGuestOperatingSystems at[Link]
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 [Link] 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/[Link], 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,[Link],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)[Link] allowscustomizationoftheVAMIWebinterfaceifyouareshippingthevirtualmachineasavirtualappliance andwanttorebrandtheWebconsoleforyourvirtualappliance.
Prerequisites OS and Application
ThischapterassumesthatyouhavedownloadedtheVMwareStudiosoftwareontoasupportedvirtualization productplatform,asdescribedinDeployingVMwareStudioonpage [Link]:
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 [Link] aresupportedtoensurecompatibilitywheninstallingthemanagementagent. [Link],Table 41providesURLs [Link],soitisbest touseasearchenginetofindtherequiredISOimage.MD5checksumsareprovidedtohelpensurevalidity. Table 4-1. Linux Operating System ISO Images
Operating System Name Arch ISO Image Name MD5 Checksum
[Link] Ubuntu8.04.4 Ubuntu8.04.3 Ubuntu8.04.1 Ubuntu8.04 Ubuntu7.10 Ubuntu7.04 [Link] SLES11.0 32bit 64bit SLES10.2 32bit 64bit [Link] RHEL5.4 32bit 64bit RHEL5.3 32bit 64bit RHEL5.2 RHEL5.1 [Link] CentOS5.4 32bit 64bit CentOS5.3 32bit 64bit CentOS5.2 32bit 64bit CentOS5.0 32bit [Link] CentOS5.4x86_64binDVD.iso [Link] CentOS5.3x86_64binDVD.iso [Link] CentOS5.2x86_64binDVD.iso [Link] 071e18754c2fb066c526672f9aea0515 92cab2977a58ce422130e5c655dc8513 997638cd72a559e38f9fd1955a368231 6d4fd59688ed8644514010316d6a5698 1539bad48e984ae1441052dc074c0995 644f9f63f208ebee36ae5e2cdcc58721 b5633ee6ee3b2e10d92672c74e594d75 32bit 64bit 32bit [Link] rhelserver5.4x86_64dvd.iso [Link] rhel5.3serverx86_64dvd.iso [Link] rhel5.2serverx86_64dvd.iso [Link] 7a12ec6599527e4f3d1790b51eadbfed 04fe3c10202402d7b389528d2bad0210 371c62851611fd32ead440df6f24a296 c5ed6b284410f4d8212cafc78fd7a8c5 b5af5c38856a331f95ac6ad40c085f9c 5390f9f703e083cf1470fb438ea49082 4380325824d389e2c202477c9d5b2855 [Link] SLES11DVDx86_64GMDVD1.iso [Link] SLES10SP2DVDx86_64GMDVD1.iso 4958d4dde2575666355c8a1c5858bab0 50a2bd45cd12c3808c3ee48208e2586b 2b91efeb8a62e2824302bf9269080252 dab2c4b8fc9939b33535ab2d321f3f2e 32bit 32bit 32bit 32bit 32bit 32bit [Link] [Link] [Link] ef478e539e991dfa09c3b5b7c589aba6 f97b4abf0a91a6b260a0261a019c0e5e 5fddb647c1945b20055d751576dea8fc deprecated deprecated deprecated
ISO of Qualifying Custom Linux OS
YoucanadddoityourselfguestOSsupportwiththe--newosoptionofstudiocli,andbyeditingtheXSL [Link],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 [Link],CentOS,andSUSEuseRPMpackaging,whereasUbuntuuses [Link], [Link] 5,PackagingaLinuxApplication,onpage 49forinformationaboutusingmkpkg. VMwareStudiosupportstheautomaticconversionofcompressedTAR([Link],tgz)filesintoRPMorDEB [Link]. SeeChapter 8,UsingtheVMwareStudioPluginforEclipse,onpage 69formoreinformation. AbuildprofilecontainsalistofApplicationPackageRepositorieswithpackagestobedownloadedfroman [Link],atsomepenaltyin [Link],addeithertheURLofadirectorycontainingone ormorepackages(VMwareStudioresolvesinstallationorder),theURLofaRPMorDEBpackage,orthename ofacompressedTARfile. BeforecreatingaVM,makecertainthatyouhavealloftheappropriateoperatingsystemandthirdparty [Link],andyoucancontrol [Link] assemblepackagesanddeterminedependencies:
VMwareStudioinstallspackagesintheorderyougiveintheApplicationPackageRepositorieslist (see Table 45)whileresolvingandinstallinganydependentpackages. IfyouincludepackagesintheApplicationPackageRepositorieslistthatdependonotherpackages, VMwareStudioresolvesdependenciesbetweenthemandpackagesincludedintheOSISO. IfyourapplicationdependsuponpackagesthatarenotavailableontheOSISO,identifythem [Link] applicationdependsuponaspecificversionofapackagethatisnotpresentintheISO,obtainitseparately. Forexample,yourapplicationmightdependonthelatestversionofApache,buttheOSdistributionyou [Link] beforestartingthebuildprocess.
BydefaulttheApplicationPackageRepositorieslistcontainsoneURLthatreferstoalocaldirectoryonthe [Link][[Link]]torepresenttheIPaddressofthe [Link]:
URLoftheapplicationpackagerepository[Link] LocaldirectoryonVMwareStudioappliance/opt/vmware/www/ISV/appliancePackages
YoucanplaceyourapplicationpackagesinadifferentlocaldirectoryontheVMwareStudioappliance,oron [Link],itmustbe [Link](forexample,Options+Index specifiedintheApacheconfigurationfile)becauseVMwareStudiorequiresdirectoryindexingforfilediscovery. IfyourURLpointstoanHTTPserverdirectory,[Link] packageandwillbeinstalled.
Creating a VM Build Profile
[Link] containsinformationaboutthecontentsoftheVM,virtualhardwareconfigurationoftheVM,locationwhere toobtaintheOSISO,[Link] [Link] theoptionsineachconfigurationtab.
VMware, Inc.
35
Developers Guide to Building vApps and Virtual Appliances
To create a VM build profile 1 [Link] page 34forinformationaboutsupporteddistributions. [Link] [Link] 105. 2 3 IntheVMstaboftheWebconsole,clickCreateProfile. IntheCreateaNewVMProfiledialogbox,specifyanameforyourVMbuildprofile,selectaLinuxprofile fromtheOStemplates,andclickCreateProfile. [Link] yourownvirtualmachine,italsobecomesavailableasatemplatetocreatederivedvirtualmachines. 4 TheEditingpageappears,[Link] buildprofileintothefollowingtabs:
DescriptionSpecifiesgeneralinformationaboutthevirtualmachineorvirtualappliance,including [Link] 37fordetails. HardwareSpecifiesvirtualhardwareconfigurationforthevirtualmachine,includingCPU, memory,networkadapters,CD/DVD,[Link] 38fordetails. OSSpecifieslocationoftheOSISOimage,rootpassword,additionalusers,andbootscript [Link] 39fordetails. ApplicationSpecifiestheapplicationpackagerepositoryandoperatingsystempackagestoinstall [Link] 40fordetails. ManagementSpecifiesVAMImanagementservicestoincludeinthevirtualmachine,anddetails [Link] 41. OutputSpecifiesthetypeofdistributionformat(OVF,OVA,orZIP)forthevirtualmachine. See OutputTabonpage 43fordetails. BuildSettingsSpecifiessetupofthebuildenvironment,suchasconnectioninformationtooneof [Link] 44fordetails.
UsetheNextandBackbuttonstonavigatebetweenthetabsuntilyouhavespecifiedallrequiredfields. Ifyoutrytonavigatetothenextpagewithoutspecifyingarequiredfield,anerrormessageappearsinred nexttothefieldshowingwhereyoumustfixaproblembeforecontinuing. Eachfieldinthebuildprofilehasahelpicon(iinacircle)[Link] betweendisplayofcontextualhelpandalistoffrequentlyaskedquestions(FAQ). Attemptingtonavigateofftheeditingpageproducesaconfirmationdialogboxaskingifyouwantto discardyouredits. 5 Afteryoucompleteeditingabuildprofile,youcantakeoneofthefollowingactionsbyclickingabutton ontherightsideofthewindow:
ValidateAftercompletionofabuildprofile,checkstheconfigurationtohelpyouavoidbuilderrors. Awindowappearstoshowthevalidationsthatitperforms. SaveandBuildSavesyourbuildprofileanddisplaystheBuildSummarydialogboxforreview. To buildtheVMandbeginprovisioning,[Link] thatshowsstatusasthebuildprogresses. [Link] [Link],soyoucanchoosetoeditorbuilditlater. [Link] youaresureyouwanttodiscardchangesmadeduringthecurrentsession.
AftercreatingaVMprofile,[Link] onpage 46.
36 VMware, Inc.
Chapter 4 Creating a Linux-Based VM
WithVMwareStudio2.1,youcanrunconcurrentbuildsfromdifferentVMprofiles,ormultiplebuildsfrom [Link]/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 [Link] [Link]. [Link] [Link] [Link] [Link],[Link]. [Link],ifthe virtualapplianceisinthealphareleasestate,youmightenter1.0.0.0alphaversion. URLonyourcompanysWebsitethatprovidesinformationabouttheproduct. [Link] machineasavirtualappliance. [Link],thefeaturesprovidedorthe contentsofthevirtualmachine,[Link]. [Link] thevirtualmachineasavirtualappliance. [Link] [Link] usedbothasatargetfortheApplicationURLLabel,andinthevSpheresummarytab [Link]${[Link]}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 [Link] thevirtualmachineasavirtualappliance. [Link] companysWebsiteorasitethatcontainsinformationaboutthevirtualappliance. ThelinkshouldbeanhttporhttpsURL,forexample,[Link] [Link] [Link],ifyourapplicationisnamed Acme,youcanusethelabelAcmeHometopointtothehomeaddressofthe Acmeapplication. Tocustomizetheleftsidefooterandthemiddlefootertext,youcanedittheXML [Link] 129.
LogoLinkURL
ApplicationURLLabel
FooterText(nofield) EULA and Login Screen EndUserLicenseAgreements
Youcanaddanenduserlicenseagreement(EULA)byclickingtheAddEULA button,[Link],clickthe RemoveEULAlinkassociatedwiththeEULAyouwanttoremove. YoucanAddEULAmultipletimesindifferentlanguages,thenedittheXMLprofile in/opt/vmware/var/lib/build/profilestodesignatethelanguageofeach [Link]:EulaSection_Typesection,changexml:lang="en"tothe languageslocale,sovCenterServercandisplaytheEULAintheprevailinglocale whenimportingthevirtualapplianceasOVF.
EULA
[Link] [Link] [Link],thentheVMboots [Link],butyoudisablethecheckboxShow EULAonfirstboot,theappliancedoesnotpromptforEULAacceptanceduringits firstboot. IftheEnableLoginScreencheckboxisenabled,thevirtualappliancedisplaysthe WelcomeTextontheloginscreenafterthevirtualmachinebootsup. [Link] instructionsfortheuseronhowtoaccessyourapplicationontheVM,whichhelps [Link] [Link] [Link] areacceptedfor${[Link]},${[Link]},and${[Link]}.
LoginScreen WelcomeTextonLoginScreen
Hardware Tab
Table 43describestheconfigurationpropertiesavailableontheHardwaretab. Table 4-3. Hardware Tab Configuration Properties
Field VMware Hardware Version HardwareVersion [Link] version,seetheKnowledgeBasearticle1003746at[Link]
Description
Virtualhardwareversion4isforESX3orlater,andWorkstation5orlater. Virtualhardwareversion7isforVMwareServer2.0,Workstation6.5orlater, Player2.5orlater,Fusion2orlater,andESX4.0orlater.
Compatibility Virtual CPU and Memory VirtualProcessors CPUReservation(Mhz)
ShowsVMwareproductplatformscompatiblewiththehardwareversionselected.
[Link] 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
[Link] 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 [Link]/bootpartitionmustcomefirst. [Link] ModifyDiskLayoutlinktoalterthePartitionspecifications. Ifyourequiremorethanoneharddisk,clicktheAddDiskbutton. Toremoveanadditionalvirtualdisk,clicktheRemoveDisklink.
Partitions MountPoint MaximumSize Size(MB) Filesystem Mountpointforthepartition. Checktheboxtospecifythatthispartitionautomaticallyusesthemaximumsize [Link]. Sizeinmegabytesofthepartition. Filesystemformat,eitherext3orswap. [Link],for compatibilitywithunattendedinstallers. Bootable Checkthisboxifyouwanttobeabletobootfromthepartition.
OS Tab
Table 44describestheconfigurationpropertiesavailableontheoperatingsystemOStab. Table 4-4. Operating System Tab Configuration Properties
Field Operating System OSDistribution ISOURL Areadonlyfieldspecifyingtheoperatingsystemcorrespondingtothetemplateyou chosewhenyoucreatedthisvirtualmachine. [Link][Link] [Link] isrecommendedtouse[Link] IfVMwareStudiowarnsyouthattheISOLocationCannotbeVerified,download therequiredOSISOimageorNFSmounttheOSISOdirectory,thenclickthe Check NowbuttontoreverifytheISOimageatthisURL. ISOMD5 [Link] fieldwiththechecksumfortheISOimagetoensurethattheimageiscorrect. InVMwareStudio2.1youcaneditthisfieldtocorrectthechecksumafterupdating [Link],removingthechecksumentirelyskipsthechecksum [Link],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 [Link] areshippingtheVMasvirtualappliance,youmightwanttocreateafirstbootscript topromptusersforanewrootpassword. Ifyouneedtoaddauseraccount,[Link] usingtheoperatingsystemsdatabasetoauthenticateaccesstotheWebconsoleand thesmallfootprintCIMbroker(SFCB). [Link],youmaywanttocreate nonrootuseraccountsforlimitedaccess. Enterthepasswordfortheuserandthenenteritagaintoconfirmthepassword. Enterthefullnameforthisuseraccount. [Link],notspecifyingtheUIDandallowing [Link],makesuretogiveavalid (existing)UIDnumbervaluethatisuniquewithintheVM. Todeleteauseryouhaveadded,clicktheRemoveUserlink. Description
AddUser
Username Password FullName(optional) UID(optional)
RemoveUser Boot Customization EnableBootScripts FirstBootScript
Ifthecheckboxisenabled,thefirstscriptrunsatinitialbootandtheotherscriptruns atsubsequentboots. Ascriptthatcontainsanyapplicationrelatedconfigurationthatshouldoccurwhen [Link] [Link] example,populatingadatabase,configuringsystemdatathattheapplicationneeds, [Link] [Link] /opt/vmware/etc/isv/firstboot. [Link] [Link] VMat/opt/vmware/etc/isv/[Link].
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,[Link],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 [Link] findapplicationpackagesintheOSISOimage. Toaddpackagestothelist,clickAdd,searchforapackagebytypingpartof itsnameintheSearchwindoworselectingacategory,clickAddonpackages toadd,andwhenyouarereadyclickOK. Toremoveapackagefromthelist,[Link] removeanyVAMIrequiredpackagesfromthelist. Application Installation Customization ApplicationPreInstallScript ApplicationPostInstallScript ScriptthatrunsafterinstallationofpackagesfromtheOSmedia,butbeforethe installationofapplicationpackagesduringvirtualmachineprovisioning. Scriptthatrunsaftertheinstallationofapplicationpackagesduringthevirtual machineprovisioningphase. Description
Management Tab
Table 46describestheconfigurationpropertiesavailableontheManagementtab. VAMImanagementservicesexposemanagementfunctionalityastabsinthegeneratedappliancesVAMIWeb [Link] servicesprovidesbasicsysteminformation,timezonesettings,[Link] optionalandenablesupdatingoftheOSandapplicationpackagesfromaremoteupdaterepository. Table 4-6. Management Tab Configuration Properties
Field Management Services EnableManagementCIMOM Server core,network,system Ifyouenablethischeckbox,thesmallfootprintCIMbroker(SFCB)thatsupports [Link](CIMobjectmanager). Ifthischeckboxisdisabled,asasideeffectthemanagementGUIisnotinstalled. Name,versionnumber,[Link] appearastabsintheWebconsoleofaVMbuiltbyVMwareStudio,ifyouenablethe [Link],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. [Link] 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. [Link],thisisthefullDNS name(fullyqualifieddomainname)usedtonavigatetoaWebsite. Organization Unit CountryCode [Link]. Thegroupordepartmentwithinyourcompanyrequestingthecertificate. Enterthetwodigitcodeforthecountrywhereyourcompanyislocated. For example,USfortheUnitedStates. Description
Update Service Repository Settings (Optional) Toenableupdateservice [Link],but [Link] serviceandestablishanupdaterepository,followthisprocedure. UnderManagementServices,clickAdd,selecttheupdatecheckbox,clickAddagain, andfilloutallfieldsfortheupdaterepositoryservice. SeeChapter 7,ManagingtheLinuxUpdateRepository,onpage 61formore informationaboutupdaterepositories. CDROMupdates IfyouwanttocreateaCDROMcontainingupdatesforappliancesthatlackexternal networkaccess,[Link] ontotheCDROM,andyourappliancewillbeabletoupdatefromtheCDROM. IftheSpecifyrepositoryoptionisselectedinsteadoftheCDROMupdatesoption, [Link] intothebuildprofileandgetsembeddedinthevirtualappliance,whichperiodically [Link], theRepositoryURLmustpointtoanInternetaccessiblelocation,andyoushouldnot changetheURLafterabuild. Youmightplantouseastagingserverforinternaltestingandcopythecontentsof yourupdaterepositorymanuallytoanInternetaccessibleandexternallyvisiblesite whenthevirtualapplianceisreadytobeshipped. Username(optional) ThisusernameisusedtoauthenticatetoaWebserverattheURLfortheupdate [Link],thisfieldisrequiredforupdating anyvirtualappliancebasedontheRedHadEnterpriseLinux(RHEL)operating [Link]. [Link]. ThispasswordisusedtoauthenticatetoaWebserverattheURLfortheupdate [Link],thesefieldsarerequiredfor updatinganyvirtualappliancebasedontheRedHadEnterpriseLinux(RHEL) [Link]. VendorUUID AuniqueidentifierthatVMwarevCenterUpdateManagerusestoidentifyavendor. [Link] recommendsthatthisbea128bitslongUUID(16bytes). AuniqueidentifierthatVMwarevCenterUpdateManagerusestoidentifya [Link] recommendsthatthisbea128bitslongUUID(16bytes). [Link],aversionnumber,issuesfixed,orthe [Link] intheWebconsoleofthevirtualappliancewhentheupdateismadeavailable.
RepositoryURL
Password(optional)
ProductRID
UpdateDescription
Repository Server Settings FileTransferProtocol FileTransferHostname AreadonlyfieldindicatinguseofSCPfiletransferprotocol. [Link] musthaveSSH/[Link] neededtopublishthevirtualappliancefiletotheupdaterepository.
42
VMware, Inc.
Chapter 4 Creating a Linux-Based VM
Table 4-6. Management Tab Configuration Properties (Continued)
Field FileTransferUsername Description [Link] [Link] differentfromtheusernamethatthevirtualappliancesusestodownloadupdates. [Link]. [Link] virtualappliancetofindanyupdates,thispathshouldtranslatetotheURLofthe updaterepository.
FileTransferPassword FileTransferPath
Repository Export Settings UpdateArchive EnablethisoptiontoexportanupdatearchiveasaZIPfile,andspecifyZIPFilename. [Link] ZIParchivetoaWebserver. EnablethisoptiontoexportanupdatearchiveasaISOfile,andspecifyISOFilename. [Link] thisarchivetoaWebserver,ormorelikely,burnitontoCDROM.
ISOArchive
Output Tab
Table 47describestheconfigurationpropertiesavailableontheOutputtab. Table 4-7. Output Tab Configuration Properties
Field Distribution Format OutputFileName OutputFormat [Link] creatingthevirtualmachineOVF,OVA,orZIPpackage. [Link]. Youcanchoosemorethanoneoutputformat.
Description
OVFUsethisformatifthevirtualmachinewillbedeployedonvirtualization platformsthatsupporttheOpenVirtualizationFormat. [Link] VMwarevSphere4fordeployment. ZIPUsethisformatifyourvirtualmachinewillbedeployedonvirtualization platformsthatdonotsupportOVF.
DirectoryinZIPArchive OVF IP Assignment Settings DHCP
Thedirectoryunderwhichfilesrelatedtoyourvirtualmachineshouldappearwithin thegeneratedZIPoutputfile.
IfthedistributionformatisOVF1.0orOVA,duringdeploymenttheuserisgiventhe optiontouseaDHCPserverforconfiguringthisVMsnetworking,whichwillbe [Link] beconfiguredonthevCenterServertoavoidawarningmessage,butanIPpoolis notrequiredforDHCP. IfthedistributionformatisOVF1.0orOVAanddeployingonvCenterServer,during deploymenttheuserisgiventheoptiontouseafixedortransientIPaddressforthis [Link]. This requiresthatanIPpoolbeconfiguredonthevCenterServer.
OVFEnvironment
OVF Properties Add|Edit|Remove Key Label Description [Link]. 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 [Link] [Link],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. [Link] [Link](exceptOVFandOVA,whichcanoverridenetworksettings)willbeconfiguredtorunat firstinDHCPnetworkmode. Table 4-8. Build Settings Tab Configuration Properties
Field Build Environment VirtualizationPlatform TheVMwarevirtualizationplatformforprovisioningyourvirtualmachine.A [Link] platforms,[Link] below,althoughnotallappearatanygiventime. [Link] [Link] [Link]/ESXihosts, VMwareVirtualCenter,VMwarevCenterServer,andVMwareServer2. Description
ConnectionWizard
Build Environment Settings <Platform>Host ThehostnameorIPaddressofthevirtualizationplatformyouuseforprovisioning. [Link],only VMwareWorkstationneedsthevmruncommand,andthebuilddirectorypathis neededonlyforhostedproducts. Port [Link] [Link] usestheauthdorautomationport,usually902,sometimes904.VMwareServer2.0 [Link] 22forremoteprovisioning,soitdoesnotaskforaportnumber. Ausernameontheremotehostforauthenticationofvirtualmachineprovisioning. [Link]. (vCenteronly)DatacenternameasdesignatedintheVMwarevSphereinventory. ThisnameappearsintheleftsidebaroftheVMwarevSphereclientwhenconnected throughvCenterServer. [Link] 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 [Link] [Link],useonethatwascreated,not Resources. ManagedESXHost NetworkLabel PathtovmrunCommand (vCenteronly)HostnameorIPaddressoftheESX/ESXihostmanagedbyvCenter. [Link] [Link]. (Workstationonly)VMwareWorkstationusesthevmruncommandforprovisioning. Donotincludethevmruncommanditself,onlythepathtoit.
OnWindowsthiscouldbeC:\ProgramFiles\VMware\VMwareWorkstation. OnLinuxthiscouldbe/usr/bin.
BuildDirectoryPath
([Link])Thetemporarypathusedbytheprovisioning [Link] usedtostorethevirtualmachineduringtheprovisioningphase. Forexample,ifaLinuxsystemisthehostoftheVMwareServerand/tmpisthe provisioningdirectory,thenenter/tmpintheHostPathfield. Asanalternateexample,ifaWindowssystemisthehostoftheVMwareServerand c:\tmpistheprovisioningdirectory,SCPusestheOpenSSHserverinCygwin,sothe HostPathisc:\tmpbuttheFileTransferPathbelowshouldbe/cygdrive/c/tmp.
HostEnvironment
([Link])Specifiesthehostoperatingsystemwhereyour [Link],then [Link] itemsundertheOutputtab.
FileTransferProtocol FileTransferUsername FileTransferPassword FileTransferPathUsedbyVMwareStudioforuploadingthevirtualmachine [Link] provisioningphasefromVMwareStudiotothehostrunningtheprovisioning platform,youmightneedtospecifytheFileTransferPathandHostPath differentlyforthescputility,althoughtheymustrefertothesamedirectoryon [Link],ifVMwareServerruns onWindows,SCPusestheOpenSSHserverinCygwin,sotheHostPathis c:\tmpbuttheFileTransferPathshouldbe/cygdrive/c/tmp.
Network Settings NetworkType SpecifyeitherDHCPtoretrieveIPaddressesfromaDHCPserver,orStatictoseta [Link],thefollowingfieldsappearforyoutofillin:
IPAddress Netmask Gateway PreferredDNSServer AlternateDNSServer Bridgedmodeisthedefaultforcommunicatingwiththevirtualmachinebeing [Link] theprovisioningplatformarerunningondifferentcomputers. HostOnlymodeapplieswhenVMwareStudioisrunningonalocalinstallation [Link] 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,[Link] [Link],[Link],click [Link]. ToretainthetransientVMwithoutcleaningupafterthebuild,intheBuildSummarydialogbox,click [Link] [Link] platformbeforedeployingitelsewhere. Whenthebuildstarts,[Link], [Link], clickCancelunderthestatusicon. [Link] [Link]. IMPORTANTYoucanmonitortheinstallationoftheLinuxOSandyourapplicationsontheconsoleofthe [Link],starteithertheVMwarevSphereClient,theVMwareInfrastructureClient,or [Link] intheprofileyoucreated,whichshouldpoweron,andclickConsole(ifnotalreadydisplayed). WatchingtheVMprovisioningcanhelpgreatlyifsomethinggoeswrong. [Link], seeTroubleshootingVMBuildsonpage 135fordiagnosticinformation. Afterabuild,[Link],select aVMandclickBuildLogtoseearecapofbuildprogress. Toseethebuildsummary,variouslogs,anddiscoveryreports:intheVMList,clicktheVMname>Finished (orFailed,orCanceled).TheDetailsdialogboxappears,withthefollowingtabs:
BuildSummaryprovidesdetailsofthebuildprofileconfiguration. VerboseLogprovidesadetailedlogofeachcompletedphaseofthebuildprocess. DebugLogprovidesdetailsofeachcompletedbuildphase,includingdebugginginformation. ApplicationInstallLogprovidesalogoftheinstallationmessagesastheoperatingsystemandeach [Link] troubleshootingpackagedependencyerrorsifmorepackagesarerequired. DiscoveryReportsprovidesinformationaboutpackages,hardwaresettings,andoperatingsystem.
[Link] [Link] 47formoreinformation.
Testing the Generated VM
AfteryouhavesuccessfullybuiltaVM,youcanobtainthevirtualmachinedistributionfilebyclickingonthe ZIPorOVFlink(dependinguponwhichtypeofoutputfileyouspecified)intheDownloadcolumnofthe VMsPreviousBuildlist. YoushouldclickonyourvirtualmachinedistributionfileandtestthecompletedVMbydeployingitintothe [Link] [Link],becauseifyoudo,yougetonlytheOVF [Link],testtheOVFbyrightclickingontheURL,copyingit,andpasting itintotheImportApplianceorDeployOVFTemplatedialogboxesofESX3.5or4.0,respectively. [Link] yourapplicationstartscorrectly.
46
VMware, Inc.
Chapter 4 Creating a Linux-Based VM
Ifyouplantodistributethisvirtualmachineasavirtualappliancetoyourcustomers,seetheUsersGuideto DeployingvAppsandVirtualAppliancesforinformationaboutdeployingyourvirtualappliancefortesting.
Reiterating the Build Process
ManydevelopersfindthataneasywaytoacreateaLinuxVMistobuilditinitiallycontainingonlythe operatingsystem,[Link] occupiesspace,butyoucandeletethem. TodeleteabuildusingtheVMwareStudioconsole,selectaVMfromtheVMList,locatethebuildinstance youwanttoremove,[Link]-dcommand.
Migrating Build Profiles from Studio 1.0 or 2.0
YoucanimportbuildprofilesintoVMwareStudiointhefollowingcircumstances:
WhenyouupgradetoanewerversionofVMwareStudio. Whenyoumanuallycreateabuildprofile. WhenusingabuildprofilecreatedbyanotheruseronanotherVMwareStudioappliance.
IfyouhaveanexistingbuildprofilethatyouwanttobringintoVMwareStudioyoucanimporttheprofile. Howeveryoucannotuse,norsuccessfullyimport,[Link], youmuststartfromapreexisting2.0template,orimportaVMwareStudio1.0profile. To import an existing build profile 1 2 3 4 PlacethebuildprofileonthehostwheretheWebbrowserruns. OpentheVMwareStudioWebconsoletotheVMspageandclickImportProfile. Adialogboxappearswhereyouenteranamefortheprofileandlocationofthebuildprofiletoimport. ClicktheBrowsebuttontohelpfindthebuildprofileonyourcomputer. [Link],andaddsit [Link],oredititsprofile.
VMware Tools Installed in a Generated VM
TheVMwareToolssoftwarepackages(vmware-open-vm-toolsDEBorRPMpackages)thatVMwareStudio installsinLinuxbasedVMsareoftheVMwareOperatingSystemSpecificPackages(OSP)packagingformat, [Link][Link] NewlyreleasedoperatingsystemsmightnotyetbesupportedbyanavailableOSPVMwareToolsdownload. Also,[Link], youralternativeistoobtainandcompiletheopensourcetoolsat[Link] 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
[Link] imageofyoursoftware,youcanspecifycopycommandsaspartofyourpreinstallorpostinstallscripts. You canalsospecifytheapplicationbitsinTARformat. Forbetterlifecyclemanagementofthevirtualmachinecontents,VMwarerecommendsthatyourapplication bepackagedinthenativepackagingformatoftheoperatingsystem(RPMorDEB).Ifthevirtualmachineis deliveredasavirtualappliance,nativepackagingguaranteesthattheISVcanupdatetheapplicationina [Link],versiontracking, dependencyresolution,andcompletevirtualappliancemanifestsarethebenefitsofrequiringthat applicationsbedeliveredinthenativeoperatingsystempackagingformat. VMwareStudioprovidesacommandlinetool,mkpkg,[Link] [Link],theVMwareStudioPlugin forEclipseiscapableofcreatingpackages,[Link],seeChapter 8, UsingtheVMwareStudioPluginforEclipse,onpage 69.
Options of the Make Package Tool
ThefollowinglistshowstheLinuxoperatingsystemsthatVMwareStudiosupports,andthepackageformat foreachoperatingsystem:
CentOSRPM RedhatRPM SLESRPM UbuntuDEB
ForDEBpackages,youcreateandspecifythepreinstallandpostinstallscriptswhenyoubuildthepackage. ThesescriptsremainseparatefileswithDEBpackages. ForRPMpackages,[Link] [Link],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. [Link]-Toption. Filecontainingalistofuserconfigurationfilesthatarenotoverwrittenwhenapackageisupgraded. Preinstallscripttoberunbeforeinstallingthepackage. Postinstallscripttoberunafterinstallingthepackage. Preremovalscripttoberunbeforeremovingthepackage. Postremovalscripttoberunafterremovingthepackage. [Link] installed,[Link],afilethatshouldbeinstalledintothe/etcdirectoryshould beputintoasubdirectorycalledetcinthisdirectory.
Example of Creating a DEB Package
BeforeyoucreateaDEBpackage,youmustorganizeyourapplicationpackagesintotheproperdirectory [Link],executablefilesin/binmustbeunderasubdirectorynamedbinandfilesthatbelong in/etcshouldbeunderasubdirectorynamedetc. Hadoop,anopensourcedistributedfilesystemforlargedatasetswritteninJava,isourexamplehere. To create a DEB package for Hadoop 1 OntheVMwareStudioappliance,chooseorcreateadirectoryandextractHadoopintoit.
cd /<your_dir> tar zxpf [Link]
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@[Link] Architecture: i386 Description: Hadoop is a distributed file system based on map-reduce.
[Link], makesureyouremovetheDependssection.
50
VMware, Inc.
Chapter 5 Packaging a Linux Application
Youcancreatepreinstall,postinstall,preremoval,andpostremovalscriptsforyourapplication. These [Link] [Link] [Link]:
mkpkg t deb c control P [Link] p [Link] 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 [Link],executablefilesin/binmustbeunderasubdirectorynamedbinandfilesthatbelong in/etcshouldbeunderasubdirectorynamedetc. SugarCRM,anopensourcesoftwaresolutionforcustomerrelationshipmanagement,isourexamplehere. To create an RPM package for SugarCRM 1 OntheVMwareStudioappliance,chooseorcreateadirectoryandextractSugarCRMintoit.
cd /<your_dir> unzip [Link]
CreateaControlfilebyrunningthiscommand,whichproducesthemessagethatfollows
mkpkg t rpm T -p [Link] rpm control file template has been created as [Link]
UnlikeforDEB,mkpkgforRPMplacesthepreinstallandpostinstallscriptswithinthecontrolfile. 3 [Link].
Summary: Sample SugarCRM package Name: SugarCRM Version: 5.1.0c Release: 11 License: Commercial Vendor: SugarCRM Group: System Environment/Daemons URL: [Link] 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/[Link] %defattr(-,root,root)
The%configsectionlistsconfigurationfilesthatyoudonotwantoverwrittenduringanupdate.
VMware, Inc.
51
Developers Guide to Building vApps and Virtual Appliances
[Link].
mkpkg -t rpm -c [Link] 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@[Link] Architecture: i386 Description: This describes the package, and contains a summary if what it provides.
[Link],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: [Link] 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,[Link] feature,[Link] orDEB(dependingontheOSnativepackageformat)duringinstallationoftheOS,andinstallsasanormal [Link],theupdaterepositoryisalsopopulatedwiththeRPMorDEBfile. TheTARfileshouldfollowoneofthefollowingformatspecifications. 1 Simplepackagewithnoversion,nometadata,andnoupdates: a b c d 2 NametheTARfile<packageName>.[Link]<packageName>.tgz TheRPMandDEBpackagewillbeversion1.0.0,andcanbeinstalledonaLinuxOS. VMupdateswillnotinstallnewversionsofthepackage. ContentsoftheTARfilewillbeinstalledintotherootdirectoryoftheresultingVM.
Packagewithversion,butnoothermetadata,updatesifversionincrements: a b c d NametheTARfile<packageName>_<version>.[Link]<packageName>_<version>.tgz TheRPMandDEBpackagewillhavea<version>number,andcanbeinstalledonaLinuxOS. VMupdateswillinstallanewversionofthepackage,iftheversionisincrementedfornewbuilds. ContentsoftheTARfilewillbeinstalledintotherootdirectoryoftheresultingVM.
Packagewithcompletemetadata: a b NametheTARfile<anyname>.[Link]<anyname>.tgz [Link],accordingtothefollowingspecification.
[Link]:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <package format="1.0" type="linux"> <name>packagename</name> <version>[Link]-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/[Link]</file> </configuration-files> </package>
IncludealltheXMLattributesshownabove,althoughvaluesmaybeemptyexceptfor<name>,<version>, <vendor>,and<arch>.Thevalueof<arch>canbenone,i386,oramd64. OSinstallationfailsifapackagemarkedasi386isinstalledona64bitOS,orifapackagemarkedamd64 [Link]. The<short-description>isaonelinedescription,while<description>isamultilinedescription.
VMware, Inc.
53
Developers Guide to Building vApps and Virtual Appliances
Section<configuration-files>maycontainanynumberofconfigurationfilesin<file>[Link] filesmustalreadyexistintheTAR,[Link] issolisted,itisnotreplacedwhenthepackageisupgraded. FilepermissionsandownersarepreservedfromthecontentsoftheTAR,howeverallusersandgroupsmust existontheVMwareStudioappliance,otherwisefileownershipdefaultstoroot,grouproot.
Operating System Footprint Reduction
YoucanreducethesizeofmostvirtualappliancesbyrunningtheVMwareStudiofootprintreductionscripts. Althoughthesescriptsdonotaffectapplicationpackagesspecifically,theyrunbeforeandafterapplication [Link],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>/[Link] [Link]. 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)[Link](SFCB)asa CIMobjectmanager(CIMOM).CIMisastandardfromDistributedManagementTaskForce(DMTF).The VAMIservicescanbeunderpinnedastabsintheWebconsole.
VMware, Inc. 55
Developers Guide to Building vApps and Virtual Appliances
VAMIhasthefollowingcomponents:
HTTPServerAlightweightWebserverusingLIGHTTPDtohostthemanagementWebconsole. CIMBrokerThesmallfootprintCIMbroker(SFCB)[Link] astandardfromtheDistributedManagementTaskForce(DMTF);see[Link] VAMIUIFrameworkProvidesacontainerfortheVAMIserviceWebinterface,whichisshownasatab intheWebconsole. [Link] cancontainaWebinterface,theCIMprovider,additionalfiles,[Link] interfacecanoptionallyuseaJavaScriptAPIforbetterintegrationwiththeVAMIUIframework. AuthenticationThepluggableauthenticationmodule(PAM)isusedtoauthenticateaccesstothe [Link], whichisstoredat/opt/vmware/var/lib/vami/core/[Link] controlledbytheenvironmentvariableVAMI_AUTHENTICATION_TIMEOUTandspecifiedinnumberof [Link](1440minutes).
AsstatedinVirtualApplianceManagementInfrastructure(VAMI)onpage 16,VMwareStudio2.1offers [Link]: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 [Link]>Linuxtabs,this listappearsshowingthedefaultmanagementservices:
coreTheVAMIframeworkandWebcontainertoholdotherservices. systemDisplaysbasicsysteminformation,andhasaninterfacetoshutdownorreboottheVM. networkAllowsenduserstoconfiguretheirnetworkandproxysettings. updateIfyouareplanningtoshipavirtualappliance,VMwarehighlyrecommendsthatyouinclude [Link] [Link] serviceintegrateswithVMwarevCenterUpdateManagertoallowcentralizedmanagementofupdates [Link],see[Link]
VAMIpackagesmayalsoincludeapplianceconfig,init,andservicebase.
Management Services with Eclipse
[Link], seeChapter 8,UsingtheVMwareStudioPluginforEclipse,onpage 69,especiallyCreatingManagement Servicesonpage 71.
56
VMware, Inc.
Chapter 6 Adding a Linux Management Service
Creating a Management Service
VMwareStudioletsyouaddyourownmanagementservicesinthevirtualmachine,withtheirWebinterface [Link] [Link] fileandimportedintoVMwareStudio. YoucanpackagemanagementservicesusingtheVMwareStudioPluginforEclipse(seeManagement ServiceswithEclipseonpage 56)[Link] canbemadepartofyourLinuxbasedvirtualmachinebyspecifyingtheminthebuildprofile. Whenyoucreateamanagementservice,[Link] followingdirectorystructure:
[Link],versionnumber,anddescriptionofthemanagementservice. Installedinthe/opt/vmware/var/lib/vami/${servicename}/directory. conf/[Link] [Link]/opt/vmware/var/lib/vami/${servicename}/conf. provider/*.[Link],VMwareStudioinstallsthisfileintothe /opt/vmware/var/lib/sfcb/stage/regs/directory. provider/*.mofCIMprovidermanagedobjectformat(MOF)[Link] /opt/vmware/var/lib/sfcb/stage/mofs/root/cimv2directory. provider/*.[Link]/opt/vmware/lib. system-root/*Contentoftheservicethatmustresidein(getcopiedto)thesystemrootdirectoryof theVMsoperatingsystem. view/[Link],containsinformationaboutthetabs [Link]/opt/vmware/share/htdocs/service/${servicename}/directory. view/*[Link],JavaScript,[Link] /opt/vmware/share/htdocs/service/${servicename}/directory. web-root/*[Link] [Link]/opt/vmware/share/htdocs.
Oftheabovefiles,[Link],[Link].
[Link]
[Link] [Link]:
<service> <name>ServiceName</name> <version>[Link]</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>
[Link]
ThisfiledescribestheWebinterfaceproperties,[Link] oftwotypes,[Link],itisthelocationofthefilethatappearsintheUItab. [Link]:
<service> <title>ServiceTitle</title> <content type="url" url="[Link]"/> </service>
VMware, Inc.
57
Developers Guide to Building vApps and Virtual Appliances
IftheURLisprefixedwithaslash(forexample/[Link]),theURLlocationisrelativetothedocument rootoftheWebserver,/opt/vmware/share/[Link] serviceviewsareinstalled,/opt/vmware/share/htdocs/service/${servicename}. [Link]:
<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,[Link] settings,seeStructureofvAppXMLBuildProfilesonpage 132.
Underlying CLI
Youcanrunthevamimanagercommandtoinstall,uninstall,extract,register,[Link] interfaceusesthevamimanagercommandtoimplementactions. Typevamimanageratthecommandlineforinformationaboutitsoptions.
Importing a Management Service
[Link] servicethatyouhavecreatedinanewlybuiltVM. To import a management service 1 2 3 4 5 6 7
58
LogintotheVMwareStudioWebconsoleandclicktheLibrary>Linuxtabs. [Link] filethatyoucreatedforyour [Link]. Ifcorrectlycreated,yournewserviceappearsinthelist,[Link] 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/[Link] [Link]. 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 [Link]. Thischapterdescribeshowtopublishupdatestoyourvirtualapplianceandincludesthefollowingtopics:
OverviewofUpdatesonpage 61 GeneratinganUpdateonpage 62 PublishinganUpdateonpage 64 TestingAgainstaStagingUpdateRepositoryonpage 66 DiagnosingFailedUpdatesonpage 66 UpdateRepositoryXMLonpage 67 SupportingCentralUpdateswithVMwarevCenterUpdateManageronpage 67
Overview of Updates
Afteravirtualapplianceisbuiltandreleased,[Link] [Link] [Link] virtualappliancemodel,theISVcreatesandpublishesupdatestotherepository. Avirtualappliancedeployedatacustomersitecanphonehometoanupdaterepositorytoretrieveupdates, whichmightinclude:
OperatingSystemupdatesYoucandownloadOSupdatesfromtheOSprovidersWebsite. ApplicationupdatesYoucanprovideyourownapplicationupdates.
To update a virtual appliance 1 BuildyourfirstvirtualappliancesoitcanreceiveupdatesfromanupdaterepositoryhostedatanISVsite. InVMwareStudio(seeManagementTabonpage 41)[Link] youenableupdatesforaVM,VMwareStudiocreatesanupdaterepositoryaftertheVMbuild. Aftertheapplianceisshipped,monitorupdatesforitsOSinadditiontotheapplicationstackcomponents thatarepresentinyourvirtualappliance. Analyzethechangesandselectapplicableupdatesforyourvirtualappliance. [Link] VMwareStudio,seeGeneratinganUpdateonpage 62. Testtheupdatestomakesurethatyourapplicationcontinuestoworkasbeforeinthevirtualappliance. [Link] [Link] 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 [Link] [Link] Webserverwithinthecustomerslocalareanetwork,whereastheISOcanprovideoffnetworkupdatesifthe VMisconfiguredwithaCDdrive. Figure 7-2. Virtual Appliance Update Retrieval
Generating an Update
[Link] serviceforaVMisenabled,[Link] 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,[Link] [Link], whereNmustbeanumberbetween0and65535. IntheManagementtab,[Link] onthepage,withasectionforUpdateServiceRepositorySettings. ChooseandtypeaRepositoryURLtoestablishanupdatesiteforyourvirtualappliancesinthefield. The RepositoryURLshouldbeonapubliclyaccessibleWebsite. OntheVMs>ManagementpageunderUpdateServicesettings,youcanchangetheRepositoryURL. Whenavirtualapplianceupdates,itgetsthechangedRepositoryURL,sothefollowingtimeitchecksfor anupdate,[Link],theoldrepository mustcontainafinalupdatewiththenewrepositorylocation,andthenewrepositorymustcontainan [Link],ordifferent. NOTEChangingthevirtualappliancename,VendorUUID,orProductRIDinthebuildprofilewhile [Link] CentralUpdateswithVMwarevCenterUpdateManageronpage 67formoreinformation. 7 8 [Link] ProductRIDaremandatoryforusewithVMwarevCenterUpdateManager. CompletethedetailsforRepositoryServerSettings,wheretheupdatearchivegetscopiedafterabuild. Ifyouplantocopytheupdatefromastagingservertotheupdaterepositoryonanexternalproduction Website,makesuretheRepositoryURLpointstothatexternalproductionWebsite,nottotheinternal [Link],copytheentirestagingserverupdatetotheexternalproduction [Link],underRepositoryExportSettingsyoucanclick UpdateArchiveandspecifyaZIPFilename. VMwareStudiocreatesanewmanifestwiththenewversionnumberspecifiedinthebuildprofile,and [Link] [Link] profile,[Link] 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
[Link] reboot,[Link] torebootafteranupdate,youcanrunthefollowingcommandaspartoftheupdate:
/usr/share/update-notifier/notify-reboot-required
Thiscreatesthefile/var/run/reboot-required,[Link] 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/[Link] yourXMLprofile,lookinthevadk:UpdateSection_Typeundervadk:DigitalSignatureforthepubkey script,whichcreatesadigitalsignaturefromaPEMkey,placingtheresultsinthespecifiedsignaturefile. Beforeupdatebegins,[Link] [Link],the [Link]. Toproperlysupportdigitalsigning,youcanmodifythesescriptstouseyourexistingsigninginfrastructure, ratherthanopenssl. Digitalsigninginvolvestwostages.Thesign_manifestscripttakesafileasinput,andoutputsasignature. Inofficialmode,thescriptusesofficialsigninginfrastructuretoperformthesigning,whichisusefulfor [Link],thescriptcallsopensslwithaprivatekeystoredinpubliclyavailablelocation [Link]. Thesecondstageistheget_public_keyscript,[Link] [Link],whichislaterusedto [Link].
Adding Your EULA to an Update
[Link],whenrun withthe--acceptulaoption,createsanupdatethatautoacceptsanyEULAthatexists,insteadofexplicitly askingtheusertoaccepttheEULA.
vamicli update --install <version> --accepteula
ByeditingtheXMLprofile,youcansettheEULAdisplaypolicytoalways,checkversion,[Link] checkversionpolicyshowstheEULAonlyiftheupdateversionisnewerthantheintroducedVersion. UnliketheEULAmechanismforinitialvirtualapplianceinstall,theupdateEULAdoesnotcurrentlysupport multiplelocales.
Publishing an Update
Afterthefieldsaremodifiedinthebuildprofile,clickSaveandBuildtobuildyourvirtualappliancewiththe [Link],[Link] [Link],andadditionalpackagesarecopiedtotherepository. [Link] repositoryforeachconstituentVMinthevApp.
64
VMware, Inc.
Chapter 7 Managing the Linux Update Repository
[Link] maketheupdatesvisibletoendusers,youcancopytheentirecontentstoyourexternalWebserverthathosts [Link] embedded,thefollowingactionscanoccur:
Virtualappliancesflaganupdateavailable,ifautomaticcheckforupdateisenabled. Theendusercanmanuallycheckforupdatestoviewavailableupdates. [Link], youcanincludethisadvisorymessage:Thisvirtualappliancewillrebootafterapplyingthisupdate.
CAUTIONDuringthetimewhenyouarepublishinganupdateintoapreviouslyexistingupdatesdirectory, [Link] updatefirstonastagingserver,[Link] istocopythenewupdaterepositorytoanewdirectory,andrenamethedirectorywhentheuploadiscomplete.
Publishing an Update Repository from ZIP
[Link], VMwareStudiocancreateaZIParchiveofeachupdatewhenyouenableUpdateArchiveExport. YoucanuseUpdateArchiveExporttocontrolpublishingofupdatesbymanuallycopyingthearchiveand [Link],VMwareStudiocreatesthefollowing updateZIPfile:
/opt/vmware/www/build/<buildNumber>/exports/zip/<exportFile>.zip
TopublishanupdatefromtheZIParchivecreatedusingRepositoryExport,extractthecontentsofthefilein [Link],ifyousettheupdateURL to[Link] thenyouwouldextractthecontentsoftheZIPfileinto/var/www/htdocs/updates/on<your-server>. VirtualapplianceenduserscouldnowretrieveandinstalltheupdatefromyourWebserver. ThefollowingexampleisforLinuxbasedWebservers. To publish an update from the ZIP archive 1 ConnectwithSSHtoyourproductionupdateserver,[Link]:
ssh [Link]
RunscptosecurecopyfromtheVMwareStudiovirtualappliance<vmwStudio>into/tmp:
scp root@<vmwStudio>:/opt/vmware/www/build/<buildNumber>/exports/zip/<exportFile>.zip /tmp
IftheproductionupdateserverhasHTTPaccesstoyourvirtualappliance,youcouldinsteadrun:
cd /tmp; wget --no-proxy [Link]
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, [Link],[Link] example,youcanembeditscreationdateintheformatyyyymmddforyear,month,[Link] backupoftheoldupdatemanifestfile,[Link] updateservertoanolderupdateversion,[Link] contentsofapreviousmanifestbackupfile.
mv ./manifest/[Link] ./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,[Link] [Link],theUpdateRepositoryURLinthebuildprofilepointstoaHTTPorHTTPS locationontheproductionserver,whiletheupdateFileTransferHostnameandFileTransferPathpointtoa [Link] 71. AsanISVyouhavethreewaystodeliverupdates:
FromaWebserveronthepublicInternet,calledProductionServerintheFigure [Link] buildprofile,UpdateRepositoryURLreferstotheupdatelocationonthisWebserver. BydeliveringaZIPfiletoyourcustomers,whounziptherevisedsoftwareintotheupdaterepositoryon theirlocalWebserver,andsettheirvirtualappliancetoupdatefromtheURLoftheupdaterepositoryon [Link] 72showsthisdeliverymechanism. BydeliveringaCDROMtoyourcustomers,whoplacethediscinaCDdriveaccessibletotheappliance [Link] 72showsthisdeliverymechanism.
Withthestagingserversetup,hereishowyoucantestupdatesagainstthestaging(notproduction)repository [Link]. Openaterminaltotheapplianceofinterestandfollowthesesteps: 1 Edit/opt/vmware/var/lib/vami/update/provider/[Link] repositoryAddress,replacingtheURLpointingtotheupdaterepositoryontheproductionserverwith [Link]. 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/[Link] usefulforgeneraltroubleshooting,becauseitcapturesmorethanjustupdaterelatedinformation. Afteravirtualapplianceupdateerror,supportpersonnelcanaskthecustomertorunthevamisupportscript. [Link] toacomputerwithemailservice,[Link], thevamisupportscriptsavesthesefiles,whichmightbeusefultodiagnosevirtualapplianceupdateerrors:
/opt/vmware/var/log/vami/[Link] /opt/vmware/var/log/vami/[Link] /opt/vmware/var/lib/vami/update/data/job/<job-id>/*
Thejob/<job-id>directorycontainsacopyofthemanifestfiles,preinstallscripts,postinstallscripts,and [Link]<job-id>directories,checktheir modificationtimesforthemostrecent.
66
VMware, Inc.
Chapter 7 Managing the Linux Update Repository
Update Repository XML
[Link],new packages(andnewversionsofexistingpackages)[Link] manifest-<version>.xml,[Link] [Link] [Link]:
<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)[Link],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>
[Link] 64.
Supporting Central Updates with VMware vCenter Update Manager
TheupdatesthatarepublishedforanappliancecanbeappliedbytheendusereitherusingtheWebconsole ofthevirtualapplianceorusingthecentralizedupdatemanagementprovidedbyUpdateManager. VMwarevCenterUpdateManagerallowssystemadministratorstocreateabaselinethatcontrolsupdatesto allvirtualappliances,orabaselineforaparticularappliance,orabaselineforappliancesfromagivenvendor, andsoforth. Anybaselinesspecifiedusingthevendornameorproductnamesareinternallyreferencedwiththe [Link] fromvirtualappliances.
[Link] 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 [Link]:
RequirementsofVMwareStudioPluginforEclipseonpage 69 GettingStartedwithVMwareStudioPluginforEclipseonpage 69 PackagingApplicationstoRunInaVirtualMachineonpage 70 CreatingManagementServicesonpage 71 AdditionalEclipseFeaturesonpage 71
UsingtheVMwareStudioPluginforEclipse,youcancontroltheuserinterfaceportionsofVMwareStudio [Link] [Link] managementservices,[Link] 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).Visitthe[Link] todownloadandinstall.TheJavaIDEandApacheAnt1.7areincludedinEclipsereleases. OnallEclipseplatforms(Linux,Mac,Windows)checkforeitherofthefollowing:
AccesstotheVMwareStudioforEclipseupdatesite,[Link] TheVMwareStudioForEclipse-2.1.0.*.[Link]
Getting Started with VMware Studio Plugin for Eclipse
TheVMwareStudioPluginforEclipsemustbeinstalledintotheEclipseframework. To get started with VMware Studio Plugin for Eclipse 1 IfyouarerunningEclipsebehindafirewall,[Link] 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, [Link] 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,[Link]. UndertheVMwareStudioExplorertab,[Link] [Link] viewincludes:
VMwareStudioWebconsoleYoudoubleclickthislinetoopentheVMwareStudiouserinterface [Link]. 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 [Link] metadatasuchaspackagename,version,[Link],postinstall, preremove,andpostremovescripts. WhenyouopenaVSPfileinEclipse,aneditingwindowappearswithPackageconfigurationdatatitle. Atthetoprightofthiseditor,[Link],selectapackage Repositoryname,aoutputfilename,andoptionallyaVMprofiletowhichthispackageshouldbeadded. IfyouselectaVMprofile,youcanclickthecheckboxtoautomaticallystartaVMbuildwhenthepackage uploadfinishes. Whenyoucreateapackage,thefilestab(bottomofwindow)allowsyoutoimportfilesandselectthe [Link] [Link] hasitssourcelocationspecified,duringthepackageexport,thatsourcelocationisaddedintothepackage recursively,[Link],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,[Link]. To create a new Service with Eclipse 1 FromtheFilemenu,selectNew>Project>VMwareStudio>VMwareStudioServiceProject,clickNext, typeaprojectname,possiblychangetheservicenameandotherattributes,andclickFinish. [Link] hierarchy,seeCreatingaManagementServiceonpage 57. 2 [Link],[Link] [Link]>AntBuild. TheAntbuildlogappearsintheConsole,[Link]. [Link],[Link]. ToimportyournewlycreatedserviceintoVMwareStudio,seeImportingaManagementServiceonpage 58.
Additional Eclipse Features
YoucanuploadaCDimagebyrightclickingintheVMwareStudioExplorertab,selectingUploadISOImage, [Link]. Youcanmanagepackagerepositories(bycreating,deleting,andrenamingthem).Youmustcreateapackage repositorybeforeyoucanexportaLinuxApplicationPackage. Withinpackagerepositories,youcandeleteandrenameVSPpackagefiles. [Link],expandVMProfiles, expandaVM,rightclickitsprofile,[Link] VM,addsapackagerepositoryintotheapplicationpackagesoftheVM,andsavestheprofilebacktotheVM. Becareful:ifsomeoneelseiseditingthesameprofileatthesametime,yourprofilechangesmightbe overwritten,oroverwritetheotherpersonschanges. YoucanstartandmonitorbuildsofaVMorvAppbyrightclickingonaspecificProfileSummaryand [Link] runningbyrightclickingonitandselectingCancelBuild,ordeleteabuildbyrightclickingonitand selecting Delete. YoucanaccesstheLogsandExportsofeachbuildbydoubleclickingontheminsidetheVMwareStudio [Link] [Link]. 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 [Link]:
AnISOimagefromthelistofWindowsoperatingsystemsinOperatingSystemISOImageonpage 76. AvalidlicensekeyfortheWindowsoperatingsystemyouselect. YourapplicationsharedonaMicrosoftNetworkFolder,orpackagedasaVMwareStudioPackage(VSP) forWindows,asoutlinedinWindowsApplicationPackagesonpage 76.
Accessing the Web Console
ToaccesstheWebconsolewithyourbrowser,[Link] 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 [Link],itisrequiredtoruntheinstallerinsilentmode whileusingtheappropriateinstallercommandline. VMwareStudioofferstwowaystoinstallyourapplication:
YoucaninstallanapplicationlocatedinaMicrosoftNetworkFolder,byspecifyingthesetupcommand linefromtheApplicationpreinstallscript,whichisoneoftheitemsyoudefineintheVMbuildprofile. Forexampletoinstallanapplicationfromanetworkdrive:
\\installserver\crm\[Link] /s
YoucandefineaVMwareStudioPackage(VSP)forWindowstoencapsulateyourapplicationsetup,and [Link] describestheprocessofinstallingaWindowsapplicationintoaWindowsbasedVM. YoucanusetheVMwareStudioWebconsoletopackageanapplicationasaVSPforWindows. See CreatingaWindowsApplicationPackageonpage 84.
AVMbuildprofilecontainsalistofApplicationPackageRepositoryURLs,designatingVSPforWindowsfiles locatedonaMicrosoftNetworkFolder,[Link] loadedandexecutedintheorderlisted. Toincludeapackage,eitheraddtheURLofadirectorycontainingoneormoreVSPforWindowsfiles,oradd [Link]. Forexample,thisistheURLofaVSPforWindowsfile:
smb://installserver/crm/[Link]
Creating a VM Build Profile
ThebuildprofilecontainsinformationaboutthecontentsoftheVM,virtualhardwareconfigurationofthe VM,[Link] [Link]. Subsequentsectionsprovidereferenceinformationabouttheoptionsineachconfigurationtab. YoucanusetheVMwareStudioWebconsoletocreateabuildprofileforaWindowsbasedvirtualmachine. To create a Windows VM 1 2 3 ObtaintheOSISOimageforasupportedversionofWindows. IntheVMstaboftheWebconsole,clickCreateProfile. IntheCreateaNewVMProfiledialog,specifyanameforyourvirtualmachine,selectaWindowsprofile fromthetemplates,andclickCreateProfile. [Link] yourownvirtualmachine,italsobecomesavailableasatemplatetocreatederivedvirtualmachines.
76
VMware, Inc.
Chapter 9 Creating a Windows-Based VM
TheEditingpageappears,[Link] showsdifferentitemstoeditforaWindowsvirtualmachinethanforaLinuxvirtualmachine,asnoted. TheVMeditingpageorganizesthebuildprofileintothefollowingtabs:
[Link] page [Link] [Link](EULA)issupportedonlywhenpackagingthe WindowsbasedvirtualmachineasOVForOVA,andisdisplayedatdeploymenttime. HardwareSpecifieshardwareconfiguration,suchasCPU,memory,anddisks,forthevirtual [Link] [Link] diskpartition. [Link] page 39fordetails.(OperatingSystemConfigurationincluded,seeOSTabonpage 77.) [Link] ApplicationTabonpage 79fordetails. OutputSpecifiesthetypeofdistributionformat(OVF,OVA,orZIP)[Link] [Link]/ESXihostsor VMwarevSphere,[Link] 43fordetails. BuildSettingsSpecifiessetupofthebuildenvironment,suchasconnectioninformationtomany [Link] 44fordetails.
UsetheNextandBackbuttonstonavigatebetweenthetabs,fillingintherequiredandoptionalfields. If youattempttonavigatetothenextpagewithoutspecifyingarequiredfield,anerrormessageappears inrednexttothefieldshowingwhereyoumustfixaproblembeforecontinuing. Eachfieldinthebuildprofilehasahelpicon(iinacircle)[Link] betweendisplayofcontextualhelpandalistoffrequentlyaskedquestions(FAQ). TabsbelowthepurpleVMwareStudiologo(topleft)navigatetootherinterfacesintheWebconsole. Attemptingtonavigateofftheeditingpageproducesadialogaskingifyouwanttodiscardyouredits. 5 Afteryouconfigureabuildprofile,youcantakeoneofthefollowingactionsbyclickingabuttononthe rightsideofthewindow:
ValidateAftercompletingabuildprofile,youcanvalidateitsconfigurationbeforebuildingthe [Link]. SaveandBuildValidatesandsavesyourbuildprofileanddisplaysthebuildsummarydialogbox. Tobeginthebuildprovisioningprocess,[Link] andabuildlogisavailabletoviewthestatusofthebuildasitprogresses. [Link] [Link],soyoucanchoosetoeditorbuilditlater. [Link] youaresureyouwanttodiscardchangesmadeduringthecurrentsession.
Additional Fields for Windows Reference
ThissectiondescribesthenewitemsthatarerequiredforaWindowsbuildprofile.
OS Tab
[Link] 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. [Link]*togeneratearandom computername. (Windows2003)Whetherthelicenseisperserver,perdevice,orperuser. (Windows2003)[Link] valueis5. SpecifiesthelocaltimezonefortheWindowsvirtualmachine. Specifiesnetworkmembershipsettingsforthisvirtualmachine.
Description
WorkgroupNameoftheworkgroupinwhichthecomputerparticipates. DomainNameofWindowsdomaininwhichthecomputerparticipates. UsernameForadomain,nameoftheuseraccountthathaspermissionto createacomputeraccountinthatdomain. PasswordForadomain,passwordofthatuseraccountthathas permissiontocreateacomputeraccountinthatdomain.
ItisnotrecommendedtojoinadomainduringtheVMprovisioning,iftheVM [Link] theVMdeployment,whileusingtheSyspreptool. AdditionalUnattendedConfiguration VMwareStudioautomatestheOSinstallationbycreatingaWindows unattendedfilewithsettingsbasedontheVMbuildprofile. Additionalunattendedconfigurationcanbeprovidedtomergewiththe [Link] additionalcustomizationoftheWindowsOSinstallation,suchasperforming installationorremovalofOScomponents [Link] [Link] [Link] [Link] Operating System Sysprep Configuration PerformSysprep Ifchecked,runSyspreptoolattheendofinstallation. TheSystemPreparationtool(Sysprep)isatechnologyprovidedbyMicrosoft [Link] SysprepisrecommendedwhenaVMwillbedeployedmorethanonce,to preparethesystemforcloning. Foradditionalinformationsee[Link] ForWindows2003basedVMs,theSyspreptooliscopiedfromtheWindows 2003CD([Link])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 [Link] [Link] VMwareStudioisusingaspecialvariableconventiontosetsomeSysprep [Link],theProductKeycanbe retrievedbyusing$(ProductKey)intheSysprepconfigurationfilecontent. [Link] fileforusebySysprep,youcanusetheSetupManagertoolthatisincludedon theWindows2003CDandalsointheMicrosoftWindows2003ResourceKit. [Link] fileforusebySysprep,youcanusetheSetupManagertoolthatisincludedin theWindowsAutomatedInstallationKit(AIK).TolocatetheAIK,searchfor AIKdownloadontheMicrosoftWebsite. User Accounts AdministratorPassword AddUser PasswordoftheAdministratoruseraccountfortheWindowsVM. [Link] 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/[Link] ToaddanapplicationpackageordirectoryofpackagestoyourVM,clickAdd URL,entertheURLofthepackageordirectoryonaMicrosoftNetwork Folder,andclickOK. TochangetheURLofanapplicationpackageordirectory,clickEdit,modify theURL,[Link],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,[Link] [Link],[Link],click [Link]. ToretainthetransientVMwithoutcleaningupafterthebuild,intheBuildSummarydialogbox,click [Link] [Link] platformbeforedeployingitelsewhere. Whenthebuildstarts,[Link], [Link], clickCancelunderthestatusicon. IMPORTANTYoucanmonitortheinstallationofWindowsandyourapplicationsontheconsoleofthe [Link],starteithertheVMwarevSphereClient,theVMwareInfrastructureClient,or [Link] intheprofileyoujustcreated,whichshouldpoweron,andclickConsole(ifnotalreadydisplayed). WatchingtheVMprovisioningcanhelpgreatlyifsomethinggoeswrong. Whenthebuildcompletesorfails,[Link] you encounterproblemswhenbuildingavirtualmachine,seeTroubleshootingVMBuildsonpage 135for diagnosticinformation. Afterabuild,[Link],select aVMandclickBuildLogtoseearecapofbuildprogress. Toseethebuildsummary,variouslogs,anddiscoveryreports:intheVMList,clicktheVMname>Finished (orFailed,orCanceled).TheDetailsdialogboxappears,withthefollowingtabs:
BuildSummaryprovidesdetailsofthebuildprofileconfiguration. VerboseLogprovidesadetailedlogofeachcompletedphaseofthebuildprocess. DebugLogprovidesdetailsofeachcompletedbuildphase,includingdebugginginformation. ApplicationInstallLogprovidesalogoftheinstallationmessagesastheoperatingsystemandeach [Link] troubleshootingpackagedependencyerrorsifmorepackagesarerequired. DiscoveryReportsprovidesinformationaboutpackages,hardwaresettings,andoperatingsystem.
[Link] [Link] 81formoreinformation.
Testing the Generated VM
AfteryouhavesuccessfullybuiltaVM,youcanobtainthevirtualmachinedistributionfilebyclickingonthe ZIPorOVFlink(dependinguponwhichtypeofoutputfileyouspecified)intheDownloadcolumnofthe VMsPreviousBuildlist. YoushouldclickonyourvirtualmachinedistributionfileandtestthecompletedVMbydeployingitintothe [Link] [Link],becauseifyoudo,yougetonlytheOVF [Link],testtheOVFbyrightclickingontheURL,copyingit,andpasting itintotheImportApplianceorDeployOVFTemplatedialogboxesofESX3.5or4.0,respectively. [Link] yourapplicationstartscorrectly. Ifyouplantodistributethisvirtualmachineasavirtualappliancetoyourcustomers,seetheUsersGuideto DeployingvAppsandVirtualAppliancesforinformationaboutdeployingyourvirtualappliancefortesting.
80
VMware, Inc.
Chapter 9 Creating a Windows-Based VM
Reiterating the Build Process
ManydevelopersfindthataneasywaytoacreateaWindowsVMistobuilditinitiallyjustcontainingthe operatingsystem,[Link] occupiesspace,butyoucandeletethem. TodeleteabuildusingtheVMwareStudioconsole,selectaVMfromtheVMList,locatethebuildinstance youwanttoremove,[Link]-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 [Link], [Link] followingkeyfeatures:
Supportsallsilentapplicationinstallers(MSI,InstallShield,andothers). Providesacontainerforapplicationsetupfiles. Allowsmultiplecommandlinesandscripts(Shell,JScript,VBScript). Handlesexecutionerrors. Rebootstheoperatingsystemasneeded. PermitsreuseofthepackagedefinitionwithmultipleVMbuildprofiles.
VSPforWindowscanalsobeusedtoperformsimpleapplicationinstallationtasks,suchascopyingfilesand [Link],youcanprovideashellscripttocopyfilesfromthepackagefoldertothe [Link](suchasMSI)[Link] beusedasareplacementforexistingapplicationinstallationtechnologies. TheVSPforWindowsfileformatissimilarbutnotidenticaltotheVSPforLinuxproducedbyVMwareStudio PluginforEclipse.
Repository of Windows Application Packages
TheVMwareStudioappliancecontainsaWindowspackagerepositorythathostsuserdefinedVSPfor Windows,[Link],which [Link],scripts, MSIfiles,andsoforth. AVSPforWindowsisplacedontheVMwareStudioapplianceunderthefolder:
/opt/vmware/depot/winrepo
[Link] 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,[Link] [Link],usetheOthertemplateforacleanpackagedefinition. Click [Link],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 [Link].
ProgramExecutetheprogramdefinedinthecommandfield. ShellRuntheshellscriptdefinedinthescriptfieldusingtheCommandInterpreter(CMD). VBScriptRuntheVBScriptdefinedinthescriptfieldusingWindowsScriptEngine. JScriptRuntheJScriptdefinedinthescriptfieldusingWindowsScriptEngine.
Forexample,thefollowingcommandexecutestheFirefoxinstallerfromthepackagedirectory:
Firefox Setup [Link] -ms
Asanotherexample,thefollowingcommandskicksoffanMSIbasedinstallation:
msiexec /i [Link] ADDLOCAL=ALL /NoRestart /Passive
Duringpackageinstallation,thepackageMicrosoftNetworkFolderismappedasanetworkdriveand [Link] andscriptstoaccessfilesinthepackagedirectory. 7 Forvariouscommandexitcodes,[Link] [Link](*)exitcode [Link],youcanchoosefromthe followinglistofavailableactions.
OKsuccessfulexecution. Rebootimmediatelyrebootnowbeforecontinuingtothenextcommandorpackage. Rebootoninstallationendrebootafterinstallingallpackages. Rebootonpackageinstallationendrebootafterallcommandsinthecurrentpackageareexecuted. Rebootimmediatelyandrepeatcommandrebootnowandreexecutethecurrentcommand. Failexecutionfailed.
Toaddexitcodes,andforalistofregisteredexitcodes,seeRegisteredExitCodesonpage 85. 8 9 Ifinstallationofyourapplicationrequiresanothercommand,clickAddCommandandtypeitunder Command2(andup).Repeatthisstepforasmanycommandsasyouneed. [Link].
84
VMware, Inc.
Chapter 10 Packaging a Windows Application
Registered Exit Codes
[Link] tooverridethedefaultbehavior.
0OKsuccessfulexecution. 1641Rebootimmediatelyrebootnowbeforecontinuingtothenextcommandorpackage. 3010Rebootoninstallationendrebootafterinstallingallpackages. *(Other)Failexecutionfailed.
Environment Variables when installing Packages
VMwareStudiosupportsthefollowingenvironmentvariablesincommandsandscripts:
PACKAGEDIRLocationofcurrentpackagefolder. ThisexampleshowsusinganabsolutepathtotheMSIfile:
msiexec /i %PACKAGEDIR%\[Link] /Passive
REPOSITORYDIRLocationoftheVMwareStudioWindowspackagesrepository. ThisexampleshowsusingMSIfilefromanotherpackage:
msiexec /i %REPOSITORYDIR%\crm\[Link] /Passive
[Link] directoryoftheVMbuildinstanceintheVMwareStudioappliance. ThisexampleenablesthelogfileduringMSI:
msiexec /i [Link] /Lime "%LOGDIR%\[Link]" 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
[Link], [Link],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,[Link], chooseanameforyourvApp,selectatemplatefromthelist,evenifonlyoneappears,andclick Create Profile. AfteryousuccessfullysaveavAppprofile,itbecomesavailableinthislistandcanbeusedasastarting pointtodefineanothervAppbuildprofile.
VMware, Inc.
89
Developers Guide to Building vApps and Virtual Appliances
ThevAppwizardappears,[Link] buildprofileintothefollowingtabs:
[Link] 91fordetails. [Link] 91fordetails. [Link] 92for details. [Link] page 92fordetails. OutputSelectsoutputformat,virtualmachinewhichholdstheApplicationURL,andOVFsettings. SeeOutputTabonpage 92fordetails.
3 4
IntheDescriptiontab,specifytheproductnameandversion,atminimum. IntheVMstab,clickAddVMs,selectatleastoneVMbuildprofile,andclickAdd. [Link].
5 6
IntheStartOrdertab,youcancontrolpoweronandpoweroffsequenceoftheVMsbyplacingvirtual machinesintodifferentbootgroupsandspecifyingstart/stopdelay. IntheResourcestab,youcancontroltheCPUandmemorysharesthatvSphereallocatesforeachVM. Forinformationaboutbootgroups,CPUshares,andmemoryshares,seethevSpheredocumentation.
7 8 9
IntheOutputtab,[Link] inadditiontoOVF,controlthemethodofIPassignment,andaddnewOVFproperties. (Optional)ClickValidatetocheckyoursettings. TobuildthevApp,clickSaveandBuildandintheBuildSummarydialogbox,clickBuildvApp. [Link] discardsyoursettings.
Ifthebuildissuccessful,[Link] 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 [Link] vSphereinventoryandintheSummarytabofvSphere. [Link] client. ArbitrarytextstringusedtodisplayversioninformationofthevApp,oftensimilar [Link]. URLonthecompanysWebsitewherecustomerscanfindinformationaboutthis vAppThisisshownintheSummarytabforthisvAppinthevSphereclient. [Link] inthevSphereclient. [Link] whenthevAppisimportedintoESXasanOVFandintheSummarytabforthis vAppinthevSphereclient. [Link] vAppinthevSphereclient. [Link]${[Link]} keywordintheURLresolvestotheVMsIPaddress,afterdeployment,atruntime. IntheOutputpageforvApps,theApplicationURLConfigurationfieldcontainsa menuwhereyoucanspecifywhichVMyouwantrepresentedin${[Link]}. Description
VendorURL ApplicationURL
End-User License Agreements AddEULA EULA ClicktheAddEULAbuttontoaddanenduserlicenseagreement(EULA). [Link] [Link], thenthevAppbootswithoutuserintervention. [Link] 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,[Link] 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 [Link] package. UseOVFformatfordeployingthisvApponanyVMwarePlatform. UseOVA(archive)formatforfasterdeploymentbystreamingthevApp. Application URL Configuration ApplicationURLVM WhenyouspecifiedtheApplicationURLforthisvApp,theVMsIPaddressissubstituted intothe${[Link]}[Link],youmust specifywhichoftheVMscomprisingthevAppwillhaveitsIPaddresssubstitutedintothe ${[Link]}[Link]. Description
OVF IP Assignment Settings DHCP DuringdeploymenttheuserisgiventheoptiontouseaDHCPserverforconfiguring [Link] [Link], 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 [Link] [Link].
OVF Properties Key Label Description Type DefaultValue MaximumLength Range ValueMap UserConfigurable ovf:type ovf:value ovf:qualifiers vmw:qualifiers KeytoOVFProperty. LabelforOVFProperty. DescriptionofOVFProperty. [Link] vSphereduringdeployment. String,unsignedinteger,stringchoice,Booleanvalue,orIPaddressofthisproperty. Maximumlengththatcanbespecifiedforastringproperty. Lowandhighvaluesthatcanbespecifiedforanintegerproperty. Listofpossiblevaluesforastringchoiceproperty. Whethertopromptusertoallowchangingofproperty. EachPropertyelementinaProductSectionmustbeassignedanovf:[Link] typeslooklikeCIMdatatypesandarelistedintheOVFspecification. Optionalattributeovf:valueprovidesadefaultvalueforaPropertyelement. Optionalattributeovf:qualifersspecifiesCIMtypequalifiersforaProperty,with multiplequalifiersseparatedbycommas. Optionalattributevmw:qualifersgivesVMwarespecificqualifiersforaProperty.
Building a vApp Build Profile
Afteryouhavecompletedabuildprofile,[Link] [Link],clickSaveandBuild. Whenthebuildstarts,[Link], [Link], clickCancelunderthestatusicon. Whenthebuildcompletesorfails,[Link] youencounterproblemswhenbuildingavirtualmachine,seeTroubleshootingVMBuildsonpage 135for diagnosticinformation. Afterabuild,[Link], selectavAppandclickBuildLogtoseearecapofbuildprogress. ClickContentstoshowtheVMsthatarecontainedinthevApp. ToseethevAppbuildsummaryandverboselog,clickPreviousBuilds>BuildStatus>Finished(orFailed). TheDetailsdialogboxappears,withthefollowingtabs:
BuildSummaryprovidesdetailsofthebuildprofileconfigurationandEULAs. VerboseLogprovidesadetailedlogofthevAppvalidationbuild.
[Link] [Link],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 [Link] allpackagesaredeployedproperlyandthatbootscriptsruncorrectly. [Link] 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. [Link] findtheprofileonyourcomputer. [Link],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 [Link],thevirtual hardware,[Link],firstbootscript, andsubsequentbootscripts. VMwarerecommendsthatyouselectvirtualhardwareversion4.Version4virtualmachinesare compatibleacrossallVMwarevirtualizationproducts,whichisanimportantcriteriaforacceptanceof virtualappliances.Howevertherearegoodreasonsforselectingvirtualhardwareversion7. [Link] stepsforestablishinganupdaterepositoryusingtheManagementTabonpage 41. [Link] tobuild(orprovision)yourvirtualappliance. IfyouarebuildingamultipleVMappliance,calledavApp,repeatthestepsabovetocreateotherVMs. WhenyouhavethesetofVMsthatyouneed,packagethemintoavAppcontainerbydefiningavApp buildprofileandbuildingthevApp. DistributetheoutputasOVAorOVF. Onanongoingbasis,youmightberequiredtoreleasepatchesforyourvirtualappliancesandvAppsthat aredeployedatcustomersites.
3 4 5
6 7
Aftervirtualappliancesaredeployed,enduserscanmanagethemindividuallyfromtheVMwareStudioWeb [Link]. EnduserscancheckforandinstallapplianceupdatesusingtheWebconsole,ifyouenabledtheupdateservice forthevirtualapplianceandestablishedanupdaterepository.
VMware Recommendations
Theremainingsectionsinthischaptergivesuggestionsorrecommendationsforchoicesyoumakeduringthe [Link].
VMware, Inc.
95
Developers Guide to Building vApps and Virtual Appliances
VMware Ready Virtual Appliances
[Link] [Link],[Link] currentrelease,ProductNameisfilledinfromtheVMprofilename,and1.0.0.0isthedefaultversionnumber. FordetailsabouttheVMwareReadyprogram,see[Link]
Choosing OVF Version
VMwaresuggestsdeliveringOVF0.9outputfilessoyourvirtualappliancecanrunonolderVMwareproduct platformssuchasESX/[Link],youmustdeliver OVF1.0orOVAoutputfiles,andthevAppcanrunonlyonVMwarevSphere. ThedownsideofOVF0.9isthatitlosesanyOVFpropertiesyouhavedefined,andyourvirtualappliance cannotbenefitfromautomaticnetworkconfigurationthatOVF1.0deploymentintoVMwarevSphere provides.FortunatelyVMwareStudiogeneratesbothOVF0.9andOVF1.0descriptorswhenyouselectOVF output,soyoucaneasilydeliverbothformatstocustomers.
Choosing Virtual Hardware Version
VMwarerecommendsspecifyingvirtualhardwareversion4(vmx-4)intheVMs>[Link] [Link] morethanfourprocessorsormorethan64GBmemoryandisdesignedtorunonESX/ESXi4.0,youshould selectvirtualhardwareversion7.VMwareWorkstationandVMwareServer2arelimitedto8GBmemory evenwithvirtualhardwareversion7.
User Accounts
[Link] modifythefirstbootscripttorequestthattheendusersupplyacustomrootpasswordatdeploymenttime. Alternatively,youcancreateadditionaluseraccountsthathavenonrootprivileges,andinformcustomers aboutthoseaccountstoenforcelimitedaccesstothevirtualappliance.
Include Update Agent
WhenbuildingLinuxbasedVMs,[Link] ontheVMs>[Link] proceduresinChapter 7,ManagingtheLinuxUpdateRepository,onpage [Link] allowtheoptionofanupdaterepository.
Partitioning Disk for System and User Data
[Link] [Link] andmountingthemonthenewvirtualappliance.
Footprint Reduction
VMwarerecommendsbothmethodsofreducingthesizeofgeneratedVMs:redundantpackageelimination [Link] 54
Guidelines for Adding Kernel Extensions
Toinsertacustomkernelmodule,youcanrunthemodprobecommandfromtheFirstBootScripttoloadyour [Link](8)[Link] file,asgeneratedbythedepmodcommand;seedepmod(8).TomakealterationstotheLinuxkernel,youcanuse [Link] creatinganISOimageoftheoperatingsystemwithalteredkernel,thenaddingittothelistofOStemplates [Link],seeAddingSupportforaNewOSonpage 99.
96 VMware, Inc.
13
Building from the Command Line
13
[Link] usetheVMwareStudiocommandlineinterfacetointegratewithanexistingapplicationbuildsystem, automatethebuildprocess,[Link] 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 [Link],youcanuseaterminalemulatortomakeanSSH [Link],runthefollowingcommand:
studiocli
Table 131describestheoptionsavailableforthestudioclicommand. Table 13-1. Options to the studiocli Command
Option -b Alternate --buildstatus Description Displaysthestatusandlogmessagesforaspecifiedbuildinstanceorallinstances [Link],tolistallbuildinstances: studiocli --buildstatus TolistthestatusofbuildinstancemyVA/myvAppwithextraverbosity,run: studiocli --buildstatus --verbose --instance myVA/myvApp [Link],run: studiocli --buildstatus --verbose --profile [Link] Thissubcommandtakesthe--key,--value,and--nomapoptions. -c --createbuild Createsthevirtualmachine/[Link] [Link],to buildavirtualmachine,enterthefollowingcommand: studiocli --createbuild --verbose --profile /<path>/<[Link]> -C --convertprofile [Link] [Link] 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,[Link],todeleteallfilesassociatedwiththebuild instancemyVA/myvApp,run: studiocli --deletebuild --instance myVA/myvApp -D --debug [Link],afterabuild,thetransientvirtualmachineorvApp [Link],thisoptionprevents thetransientvirtualmachinefrombeingdeleted,leaveshelpfullogfilesinplace, [Link] /var/log/[Link]/root/[Link] optionalsoenablesverbosedebuggingmessages(-vvoptiondescribedbelow). Showsubcommandofstudiocli,andpossibleoptionstoeachsubcommand. Auniquetagforeachbuild.Thevaluemustbelessthan16characterslongandcan becomposedofthelettersaz,AZ,thenumbers09,andthecharactersand_.By default,abuildinstancewillbegeneratedbyVMwareStudio. [Link] [Link],VMwareStudioalsoneedsabuildprofile [Link],specifytheoriginalbuildprofilethat matchestheimportedVMwiththeprofileoption:p [Link] Beforeprovisioning,youcanchangethisbaseprofile,forexamplebyaddingnew [Link],VMware Studiotriestogenerateoneforyou. studiocli --importvm <[Link] --profile /<path>/<[Link]> -k -k -v --cancelbuild -key --value [Link] provisionedontheserver,itisdeletedfromtheserver. [Link] the<key>and<value>.<key>areonesonthelefthandsideofthebuildstatus outputand<value>areontherighthandside. [Link] [Link],seeChapter 5,PackagingaLinux Application,onpage 49 Disablesthemappingof[[Link]]totheIPaddressofVMwareStudio. [Link]-bor--buildstatus. SpecifiesanewOS,usuallyonethatisnotontheofficiallysupportedlist,forsystem [Link]. Mustbefollowedbythe-por--profileoption. After-Cor--convertprofile,specifiesoutputfilenameforconversion. [Link] canbefoundunder/opt/vmware/etc/build/[Link] generatedVMprofilesarelocatedat/opt/vmware/var/lib/build/profiles, andvAppprofilesarelocatedat/opt/vmware/var/lib/build/vapp_profiles. [Link] specified Validatesagivenbuildprofilebytestingresourceauthentication,availability,and [Link],tovalidateyourbuildprofilebeforebuildingyour virtualmachine/vApp,runthefollowingcommand: studiocli --validateprofile --profile /<path>/<[Link]> -v --verbose [Link] 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 [Link],buildinstance1storeslogsinthefollowingdirectory:
/opt/vmware/www/build/1/status/
Thisdirectorycontainsthreeimportantlogfilesforeachbuild:
[Link]. [Link]. [Link],networkcommunications, andprovisioninginformation.
BuildlogsareaccessibleusingtheStudioWebconsoletotroubleshootbuildfailures.
Discovery Reports
ThestudioclicommandgeneratesseveralreportfilesduringVMdiscovery,whichareavailableinthe followingdirectory:
/opt/vmware/www/build/<VM-name>.<instance>/discover
Old Builds
[Link] 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 [Link].
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 [Link],seeGuidelinesforAddingKernelExtensionsonpage 96. IfyouthengototheVMwareStudioWebconsoleandclicktheCreateProfilebutton,SLES11SP1appears asoneoftheavailabletemplatesforcreatingavirtualapplianceprofile.
Requirements
[Link] anunattendedinstallerthatmaybeinvokedremotelythroughthenetwork,suchasAnacondaforRHELand CentOS,PreseedforUbuntu,orAutoyastforSLES.
VMware, Inc.
99
Developers Guide to Building vApps and Virtual Appliances
Support Files for the New OS
Table [Link], youmustupdatetheISOpath,MD5checksum,vendor,majorversion,andminorversion. Table 13-2. Support Files in OS Profile
build_profile.xml <new_OS>.xsl [Link] [Link] [Link] [Link] Templatebuildprofile. OSunattendedinstallerconfigurationfile. [Link] forpackagingutilities. ScriptexecutedbyStudioinsidetheVMaftertheOSinstallationcompletes. [Link]. [Link].
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>[Link][Link] forcompatibilityquestions. <vadk:VMToolsX>VMwareToolspackagestosupportXwindows.
For<new_os>.xsl,verifythatthegivenunattendedinstallerconfigurationfileworksforthenewguestOS. [Link],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/[Link],must havean%endtagtoclosethesections%pre,%post,and%[Link]%endtag. Youalsomustupdatethevadk:ISOsectionoftheFedora11profilewiththepropervadk:pathtotheISOfile, andrelatedattributesinthissection.
Signing OVF Files
[Link] elementhasbeenextendedtoallowusersuppliedscriptstorunafterthegenerationofagivenoutputformat, whetherOVF,OVA,[Link] [Link] generatedStudioprofiles. TheeffectofsigninganOVFcanbeseenonlywhendeployingtoESX/ESXi4.1orthroughvCenterServer4.1. TheOVFbasedcertificateisignoredinearlierversionsofVMwarevSphere. TheXMLprofilescontainasamplesigningprogramthatacceptsanOVFstyleprivacyenhancedmail(PEM) file,orintheabsenceofaPEMfile,generatesaselfsignedkey,withwhichtosigntheOVF.
signovf -p <PEM_file> [-s subject] <OVF_file>
Youcanspecifythe-soptionwithanX500likeparameterforsigning,soopenssldoesnothavetoaskfor [Link]:
signovf -p [Link] -s '/C=US/ST=Some-State/O=AnyCompany/CN=Self-Signed' [Link]
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
[Link] whenchangingtheapplicationmixofanappliance,orwhendevelopingabaseapplianceforuseasapattern.
Importing an Existing VM Using the CLI
[Link],studioclicreates [Link],see UsingtheCommandLineonpage 97.
Prerequisites
Beforeyoubegin,notethefollowingrequirements:
YoumusthaveeitheraLinuxbasedvirtualappliancepackagedasZIP,OVF,orOVAonthelocalhost,or apoweredoffLinuxVMonaremoteprovisioningengine,eitherESX/ESXiorvCenterServer. AfterexistingVMimport,youneedtheISOfileofacorrespondingLinuxOStobuildthenewVM. TheVMwareStudioprovisioningagentmustbeinstalledintheinputVMfordiscovery. IftheinputVMwasbuiltusingVMwareStudio2.1withthevadk:removeAgentPackageattributesetto false(itsdefaultvalue),[Link]. OntheBuildSettingspagetheRemoveagentafterprovisioningcheckboxisnormallyunchecked,so leaveituncheckedwhenbuildinganinputVM. IftheinputVMwasnotbuiltwithVMwareStudio2.1,youmustinstalltheprovisioningagentmanually. Thepackagesvmware-studio-provagent_*_i386.rpmandvmware-studio-provagent_*_all.deb areavailablein/opt/vmware/www/[Link] ontheinputVMbeforestartingthediscoveryandimportphases.
[Link],youmustacceptitontheconsoleof [Link], 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,[Link],andwiththenameoption,itcalls theimport_helper.[Link]/opt/vmware/share/builddirectoryonthe VMwareStudioappliance.
Discovering an Existing VM
[Link]. 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,[Link], youcanacceptthedefault4forvSphere4.x. Whenaskedforhost,[Link],accept thedefault443unlessitwaschanged. [Link]/ESXi,[Link],typeAdministrator. Thentypetheuserloginpassword,twice. WhentheCLIdisplaysresourcepool,youcanacceptthedefault. IfyouselectedVI(vSphere)locator,[Link] [Link]. Theimportscriptreadsthesnapshotlistandallowsyoutochooseanoldsnapshot,[Link] fortheLinuxOSvendor,majorversion,[Link],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/[Link] -v
104
VMware, Inc.
Chapter 14 Build From an Existing VM
Modifying the Import Profile
Youcansavetheimportprofile,/root/[Link],formodificationandlateruse. GoodXMLeditorsexist,butimportprofilesyntaxisnotdifficulttounderstand,soitisbesttouseatexteditor thatyoufeelcomfortablewith.
Building with the Import Profile
[Link] [Link]. YouneedtosupplyanISOURLandrootpassword,butlittleelse. To create a new VM from an existing VM 1 ClicktheVMstab. ThenewlyimportedprofileshouldappearintheVMProfilelist. 2 3 Selecttheprofilethatyoujustimported,newVMforexample. [Link]. YoucanmodifymostitemsontheDescriptionpage,includingProductNameandVersion. TheHardwarepageimposesrestrictionsaslistedinExistingVMLimitationsonpage 106. 4 OntheOStab,providetheISOURLofacorrespondingLinuxdistribution,andsettherootpassword. TheISOURLusuallylookslike[Link] ISOMD5isoptional. 5 OntheApplicationtab,youcanremovepackagesontheListofpackagesfromOSinstallmediaifyou donotwanttheminthenewVM. ThebuildprofilescreatedfromanexistingVMimportprofiledonotincludeVMwareTools(coreorX) [Link] donotupgradecleanly,andbecauseOSspecificpackagesmightnotworkonanunsupportedOS. IfyouwanttoincludeVMwareToolsinsubsequentVMbuilds,youcanobtainanoperatingsystem specificpackage(OSP)fromthepackagerepositoryat[Link] sourcecodeavailableat[Link] [Link]:
vmware-open-vm-tools-kmod-<[Link]>* 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 [Link](GUI)ifyouwanttheWebconsoletoappear. TheOutputandBuildSettingstabsshouldbefilledinalreadyfromthediscoveryphase. (Optional)ClicktheValidatebuttontoverifyyourbuildprofile. Whenyouarefinishedediting,clicktheSaveandBuildbutton.
YoucanchoosetoremovetheprovisioningagentafterabuildbycheckingRemoveagentafterprovisioning [Link]:[Link] debugging,andexistingVMtransformation,VMwarerecommendsthatyouretaintheprovisioningagent (vmware-studio-provagent*)[Link],VMwarestronglyrecommends thatyouremovetheagent.
VMware, Inc.
105
Developers Guide to Building vApps and Virtual Appliances
Existing VM Limitations
WhenyoubeginwithanexistingVMoranyqualifyingLinuxOSinsteadofwithasupportedOSdistribution, VMwareStudio2.1offersbenefitsandimposeslimitationsasfollows:
YoushouldnotattemptconcurrentbuildsofanexistingVM,althoughVMwareStudiodoesnotprevent youfromdoingso. [Link] withanyrelatedLinuxdistributionusingDEBorRPMpackaging. YoucanaddandremoveOSpackages,applicationpackages,andmanagementpackages. Youcanaddnewvirtualdiskbutneitherresizenorremovedisks. YoucanaddandremovevirtualCPUs,[Link]. 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 [Link] managementservice.
RootObjectonpage 109 VAMIContaineronpage 109 VAMIContainerCallbacksonpage 110 VAMII/Oonpage 111 VAMILogonpage 112
AsshowninCreatingaManagementServiceonpage 57,[Link] <Contenttype="html">andas<Contenttype=url>.ThisJavaScriptAPIcanbeusedinbothcases.
Root Object
TherootobjectvamihasoveradozenmethodstonavigatewithinaWebcontainer,communicatewiththe LIGHTTPDWebserver,[Link] JavaScript,calltheparent:
var vami = [Link];
VAMI Container
Thefollowingfunctionscanbecalledontherootvamiobject.
[Link]
[Link].
boolean navigate(String token)
Parameter: tokenAstringrepresentingthedestinationpage,[Link] [Link],itgoestothefirstpageintheService. Example:
[Link]('[Link]');
[Link]
Logsoutthecurrentuser.
void logout()
VMware, Inc.
109
Developers Guide to Building vApps and Virtual Appliances
[Link]
Addsanewbrowserhistoryitem.
void newHistoryItem(String historyToken)
Parameter: historyTokenThetokenassoicatedwiththehistoryitem. Exampletorecordahistorychange:
[Link]('[Link]');
[Link]
[Link].
public boolean isLogin()
[Link]
[Link].
public String getUser()
[Link]
ReturnsthecurrentsessionID,whichisusedforauthenticationwithPAMortocommunicatewithsfcbd.
public String getSessionID()
ExampletoauthenticateauserontheserversideusingPython:
# import required libraries import sys [Link]('/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 = [Link]('[Link] (user, sessionid)) [Link]('VAMI_ComputerSystem') return True except Exception, e: return False
VAMI Container Callbacks
VAMIWebcontainerprovidescallbacksforservicestoregisterandgetnotifiedofvariousnavigationalevents.
[Link]
[Link] functionyoupasswillthenreceivethetokenforthecurrentpage.
public void registerOnShowCallback(JavaScriptObject callback)
Parameter: [Link] thecurrentpage. Exampletoregisteracallbackfunction:
function myOnShow(token){ alert(token); [Link](myOnShow);
110
VMware, Inc.
Appendix A Management Services Web API
[Link]
RegistersacallbackfunctionwiththecontainerforexecutionwhentheServiceishiddenandtheusermoves [Link].
public void registerOnHideCallback(JavaScriptObject callback)
Parameter: [Link] thependingpagetowheretheuserisnavigating. Exampletoregisteracallbackfunction:
function myOnHide(pendingToken){ return confirm(pendingToken); } [Link](myOnHide);
[Link]
Registersacallbackfunctionwiththecontainerforexecutionwhenthecontainernavigatestothecurrent [Link].
public void registerOnNavigateCallback(JavaScriptObject callback)
Parameter: [Link] [Link]:
functionName(token);
Exampletoregisteracallbackfunction:
function myOnNavigate(pendingToken){ alert(token); } [Link](myOnNavigate);
VAMI I/O
[Link].
[Link]
MakeanHTTPGETrequestfortheprovidedURL,[Link] SameOriginPolicy(SOP)restrictions,thisAPIcannotmakecallstoanyotherserverotherthantheserverfrom whichthispageisloaded.
public void httpGet(boolean authenticate, boolean blocking, String description, String url, JavaScriptObject callback)
Parameters:
authenticateTrueifyouwanttouseHTTPbasicaccessauthenticationonthecurrentlyloggedin [Link]. blockingTruetoindicatetothecontainerthatthisisablockingrequest. descriptionDescriptionoftherequest,tobeshownintheuserinterface. urlRelativeorfullHTTPURLforthisrequest. [Link] requestispassedtothiscallbackfunction.
Exampletorequestafile:
[Link](false, false, 'Get XML file', '/[Link]', alert);
VMware, Inc.
111
Developers Guide to Building vApps and Virtual Appliances
ExampletorequestaJavaScriptObjectNotation(JSON)objectandparsethatobject:
function evaluateJSON(json){ eval(json); } [Link](false,false,'Get JSON Object','/RESTInterface',evaluateJSON);
[Link]
MakeanHTTPPOSTrequestfortheprovidedURL,[Link] SameOriginPolicy(SOP)restrictions,thisAPIcannotmakecallstoanyotherserverotherthantheserverfrom whichthispageisloaded.
httpPost public void httpPost(boolean authenticate, boolean blocking, String description, String url, String content, JavaScriptObject callback)
Parameters:
authenticateTrueifyouwanttouseHTTPbasicaccessauthenticationonthecurrentlyloggedin [Link]. blockingTruetoindicatetothecontainerthatthisisablockingrequest. descriptionDescriptionoftherequest,tobeshownintheuserinterface. urlRelativeorfullHTTPURLforthisrequest. contentContenttopostfortheURL,usuallyforHTTPGETrequestthisispartoftherequestURL. [Link] requestispassedtothiscallbackfunction.
Exampletorequestacalltothesfcb:
var cimXML; //fill cimXML with the CIM XML that you want to post to CIMOM [Link](true,false,'Making CIMOM Call','/cimom', cimXML, evaluateJSON);
VAMI Log
ToenableloggingforavirtualmachineWebconsole,use<webconsoleurl>?log=info&logwindow=true. [Link] optionsforthelogparameterarewarnanderror.
[Link]
Logsaninformationalmessage.
public void info(String message, JavaScriptException exception)
Parameters:
messageMessagestringtolog. [Link].
[Link]
Logsawarningmessage.
public void warn(String message, JavaScriptException exception)
Parameters:
messageMessagestringtolog. [Link].
112
VMware, Inc.
Appendix A Management Services Web API
[Link]
Logsanerrormessage.
public void error(String message, JavaScriptException exception)
Parameters:
messageMessagestringtolog. [Link].
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, [Link],VMware [Link],theSSHprotocolisavailableby [Link],youmustinstallSSH.
VMware Workstation and VMware Server 1.0.x
BecauseWindowssystemsdonotordinarilyincludesupportforthisprotocol,whenVMwareWorkstationor [Link],installOpenSSHasfollows. To install the SSH daemon on a Windows system 1 DownloadtheOpenSSH4.2p11forWindowsBinaryInstallerfrom[Link] [Link] Windows,youshouldconsiderinstallingarecentversionofCygwinanditsOpenSSHoption. 2 3 Runtheinstaller,[Link]. Afterinstallation,createaworkingdirectoryforprovisioningvirtualmachines,forexample:
mkdir C:\vmware_studio-tmp
NOTEc:\vmware_studio-tmp translatesto /cygdrive/c/vmware_studio-tmpwhenyousetthe VMwareServerFileTransferPath. 4 5 Selectausernameandpasswordtouseinthescriptbelow. Thefollowingscriptusesthenetusercommandtocreateausernamedvmware_studiouserwith [Link]:\vmware_studio-tmp [Link],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/[Link]
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,[Link]. 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 [Link] thekeypresented(inthecaseofPuTTY,a2048bitRSAkeyoverSSHv2). ComparethisfingerprinttotheSSH2orRSAfingerprintyougeneratedinStep 4. Ifthefingerprintsmatch,[Link], ratherthanforthisSSHsessiononly. [Link],arootshellappears.
2 3 4
To confirm with SCP or SFTP 1 UsingyourchoiceofSCPclient(forexampleWinSCP4.x),orthescpcommandonLinux,connecttothe IPaddresswithintheURLthatyounoteddowninStep [Link] thekeypresented(inthecaseofWinSCP,a2048bitRSAkeyoverSSHv2). ComparethisfingerprinttotheSSH2orRSAfingerprintyougeneratedinStep 4. Ifthefingerprintsmatch,[Link], ratherthanforthisSCPsessiononly. TheSCPclientproceedswithsessioninitiation.
2 3 4
VMware, Inc.
117
Developers Guide to Building vApps and Virtual Appliances
118
VMware, Inc.
Editing XML Build Profiles
[Link]:
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 [Link] [Link] 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
[Link], see[Link]
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 [Link]. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/Vendor [Link], 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 [Link],youcanusethe variablestring${[Link]},whichresolvestotheIPaddressoftheVM. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/AppUrl Category Description UsuallyApplication. //ovf:Envelope/Section[@xsi:type='ovf:ProductSection_Type']/Category [Link] isimportedintoESXasanOVF. //ovf:Envelope/Section[@xsi:type='ovf:AnnotationSection_Type']/Annotation EULAText [Link] deployingonvSphere,thevSphereClienthandlesovf:EulaSection_Typeacceptance. //ovf:Envelope/Section[@xsi:type='ovf:EulaSection_Type']/License YoucanaddmultipleEULAtextsbycopyingthe<Section>elementcontainingEulaSection_Type andplacingadditionalEULAtextsinrepeated<Section>[Link] 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 [Link] 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. [Link] 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 [Link] details,seeSupportingCentralUpdateswithVMwarevCenterUpdateManageronpage 67. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/ vadk:ProductRID ApplicationLinkLabel [Link] theURLprovidedinApplicationLinkURLfield. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/ vadk:AppUrlName LogoPath [Link] 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,[Link] willnotdisplayinthevirtualmachineconsole. //ovf:Envelope/Section[@xsi:type='vadk:ExtendedProductSection_Type']/ vadk:WelcomeText SSL Certificate CommonName TheSSLCertificateSectionprovidesdetailsabouttheappliancesSSLcertificate. [Link],thisisthefullDNSnameusedwhen navigatingaWebsite. //ovf:Envelope/Section[@xsi:type='vadk: SSLCertificateSection_Type']/vadk:CommonName Organization [Link]. //ovf:Envelope/Section[@xsi:type='vadk: SSLCertificateSection_Type']/vadk:OrganizationName OrganizationalUnit [Link]. //ovf:Envelope/Section[@xsi:type='vadk: SSLCertificateSection_Type']/vadk:OrganizationalUnitName CountryCode [Link] 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 [Link]. //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 [Link] 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. [Link] ZIPorOVFpackage. //ovf:Envelope/Section[@xsi:type='vadk:ApplicationSection_Type']/ vadk:VMXFilename DistributionFormat [Link]. //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 [Link]. //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 [Link] ontotheVMwareStudioappliance(/optdirectoryonthefirstline),whichismadeavailableatthe followingURL(secondline): /opt/vmware/www/ISV/appliancePackages [Link] //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 [Link] 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. [Link] isshippedasvirtualappliance,[Link] 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) [Link] withlicensingrestrictions,thisfieldisrequiredtoupdateanyvirtualappliancebasedontheRedHat EnterpriseLinux(RHEL)[Link]. //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 [Link]. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:RepositoryStagingServer/@vadk:fileLogin FileTransferPassword ThisisthepasswordusedbyVMwareStudiotocopyfilesusingscpprotocoltotherepositorystaging [Link]. //ovf:Envelope/Section[@xsi:type='vadk:UpdateSection_Type']/ vadk:RepositoryStagingServer/@vadk:filePassword FileTransferPath [Link] 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 [Link]. [Link]. //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,[Link] Disks,Partitions,andVirtualDevicesonpage 129. InthefollowingXMLitems,<rasd:InstanceId>shouldbesequentialstartingwithnumberone(1) anduniqueforeverynewresource. CPUs Thenumberofvirtualprocessorstobeconfiguredforthisvirtualmachine. IMPORTANTThisnumbermustbelessthanorequaltothenumberofCPUsintheprovisioning [Link] 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 [Link]. //ovf:Envelope/Section[@xsi:type='ovf:VirtualHardwareSection_Type'] /Item[rasd:ResourceType = 10] /Item[rasd:ResourceType = 6] InVMwareStudio2.1youcanchangethenetworkorSCSIadaptertypebyeditingtheXMLprofile. Thesupported10networkadaptertypesarePCNet32andE1000.Thesupported6SCSIadapter typesarelsilogicandbuslogic. VirtualHardDisk [Link],inmostcases,onefull sizepartitionshouldbesufficient,sincethereisamaximumof60diskssupportedforCentOS5.0and RHEL5.1.ForUbuntu7.04,Ubuntu7.10,andUbuntu8.04,15disksaresupported. [Link] [Link] 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 [Link]. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:PreInstallScript PostInstallScript [Link],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 [Link][Link] butifthe[Link] [Link],thedefaultbuildprofiletemplatesspecifya[Link] [Link]. //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 [Link] removedfromtherequiredlistofpackages. //ovf:Envelope/Section[@xsi:type='vadk:JEOSSection_Type']/vadk:OSPackages Build Settings VMNetworkConnection TheBuildSectioncontrolsprovisioningoftheVM. [Link] [Link] networklabelforVMwarevSphere,VMNetworkforexample. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:NetworkConnection VMNetworkType VMwareStudioprovidestwooptionsforobtainingIPaddressesforthevirtualmachinebeingbuilt duringprovisioning,[Link]:
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 [Link] 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 [Link]. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:DNS1 AlternateDNSServer(Optional)ThealternateDNSservertobeusedforthevirtualmachineduring [Link]. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningSettings/vadk:DNS2 HostName (provisioningplatform) ThehostnameorIPaddressofthevirtualizationplatformyouuseforprovisioning. [Link],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 [Link] [Link], usually902,[Link] 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 [Link]. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:password BuildDirectoryPath ([Link])Thetemporarypathusedbytheprovisioningplatformtoregister [Link] [Link],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 [Link] datastore1,storage1,orsomeotherdesignation. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostLan/@vadk:datastore DatacenterName (vCenteronly)[Link] 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 [Link]/ESXihostsandvCenterServerhaveabuiltindefaultresource pool,[Link](MOB)interfaceat [Link] 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 [Link] 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 [Link] [Link],say aLinuxboxisthehostoftheVMwareServerand/[Link],both FileTransferPathandBuildDirectoryPathwouldhave/[Link],say aWindowsboxisthehostoftheVMwareServerandc:\[Link] 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 [Link] [Link],buildenvironmentsettingschange. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:ProvisioningEngine/vadk:VmhostProduct vadk:name=""> PreInstallShellScript Shellscriptthatyoucanmodify,whichrunsontheprovisionedVMbeforeinstallationofapplication [Link]. //ovf:Envelope/Section[@xsi:type='vadk:BuildSection_Type']/ vadk:PreInstallShellScript PostInstallShellScript Shellscriptthatyoucanmodify,whichrunsontheprovisionedVMafterinstallationofapplication [Link]. //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:[Link](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)[Link] 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 [Link].
128 VMware, Inc.
Appendix C Editing XML Build Profiles
Customizing the Footer in the Web Console
[Link],edittheVM profileandaddHTMLtagsasinthisexampletotheViewCustomizationXMLsection:
<Section xsi:type="vadk:VAMISection_Type"> <vadk:ViewCustomization> <vadk:FooterLeft><a href="[Link] target="_blank"><img style="padding-top: 3px;" src="service/core/[Link]" alt="VMware logo" border="0" /></a></vadk:FooterLeft> <vadk:FooterCopyright>Copyright &copy; 1998-2009 VMware, Inc. All rights reserved.</vadk:FooterCopyright> </vadk:ViewCustomization> </Section>
Asshownintheexample,[Link],makesurethat theimagesareaccessibletotheWebconsoleofyourvirtualappliance.
Creating Virtual Disks, Partitions, and Virtual Devices
Thefollowingsectionsprovideinformationaboutthevirtualhardwarethatisdefinedinthebuildprofilefor [Link],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,[Link] controllersaresupported(03). rasd:CaptionAtextdescriptionofthecontroller. rasd:InstanceIdTheorderofthisIteminthehardwaresection. rasd:[Link] adapter,[Link] 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:[Link] supported,numbered015,withaddress7beingreserved. rasd:CaptionAtextdescriptionoftheharddrive. rasd:HostResourceAstringthatassociatedthisharddrivewithanassociatedentryintheDiskSection. Thisentryalwaysbeginswith/disk/ followedbytheIDfromtheentryintheDiskSection.
VMware, Inc.
129
Developers Guide to Building vApps and Virtual Appliances
rasd:InstanceIdTheorderofthisIteminthehardwaresection. rasd:[Link] 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="[Link] ovf:fileRef="[Link]" />
ovf:[Link]. ovf:capacityThesizeofthedisk,inovf:capacityAllocationUnits. ovf:[Link]. ovf:[Link]: [Link] ovf:fileRefThenameofthegeneratedfileforthisdisk.
Partition [Link]:
/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:[Link] forpartitionsmarkedswap. vadk:fsThetypeofpartitiontomake.Astandardfilesystemwillhavethevalueext3;theothervalid valueisswaptodefineaswappartitiontoextendthevirtualmemoryofthevirtualmachine. vadk:[Link] (controller0,disk0)andonlyonthebootpartition. vadk:diskIdTheovf:diskIdintheDisksectiontowhichthispartitionrefers. vadk:[Link],eachnewdiskhasonlyonepartition,specifyingtheentire [Link],avaluemaybeenteredherethat [Link].
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:[Link]. Whensettotrue,[Link]. ItisalsousefulwhenyouwanttomountadifferentISOforthenextbuild.
Resource Allocation Setting Data
Table C2shows<Item>[Link] 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. [Link]. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:Product [Link]. //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 [Link]. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:AnnotationSection/ovf:Annotation VendorURLtothecompanysWebsite. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:VendorUrl [Link]{$[Link]}keywordintheURLisresolvedtotheIPaddress oftheVM. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:ProductSection/ovf:AppUrl EULAText [Link]. 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,[Link]:locationisspecified,thentheVMatthat [Link],theVMisbuiltfromtheprofilespecifiedinthevadk:profile. //vadk:MultiVM/vadk:VMCollection/vadk:VM/@vadk:location Id ThisistheidentificationoftheVM,[Link]. //vadk:MultiVM/vadk:VMCollection/vadk:VM/@vadk:ovfid Start Order Id BootGroup StartAction TheStartupSectiondescribespoweronorderforthevApp. [Link]:ovfidintheVMCollectionSection. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/@ovf:id SpecifythebootgrouptoorderthestartupandshutdownoftheVMs. //vadk:MultiVM/ovf:VirtualSystemCollection/ovf:StartupSection/ovf:Item/@ovf:order [Link]. //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. [Link]: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 [Link] [Link]: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. [Link] createone,itcausesbuildstofail. Checktheprovisioningengineconsoletoseeifuserinputis [Link] youspecifiedanOSpackageinthebuildprofilethatdoesnot existaspartoftheISO;inthatcase,removetheOSpackage. Thisproblemhasseveralpossiblecauses: 1 YourDHCPservermightbehavingtroubleissuinganIP [Link] [Link],and updatethevirtualmachineNetworkType. Ifyoutrytoprovisiona64bitOSona32bitESXihost, VMwareStudiotimesoutwaitingforIPinformationfrom theVM,[Link] oftheprovisioningmachinewouldbeYourCPUdoesnot supportlongmode.Usea32bitdistribution. WhenanESX/ESXihostismanagedbyvCenterServer,and youprovisiondirectlyontheESX/ESXihost,notthrough vCenterServer,[Link] supportedconfiguration:nexttimeprovisionthrough vCenterServer. Resolution
VMwareStudiotimesoutwaitingforIPinformation fromtheprovisioningVMduringbuild.
Abuildfailsandprintsmanymessagesincluding: Error: unable to open NFC target disk.
[Link] servefilesanddirectoriesownedbydifferentusers,remotebuild [Link] [Link]. Youmustuse64bithardwaretoprovisionavirtualmachine [Link] 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 [Link] periodorhyphenusingthestudioclicommand. Thecausecouldbethatrpmbuildsearchedfordependencies andfoundsomefilesmissing,eventhoughtheyarenotreally [Link] thepostinstallscripttocopythefilesinvolved. Youcanignorethesewarningmessages. Youdonotneedtorunapt-getupdatetocorrectthisproblem.
AStudiobuildfailswiththismessage: Provisioning Agent: failed to run script .[Link] WhilebuildinganUbuntuVMyoumayseeoneof [Link]: W: Conflicting distribution: [Link] stable Release. WARNING: The following packages cannot be authenticated! UnabletobuildUbuntuvirtualmachinesthat containmorethan15virtualdisks.
TheUbuntuinstallerlimitsyoutocreatingnomorethan15disks duringOSinstallationprocess,andVMwareStudiofollowsthis restriction.Toaddmorethan15disks,addthemaftertheVMis builtbyVMwareStudio. UsethenumericIPaddresstoconnecttotheprovisioningengine orupdaterepositoryserver. Ensurethatifyouassignapartitionwithsize=growthatitisthe lastpartitiononthedisk. Thisproblemcanbecausedbynotchangingtheversionnumber [Link],butthe [Link] createanupdatepackage,changetheversionnumber. Theproblemcanalsooccuriftheapplicationpackagesareofthe sameversion,butdifferentchecksum
TheStudioWebconsoledoesnotaccepthostnames, forexamplehostnamescontainingunderscore(_). Diskpartitioningforyourvirtualmachinehas partitionsassignedtothewrongmounts. Updatepackagebuildfails,butaZIPorOVFfileis created.
WhenbuildingRHEL,CentOS,orSLES,themessage Error:RPMfailed:...[Link]...conflict appearswhileinstallingVMwareTools. Whenprovisioningavirtualmachineonan ESX/ESXihostthatismanagedbyvCenterServer,the buildissuccessful,butanorphanedinstanceofthe machineremainsintheinventoryafterwards. Thebuildfailswiththefollowingfaultstring: [Link]
[Link] [Link] duringthebuildprocess. Theworkaroundistodeletetheorphanedvirtualmachinefrom theinventoryusingthevSphereClientconnectedtovCenter. Nexttime,provisionthroughtheESX/ESXihostsmanaging vCenterServertoavoidthisproblem. ProvisioningthroughESXiwiththefreeESXilicenseproduces thiserrorbecausetherequiredESXcapabilitiesforprovisioning [Link](whichexpiresina givenperiod)orapaidlicensewillsolvethisissue. Checkthattherearenonetworkingrelatedproblembyrunning sshfromtheStudioappliancetotheWorkstationhost. [Link] instance,enter/usr/binnot/usr/bin/vmrunforLinux,or enterC:\ProgramFiles\VMware\VMwareWorkstationnot C:\ProgramFiles\VMware\VMwareWorkstation\[Link] forWindows. IfthesymptomwasthatthetransientVMcouldnotbepowered on,orthattheVMwasnotseenontheWorkstationconsole, verifythattheuserenteredintheBuildSettings(forWorkstation provisioning)matchestheuserwhoiscurrentlyrunningthe [Link], 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! [Link]: Login error: Insufficient permissions in host operating system [Link]: VMware Server unrecoverable error: (vmx) [Link] withoutlocaladministrativeprivilegesdoingabuild. [Link]: Cannotgettemporarydirectoryforlogfile. [Link]. Resolution [Link] prerequisitessectionforPrerequisitesonpage 19. Port7butalsobeopenonthehostoftheUpdateRepository. EnsurethatyouhavethecorrectcredentialsforVMwareServer intheBuildSettings. SelectauserwithWindowsadministrativeprivilegesforthe VMwareServersectioninthebuildprofile.
MakesuretogiveAdministrativeprivilegestotheuseronthe [Link] specifiedintheSetupTabinVMwareServerSectionduring buildprofilecreation,forauthenticatingtoVMwareServerand remotelycontrollingVMprovisioningusingtheVIXprotocol. Onecauseisthatduringdiscovery,disksizeswerecalculatedtoo [Link] cylinderstoMB,virtualdisksizeissometimescalculatedoneor [Link] ofthedisksinthegeneratedbuildprofiletobematchwhatis [Link]:capacity attributeofDiskelementsintheDiskSection_Typesection. //ovf:Envelope/Section[@xsi:type="ovf:DiskSection_ Type"]/Disk/@ovf:capacity
AfterexistingVMdiscoveryandimport,theVM builtfromitcannotdeploy,returninganI/Oerror [Link]/ESXi 4.1,theerrorisproperlyreportedascapacityofdisk islargerthanrequested.
Thebuildfailswithamessagelikethis: STUDIOABORT:Error:Unabletoinstallpackage pkg-name Troubleshooting VM Power-On VMwareStudioappliancedoesnotgetanIPAddress assigned. Duringthefirstbootofavirtualmachine,thevirtual machinestopsrunningbeforereachingthelogin [Link] FirstBootScriptbeingskipped. ALinuxVMcreatedbyVMwareStudioinOVF format,whenimportedintoVMwareWorkstation withtheWorkstationConversionWizard,failsto [Link] thattheBuslogicSCSIadapterisnotsupported. WhenyouprovisiononWorkstationorServer1.0.x andchecktheRetainTransientVMoption,which callsthedebugCLIflag,thetransientVMleftafter [Link], andtheprovisioningagentshowssignsofexecuting, buttheVMsoonpowersdownsoyoueffectively cannotdoanythingwithit. AfterprovisioningthetransientVMgoesoffline, looksforthepostOSinstallationlogfile,butdoesnot findit,sothebuildfails. AfteryousetanappliancetouseastaticIPaddress, itsIPaddressmightreverttotheDHCPsettingthat itusedpreviously.
Thismighthappenwhentheconfigurationfilesinaprevious buildgetoutofsyncwiththoseinanupdatedpackage. Thesolutionistomodifythepreinstallscripttoremoveand purgetheoldpackage.
GotoVMwareStudioconsole,andusetheConfigureNetwork optiononVMwareStudiowelcomescreen. Discardthevirtualmachineandstartoverwiththevirtual machineOVForZIPfile.
ToworkaroundthisknownissueintheVMwareConverter versionthatsupportstheWorkstationConversionWizard,edit [Link]. [Link] line,andpowerontheVM. [Link] availabletothetransientVM,sotheprovisioningagentcannot [Link].A workaroundistoreconfiguretheVMsoitsCDROMconnectsto [Link],rebuildandreboot [Link], theVMwillbootandfunctionasyouexpect. Thecausecouldbeatemporarylossofnetworkconnectivity,or [Link]. 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 [Link] VMsdeployedundervCenterServer,whenyou changenetworksettingswiththebluescreenlogin insteadofwiththeWebconsoleUI. WhenyoudeployaVMundervCenterServer,you aregivenachoiceofnetworkingconfiguration (DHCP,Fixed,orTransient)andyoumayassignan [Link],VAMI allowstheUItodonetworkreconfigurationofthe [Link] [Link] thattellstheVAMIcoderunatboottimethat networkingwasreconfiguredintheVM,soignore thenetworkparametersfromvCenterServer. ThisworksfineifyouusetheWebconsoleUIto [Link],thebluescreen networkconfigurationdoesnotsetthisflag,sothe nexttimetheVMisbooted,networkingparameters aresettotheirstatewhentheVMwasfirstdeployed. [Link], changethevalueoftheovfattributeinthenetworkelementof /opt/vmware/etc/vami/vami_ovf_info.xmlfromtrueto [Link],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 [Link]/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 [Link] StartedwithVMwareStudioPluginforEclipseonpage 69. ItispossiblethatEclipseistryingtoupdateorinstallplugins [Link] 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 [Link] 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:
[Link], 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 [Link] description 57 services for system, network, update 56 [Link] 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.