CentOS 5.4 support on VMware Studio 2.0

Version 3

    In order to add CentOS 5.4 to be supported under VMware Studio 2.0 you must add it to the supported OS profiles.

    I hope this helps someone.

     

    #1 Copy the DVD ISO to /opt/vmware/www/ISV/ISO/

     

     

    #2  Go to /opt/vmware/etc/build/templates/centos/5 and create directory “4” as the latest version can also add “4_x86_64”.

     

     

    #3 Create build_profile.xml as sample below. The latest md5sum must exist in the line that reads:

     

     

    <vadk:ISO  vadk:path="file:///opt/vmware/www/ISV/ISO/CentOS-5.4-i386-bin-DVD.iso"  vadk:md5sum="071e18754c2fb066c526672f9aea0515" vadk:containFiles=""/>

     

     

    So md5sum="071e18754c2fb066c526672f9aea0515" is the latest CentOS 5.4 DVD ISO md5.

     

     

    #4 Create build_profile.xml inside /opt/vmware/etc/build/templates/centos/5/4/

     

     

    <ovf:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

     

    xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 /opt/vmware/etc/build/schemas/vadk.xsd"

     

    xmlns:vadk="http://www.vmware.com/schema/vadk"

     

    xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"

     

    xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"

     

    xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"

     

    xmlns:vmw="http://www.vmware.com/schema/ovf"

     

    ovf:version="0.7.0"

     

    vadk:version="1.1">

     

     

    <References></References>

     

     

    <!--

     

    The Annotation element of the AnnotationSection_Type is the text

     

    that will be presented as the Description of the VM.

     

    -->

     

    <Section xsi:type="ovf:AnnotationSection_Type">

     

    <Info></Info>

     

    <Annotation></Annotation>

     

    </Section>

     

     

    <Section xsi:type="ovf:ProductSection_Type" ovf:required="false">

     

    <Info>VM ISV branding information</Info>

     

    <Product>CentOS Linux 5.4</Product>

     

    <Vendor>Independent Software Vendor, Inc.</Vendor>

     

    <!--

     

    Version is the actual product version in the

     

    form X.X.X.X where X is an unsigned 16-bit integer.

     

     

    FullVersion is a descriptive version string

     

    including, for example, alpha or beta designations

     

    and other release criteria.

     

    -->

     

    <Version>1.0.0.0</Version>

     

    <FullVersion>1.0.0.0 alpha</FullVersion>

     

    <ProductUrl></ProductUrl>

     

    <VendorUrl></VendorUrl>

     

    <AppUrl>

    http://${app.ip}/</AppUrl>

     

    <Category>Application</Category>

     

    </Section>

     

     

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

     

    <Info></Info>

     

    <vadk:VendorUUID></vadk:VendorUUID>

     

    <vadk:ProductRID></vadk:ProductRID>

     

    <vadk:AppUrlName>Application Home</vadk:AppUrlName>

     

    <vadk:Logo></vadk:Logo>

     

    <vadk:LogoUrl></vadk:LogoUrl>

     

    <vadk:WelcomeText>${app.name} - ${app.version}

     

     

    To manage this VM browse to ${vami.url}

     

    </vadk:WelcomeText>

     

     

    </Section>

     

     

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

     

    <Info></Info>

     

    <vadk:CommonName>Self-Signed by YourCompany, Inc.</vadk:CommonName>

     

    <vadk:OrganizationName>YourCompany, Inc.</vadk:OrganizationName>

     

    <vadk:OrganizationalUnitName>VM Division</vadk:OrganizationalUnitName>

     

    <vadk:CountryName>US</vadk:CountryName>

     

    </Section>

     

     

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

     

    <Info>VAMI Specific Information</Info>

     

    <vadk:Services>

     

    <vadk:Service vadk:name="core" vadk:version="2.0.0.0" vadk:tabOrder="0"/>

     

    <vadk:Service vadk:name="update" vadk:version="2.0.0.0" vadk:tabOrder="0"/>

     

    <vadk:Service vadk:name="system" vadk:version="2.0.0.0" vadk:tabOrder="1"/>

     

    <vadk:Service vadk:name="network" vadk:version="2.0.0.0" vadk:tabOrder="2"/>

     

    </vadk:Services>

     

    <vadk:WebServer vadk:httpsPort="5480"/>

     

    <vadk:ViewCustomization>

     

    <vadk:FooterLeft><!--Html for the footer left  section, example ISV small logo --></vadk:FooterLeft>

     

    <vadk:FooterCopyright><!--Html for footer middle  section, ISV copyright section.--></vadk:FooterCopyright>

     

    </vadk:ViewCustomization>

     

    <vadk:ShowEULA>true</vadk:ShowEULA>

     

    </Section>

     

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

    <vadk:VMXFilename>VM.vmx</vadk:VMXFilename>

    <vadk:DistributionFormat vadk:format="ovf" vadk:filename="VM" vadk:directory="VM"/>

    <vadk:ApplicationPackages>
    <vadk:url>http://http://VADK.localIP/ISV/appliancePackages</vadk:url>
    <vadk:url>http://http://VADK.localIP/vmware-open-vm-tools/centos/5/3</vadk:url>
    </vadk:ApplicationPackages>

    <vadk:OSPackages>    <!-- Additional OS packages needed by the ISV's application -->
    <vadk:Package vadk:name="openssh-server"/>
    <vadk:Package vadk:name="openssh-clients"/>
    </vadk:OSPackages>

    <vadk:BootActions>
    <vadk:FirstBoot>
    #!/bin/bash
    #Un comment to send the output of this script to a logfile
    #exec > /opt/vmware/var/log/firstboot 2>&1

    echo This script is executed on first boot only.

    #Un comment to run subsequent boot script after first boot
    #/opt/vmware/etc/isv/subsequentboot
    </vadk:FirstBoot>
    <vadk:SubsequentBoot>
    #!/bin/bash
    #Un comment to send the output of this script to a logfile
    #exec > /opt/vmware/var/log/subsequentboot 2>&1

    echo This script is executed on all boots, except the first one.
    </vadk:SubsequentBoot>
    </vadk:BootActions>

    <vadk:Users>
    <vadk:User vadk:username="root" vadk:password="" vadk:passwordFormat="plaintext"/>
    </vadk:Users>
    </Section>

    <Section xsi:type="vadk:IpAssignmentSection_Type">
    <Info>Supported IP assignment schemes</Info>
    <vmw:IpAssignmentSection
    ovf:required="false" vmw:protocols="IPv4" vmw:schemes="ovfenv,dhcp">
    <Info>Supported IP assignment schemes</Info>
    </vmw:IpAssignmentSection>
    </Section>

    <Section xsi:type="vadk:PropertySection_Type">
    <Info/>
    </Section>

    <Section xsi:type="vadk:AnyOVFSection_Type">
    <Info>
    Unknown OVF elements in this element will be passed directly
    to the OVF output descriptor without interpretation
    </Info>
    </Section>

    <Section xsi:type="vadk:UpdateSection_Type">
    <Info></Info>

    <vadk:Repository vadk:url="" vadk:username=""
    vadk:password="" vadk:passwordFormat="plaintext"/>

    <!--
    <vadk:RepositoryStagingServer vadk:hostname=""
    vadk:fileLogin="root" vadk:filePassword=""
    vadk:filePasswordFormat="plaintext" vadk:fileProto="scp"
    vadk:filePath="/tmp"/>
    -->

    <vadk:Info></vadk:Info>

    <!--
    <vadk:RepositoryExport vadk:format="zip"
    vadk:filename="VADK_Update"/>
    -->

    <vadk:PreInstallShellScript>#!/bin/sh
    #Sample pre install update script
    #This script will be executed with the following arguments:

    1. $1 - version of VM before update
    2. $2 - version of VM trying to be installed

    echo "Installing update from version $1 to version $2"

     

    #exit with value of 0 to allow update to continue

     

    exit 0

     

    </vadk:PreInstallShellScript>

     

    <vadk:PostInstallShellScript>#!/bin/sh

     

    #Sample post install update script

     

    #This script will be executed with the following arguments:

     

    1. $1 - version of VM before update
    2. $2 - version of VM trying to be installed
    3. $3 - status of update process

    #

    #The Status in $3 will indicate to success of failure of the update:

    1. 0 - all update steps are successful
    2. 1 - pre install script failed, package test and installation skipped
    3. 2 - pre install success, package test failed, installation skipped
    4. 4 - pre install and package test success, package installation failed

    #

    #A Status of 2 is likely caused by a package dependency conflict.  A Status of 4

    #is likely caused by a failed package install script.

     

    if

    $3 -eq 0 ; then

     

    echo "Finished installing version $2"

     

    else

     

    echo "Failed with status of $3 while installing version $2"

     

    echo "VM version is still $1"

     

    fi

     

     

    #Exit with a value of 0 to allow the VM version to be changed and set the final

     

    #update status to success.

     

    exit 0

     

    </vadk:PostInstallShellScript>

     

     

    </Section>

     

     

    <!-- Defined by  CIM_OperatingSystem.OsType -->

     

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

     

    <Info>Guest Operating System</Info>

     

    <Description>CentOS Linux 5.4</Description>

     

    </Section>

     

     

    <Section xsi:type="ovf:VirtualHardwareSection_Type">

     

    <Info>Virtual Hardware Requirements</Info>

     

    <System>

     

    <vssd:VirtualSystemType>vmx-04</vssd:VirtualSystemType>

     

    </System>

     

    <Item>

     

    <rasd:Caption>1 virtual CPU</rasd:Caption>

     

    <rasd:Description>Number of virtual CPUs</rasd:Description>

     

    <rasd:InstanceId>1</rasd:InstanceId>

     

    <rasd:ResourceType>3</rasd:ResourceType>

     

    <rasd:VirtualQuantity>1</rasd:VirtualQuantity>

     

    </Item>

     

    <Item>

     

    <rasd:AllocationUnits>MegaBytes</rasd:AllocationUnits>

     

    <rasd:Caption>512 MB of memory</rasd:Caption>

     

    <rasd:Description>Memory Size</rasd:Description>

     

    <rasd:InstanceId>2</rasd:InstanceId>

     

    <rasd:ResourceType>4</rasd:ResourceType>

     

    <rasd:VirtualQuantity>512</rasd:VirtualQuantity>

     

    </Item>

     

    <Item>

     

    <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>

     

    <rasd:Caption>Ethernet adapter on vmnet</rasd:Caption>

     

    <rasd:Connection>Network 1</rasd:Connection>

     

    <rasd:InstanceId>3</rasd:InstanceId>

     

    <rasd:ResourceSubType>PCNet32</rasd:ResourceSubType>

     

    <rasd:ResourceType>10</rasd:ResourceType>

     

    </Item>

     

    <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>

     

    <Item>

     

    <rasd:AddressOnParent>0</rasd:AddressOnParent>

     

    <rasd:Caption>Harddisk 0</rasd:Caption>

     

    <rasd:HostResource>/disk/system</rasd:HostResource>

     

    <rasd:InstanceId>5</rasd:InstanceId>

     

    <rasd:Parent>4</rasd:Parent>

     

    <rasd:ResourceType>17</rasd:ResourceType>

     

    </Item>

     

    </Section>

     

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

    <vadk:BootArgs>
    append ks=http://VADK.unattendedCfgURL ksdevice=eth0
    method=http://http://VADK.localIP/build/http://VADK.buildID/
    initrd=initrd.img
    ip=http://VADK.ip netmask=http://VADK.nm gateway=http://VADK.gw dns=http://VADK.ns1
    lang=en_US keymap=us ramdisk_size=100000
    divider=10 clocksource=acpi_pm
    </vadk:BootArgs>

    <vadk:BootArgsDHCP>
    append ks=http://VADK.unattendedCfgURL
    ksdevice=eth0 ip=dhcp
    method=http://http://VADK.localIP/build/http://VADK.buildID/
    initrd=initrd.img
    lang=en_US keymap=us ramdisk_size=100000
    divider=10 clocksource=acpi_pm
    </vadk:BootArgsDHCP>

    <vadk:BootFiles vadk:relPath="images/pxeboot" vadk:kernel="vmlinuz"/>

    <vadk:UnattendedInstallTemplate>
    http://VADK.vadkRoot/etc/build/templates/redhat/5/redhat5.xsl
    </vadk:UnattendedInstallTemplate>

    <vadk:PreInstallScript
    vadk:template="http://VADK.vadkRoot/etc/build/templates/centos/5/preinstall.xsl"
    vadk:output="http://VADK.stageDir/preinstall.sh"/>

    <vadk:EVMInstallScript vadk:template="http://VADK.vadkRoot/etc/build/templates/redhat/5/evm_install.xsl"/>
    <vadk:EVMConfigScript vadk:template="http://VADK.vadkRoot/etc/build/templates/redhat/5/evm_config.xsl"/>
    <vadk:EVMCleanScript vadk:template="http://VADK.vadkRoot/etc/build/templates/redhat/5/evm_clean.xsl"/>

    <vadk:PostScriptRepoList>RepositoryList</vadk:PostScriptRepoList>

    <vadk:PostScriptPackageList>PackageList</vadk:PostScriptPackageList>

    <vadk:VADKPackages vadk:path="http://http://VADK.localIP/build/http://VADK.buildID/repo/vadkPackages/"
    vadk:sourceDir="http://VADK.vadkRoot/lib/build/include/centos/5/3/"
    vadk:targetDir="http://VADK.stageDir/repo/vadkPackages/"/>

    <vadk:ISO vadk:path="file:///opt/vmware/www/ISV/ISO/CentOS-5.4-i386-bin-DVD.iso"
    vadk:md5sum="071e18754c2fb066c526672f9aea0515" vadk:containFiles=""/>

    <vadk:Distribution vadk:vendor="CentOS" vadk:OSverMajor="5" vadk:OSverMinor="3"
    vadk:arch="i386" vadk:smp="1" vadk:packageFormat="rpm"
    vadk:packageManager="yum" vadk:packageRepoDir="packageRepoDir"/>

    <vadk:OSPackages>
    <vadk:Package vadk:name="bash"/>
    <vadk:Package vadk:name="bind-utils"/>
    <vadk:Package vadk:name="boost"/>
    <vadk:Package vadk:name="chkconfig"/>
    <vadk:Package vadk:name="coreutils"/>
    <vadk:Package vadk:name="curl"/>
    <vadk:Package vadk:name="dhclient"/>
    <vadk:Package vadk:name="gawk"/>
    <vadk:Package vadk:name="grep"/>
    <vadk:Package vadk:name="initscripts"/>
    <vadk:Package vadk:name="iptables"/>
    <vadk:Package vadk:name="libicu"/>
    <vadk:Package vadk:name="libxml2-python"/>
    <vadk:Package vadk:name="module-init-tools"/>
    <vadk:Package vadk:name="ncurses"/>
    <vadk:Package vadk:name="net-tools"/>
    <vadk:Package vadk:name="openssl"/>
    <vadk:Package vadk:name="passwd"/>
    <vadk:Package vadk:name="rpm"/>
    <vadk:Package vadk:name="procps"/>
    <vadk:Package vadk:name="sed"/>
    <vadk:Package vadk:name="sudo"/>
    <vadk:Package vadk:name="sysklogd"/>
    <vadk:Package vadk:name="SysVinit"/>
    <vadk:Package vadk:name="util-linux"/>
    <vadk:Package vadk:name="wget"/>
    <vadk:Package vadk:name="which"/>
    <vadk:Package vadk:name="yum"/>
    <vadk:Package vadk:name="yum-metadata-parser"/>
    </vadk:OSPackages>
    </Section>

    <Section xsi:type="vadk:BuildSection_Type">
    <Info></Info>
    <vadk:ProvisioningSettings>  <!-- OS settings for the VM being provisioned -->
    <vadk:NetworkConnection></vadk:NetworkConnection>
    <vadk:NetworkType>dhcp</vadk:NetworkType>
    <vadk:IP></vadk:IP>
    <vadk:Netmask></vadk:Netmask>
    <vadk:Gateway></vadk:Gateway>
    <vadk:DNS1></vadk:DNS1>
    <vadk:DNS2></vadk:DNS2>
    </vadk:ProvisioningSettings>

    <!--
    vadk:path maps to the Upload Path field in the web UI. This is a local directory path on the
    physical box where the VMware Server is running. This location will be used to store
    the provisioning virtual machine for building the VM.

    vadk:filePath maps to the Registration Path field in the web UI. This is a path used by
    VMware Studio for uploading the provisioning virtual machine to the Upload Path mentioned above.

    The Registration Path and the Upload Path above must refer to same physical directory.
    -->
    <vadk:ProvisioningEngine>
    <vadk:VmhostLan vadk:hostname="" vadk:port="" vadk:hostOS=""
    vadk:login="root" vadk:password="" vadk:passwordFormat="plaintext"
    vadk:path="/tmp" vadk:datastore=""
    vadk:datacenter="" vadk:managedESX=""
    vadk:resourcePool=""
    vadk:fileLogin="root" vadk:filePassword="" vadk:filePasswordFormat="plaintext"
    vadk:fileProto="scp" vadk:filePath="/tmp"
    vadk:vmrunPath="" vadk:wsXDisplay=".0"/>
    <vadk:VmhostProduct vadk:name="" vadk:majorVersion=""/>
    </vadk:ProvisioningEngine>

    <!-- all timeouts are in seconds    -->
    <vadk:ProvisioningTimeouts vadk:boot="600" vadk:poweroff="25"  vadk:hang="7200" vadk:sshWaitTime="120" vadk:scpOperationTime="300"  vadk:scpAutoYesWaitTime="2" vadk:systemCmdWaitTime="30"  vadk:systemCmdMaxTime="7200"/>

    <vadk:PreInstallShellScript>
    #!/bin/bash
    echo pre-install shell code
    </vadk:PreInstallShellScript>

    <vadk:PostInstallShellScript>
    #!/bin/bash
    echo post-install shell code
    </vadk:PostInstallShellScript>

    <!-- example of existing vm provisioning:
    <vadk:ExistingVm  vadk:filepath="/opt/vmware/www/build/exampleBuildId/exports/zip/exampleVM.zip"  vadk:buildid="exampleBuildId" vadk:isAgentInstalled="false" />
    -->

    </Section>

    <!--
    The combination of a network device in ovf:VirtualHardwareSection_Type
    an entry in ovf:NetworkSection_Type describe a network.
    -->
    <Section xsi:type="ovf:NetworkSection_Type">
    <Info>List of logical networks used in the package</Info>
    <Network ovf:name="Network 1" ovf:id="vmnet">
    <Description>Network 1</Description>
    </Network>
    </Section>

    <!--
    The combination of a disk device in ovf:VirtualHardwareSection_Type,
    an entry in ovf:DiskSection_Type, and optionally entries in
    vadk:DiskPartitionSection_Type describe a disk, referenced by ovf:diskId
    -->
    <Section xsi:type="ovf:DiskSection_Type">
    <Info>List of the virtual disks and partitions needed</Info>
    <Disk ovf:diskId="system" ovf:capacity="2048"
    ovf:capacityAllocationUnits="MegaBytes"
    ovf:fileRef="system.vmdk"
    ovf:format="http://www.vmware.com/specifications/vmdk.html#sparse"
    />
    </Section>

    <Section xsi:type="vadk:DiskPartitionSection_Type">
    <Info></Info>
    <vadk:Partition vadk:diskId="system" vadk:bootable="1" vadk:fs="ext3" vadk:mount="/boot" vadk:size="128"/>
    <vadk:Partition vadk:diskId="system" vadk:bootable="0" vadk:fs="ext3" vadk:mount="/" vadk:size="grow"/>
    <vadk:Partition vadk:diskId="system" vadk:bootable="0" vadk:fs="swap" vadk:mount="" vadk:size="128"/>
    </Section>

    </ovf:Envelope>