From eff4b2b617ab20d414cca5b676df4daa465682ee Mon Sep 17 00:00:00 2001 From: Karthik K N Date: Tue, 30 Apr 2024 10:13:31 +0530 Subject: [PATCH] Add instruction to build DHCP configured images --- docs/book/src/capi/providers/ibmcloud.md | 31 ++++++++++++++---------- images/capi/hack/ensure-powervs.sh | 2 +- images/capi/packer/powervs/packer.json | 2 ++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/docs/book/src/capi/providers/ibmcloud.md b/docs/book/src/capi/providers/ibmcloud.md index 59255d3ca7..0ece76268b 100644 --- a/docs/book/src/capi/providers/ibmcloud.md +++ b/docs/book/src/capi/providers/ibmcloud.md @@ -39,22 +39,27 @@ In addition to the configuration found in `images/capi/packer/config`, the `powe This table lists several common options that a user may want to set via `PACKER_VAR_FILES` to customize their build behavior. -| Variable | Description | Default | -|----------|-------------|---------| -| `account_id` | IBM Cloud account id. | `""` | -| `apikey` | IBM Cloud API key. | `""` | -| `capture_cos_access_key` | The Cloud Object Storage access key. | `""` | -| `capture_cos_bucket` | The Cloud Object Storage bucket to upload the image within. | `""` | -| `capture_cos_region` | The Cloud Object Storage region to upload the image within. | `""` | -| `capture_cos_secret_key` | The Cloud Object Storage secret key. | `""` | -| `key_pair_name` | The name of the SSH key pair provided to the server for authenticating users (looked up in the tenant's list of keys). | `""` | -| `region` | The PowerVS service instance region to build the image within. | `""` | -| `service_instance_id` | The PowerVS service instance id to build the image within. | `""` | -| `ssh_private_key_file` | The absolute path to the SSH key file. | `""` | -| `zone` | The PowerVS service instance zone to build the image within. | `""` | +| Variable | Description | Default | +|--------------------------|------------------------------------------------------------------------------------------------------------------------|---------| +| `account_id` | IBM Cloud account id. | `""` | +| `apikey` | IBM Cloud API key. | `""` | +| `capture_cos_access_key` | The Cloud Object Storage access key. | `""` | +| `capture_cos_bucket` | The Cloud Object Storage bucket to upload the image within. | `""` | +| `capture_cos_region` | The Cloud Object Storage region to upload the image within. | `""` | +| `capture_cos_secret_key` | The Cloud Object Storage secret key. | `""` | +| `key_pair_name` | The name of the SSH key pair provided to the server for authenticating users (looked up in the tenant's list of keys). | `""` | +| `region` | The PowerVS service instance region to build the image within. | `""` | +| `service_instance_id` | The PowerVS service instance id to build the image within. | `""` | +| `ssh_private_key_file` | The absolute path to the SSH key file. | `""` | +| `zone` | The PowerVS service instance zone to build the image within. | `""` | +| `dhcp_network` | The PowerVS image with DHCP support. | `false` | The parameters can be set via a variable file and passed via `PACKER_VAR_FILES`. See [Customization](../capi.md#customization) for examples. + +Note: When setting `dhcp_network: true`, make sure to customize the network settings while building OS using [pvsadm tool](https://github.com/ppc64le-cloud/pvsadm/blob/main/docs/Build%20DHCP%20enabled%20Centos%20Images.md). +Also run the image-builder from system from where the DHCP private IP can be reached and SSH able. + ## CAPIBM - VPC ### Hypervisor diff --git a/images/capi/hack/ensure-powervs.sh b/images/capi/hack/ensure-powervs.sh index 76dc4e5875..6773ad4b45 100755 --- a/images/capi/hack/ensure-powervs.sh +++ b/images/capi/hack/ensure-powervs.sh @@ -31,7 +31,7 @@ if ! (${SED} --version 2>&1 | grep -q GNU); then exit 1 fi -_version="0.2.1" +_version="0.2.4" _chkfile="packer-plugin-powervs_v${_version}_SHA256SUMS" _chk_url="https://github.com/ppc64le-cloud/packer-plugin-powervs/releases/download/v${_version}/${_chkfile}" _bin_url="https://github.com/ppc64le-cloud/packer-plugin-powervs/releases/download/v${_version}/packer-plugin-powervs_v${_version}_x5.0_${HOSTOS}_${HOSTARCH}.zip" diff --git a/images/capi/packer/powervs/packer.json b/images/capi/packer/powervs/packer.json index ef14ea640b..638de97ad4 100644 --- a/images/capi/packer/powervs/packer.json +++ b/images/capi/packer/powervs/packer.json @@ -12,6 +12,7 @@ }, "name": "capibm-powervs-{{user `build_name`}}-{{user `kubernetes_rpm_version` | clean_resource_name}}-{{user `build_timestamp`}}" }, + "dhcp_network": "{{user `dhcp_network`}}", "instance_name": "capibm-{{user `build_name`}}-{{user `build_timestamp`}}", "key_pair_name": "{{user `key_pair_name`}}", "region": "{{user `region`}}", @@ -78,6 +79,7 @@ "containerd_version": null, "crictl_url": null, "crictl_version": null, + "dhcp_network": "false", "existing_ansible_ssh_args": "{{env `ANSIBLE_SSH_ARGS`}}", "key_pair_name": "", "kubernetes_cni_deb_version": null,