1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/multi-architecture-creating-x86_64-bootimage.adoc

140 lines
5.3 KiB
Plaintext

//Module included in the following assemblies
//
//post_installation_configuration/cluster-tasks.adoc
:_mod-docs-content-type: PROCEDURE
[id="multi-architecture-creating-x86-64-bootimage_{context}"]
= Creating a 64-bit x86 boot image using the Azure image gallery
The following procedure describes how to manually generate a 64-bit x86 boot image.
.Prerequisites
* You installed the Azure CLI (`az`).
* You created a single-architecture Azure installer-provisioned cluster with the multi-architecture installer binary.
.Procedure
. Log in to your Azure account by running the following command:
+
[source,terminal]
----
$ az login
----
. Create a storage account and upload the `x86_64` virtual hard disk (VHD) to your storage account by running the following command. The {product-title} installation program creates a resource group. However, the boot image can also be uploaded to a custom named resource group:
+
[source,terminal]
----
$ az storage account create -n ${STORAGE_ACCOUNT_NAME} -g ${RESOURCE_GROUP} -l westus --sku Standard_LRS <1>
----
+
<1> The `westus` object is an example region.
+
. Create a storage container using the storage account you generated by running the following command:
+
[source,terminal]
+
----
$ az storage container create -n ${CONTAINER_NAME} --account-name ${STORAGE_ACCOUNT_NAME}
----
. Use the {product-title} installation program JSON file to extract the URL and `x86_64` VHD name:
.. Extract the `URL` field and set it to `RHCOS_VHD_ORIGIN_URL` as the file name by running the following command:
+
[source,terminal]
----
$ RHCOS_VHD_ORIGIN_URL=$(oc -n openshift-machine-config-operator get configmap/coreos-bootimages -o jsonpath='{.data.stream}' | jq -r '.architectures.x86_64."rhel-coreos-extensions"."azure-disk".url')
----
.. Extract the `x86_64` VHD name and set it to `BLOB_NAME` as the file name by running the following command:
+
[source,terminal]
----
$ BLOB_NAME=rhcos-$(oc -n openshift-machine-config-operator get configmap/coreos-bootimages -o jsonpath='{.data.stream}' | jq -r '.architectures.x86_64."rhel-coreos-extensions"."azure-disk".release')-azure.x86_64.vhd
----
. Generate a shared access signature (SAS) token. Use this token to upload the {op-system} VHD to your storage container by running the following commands:
+
[source,terminal]
----
$ end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
----
+
[source,terminal]
----
$ sas=`az storage container generate-sas -n ${CONTAINER_NAME} --account-name ${STORAGE_ACCOUNT_NAME} --https-only --permissions dlrw --expiry $end -o tsv`
----
. Copy the {op-system} VHD into the storage container by running the following command:
+
[source,terminal]
----
$ az storage blob copy start --account-name ${STORAGE_ACCOUNT_NAME} --sas-token "$sas" \
--source-uri "${RHCOS_VHD_ORIGIN_URL}" \
--destination-blob "${BLOB_NAME}" --destination-container ${CONTAINER_NAME}
----
+
You can check the status of the copying process by running the following command:
+
[source,terminal]
----
$ az storage blob show -c ${CONTAINER_NAME} -n ${BLOB_NAME} --account-name ${STORAGE_ACCOUNT_NAME} | jq .properties.copy
----
+
.Example output
[source,terminal]
----
{
"completionTime": null,
"destinationSnapshot": null,
"id": "1fd97630-03ca-489a-8c4e-cfe839c9627d",
"incrementalCopy": null,
"progress": "17179869696/17179869696",
"source": "https://rhcos.blob.core.windows.net/imagebucket/rhcos-411.86.202207130959-0-azure.aarch64.vhd",
"status": "success", <1>
"statusDescription": null
}
----
+
<1> If the `status` parameter displays the `success` object, the copying process is complete.
. Create an image gallery by running the following command:
+
[source,terminal]
----
$ az sig create --resource-group ${RESOURCE_GROUP} --gallery-name ${GALLERY_NAME}
----
. Use the image gallery to create an image definition by running the following command:
+
[source,terminal]
----
$ az sig image-definition create --resource-group ${RESOURCE_GROUP} --gallery-name ${GALLERY_NAME} --gallery-image-definition rhcos-x86_64 --publisher RedHat --offer x86_64 --sku x86_64 --os-type linux --architecture x64 --hyper-v-generation V2
----
+
In this example command, `rhcos-x86_64` is the name of the image definition.
. To get the URL of the VHD and set it to `RHCOS_VHD_URL` as the file name, run the following command:
+
[source,terminal]
----
$ RHCOS_VHD_URL=$(az storage blob url --account-name ${STORAGE_ACCOUNT_NAME} -c ${CONTAINER_NAME} -n "${BLOB_NAME}" -o tsv)
----
. Use the `RHCOS_VHD_URL` file, your storage account, resource group, and image gallery to create an image version by running the following command:
+
[source,terminal]
----
$ az sig image-version create --resource-group ${RESOURCE_GROUP} --gallery-name ${GALLERY_NAME} --gallery-image-definition rhcos-arm64 --gallery-image-version 1.0.0 --os-vhd-storage-account ${STORAGE_ACCOUNT_NAME} --os-vhd-uri ${RHCOS_VHD_URL}
----
+
In this example, `1.0.0` is the image version.
. Optional: Access the ID of the generated `x86_64` boot image by running the following command:
+
[source,terminal]
----
$ az sig image-version show -r $GALLERY_NAME -g $RESOURCE_GROUP -i rhcos-x86_64 -e 1.0.0
----
The following example image ID is used in the `recourseID` parameter of the compute machine set:
+
.Example `resourceID`
[source,terminal]
----
/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.Compute/galleries/${GALLERY_NAME}/images/rhcos-x86_64/versions/1.0.0
----