Skip to content

Commit

Permalink
Improve VMWare documentation with gzip+base64 information (coreos#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
Okeanos authored Sep 27, 2021
1 parent 39d49c3 commit 6277d77
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions modules/ROOT/pages/provisioning-vmware.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@ For maximum compatibility, it is recommended to use `base64` encoding and to pre

[source, bash]
----
CONFIG_B64=`cat example.ign | base64 -w0 -`
CONFIG_ENCODING='base64'
CONFIG_ENCODED=$(cat example.ign | base64 -w0 -)
----

An alternative to plain `base64` encoding is `gzip+base64` as described in the https://coreos.github.io/ignition/supported-platforms/[Ignition support platforms]. This is especially useful when submitting the Ignition Config via `govc` as _inline_ parameter. In that case the maximum length for shell arguments called `ARG_MAX` comes into play. Depending on the platform you are on, it may be impossible to submit your config inline unless it was compressed with `gzip`. Call `getconf ARG_MAX` in your shell to see the local limit.

[source, bash]
----
CONFIG_ENCODING='gzip+base64'
CONFIG_ENCODED=$(cat example.ign | gzip | base64 -w0 -)
----

== Booting a new VM on Workstation or Fusion
Expand All @@ -54,8 +63,8 @@ ovftool \
--powerOffTarget \
--name="${VM_NAME}" \
--allowExtraConfig \
--extraConfig:guestinfo.ignition.config.data.encoding="base64" \
--extraConfig:guestinfo.ignition.config.data="${CONFIG_B64}" \
--extraConfig:guestinfo.ignition.config.data.encoding="${CONFIG_ENCODING}" \
--extraConfig:guestinfo.ignition.config.data="${CONFIG_ENCODED}" \
"${FCOS_OVA}" "${LIBRARY}"
----

Expand Down Expand Up @@ -87,12 +96,10 @@ You can now deploy a new VM, starting from the template in the library and the e
----
VM_NAME='fcos-node01'
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.ignition.config.data.encoding=${CONFIG_ENCODING}"
govc vm.change -vm "${VM_NAME}" -e "guestinfo.ignition.config.data=${CONFIG_ENCODED}"
----

WARNING: When submitting the Ignition Config as Base 64 encoded string via `govc` _inline_ the maximum length for shell arguments called `ARG_MAX` comes into play. Depending on the platform you are on, it may be impossible to submit your config inline. Call `getconf ARG_MAX` in your shell to see the local limit.

A new `fcos-node01` VM is now available for booting. Its hardware configuration can be further customized at this point, and then powered-up:

[source, bash]
Expand Down Expand Up @@ -120,8 +127,8 @@ IFACE='ens192'
IPCFG="ip=192.0.2.42::192.0.2.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.ignition.config.data.encoding=${CONFIG_ENCODING}"
govc vm.change -vm "${VM_NAME}" -e "guestinfo.ignition.config.data=${CONFIG_ENCODED}"
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}"
Expand Down

0 comments on commit 6277d77

Please sign in to comment.