Adding and Publish Custom image to Azure Stack 180513

Hello everyone, since there are a lot of changes happen on the way of uploading the Custom Image to Azure Stack, please note that this is tested on Azure Stack Development Kit Version 180513. There a few blog post that mainly focus on this but I will also share my method on Upload and Publish A custom Image to Azure Stack,

One of the concern in Azure Stack either is in Online mode of Offline mode, Red Hat Enterprise Linux (RHEL)will not able to be downloaded from Azure Marketplace. So, the only way to do have RHEL to be available in your Azure Stack is by uploading your own RHEL image on it. There a couple of prerequisites that need to be follow to make your RHEL running on Azure Stack. You may refer here to get a step to prepare your RHEL for Azure Stack. – Click HereIn my case, I don’t have RHEL running in my Environment, and I also don’t have any RHEL subscription registered so I can call the necessary repository for Preparation process.  So what I have done is i Deploy a RHEL 7.2 in my Azure environment.  I run the following command to provision the RHEL after the machine is running.

1. Sudo waagent -force -deprovision2.  export HISTSIZE=03. logout .
After that I shutdown the machine and I export out the VHD and download it.

This method is only applicable if your RHEL image do not have any special config it. 
Once the VHD completely downloaded, you may rename it and upload the image to your Azure Stack. Uploading image can be done using GUI. Upload it as Page blob .

After the VHD successfully uploaded into storage account, a vm image need to be created using that VHD. The way to do this, by login in Operator Portal @ Admin Portal.  Click on dashboard > Compute > VM image .

 Fill in the details. The disk URL can be copied by going to blob properties of the VHD that we uploaded.  

The VM image will appear after the process is done

Ok, we have gone through almost all the part.Moving on, I download the azpkg using syndication; package file needed to publish the VM image in Azure Stack marketplace.One the file has been downloaded. Change the extension from “.azpkg” to “.zip” for your to extract all the file inside.This is the content of the file after being extracted.

Ok, we need to do some editing to make it able to choose the correct VM image and Display a desired display name,1.  Manifest.JSON.“
{“$schema”: “https://gallery.azure.com/schemas/2015-10-01/manifest.json#”,                “name”: “RHEL”,                “publisher”: “Contoso”,                “version”: “1.0.2”,        “displayName”: “ms-resource:displayName”,“Please match back the parameter for publisher and Version. Name can be varies because this is mainly for the record.2. go to createuidefinition,json under DevelopmentTemplate  Folder.Edit this parameter to mach back with VM image
“imageReference”: {
      “publisher”: “Contoso”,      “offer”: “rhelserver”,      “sku”: “rhel”“3. Go to String Folder and edit the resources.resjson using notepad.Find these two lines and replace it accordingly3.1 “displayName”:”Red Hat Enterprise Linux”,”publisherDisplayName”:”Constoso”3.2 productDisplayName0″:”Red Hat Enterprise Linux”,”productPublisherDisplayName0″:”Contoso”
4. You can put your desired display icon by replacing all the icon that is in the Icons folder.After Complete editing all the file and parameter.You need create back the “.azpkg ” file by using Azurepackagegallery.exe through powershell not Powershell ISE.  I will advise using method here to do that instead of zip the folder and change the extension as during the Azurepackagegallery.exe process, it will check for syntax error.

Upload the “.azpkg” file and copy the link . run the following command to make your VM Image appear in  Marketplace. Add-AzsGalleryItem -GalleryItemUrihttps://addvmimagestorageaccount.blob.local.azurestack.external/addvmimagecontainer/Contoso.RHEL-Contoso.1.0.2.azpkg -Verbose

There will a ubuntu info as the “.azpkg” main file is for ubuntu 17.10 downloaded using syndication. I only change the necessary parameter for to work with RHEL VHD.

and

Thanks for reading,  sample “.azpkg” file with RHEL icon can be downloaded from Here.

Note: Munir Tajudin is a technical specialist from Enfrasys and is specialised in Azure Migration. You can read more about him from his blog https://munirtajudin.blogspot.com/

Share this post

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email

Recent News

Close Menu
Bitnami