Skip to content

VMware

Warning

Since OpenShift 4.3 it is not supported anymore to setup static IP address via Ignition configuration. You have to use the kernel boot args: Creating Red Hat Enterprise Linux CoreOS (RHCOS) machines

OVA do not support static ip's yet! - target 4.6 - BZ 1785122

Guestinfo property: guestinfo.afterburn.initrd.network-kargs

How you deploy OpenShift 4 VM's on VMware

iPXE, static ip addresses and govc

https://github.com/openshift-examples/ipxe

Kudos to my colleague Rodrigo Alvares

govc

Go CLI for vSphere/VMware - https://github.com/vmware/govmomi/releases

Create a VM Template via the OVA and copy via govc

Note

Use static DHCP via mac address

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
export GOVC_URL='vcenter-ip'
export GOVC_USERNAME='administrator@vsphere.local'
export GOVC_PASSWORD='VMware99!'
export GOVC_INSECURE=1
export GOVC_DATACENTER="DC"

CLUSTER_NAME="ocp4"
CLUSTER_DOMAIN="example.com"
RHCOS_TEMPLATE="rhcos-4.3.8-x86_64-template"

VM_NETWORK="NETWORK"
VM_DATASTORE="DATASTORE"
VM_DATACENTER="DC"
VM_FOLDER="$CLUSTER_NAME"

WORKER2_MAC='00:50:56:23:F7:21'
WORKER2_NAME='worker-2'


worker=$(cat worker.ign | base64 -w0)
govc vm.clone -vm ${RHCOS_TEMPLATE} \
    -annotation=WorkerNode02 \
    -c=4 \
    -m=16384 \
    -net ${VM_NETWORK} \
    -net.address ${WORKER2_MAC} \
    -on=false \
    -folder=${VM_FOLDER} \
    -ds="${VM_DATASTORE}" \
    ${WORKER2_NAME}.${CLUSTER_NAME}.${CLUSTER_DOMAIN}

govc vm.change \
    -e="guestinfo.ignition.config.data=${worker}" \
    -vm=${WORKER2_NAME}.${CLUSTER_NAME}.${CLUSTER_DOMAIN}

govc vm.power -on=true \
    {WORKER2_NAME}.${CLUSTER_NAME}.${CLUSTER_DOMAIN}

ovftool

Create VM direct from OVA:

Note

The example use static IP via ignition config - since OCP 4.3 not supported anymore!

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 ovftool \
    --acceptAllEulas \
    --name=${NAME}.$DOMAIN \
    --datastore=$GOVC_DATASTORE \
    --net:'VM Network'='VM Network' \
    --vmFolder=$GOVC_FOLDER \
    --diskMode=thin \
    --numberOfCpus:'*'=8 \
    --diskSize:'*'=122880 \
    --memorySize:'*'=16384 \
    --prop:guestinfo.ignition.config.data=$IGN_CONFIG \
    --prop:guestinfo.ignition.config.data.encoding=base64 \
    --allowExtraConfig \
    --extraConfig:disk.enableUUID=true \
    --powerOn \
    /var/www/html/rhcos-4.1.0-x86_64-vmware.ova \
    "vi://${GOVC_USERNAME}:${GOVC_PASSWORD}@xxx.vcenter.example.com/DC/host/foo/Resources"

Terraform

Warning

Terraform use static IP via ignition config - since OCP 4.3 not supported anymore!

https://github.com/openshift/installer/tree/master/upi/vsphere

Resources


Last update: September 29, 2020