Start a new topic

Creating Azure Images

Creating an image in azure is a multi-step process that can be difficult to navigate for first time and infrequent Azure users.


To simplify this process you can use the attached PowerShell script that will de-allocate the VM and create the image for you according to Microsoft's guidelines.


The script will require the AzureRM PowerShell modules to be installed on your system, you can do this from an elevated PowerShell session buy running the command:


Install-Module -Name AzureRM -AllowClobber -Force


Windows Images


For Windows images you will need to start by running the sysprep command below from an elevated cmd prompt on the machine you want to convert to an image.


%WINDIR%\system32\sysprep\sysprep.exe /generalize /shutdown /oobe


Linux Images


For Linux images you will need to run the command below on the machine you want to convert to an image.


sudo waagent -deprovision+user


Running The Script


The script will prompt you for some information about the instance you want to convert to an image.  All this information can be copied from the instances details in the Azure console.



When the script is finished you will have created the image and it will be ready to deploy.


Don't forget to synchronize your vCommander inventory after running the script so you can add it to your service catalog!

ps1
(789 Bytes)
Login or Signup to post a comment