1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/installation-azure-user-infra-uploading-rhcos.adoc

190 lines
6.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * installing/installing_azure/installing-azure-user-infra.adoc
// * installing/installing_azure_stack_hub/installing-azure-stack-hub-user-infra.adoc
// * installing/installing_azure_stack_hub/installing-azure-stack-hub-default.adoc
// * installing/installing_azure/installing-restricted-networks-azure-user-provisioned.adoc
ifeval::["{context}" == "installing-azure-user-infra"]
:azure:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-user-infra"]
:ash:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-default"]
:ash-ipi:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-network-customizations"]
:ash-ipi:
endif::[]
ifeval::["{context}" == "installing-restricted-networks-azure-user-provisioned"]
:azure:
endif::[]
:_mod-docs-content-type: PROCEDURE
[id="installation-azure-user-infra-uploading-rhcos_{context}"]
ifndef::ash-ipi[]
= Uploading the {op-system} cluster image and bootstrap Ignition config file
endif::ash-ipi[]
ifdef::ash-ipi[]
= Uploading the {op-system} cluster image
endif::ash-ipi[]
ifndef::ash-ipi[]
The Azure client does not support deployments based on files existing locally. You
must copy and store the {op-system} virtual hard disk (VHD) cluster image and bootstrap Ignition config file in a storage container so they are accessible during deployment.
endif::ash-ipi[]
ifdef::ash-ipi[]
You must download the {op-system} virtual hard disk (VHD) cluster image and upload it to your Azure Stack Hub environment so that it is accessible during deployment.
endif::ash-ipi[]
.Prerequisites
* Generate the Ignition config files for your cluster.
.Procedure
ifndef::ash-ipi[]
. Create an Azure storage account to store the VHD cluster image:
+
[source,terminal]
----
$ az storage account create -g ${RESOURCE_GROUP} --location ${AZURE_REGION} --name ${CLUSTER_NAME}sa --kind Storage --sku Standard_LRS
----
+
[WARNING]
====
The Azure storage account name must be between 3 and 24 characters in length and
use numbers and lower-case letters only. If your `CLUSTER_NAME` variable does
not follow these restrictions, you must manually define the Azure storage
account name. For more information on Azure storage account name restrictions,
see link:https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/error-storage-account-name[Resolve errors for storage account names]
in the Azure documentation.
====
. Export the storage account key as an environment variable:
+
[source,terminal]
----
$ export ACCOUNT_KEY=`az storage account keys list -g ${RESOURCE_GROUP} --account-name ${CLUSTER_NAME}sa --query "[0].value" -o tsv`
----
. Export the URL of the {op-system} VHD to an environment variable:
+
ifdef::azure[]
[source,terminal]
----
$ export VHD_URL=`openshift-install coreos print-stream-json | jq -r '.architectures.<architecture>."rhel-coreos-extensions"."azure-disk".url'`
----
+
where:
`<architecture>`:: Specifies the architecture, valid values include `x86_64` or `aarch64`.
endif::azure[]
ifdef::ash[]
[source,terminal]
----
$ export COMPRESSED_VHD_URL=$(openshift-install coreos print-stream-json | jq -r '.architectures.x86_64.artifacts.azurestack.formats."vhd.gz".disk.location')
----
endif::ash[]
+
[IMPORTANT]
====
The {op-system} images might not change with every release of {product-title}.
You must specify an image with the highest version that is
less than or equal to the {product-title} version that you install. Use the image version
that matches your {product-title} version if it is available.
====
. Create the storage container for the VHD:
+
[source,terminal]
----
$ az storage container create --name vhd --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY}
----
ifdef::ash[]
. Download the compressed {op-system} VHD file locally:
+
[source,terminal]
----
$ curl -O -L ${COMPRESSED_VHD_URL}
----
. Decompress the VHD file.
+
[NOTE]
====
The decompressed VHD file is approximately 16 GB, so be sure that your host system has 16 GB of free space available. You can delete the VHD file after you upload it.
====
endif::ash[]
. Copy the local VHD to a blob:
+
ifdef::azure[]
[source,terminal]
----
$ az storage blob copy start --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY} --destination-blob "rhcos.vhd" --destination-container vhd --source-uri "${VHD_URL}"
----
endif::azure[]
ifdef::ash[]
[source,terminal]
----
$ az storage blob upload --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY} -c vhd -n "rhcos.vhd" -f rhcos-<rhcos_version>-azurestack.x86_64.vhd
----
endif::ash[]
. Create a blob storage container and upload the generated `bootstrap.ign` file:
+
[source,terminal]
----
$ az storage container create --name files --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY}
----
+
[source,terminal]
----
$ az storage blob upload --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY} -c "files" -f "<installation_directory>/bootstrap.ign" -n "bootstrap.ign"
----
endif::ash-ipi[]
ifdef::ash-ipi[]
. Obtain the {op-system} VHD cluster image:
.. Export the URL of the {op-system} VHD to an environment variable.
+
[source,terminal]
----
$ export COMPRESSED_VHD_URL=$(openshift-install coreos print-stream-json | jq -r '.architectures.x86_64.artifacts.azurestack.formats."vhd.gz".disk.location')
----
.. Download the compressed {op-system} VHD file locally.
+
[source,terminal]
----
$ curl -O -L ${COMPRESSED_VHD_URL}
----
. Decompress the VHD file.
+
[NOTE]
====
The decompressed VHD file is approximately 16 GB, so be sure that your host system has 16 GB of free space available. The VHD file can be deleted once you have uploaded it.
====
. Upload the local VHD to the Azure Stack Hub environment, making sure that the blob is publicly available. For example, you can upload the VHD to a blob using the `az` cli or the web portal.
endif::ash-ipi[]
ifeval::["{context}" == "installing-azure-user-infra"]
:!azure:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-user-infra"]
:!ash:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-default"]
:!ash-ipi:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-network-customizations"]
:!ash-ipi:
endif::[]
ifeval::["{context}" == "installing-restricted-networks-azure-user-provisioned"]
:!azure:
endif::[]