Bala's Blog

Install CoreOS VM on VMware ESXi using OVFTool and Ignition

September 9 2018
194 words, ~1 min. read
esxi,  coreos,  docker,  ignition,  ovftool 

Ignition is a provisioning utility designed specifically for CoreOS; OVF Tool is a command-line utility from VMware for dealing with export and import of OVF packages; also, it can deploy Open Virtualization Appliance (OVA) to vCenter or ESXi.

The following steps helped me to deploy a CoreOS OVA on VMware ESXi,

  1. Download the latest CoreOS OVA from http://stable.release.core-os.net/amd64-usr/current/
  2. Create an ignition config JSON file, say coreos.json
{
    "ignition": {
	"config": {
	},
	"timeouts": {
	},
	"version": "2.1.0"
    },
    "networkd":{
	"units": [
	    {
		"contents": "[Match]\nName=ens192\n\n[Network]\nAddress=192.168.1.101/24\nGateway=192.168.1.11\nDNS=192.168.1.1 192.168.1.2",
		"name": "static.network"
	    }
	]
    },
    "passwd": {
	"users": [
	    {
		"name": "bala",
		"groups": [
		    "wheel",
		    "sudo",
		    "docker"
		],
		"passwordHash": "<password>",
		"sshAuthorizedKeys": [
		    "<ssh-key>"
		]
	    }
	]
    },
    "storage": {
    },
    "systemd": {
	"units": [
	    {
		"dropins": [
		    {
			"contents": "[Service]\nEnvironment=\"HTTP_PROXY=http://proxy.sbchand.net:8080\"",
			"name": "20-http-proxy.conf"
		    }
		],
		"enable": true,
		"name": "docker.service"
	    }
	]
    }
}
  1. Deploy using ovftool
  $ ovftool                                                                \
      --acceptAllEulas                                                     \
      --name="coreos"                                                      \
      --numberOfCpus:"*=4"                                                 \
      --memorySize:"*=4096"                                                \
      --diskMode=thin                                                      \
      --datastore="<datastore>"                                            \
      --net:"VM Network=<network>"                                         \
      --X:guest:"coreos.config.data=$(base64 -w0 coreos.json)"             \
      --X:guest:"coreos.config.data.encoding=base64"                       \
      --X:waitForIp                                                        \
      --powerOn                                                            \
      ~/Downloads/coreos_production_vmware_ova.ova                         \
      vi://root@<esxi>

Note:

  1. Retrospect the CoreOS config parameters on the OVA using ovftool coreos_production_vmware_ova.ova
  2. Refer OVF Tool options using ovftool --help

References