2.2. Manually uploading VHD images to Microsoft Azure cloud
After you have created your customized VHD image, you can manually upload it to the Microsoft Azure cloud. When you create a .vhd image by using the CLI, RHEL image builder writes temporary files to the /var subdirectory.
To prevent the .vhd image creation from failing, increase the /var subdirectory capacity to at least 15 to 20 GB of free space to ensure availability.
Prerequisites
- Your system must be set up for uploading Microsoft Azure VHD images.
You must have a Microsoft Azure VHD image created by RHEL image builder.
-
In the GUI, use the
Azure Disk Image (.vhd)image type. -
In the CLI, use the
vhdoutput type.
-
In the GUI, use the
Procedure
Build the image:
$ image-builder build <image-type>Push the image to Microsoft Azure and create an instance from it:
$ az storage blob upload --account-name account_name --container-name container_name --file image_disk.vhd --name image-disk.vhd --type pageAfter the upload to the Microsoft Azure Blob storage completes, create a Microsoft Azure image from it. Because the images that you create with RHEL image builder generate hybrid images that support both the
V1 = BIOSandV2 = UEFIinstance types, you can specify the--hyper-v-generationargument. The default instance type isV1.$ az image create --resource-group resource_group_name --name image-disk.vhd --os-type linux --location location \ --source https://$account_name.blob.core.windows.net/container_name/image-disk.vhd - Running
Verification
Create an instance either with the Microsoft Azure portal, or a command similar to the following:
$ az vm create --resource-group resource_group_name --location location --name vm_name --image image-disk.vhd(--admin-username azure-user --generate-ssh-keys* - Running-
Use your private key by using SSH to access the resulting instance. Log in as
azure-user. This username was set on the previous step.