Last updated 19th September 2018
This first guide will go throught:
- create a CentOS 7 ISO with a kickstart config file
- create a virtual image template inside vSphere on OVH Private Cloud Computing
- an access to a vSphere instance
- a terminal with root access for package installation. It can be a Debian under WSL, CentOS, Ubuntu, ...
The resources used to automate this guide are available here: https://github.com/ovh/docs/tree/master/pages/cloud/private-cloud/vsphere_unattended_centos_install/scripts/.
From your terminal, install
If you use
python-2, make sure to use
ansible-2.7 or above due to issue #42237 otherwise, switch to
pip install ansible pip install requests # dependency for the ansible vmware_guest module pip install PyVmomi # dependency for the ansible vmware_guest module
All variables are set in a
vars.yml file that needs to be edited before running the playbooks
govc is a Go client using the vSphere API. You can fetch the latest release from the Release page.
chmod +x, you'll need to setup at least three environmnent variables.
export GOVC_URL=https://pcc-xxx-xxx-xxx-xxx.ovh.com/sdk export GOVC_USERNAME=username export GOVC_PASSWORD=password
Tip: Edit a file
activate with the three export commands and source it
. activate from your terminal before running the scripts.
You can now try the following command
$ govc about Name: VMware vCenter Server Vendor: VMware, Inc. Version: 6.0.0 Build: 7037394 OS type: win32-x64 API type: VirtualCenter API version: 6.0 Product ID: vpx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Preparing ISO images
There will be two images.
The first one will be the unmodified Centos iso file.
There are three ISO flavors. We'll pick the DVD edition, the smallest one with the
The second one will a simple iso volume named
OEMDRV containing the
/KS.CFG file. The full documentation is on RedHat documentation page.
The above steps can be automated via
sudo apt-get install --no-install-recommends genisoimage ansible-playbook -vvv --extra-vars @vars.yml create_isos.yml
You are now ready to move the the second section.
Creating a vSphere VM template.
We'll first upload the two ISO images created in the previous step in a datastore define by the variable
Then, we'll create the virtual machine and attach two CDROM devices, each for one of the ISO files.
During the installation, to observe what is happening you can connect using the VMware Remote Console and get the vmrc link with
govc vm.console Centos7
Tip: Without VMRC, you can check if the install is done by trying to connect the the VM guest tool daemon with
govc guest.ls -l root:test -vm centos7 .
Be sure the use the proper password defined is the
Once the installation is done and the VM has rebooted, we'll eject the ISO files and convert the VM to a template.
The above can be done automated via
ansible-playbook -vvv --extra-vars @vars.yml create_template.yml
We have learn how to create a custion unattended installation CentOS ISO file and a VM template in vSphere.
The next step is to deploy our first OpenShift Origin mono-server instance.