Quick overview on how to prepare CentOS-8 VM Template with cloud-init for vSphere.
Create CentOS-8 VM Template with cloud-init for vSphere
CentOS-8 image in qcow2 format can be found here. Use one of the GenericCloud
image links.
wget https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.2.2004-20200611.2.x86_64.qcow2
# or
curl -L https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.2.2004-20200611.2.x86_64.qcow2
qemu-img convert -O vmdk -o subformat=streamOptimized "CentOS-8-GenericCloud-8.2.2004-20200611.2.x86_64.qcow2" "centos-8-cloud-init.vmdk"
export GOVC_URL="vcenter.example.com"
export GOVC_USERNAME="username@example.com"
export GOVC_PASSWORD='password'
export GOVC_INSECURE="true"
export GOVC_DATACENTER="DC1"
export GOVC_DATASTORE="/DC1/datastore/data_store1"
export GOVC_RESOURCE_POOL="/DC1/host/192.168.3.2/Resources"
export GOVC_FOLDER="/DC1/vm/templates"
# useful commands
# show available pools
govc find / -type p
# show available folders
govc find / -type f
# show available datastores
govc find / -type s
govc import.vmdk "centos-8-cloud-init.vmdk"
govc datastore.disk.inflate "centos-8-cloud-init/centos-8-cloud-init.vmdk"
Create a new virtual machine using that image with vSphere WebUI. Pay attention:
GenericCloud
image of CentOS-8 doesn’t have default SCSI driver.During the Customize Hardware step:
ADD NEW DEVICE
, select Existing Hard Disk
and select the disk previously created. Select SATA controller for this diskADD NEW DEVICE
, select Hard Disk
, set 1 GB of size. Use SCSI controller for this disk. Kublr is not going to use this disk for data, so you can set Disk Provisioning
to Thin Provision
.Increase the boot disk size to 40 GB or more. Default size of 10Gb is too small. You cannot increase the boot disk when creating a k8s cluster, because it is installed on the SATA controller
Convert VM to VM Template.
govc vm.markastemplate ${VM_NAME}
When creating a cluster with this image, open Advanced Options
and set Network Interface
to eth0
for each node group (including master) using this image.
CentOS 8 is only supported as a technical preview, and you can use this OS only with agent versions: 1.17.3
, 1.17.4
, 1.17.7
.
And don’t forget to set spec.network.provider
to cni-calico
and disable the node local dns component by setting spec.network.enableLocalDns
to false
. Read about it in our release notes.