How to Create a Centos 8 VM Template for VMware Automation?

Summary: This guide discloses manual steps to create a CentOS 8 VM Template to automate VMware vSphere.

 

Introduction

Creating a CentOS 8 VM template for VMware automation involves a series of steps to prepare the virtual machine (VM) and configure it according to your requirements. A VM template is a preconfigured virtual machine that can quickly deploy multiple instances with consistent settings. In this guide, we’ll create a CentOS 8 VM template for VMware automation. Let’s get started!

Prerequisites   

  • Ensure you have a VMware environment, such as VMware vSphere or VMware Workstation, which allows you to create and manage virtual machines.
  • Download the CentOS 8 ISO image from the official CentOS website or a trusted mirror. Make sure you choose the appropriate version, such as CentOS 8.4.
  • Obtain the VMware Tools ISO for CentOS 8. You can download this from the VMware website or extract it from the VMware product installation media.

Once you have these prerequisites, you can proceed to the next step.

WGS VMware WHMCS Module

Steps to Create the CentOS 8 VM Template:

Step 1. Download The ISO File

Step 2. Login into your VMware ESXi

Step 3. Upload the ISO Image

Step 4. Create a VMware ESXi VM

Step 5. Installation of CentOS-8 Operating System

Step 6. Installation of VMware Tools

Step 7. Convert the VM to Template


Simple Steps to Build Centos 8 VM Template

In the subsequent section, we will disclose the simple steps to create CentOS 8 VM template:

Step 1. Download the ISO File

1. Click on the official website of CentOS: –

Link: https://www.centos.org/download/

Centos 8 VM Template

    • Step 2. Now, Login into Your VMware ESXi

      Centos 8 VM Template

    • Step 3. Upload the ISO Image to VMware ESXi Datastore

      1. Click on the Storage button, then click on the Datastore browser.

      Centos 8 VM Template

      2. Click on the Create Directory and create the folder with the name of iso

      Centos 8 VM Template

      3. Click on the Upload button

      Centos 8 VM Template

      4. Then, choose the CentOS-8 ISO image from your local computer and click on the Open button.

      Centos 8 VM Template

      Step 4. Create a VMware ESXi Virtual Machine for CentOS 8 Installation

      1. Click on the created / RegisterVM

      Centos 8 VM Template

      2. Then Select the Option: – Create a new virtual machine and click on Next.

      Centos 8 VM Template

      3. Enter VM name and select the Guest OS family to Linux and Guest OS version to CentOS 8 (64-bit). Then, click on Next.

      Centos 8 VM Template

      4. Select the datastore and click on Next.

      Centos 8 VM Template

      5. Configure the virtual machine hardware and click on CD/DVD Drive 1 and browse the CentOS-8 ISO file from the datastore then click on Next.

      Centos 8 VM Template

      6. Then choose the ISO file.

      Centos 8 VM Template

      5. Once it is done then click on Next and click on the Finish button.

      Now the new VM should be created on your VMware-ESXI. Click on Virtual Machine.

      Centos 8 VM Template

    • Step 5. Installation of CentOS-8 Operating System

      1. For starting the installation of OS, click on the VM or Power on the button.

      Centos 8 VM Template

      2. Click on Install CentOS Linux 8.

      vmware esxi
      3. For now, the next entire installation is in graphical mode. Select any language according to your preference and click on the Continue button.

      Centos linux 8 dashboard

      Click on the Installation Destination.

      Centos 8 VM Template

      4. Click on the Installation Destination, then select the Automatic option under the Storage Configuration and select the VMware Virtual disk. After this click on the Done button.

      installation destination

      5. Click on the Software Selection.

      installation summary in centos linux 8 installation

      6. Next select the Server option for the Environment of Operating system and select the Done button.

      centos linux 8 installation

      7. Now we configure the Network Configuration. Click on the Network & Host Name.

      Centos 8 VM Template

      8. Enter the Host Name check on the Configure button.

      Centos 8 VM Template

      9. Click on the IPv4 Settings and select the Manual option.

      Centos 8 VM Template

      10. Now configure the IP Address according to your network. Click on the Save button and then click on the Done button.

      Centos 8 VM Template

      11. In the last, Click on the Begin Installation.

      Centos 8 VM Template

      12. Then enter the Root Password.

      Centos 8 VM Template

      13. Once the installation is done, click on the Reboot button.

      CentOS Linux 8 Installation
      After all steps, the Virtual Machine is ready to boot CentOS-8 from the virtual hard drive. After that, Enter the username and password.

    • Step 6. Installation of VMware Tools on CentOS/RHEL 8 VMware Virtual Machines

      1. On VMware ESXI, click on the Action button > Guest OS > Install VMware Tools. After the Install VMware Tools option, CD-Drive is automatically connected with your OS.

      Centos 8 VM Template

      2. Confirm the CD-Drive is connected properly. Run the below command: –

      # lsblk

      3. After confirmation, run the below command:-
      # mount /dev/sr0 /mnt
      # lsblk

      4. After the CD-Drive is mounted on /mnt directory. Run the below command: –

      # cp -rv VMwareTools-10.3.23-17030940.tar.gz /tmp
      # ls /tmp

      5. Extract the VMwareTools-10.3.23-17030940.tar.gz file in /tmp directory.
      Run the below command.

      # cd /tmp
      # tar -xvzf VMwareTools-10.3.23-17030940.tar.gz

      6. After extracting the file. We need to run the script under /tmp/vmware-tools-distrib
      directory. Execute the command that are mentioned below:-
      # cd /tmp/vmware-tools-distrib
      # ./vmware-install.pl

      7. Check whether VMware tools are installed or not. Run the below command: –

      # systemctl status vmware-tools
                                    OR
      # systemctl status open-vm-tools
      # systemctl start vmware-tools

      !!!!! Reboot the Virtual Machine by running the command > init 6 !!!!!

      Step 7. Convert the Virtual Machine to Template

      After the installation of the virtual machine and VMware tools on it. We are going to convert the virtual machine to a template.

      1. Go to your Vcenter server.

      2. After login you can see your virtual machine under the VMware ESXi (host).

      Right-click on the virtual machine, then go to the Template option and choose the Convert to Template.

    • Centos 8 VM Template


Recommended Articles:

Looking for Something More? We can help!

Our WHMCS experts are ready to accept your custom requirements.

Your questions, our answers

A VM template is a preconfigured and pre-installed virtual machine that can be used as a starting point for creating new virtual machines. It includes the base operating system and any additional software or configurations required for a particular environment.  

Creating a CentOS 8 VM template can save time and effort when installing many virtual machines with the same setup. It makes it simple to swiftly provide additional virtual machines while ensuring uniformity throughout your virtual infrastructure.  

Yes, many virtualization solutions include APIs or automation tools that let you automatically install virtual machines using templates. The provisioning process may be automated using scripting languages or configuration management systems, making it go more quickly and effectively. 

Have more questions?
Our support team loves answering questions