Install Ansible automation portal on VMware vSphere
Deploy the Ansible automation portal appliance on VMware vSphere.
Prerequisites
- VMware vSphere/vCenter with permissions to create VMs and upload files to a datastore.
- The Ansible automation portal disk image in VMDK format, available from the Red Hat Ansible Automation Platform downloads page.
- Your
cloud-inituser-data and meta-data files prepared with Ansible Automation Platform credentials and SSH keys. See Prerequisites for deploying Ansible automation portal on RHEL in the related links below. - An SSH key pair for appliance access.
genisoimageinstalled on your local machine (for creating the cloud-init ISO).- The
govcCLI tool installed and configured with your vSphere credentials.
Installing the appliance
- Upload the VMDK disk image to a datastore using the
govcCLI:$ govc import.vmdk disk.vmdk <folder_name>Note:The Ansible automation portal VMDK uses stream-optimized format and requires format conversion during upload. Do not upload VMDK disk images by using the vSphere web client orgovc datastore.upload— these methods copy the file without converting it, producing an unusable 0 MB disk. Thegovc import.vmdkcommand converts the image automatically. This restriction applies to VMDK disk images only, not to ISO files. - Save your
cloud-inituser-data file ascloud-init-user-data.yaml. Use the template from Prerequisites for deploying Ansible automation portal on RHEL in the related links below. - Create a cloud-init ISO from your user-data file.
VMware delivers cloud-init configuration to the VM as a small ISO disk image labeled
cidata. Cloud-init expects two files on the ISO:user-data(your configuration) andmeta-data(instance identity):$ cp cloud-init-user-data.yaml user-data $ echo "instance-id: automation-portal" > meta-data $ genisoimage -output cloud-init.iso -volid cidata -joliet -rock user-data meta-dataNote:Cloud-init runs only once per instance ID. If you need to re-apply cloud-init configuration to an existing VM, change theinstance-idvalue in themeta-datafile to a new unique value (for example,automation-portal-2), regenerate the ISO, and reattach it before rebooting. - Upload the cloud-init ISO to the same datastore:
$ govc datastore.upload cloud-init.iso <folder_name>/cloud-init.iso - Create a virtual machine:
- Right-click the cluster or host and select New Virtual Machine > Create a new virtual machine.
- Set the following example values. Replace the name, CPU, and memory to match your environment:
Field Example value Name automation-portalGuest OS Red Hat Enterprise Linux 9 (64-bit) CPU 6 cores Memory 24 GB Hard disk Remove the default disk Network Select your VM network - Click Next and then Finish.
- Attach the VMDK disk and cloud-init ISO to the VM:
- Edit the VM settings.
- Click Add New Device > Existing Hard Disk and browse to the imported VMDK in the <folder_name> folder on the datastore.
- Click Add New Device > CD/DVD Drive. Select Datastore ISO File and browse to the cloud-init ISO.
- Select Connect At Power On for the CD/DVD drive.
- Save the VM settings.
- Power on the VM. First-boot configuration takes 2-3 minutes.
Verification
- Open the VM console in vSphere or SSH into the VM and confirm that all services are running:
$ sudo ansible-portal status - Access the portal URL from your browser.
Using VMware guestinfo properties
Use this method for VMware vSphere deployments as an alternative to the ISO method.
- Base64-encode your cloud-init user-data file:
$ base64 -w 0 user-data > user-data.b64 - Create a metadata file with an instance ID and Base64-encode it:
$ echo '{"instance-id": "automation-portal"}' > meta-data $ base64 -w 0 meta-data > meta-data.b64 - Set the following guestinfo properties on the virtual machine in vSphere:
guestinfo.userdata = "<contents-of-user-data.b64>" guestinfo.userdata.encoding = "base64" guestinfo.metadata = "<contents-of-meta-data.b64>" guestinfo.metadata.encoding = "base64"Set these properties using the vSphere web client (Edit Settings > VM Options > Advanced > Configuration Parameters).
- Power on the virtual machine. Cloud-init reads the guestinfo properties and applies the configuration on first boot.
Note:
Cloud-init runs only once per instance ID. If you need to re-apply cloud-init configuration to an existing VM, change the
instance-id value in the metadata, re-encode it, and update the guestinfo.metadata property before rebooting.
For additional native cloud-init configuration options, such as network configuration, see the cloud-init VMware datasource documentation in the related links below.