Prepare the OVF template

Prepare the OVF template

To deploy Mirantis Container Cloud on a vSphere-based environment, the OVF template for cluster machines must be prepared according to the following requirements:

  1. The VMWare Tools package is installed.

  2. The cloud-init utility is installed and configured with the specific VMwareGuestInfo data source.

  3. The virt-who service is enabled and configured to connect to the VMWare vCenter Server to properly apply the RHEL subscriptions on the nodes.

The following procedures describe how to meet the requirements above either using the Container Cloud script or manually.

To prepare the OVF template using the Container Cloud script:

  1. Prepare the Container Cloud bootstrap and modify vsphere-config.yaml.template and templates/vsphere/cluster.yaml.template as described in Bootstrap a management cluster, steps 1-9.

  2. Download the RHEL 7.8 DVD ISO from the RedHat Customer Portal.

  3. Export the following variables:

    1. The packer user name and password. For details, see Prepare the VMWare deployment user setup and permissions.

    2. The virt-who user name and password.

    3. The path to the RHEL 7.8 DVD ISO file.

    4. The vSphere cluster name.

    For example:

    export KAAS_VSPHERE_ENABLED=true
    export VSPHERE_RO_USER=virt-who-user
    export VSPHERE_RO_PASSWORD=virt-who-user-password
    export VSPHERE_PACKER_USER=packer-user
    export VSPHERE_PACKER_PASSWORD=packer-user-password
    export VSPHERE_PACKER_ISO_FILE=$(pwd)/rhel-7.8.dvd.iso
    export VSPHERE_CLUSTER_NAME=vsphere-cluster-name
  4. Prepare the OVF template:

    ./ vsphere_template
  5. After the template is prepared, set the SET_VSPHERE_TEMPLATE_PATH parameter in templates/vsphere/machines.yaml.template as described in Bootstrap a management cluster.

To prepare the OVF template manually:

  1. Run a virtual machine on the vSphere data center from the official RHEL 7.8 server image. Specify the amount of resources that will be used in the Container Cloud setup. A minimal resources configuration must match the requirements for a vSphere-based Container Cloud cluster.

  2. Select minimal setup in the VM installation configuration. Create a user with root or sudo permissions to access the machine.

  3. Log in to the VM when it starts.

  4. Attach your RHEL license for Virtual Datacenters to the VM:

    subscription-manager register
    # automatic subscription selection:
    subscription-manager attach --auto
    # or specify pool id:
    subscription-manager attach --pool=<POOL_ID>
    # verify subscription status
    subscription-manager status
  5. Select from the following options:

    • Prepare the operating system automatically:

      1. Download the automation script:

        curl  v1.1.1/ | \
        base64 -d >
        chmod +x
      2. Export the vCenter Server credentials of the read-only user. For example:

        export VC_SERVER=''
        export VC_USER='domain\vmware_read_only_username'
        export VC_PASSWORD='password!23'
        # optional parameters:
        export VC_HYPERVISOR_ID=hostname
        export VC_FILTER_HOSTS=","
        export VCENTER_CONFIG_PATH="/etc/virt-who.d/vcenter.conf"
      3. Run the installation script:

    • Prepare the operating system manually:

      1. Install open-vm-tools:

        yum install open-vm-tools -y
      2. Install and configure cloud-init:

        1. Download the VMwareGuestInfo data source files:

          curl | \
          base64 -d >
          curl | \
          base64 -d > 99-DataSourceVMwareGuestInfo.cfg
        2. Add 99-DataSourceVMwareGuestInfo.cfg to /etc/cloud/cloud.cfg.d/.

        3. Depending on the Python version on the VM operating system, add to the cloud-init sources folder.

        4. Obtain the cloud-init folder on RHEL:

          yum install cloud-init -y
          python -c 'import os; from cloudinit import sources; print(os.path.dirname(sources.__file__));'
      3. Prepare the virt-who user configuration:


        For details about the virt-who user creation, see Prepare the VMWare deployment user setup and permissions.

        1. Install virt-who:

          yum install virt-who -y
          cp /etc/virt-who.d/template.conf /etc/virt-who.d/vcenter.conf
        2. Set up the file content using the following example:


          virt-who configuration parameters




          Name of the vCenter data center.


          Specifies the connection of the defined virt-who user to the vCenter Server.


          The FQDN of the vCenter Server.


          The virt-who user name on the vCenter Server with the read-only access.


          The virt-who password encrypted by the virt-who-password utility using the virt-who-password -p <password> command.


          The organization that the hypervisors belong to.


          Specifies how to identify the hypervisors. Use a host name to provide meaningful host names to the Subscription Management. Alternatively, use uuid or hwuuid to avoid duplication in case of hypervisor renaming.


          List of hypervisors that never run RHEL VMs. Such hypervisors do not have to be reported by virt-who.

  6. Remove the RHEL subscription from the node.

    subscription-manager remove --all
    subscription-manager unregister
    subscription-manager clean
  7. Shut down the VM.

  8. Create an OVF template from the VM.

Now, proceed to Bootstrap a management cluster.