Skip to content

Commit

Permalink
provisioning/vmware: document first-boot static networking guestinfo
Browse files Browse the repository at this point in the history
This removes the DHCP requirement for VMware instances, and document
how to use the guestinfo for static networking on first-boot.
  • Loading branch information
lucab committed Jun 29, 2020
1 parent e6e9bd8 commit 9a5d8ae
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion modules/ROOT/pages/provisioning-vmware.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This guide shows how to provision new Fedora CoreOS (FCOS) nodes on the VMware h

Before provisioning a FCOS machine, you must have an Ignition configuration file containing your customizations. If you do not have one, see xref:producing-ign.adoc[Producing an Ignition File].

You also need to have access to a working VMware infrastructure, with DHCP-based networking and supporting VMs with at least hardware version 13.
You also need to have access to a working VMware infrastructure, supporting VMs with at least hardware version 13.
The examples below use the https://github.com/vmware/govmomi/blob/v0.22.2/govc/README.md[govc] command-line tool.

=== Downloading the OVA
Expand All @@ -31,6 +31,7 @@ For the `vmware` provider, Ignition requires two "guestinfo" fields to be presen
* `guestinfo.ignition.config.data`: the content of the Ignition configuration, encoded according to the format above.

For maximum compatibility, it is recommended to use `base64` encoding and to prepare the Ignition configuration as such:

[source, bash]
----
CONFIG_B64=`cat example.ign | base64 -w0 -`
Expand Down Expand Up @@ -74,3 +75,30 @@ govc vm.info -e "${VM_NAME}"
govc vm.power -on "${VM_NAME}"
----

=== First-boot networking and Ignition

Ignition supports referencing remote content in configuration and fetching it at provisioning time.
For this reason, on first-boot FCOS instances try to perform network autoconfiguration via DHCP.

If your VMware setup employ static network configuration instead, you can override this automatic DHCP setup with your own custom configuration.
Custom networking command-line `ip=` parameter can be configured via guestinfo properties as shown below, before booting a VM for the first time.

The provisioning flow follows the usual steps, plus an additional `guestinfo.afterburn.initrd.network-kargs` entry.

[source, bash]
----
VM_NAME='fcos-node02'
IFACE='ens9'
IPCFG="ip=10.20.30.42::10.20.30.1:255.255.255.0:${VM_NAME}:${IFACE}:off"
govc library.deploy "${LIBRARY}/${TEMPLATE_NAME}" "${VM_NAME}"
govc vm.change -vm "${VM_NAME}" -e "guestinfo.ignition.config.data.encoding=base64"
govc vm.change -vm "${VM_NAME}" -e "guestinfo.ignition.config.data=${CONFIG_B64}"
govc vm.change -vm "${VM_NAME}" -e "guestinfo.afterburn.initrd.network-kargs=${IPCFG}"
govc vm.info -e "${VM_NAME}"
govc vm.power -on "${VM_NAME}"
----

The full syntax of the `ip=` parameter is documented in https://www.man7.org/linux/man-pages/man7/dracut.cmdline.7.html[Dracut manpages].

For further information on first-boot networking, see https://github.com/coreos/afterburn/blob/v4.4.1/docs/usage/initrd-network-cmdline.md[Afterburn documentation].

0 comments on commit 9a5d8ae

Please sign in to comment.