Azure VM Images (Contd..)
- In Azure when we create vm’s we are given the option of setting user credentials, so vm image ideally should not have user credentials
- Before Creating VMImages we should remove user credentials, since we remove user credentials from the vm from which we create vm image the vm becomes unusable.
- In the case of Windows We remove user credentials using sysprep, in linux vm’s we deprovision using azure agent running on linux.
- The images created by removing user specific information are called as generalized images.
- Other Kinds of VM Images created by importing from virtual hard disks etc are called as specialized vm images.
- VM Image Creation can be automated using a tool called Packer.
- Lets create a VM Image with lamp stack and stress tool, just add this step to the steps used in previous session
sudo apt-get install stress -y
Azure Linux VM Provisioning
When you create VM, you are allowed to pass parameters and setting to the VM, This is called as VM Provisioning.
During VM Provisioning we set
- SSH Keys
- Custom data
A provisioning agent inside the Azure linux vm is responsible for setting the parameters.
The provisioning agents could be
- Azure Linux Agent
After azure sets the above mentioned parameters (hostname, credentials, etc) it will run cloud-init.
Provisioning Agents responsibilities
- Image Provisioning
Advanced Tab in VM Creation
- Screenshots for linux
- Screenshots for Windows